On Thu, Jun 26, 2003 at 14:31:34 +0200, Dani Oderbolz <[EMAIL PROTECTED]> wrote: > > It was written for MySQL, which can take NULL and then assign an > auto_increment. > However, in PostgreSQL I am getting problems, because it would not let > me insert NULL > into a NOT NULL column (which is perfectly sensible from my point of view). > But as the author has also left out the column list in the insert, its > really tedious to change > the code.
You can use the keyword DEFAULT instead of NULL and it will do what you want. > This way, there would be no possibility to circumvent the Value which > comes from the Sequence. You can use a unique constraint to enforce uniqueness. > Is there a way to change SERIAL this way? Well you can certainly write your own trigger to do this. ---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html