SQL type conversion - text to char/varchar

Поиск
Список
Период
Сортировка
От R.K.Street@rl.ac.uk
Тема SQL type conversion - text to char/varchar
Дата
Msg-id XFMail.980928110054.R.K.Street@rl.ac.uk
обсуждение исходный текст
Список 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 по дате отправления:

Предыдущее
От: "Stan Thomas"
Дата:
Сообщение: subscribe
Следующее
От: Sferacarta Software
Дата:
Сообщение: Re: [SQL] Another nut to crack with insertion into tables... *sigh*