Re: Inserting preset values into a serial column

From: Chris Browne <cbbrowne(at)acm(dot)org>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Inserting preset values into a serial column
Date: 2010-07-21 16:44:36
Message-ID: 878w544wej.fsf@cbbrowne.afilias-int.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

mike(dot)rowan(at)internode(dot)on(dot)net (Michael Rowan) writes:
> PostgreSQL 8.4.4.1
>
> Can someone pls confirm that, provided I am doing it right, I can
> insert a row into a table where the primary key is serial NOT NULL and
> a (unique) value is provided in the offered data? I cannot see an
> answer to this specific point in the docs.

Sure, it shouldn't present a problem. You'd presumably also want to
change the value of the sequence that underlies this in order to point
it to a value beyond the range of the "offered data." (Use the function
"setval()" to do this.)
--
Rules of the Evil Overlord #208. "Members of my Legion of Terror will
attend seminars on Sensitivity Training. It's good public relations
for them to be kind and courteous to the general population when not
actively engaged in sowing chaos and destruction."

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Tim Landscheidt 2010-07-21 16:50:54 Re: Inserting preset values into a serial column
Previous Message Michael Rowan 2010-07-21 14:53:38 Inserting preset values into a serial column