Re: default to WITHOUT OIDS?

From: Neil Conway <neilc(at)samurai(dot)com>
To: Ashley Cambrell <ash(at)freaky-namuh(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: default to WITHOUT OIDS?
Date: 2003-01-10 23:25:58
Message-ID: 1042241157.743.17.camel@tokyo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 2003-01-10 at 18:17, Ashley Cambrell wrote:
> The problem with getting rid of OIDs as default is there is then no way
> to get the primary key of a just inserted row with out OIDs (as far as I
> know)

Use currval() on the PK sequence -- if you call it from within the query
that inserted a row, it is guaranteed to give you the last sequence
value that it generated.

However, I agree that one of the drawbacks of this scheme would be
breaking the OID in the status string returned by INSERT and similar
commands. Not too big a deal, IMHO (users can still get the same effect
by specifying WITH OIDS, or toggling the GUC var)...

Cheers,

Neil
--
Neil Conway <neilc(at)samurai(dot)com> || PGP Key ID: DB3C29FC

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-01-10 23:44:54 Re: default to WITHOUT OIDS?
Previous Message Ashley Cambrell 2003-01-10 23:17:55 Re: default to WITHOUT OIDS?