Re: Varchar concatenate fields as Char or Varchar, not Text

From: MargaretGillon(at)chromalloy(dot)com
To: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
Cc: pgsql general <pgsql-general(at)postgresql(dot)org>, "Uwe C(dot) Schroeder" <uwe(at)oss4u(dot)com>
Subject: Re: Varchar concatenate fields as Char or Varchar, not Text
Date: 2006-08-07 19:36:25
Message-ID: OF85723C5A.720F0B2E-ON882571C3.006B3F4D-882571C3.006BB4EF@CHROMALLOY.COM
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>Scott Marlowe <smarlowe(at)g2switchworks(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ron Johnson 2006-08-07 19:51:12 Re: Practical maximums (was Re: PostgreSQL theoretical
Previous Message Gabor Siklos 2006-08-07 19:21:47 Does DROP TABLE free up disk space immediately?