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

How to obtain serial generate when doing an insert?

From: "Williams, Travis L, NPONS" <tlw(at)att(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: How to obtain serial generate when doing an insert?
Date: 2003-05-27 20:44:43
Message-ID: AB815D267EC31A4693CC24D234F8291604AFF88A@ACCLUST02EVS1.ugd.att.com (view raw or flat)
Thread:
Lists: pgsql-general
I have a table with a serial field, how can I obtain what serial was generated for the insert I'm doing?  I could just do another query for max(id) .. where id is my serial field.. but I'm worried another insert could have already came in.

Travis

Responses

pgsql-general by date

Next:From: scott.marloweDate: 2003-05-27 20:52:31
Subject: Re: How to obtain serial generate when doing an insert?
Previous:From: dan radomDate: 2003-05-27 20:35:27
Subject: Re: Postgresql on SUN Server

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