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

From: Antti Haapala <antti(dot)haapala(at)iki(dot)fi>
To: Curt Sampson <cjs(at)cynic(dot)net>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, "Ross J(dot) Reedstrom" <reedstrm(at)rice(dot)edu>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Call for objections: put back OIDs in CREATE TABLE
Date: 2003-01-27 11:47:46
Message-ID: Pine.GSO.4.44.0301271238100.13057-100000@paju.oulu.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> > Anyways, I've got an idea: what about having option that INSERTs return
> > "oid_status" in form...
>
> I don't understand exactly how an INSERT statement "returns" anything.
> An INSERT statement is not a function, is it?

I mean the backend message CompletedResponse (and
s/oid_status/PQoidStatus/ (as it's written in libpq-fe.h)) (ok, it's
deprecated now in favor of PQoidValue).

From postgresql docs see section Frontend-Backend protocol:

Byte1('C')

Identifies the message as a completed response.

String

The command tag. This is usually a single word that
identifies which SQL command was completed.

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 ... ]]

--
Antti Haapala

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Clift 2003-01-27 11:51:20 Re: Have a PG 7.3.1 Windows (cygwin) easy installer... now
Previous Message Antonio Scotti 2003-01-27 09:57:57 On Commit Triggers?