pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Frederic boucher <dziablo@hotmail.com>
To: pgsql-sql@postgresql.org
Subject: create table with default value...
Date: Fri, 05 Nov 1999 08:38:55 PST
Message-ID: <19991105163855.90355.qmail@hotmail.com> (raw)

Hi,

I have a table with a Unique ID named U_ID that come from a sequence like 
that :

create table the_table(
  U_ID integer default NEXTVAL('THE_SEQUENCE'),
  ...

and I would like to have a field of type varchar that would be something 
like

create table the_table(
  U_ID integer default NEXTVAL('THE_SEQUENCE'),
  name varchar(50) default 'NT_'+itoa(U_ID)
);

so the field 'name' would be the string concatenation of "NT_" and the 
string value of the field U_ID.

Is there a way to do this?

Thanks for your precious help!  ;)

\fb

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com



view thread (4+ messages)  latest in thread

Message-ID: <19991105163855.90355.qmail@hotmail.com>
Permalink:  ../19991105163855.90355.qmail@hotmail.com/
Also on:    postgresql.org/message-id/19991105163855.90355.qmail@hotmail.com

 · 

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: dziablo@hotmail.com
  Subject: Re: create table with default value...
  In-Reply-To: <19991105163855.90355.qmail@hotmail.com>
  References: <19991105163855.90355.qmail@hotmail.com>

* 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