Received: from wdcc1.bnsc.rl.ac.uk (wdcc1.bnsc.rl.ac.uk [130.246.112.1]) by hub.org (8.8.8/8.8.8) with ESMTP id GAA19416 for ; Mon, 28 Sep 1998 06:01:01 -0400 (EDT) (envelope-from street@wdcc1.bnsc.rl.ac.uk) Received: (from street@localhost) by wdcc1.bnsc.rl.ac.uk (8.8.8/8.8.8) id LAA24678 for pgsql-sql@postgresql.org.; Mon, 28 Sep 1998 11:00:54 +0100 (BST) Message-ID: X-Mailer: XFMail 1.0 [p0] on OSF1 Sender: street@wdcc1.bnsc.rl.ac.uk Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit MIME-Version: 1.0 Date: Mon, 28 Sep 1998 10:48:14 +0100 (BST) Organization: World Data Centre C1 at RAL From: R.K.Street@rl.ac.uk To: pgsql-sql@postgresql.org Subject: SQL type conversion - text to char/varchar 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 * ********************************************************************