Received: from jasper.southwind.net (swprenzl@jasper.southwind.net [206.53.103.7]) by hub.org (8.9.1/8.9.1) with ESMTP id JAA04026 for ; Tue, 5 Jan 1999 09:45:05 -0500 (EST) (envelope-from swprenzl@jasper.southwind.net) Received: from localhost (swprenzl@localhost) by jasper.southwind.net (8.8.8/8.8.8) with SMTP id IAA17069 for ; Tue, 5 Jan 1999 08:45:04 -0600 (CST) Date: Tue, 5 Jan 1999 08:45:04 -0600 (CST) From: Larry Bottorff To: pgsql-sql@postgresql.org Subject: Converting int4 to varchar Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII I'm doing something very typical: I created a sequence "seq" and then wanted to insert the NEXTVAL('seq') into a varchar field of a table to be used as a primary key. INSERT INTO products (prodno, ...) VALUES (NEXTVAL('seq'), 'blah', 'blah'); Where prodno is varchar. I tried a text(...) cast, but it complains of a text-varchar mismatch. There is no varchar(...). Apparently, this is not possible in Postgres(?). Larry Bottorff SouthWind Internet Access, Inc. System Programmer 120 S. Market St. Suite 300 swprenzl@southwind.net Wichita, KS 67202 --------------------------------------------------------------------- In Wichita:(316)263-7964 Elsewhere:1-877-525-7964