Forum OpenACS Q&A: Re: Insert Performance Issues - PG 7.2.3/OpenACS 4.5/perl/dbi

Serial's not a bad thing, but Oracle doesn't have a serial datatype.  It provides sequences (PG's sequences are modelled after Oracle's.)

We use sequences in our PG code mostly because we support both Oracle and PG, and using sequences leads to our being able to share a lot more queries between the two than would be true if we used the serial datatype in PG.  Our datamodels for Oracle  and PG are more closely alike, too, as a consequence of this decision.

Sequences are also more flexible in practice, and PG's serial datatype is implemented using sequences.

In regard to your example, it has been so long since I've experimented with the serial datatype in PG that I don't remember the details of how it works ...