> I have defined several tables with a field names "id" that is type
> serial-not null-primary index. Here is a partial dump:
> CREATE TABLE builds (
> id serial NOT NULL,
> Now after several iterations, I find that this is no longer happening.
> Also, even though the dumps still list these fields as serial, pgaccess
> now says they're int4.
> I figured these fields were getting updated as automatic triggers. I
> need them to stay consistent for internal integrity. How do I best do
According the the manual. Serial type is really a short hand notation for:
CREATE SEQUENCE tablename_colname_seq;
CREATE TABLE tablename (
colname integer DEFAULT nextval('tablename_colname_seq') NOT NULL
So it insure that your id increments correctly you could specify DEFAULT as your entry for that
field in your insert command.
Richard Broersma Jr.
In response to
pgsql-novice by date
|Next:||From: Patrick Ng||Date: 2006-07-20 13:24:20|
|Subject: Re: RE : How do I compile/test a PL/SQL in Postgresql|
|Previous:||From: Lan Barnes||Date: 2006-07-19 20:46:13|
|Subject: Updating of serial ID fields|