Re: Varchar concatenate fields as Char or Varchar, not Text - Mailing list pgsql-general

From MargaretGillon@chromalloy.com
Subject Re: Varchar concatenate fields as Char or Varchar, not Text
Date
Msg-id OF85723C5A.720F0B2E-ON882571C3.006B3F4D-882571C3.006BB4EF@CHROMALLOY.COM
Whole thread Raw
In response to Re: Varchar concatenate fields as Char or Varchar, not  (Scott Marlowe <smarlowe@g2switchworks.com>)
List pgsql-general

>Scott Marlowe <smarlowe@g2switchworks.com> 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 varchar gets cast as
> text (as do char types) before being operated on.
>
> Note that you can cast the result of that select above to varchar:
>
> SELECT (c.refullname || d.enname || f.evname)::varchar AS evlinkname1

This is what another person , Rodrigo Gonzalez, also wrote for me to do and it worked great. Thank you for explaining about the internal function of text and varchar, it is always good to understand more.

Again, my thanks to everyone who gave me a solution.

Margaret Gillon

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: Varchar concatenate fields as Char or Varchar, not
Next
From: Ron Johnson
Date:
Subject: Re: Practical maximums (was Re: PostgreSQL theoretical