Re: [GENERAL] Varchar concatenate fields as Char or Varchar, not Text

2006-08-07 Thread MargaretGillon
>Scott Marlowe <[EMAIL PROTECTED]> wrote on 08/07/2006 12:18:17 PM: > > Just FYI, text and varchar are, internally, pretty much the same types. > varchar has an optional precision setting as in varchar(200) while text > does not allow one. > > All the text ops are written for text types, so varc

Re: [GENERAL] Varchar concatenate fields as Char or Varchar, not

2006-08-07 Thread Scott Marlowe
On Mon, 2006-08-07 at 14:11, [EMAIL PROTECTED] wrote: > >"Uwe C. Schroeder" <[EMAIL PROTECTED]> wrote on 08/07/2006 11:30:28 AM: > > Well, you cast all those fields to be concatenated to text. Why > should the db > > make a varchar out of that? I seriously doubt that 7.x made a > varchar of that

Re: [GENERAL] Varchar concatenate fields as Char or Varchar, not Text

2006-08-07 Thread MargaretGillon
>"Uwe C. Schroeder" <[EMAIL PROTECTED]> wrote on 08/07/2006 11:30:28 AM: > Well, you cast all those fields to be concatenated to text. Why should the db > make a varchar out of that? I seriously doubt that 7.x made a varchar of that > - but then, 7.2 is very very old. > So either cast your field

Re: [GENERAL] Varchar concatenate fields as Char or Varchar, not Text

2006-08-07 Thread MargaretGillon
"Uwe C. Schroeder" <[EMAIL PROTECTED]> wrote on 08/07/2006 11:30:28 AM: > Well, you cast all those fields to be concatenated to text. Why should the db > make a varchar out of that? I seriously doubt that 7.x made a varchar of that > - but then, 7.2 is very very old. > So either cast your field

Re: [GENERAL] Varchar concatenate fields as Char or Varchar, not Text

2006-08-07 Thread MargaretGillon
Rodrigo Gonzalez <[EMAIL PROTECTED]> wrote on 08/07/2006 11:41:52 AM: > SELECT b.ltname, ((c.refullname::text || d.enname::text) || > f.evname::text)::varchar AS evlinkname1, > This worked, thank you. *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** Margaret Gill

Re: [GENERAL] Varchar concatenate fields as Char or Varchar, not

2006-08-07 Thread Rodrigo Gonzalez
SELECT b.ltname, ((c.refullname::text || d.enname::text) || f.evname::text)::varchar AS evlinkname1, [EMAIL PROTECTED] wrote: >Rodrigo Gonzalez <[EMAIL PROTECTED]> wrote on 08/07/2006 11:36:28 AM: > Really, I dont see the 3 varchar fields concatenated to a new field. > > But do this > > (v

Re: [GENERAL] Varchar concatenate fields as Char or Varchar, not Text

2006-08-07 Thread MargaretGillon
>Rodrigo Gonzalez <[EMAIL PROTECTED]> wrote on 08/07/2006 11:36:28 AM: > Really, I dont see the 3 varchar fields concatenated to a new field. > > But do this > > (varchar1||varchar2||varchar3||newfield)::varchar > > Best regards > This is the concatenate statement > > SELECT b.ltname, (c

Re: [GENERAL] Varchar concatenate fields as Char or Varchar, not Text

2006-08-07 Thread Uwe C. Schroeder
Well, you cast all those fields to be concatenated to text. Why should the db make a varchar out of that? I seriously doubt that 7.x made a varchar of that - but then, 7.2 is very very old. So either cast your fields to varchar (i.e. c.refullname::varchar || d.enname::varchar) or cast the result

Re: [GENERAL] Varchar concatenate fields as Char or Varchar, not

2006-08-07 Thread Rodrigo Gonzalez
Really, I dont see the 3 varchar fields concatenated to a new field. But do this (varchar1||varchar2||varchar3||newfield)::varchar Best regards [EMAIL PROTECTED] wrote: Last week I upgraded to postgresql 8.1.4 (YEAH!) In my database I have a view which concatenates three varchar fields

[GENERAL] Varchar concatenate fields as Char or Varchar, not Text

2006-08-07 Thread MargaretGillon
Last week I upgraded to postgresql 8.1.4 (YEAH!)  In my database I have a view which concatenates three varchar fields to a new field. With postgresql 7.2.3 the field resulting from the concatenation was a varchar, with postgresql 8.1.4 the new field is a text field. This is affecting all kinds of