Skip site navigation (1) Skip section navigation (2)

Re: Inserting preset values into a serial column

From: Tim Landscheidt <tim(at)tim-landscheidt(dot)de>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Inserting preset values into a serial column
Date: 2010-07-21 16:50:54
Message-ID: m37hkovkwh.fsf@passepartout.tim-landscheidt.de (view raw or flat)
Thread:
Lists: pgsql-novice
Michael Rowan <mike(dot)rowan(at)internode(dot)on(dot)net> wrote:

> 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, just try it. You only need to make sure that after
your insertion the corresponding sequence will not collide
with your data, e. g., you will have to setval() the se-
quence to MAX(value) (+ 1?).

Tim


In response to

pgsql-novice by date

Next:From: Josh BerkusDate: 2010-07-21 20:47:01
Subject: Re: C Postgresql CGI
Previous:From: Chris BrowneDate: 2010-07-21 16:44:36
Subject: Re: Inserting preset values into a serial column

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group