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

Re: [NOVICE] Last ID Problem

From: "Merlin Moncure" <merlin(dot)moncure(at)rcsonline(dot)com>
To: "Greg Stark" <gsstark(at)mit(dot)edu>
Cc: <pgsql-hackers(at)postgresql(dot)org>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: [NOVICE] Last ID Problem
Date: 2005-02-02 20:19:27
Message-ID: 6EE64EF3AB31D5448D0007DD34EEB3412A7605@Herge.rcsinc.local (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
> > Greg Stark <gsstark(at)mit(dot)edu> writes:
> > > Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
> > >> How is what you're suggesting more portable?
> For postgres it looks like currently it requires you to pass in the
> and
> field might even need a "driver-specific hint" telling it the sequence
> name.

That is a shortcoming of the DBD::pg driver which really should be
returning a key (comprised of columns, some or none of which may be
defaulted by the server).  The 'database supplied' integer assumption is
bad, bad, bad.  In fairness, getting the last returned key is a
catastrophic limitation of sql that we must all work around (itself
being a specific annoyance of that tricky devil, default columns). :-)

The only thing that is going to meet your requirements is a system wide
(well, at least table wide, but system wide would be better) 64 bit oid,
which doesn't exist right now.  Sequences (or more generally, defaulted
columns) are application managed and difficult to deal with at the
driver level.


pgsql-hackers by date

Next:From: Martin PittDate: 2005-02-02 20:42:28
Subject: Re: libpq API incompatibility between 7.4 and 8.0
Previous:From: Joshua D. DrakeDate: 2005-02-02 20:01:11
Subject: pg_dump bug in 7.3.9 with sequences

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