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

Does INSERT inserts always at the end ?

From: florence(dot)henry(at)obspm(dot)fr (Florence HENRY)
To: pgsql-general(at)postgresql(dot)org
Subject: Does INSERT inserts always at the end ?
Date: 2004-05-19 13:19:26
Message-ID: (view raw or whole thread)
Lists: pgsql-general

well, almost everything is in the subject !

I have to fill 2 tables (more complicated than in the example !):

   id serial primary key,
   foo text);

   id serial references A,
   bar text);

I fill A with :
   INSERT into A VALUES (DEFAULT, "toto");

Then I need to retreive the "" that was given to A, in order to give it 
to If I was doing this by hand, it would have been quite easy, but I'm
doing this with a script.

So, if I make a SELECT id from A; and take the last row, will it *always*
be the row that I've just inserted.

Thanks for any tip

Florence HENRY


pgsql-general by date

Next:From: Matthew T. O'ConnorDate: 2004-05-19 13:43:23
Subject: Re: Is using cross-version pg_autovacuum possible/safe?
Previous:From: Marco LazzeriDate: 2004-05-19 12:50:11
Subject: Re: Restricted query

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