Re: Call for objections: put back OIDs in CREATE TABLE

From: Curt Sampson <cjs(at)cynic(dot)net>
To: Antti Haapala <antti(dot)haapala(at)iki(dot)fi>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Call for objections: put back OIDs in CREATE TABLE
Date: 2003-01-27 22:48:43
Message-ID: Pine.NEB.4.51.0301280745570.493@angelic.cynic.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 27 Jan 2003, Antti Haapala wrote:

> For an INSERT command, the tag is INSERT oid rows, where rows
> is the number of rows inserted, and oid is the object ID of the
> inserted row if rows is 1, otherwise oid is 0.
>
> Wouldn't it be nice to add here
>
> If table doesn't contain row oids, in place of oid is the
> primary key of the newly inserted record (if any) as column =
> 'value' [ and column = 'value [ and ... ]]

Well, as was pointed out, that's a lot of data to send back if your
primary key is a huge text column, and you've still got a problem if
you have a multi-column primary key.

Since this sort of functionality is not all that frequently needed, I'd
still say it would probably be cleaner to make a new query that selects
the most recently inserted primary key. That means that a) you don't
have to send back a potentially large amount of data unless the user
asks for it, and b) multi-column primary keys work just fine.

cjs
--
Curt Sampson <cjs(at)cynic(dot)net> +81 90 7737 2974 http://www.netbsd.org
Don't you know, in this new Dark Age, we're all light. --XTC

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2003-01-27 23:01:28 Client failure allows backed to continue
Previous Message Bruce Momjian 2003-01-27 22:37:12 pg_dump and inserts