create table with default value...

From: "Frederic boucher" <dziablo(at)hotmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: create table with default value...
Date: 1999-11-05 08:38:55
Message-ID: 19991105163855.90355.qmail@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Stoyan Genov 1999-11-05 08:46:36 Re: [SQL] Accessing other database...
Previous Message Frederic boucher 1999-11-05 07:09:37 Re: [SQL] Accessing other database...