Default Value in Table Setup Help - Mailing list pgsql-general

From Dev
Subject Default Value in Table Setup Help
Date
Msg-id 6.0.0.14.0.20030818145357.020d78a8@pop3.umpa-us.com
Whole thread Raw
Responses Re: Default Value in Table Setup Help  (Adam Kavan <akavan@cox.net>)
Re: Default Value in Table Setup Help  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Re: Default Value in Table Setup Help  (Bruno Wolff III <bruno@wolff.to>)
List 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?



pgsql-general by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Why lower's not accept an AS declaration ?
Next
From: Bruno Wolff III
Date:
Subject: Re: Hour difference?