Toad World® Forums

Serial type for Postgres 8.4 data models



Is there any way I can switch the automatic Sequence and Default Value creator off when adding a PK with a type of Serial and creating a script from the model?

Reason I ask is because we use pgAdmin with Postgres 8.4 and when running the script, Postgres complains about duplicate Default Values within the same attributes. When we remove the sequences created by the model and the default values and then create the script again, then it runs without any errors on postgres.

My postgres experience only consists of a few months now, so I might be unaware of the problem if it actually should be running correctly without having to remove the sequences etc.

Thanks in advance.



Hi Rudi,

if you use Serial data type, PostgreSQL will create sequence and default value automatically. If you wish to have more control over sequences - please use Integer data type instead of Serial.


Vaclav & Mario