pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Larry Bottorff <swprenzl@southwind.net>
To: pgsql-sql@postgresql.org
Subject: Converting int4 to varchar
Date: Tue, 5 Jan 1999 08:45:04 -0600 (CST)
Message-ID: <Pine.BSI.4.02A.9901050836090.16300-100000@jasper.southwind.net> (raw)

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




Message-ID: <Pine.BSI.4.02A.9901050836090.16300-100000@jasper.southwind.net>
Permalink:  ../Pine.BSI.4.02A.9901050836090.16300-100000@jasper.southwind.net/
Also on:    postgresql.org/message-id/Pine.BSI.4.02A.9901050836090.16300-100000@jasper.southwind.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: swprenzl@southwind.net
  Subject: Re: Converting int4 to varchar
  In-Reply-To: <Pine.BSI.4.02A.9901050836090.16300-100000@jasper.southwind.net>
  References: <Pine.BSI.4.02A.9901050836090.16300-100000@jasper.southwind.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox