Question re: serial

From: Michael Satterwhite <michael(at)weblore(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Question re: serial
Date: 2004-04-24 17:24:03
Message-ID: 200404241224.05079.michael@weblore.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I have a table with a primary key defined as serial unique. When I insert a
row into the table, I need to get the value of that row back so that I can
use it to link rows in another table to it. How do I do that in Postgresql? I
know that I can define a sequence and insert the value manually, but is there
a way to query the value of the most recently inserted serial column of a
row?

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux)

iD8DBQFAiqK0jeziQOokQnARArJKAJ0SEs8DO6ETa6yZI2Wq6SOmydEwzQCeIwLF
on3NovbSaHa+tBrvrynyQfI=
=d0AB
-----END PGP SIGNATURE-----

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Devrim GUNDUZ 2004-04-24 17:37:44 Re: Question re: serial
Previous Message Greg Sabino Mullane 2004-04-24 16:54:21 Re: Design Problem...