Se i postgresql-dokumentation af datatype-serie. Seriel er kun kort hånd.
CREATE TABLE tablename (
colname SERIAL
);
svarer til at angive:
CREATE SEQUENCE tablename_colname_seq;
CREATE TABLE tablename (
colname integer NOT NULL DEFAULT nextval('tablename_colname_seq')
);
ALTER SEQUENCE tablename_colname_seq OWNED BY tablename.colname;