Hello Jeremy,
giovedì, 20 agosto 98, you wrote:
JH> I want to create a simple auto increment field
JH> starting at 0000 for example.
^^^^ I supose you mean 1
JH> How do I do this in postgres?
JH> Thanks
JH> -jeremy
Examples:
-- How to create a sequence starting with 1:
--
CREATE SEQUENCE serial START 1;
-- How to assign the sequence as default to column <did>:
CREATE TABLE distributors (
did INTEGER DEFAULT NEXTVAL('serial'),
name VARCHAR(40)
);
Best regards,
Jose' mailto:sferac(at)bo(dot)nettuno(dot)it