I have come to the conclusion that the serial data type is inadequate
for providing a reliable unique record number on inserts. The final
sticking point is that after restoring (or replicating) a data base from
a pg_dump, the seed number for the serial value isn't updated and I get
To compensate for this, I want to add a code snippet on inserts that
checks for the high number in the unique number field, increments it,
and inserts. However, it seems to me that this snippet should be an
insert trigger so that I don't have to promulgate it to all clients,
present and future.
Because this is NOVICE I have no trouble admitting I have no trigger
experience. However, before I get into it, I want to ask if this is
already available on some contrib forum.
Linux Guy, SCM Specialist
Let me take this opportunity to dispel the notion, the canard,
that scientists are against transcendentalism, ... particularly
intelligent design. If any positive evidence could be found of a
supernatural guiding force, there would be a land rush of
scientists into it.
- Edward O. Wilson
pgsql-novice by date
|Next:||From: Steve Crawford||Date: 2006-09-09 00:11:01|
|Subject: Re: Serial and triggers|
|Previous:||From: Karen Hill||Date: 2006-09-08 21:48:13|
|Subject: Re: Insert Only Postgresql|