SQL type conversion - text to char/varchar - Mailing list pgsql-sql

From R.K.Street@rl.ac.uk
Subject SQL type conversion - text to char/varchar
Date
Msg-id XFMail.980928110054.R.K.Street@rl.ac.uk
Whole thread Raw
List pgsql-sql
Hello,

How do I convert text into char or varchar?
I tried using char/varchar for the basic fields but the sql below
(among others things) fails.

update table set field2 = upper(field1);

This only works if the two fields are text and not for char/varchar.
If I use text blobs then all length information is lost and java does
not seem to know that these are plain text fields with specific lengths
etc.  The manual implies that the char(text) and varchar(text) functions
should exist.  My error messages indicate that I am missing them.
Does anyone have the SQL text for these functions so I can add them
to my database?  Sorry I cannot give the exact version as psql does
not seem to have a 'version' command to tell me what it is.
Is there another way to tell what version you have.

ie/

select 'Hello'::varchar;           = okay
select field1::varchar from table; = ERROR:  function char(text) does not exist


Rachel Street

********************************************************************
* R K Street - RAL Database Systems - (01235) 821900 ext 5833      *
* Rutherford Appleton Laboratory, Chilton, DIDCOT, Oxon, UK        *
* Email: TCPIP  street@wdcc1.bnsc.rl.ac.uk or R.K.Street@rl.ac.uk  *
********************************************************************

pgsql-sql by date:

Previous
From: "Stan Thomas"
Date:
Subject: subscribe
Next
From: Sferacarta Software
Date:
Subject: Re: [SQL] Another nut to crack with insertion into tables... *sigh*