Re: OID wraparound (was Re: pg_depend)

From: "Rod Taylor" <rbt(at)barchord(dot)com>
To: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: "Lamar Owen" <lamar(dot)owen(at)wgcr(dot)org>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: OID wraparound (was Re: pg_depend)
Date: 2001-07-18 23:02:45
Message-ID: 02a101c10fdd$c1f4cec0$2205010a@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

currval() could work nicely, but thats an additional query. Currently
OID (in php among others) can be retrieved along with the insert
response which is instantly retrievable. This makes for a very quick
middleware enforced foreign key entry in other databases.

Returning the entire primary key of the last row inserted without
doing additional queries -- this is a known element which could be
cached -- could be very useful in these situations.

With tables requiring multi-key elements we do a second select asking
for currval()s of the sequences.

--
Rod Taylor

Your eyes are weary from staring at the CRT. You feel sleepy. Notice
how restful it is to watch the cursor blink. Close your eyes. The
opinions stated above are yours. You cannot imagine why you ever felt
otherwise.

----- Original Message -----
From: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: "Rod Taylor" <rbt(at)barchord(dot)com>
Cc: "Lamar Owen" <lamar(dot)owen(at)wgcr(dot)org>; "Tom Lane"
<tgl(at)sss(dot)pgh(dot)pa(dot)us>; "PostgreSQL-development"
<pgsql-hackers(at)postgresql(dot)org>
Sent: Wednesday, July 18, 2001 5:06 PM
Subject: Re: OID wraparound (was Re: [HACKERS] pg_depend)

> > If OIDs are dropped a mechanism for retrieving the primary key of
the
> > last insert would be greatly appreciated. Heck, it would be
useful
> > now (rather than returning OID).
> >
> > I much prefer retrieving the sequence number after the insert than
> > before insert where the insert uses it. Especially when trigger
> > muckary is involved.
>
> Doesn't currval() work for your needs.
>
> --
> Bruce Momjian | http://candle.pha.pa.us
> pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
> + If your life is a hard drive, | 830 Blythe Avenue
> + Christ can be your backup. | Drexel Hill, Pennsylvania
19026
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Sascha Schumann 2001-07-18 23:44:51 Re: MySQL Gemini code
Previous Message Tom Lane 2001-07-18 22:50:48 Re: OID wraparound (was Re: pg_depend)