pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Satterwhite <michael@weblore.com>
To: pgsql-sql@postgresql.org
Subject: Question re: serial
Date: Sat, 24 Apr 2004 12:24:03 -0500
Message-ID: <200404241224.05079.michael@weblore.com> (raw)

-----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-----




view thread (3+ messages)  latest in thread

Message-ID: <200404241224.05079.michael@weblore.com>
Permalink:  ../200404241224.05079.michael@weblore.com/
Also on:    postgresql.org/message-id/200404241224.05079.michael@weblore.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: michael@weblore.com
  Subject: Re: Question re: serial
  In-Reply-To: <200404241224.05079.michael@weblore.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox