Default Value in Table Setup Help

From: Dev <dev(at)umpa-us(dot)com>
To: Postgresql General <pgsql-general(at)postgresql(dot)org>
Subject: Default Value in Table Setup Help
Date: 2003-08-18 18:57:12
Message-ID: 6.0.0.14.0.20030818145357.020d78a8@pop3.umpa-us.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello all,

I am working on setting up a table that will append a sequence to the end
of the value inserted.
Example;
INSERT INTO test (test) VALUES ('abcd');
And have the data in the database be;
abcd0001

Now I do have things setup else where were the default value for the field
is such:
default ('abcd'::text || lpad(text(nextval('test_sequence'::text)), 4,
'0'::text))

But i want the "abcd" or what erver to be added in the insert?

What am I missing to make this happen?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2003-08-18 18:58:10 Re: Why lower's not accept an AS declaration ?
Previous Message Steve Worsley 2003-08-18 18:47:22 Re: Hour difference?