Re: oid's and primary keys on insert

From: "Nigel J(dot) Andrews" <nandrews(at)investsystems(dot)co(dot)uk>
To: Rob Brown-Bayliss <rob(at)zoism(dot)org>
Cc: PostgreSQL General List <pgsql-general(at)postgresql(dot)org>
Subject: Re: oid's and primary keys on insert
Date: 2002-08-09 21:09:03
Message-ID: Pine.LNX.4.21.0208092157240.3235-100000@ponder.fairway2k.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Fri, 9 Aug 2002, Nigel J. Andrews wrote:
>
> And in a separate message you ask how will PostgreSQL identify data if OIDs are
> removed from the system? Well doesn't the data identify the data?

It's sad to reply to one's own message but...

Ah, I see, you don't know the data in order to find the data. I'm not entirely
sure how you get in that situation but I'm sure you do. :)

I'm equally not sure how you would get out of without knowing the data. The
call to a function to combine two data values to make a unique value would seem
to me to require that you know the data. However, I would wary of using the
return information from an insert unless I knew with certainty that there was
only one row of data being inserted and perhaps more especially unless I knew
with certainty that there are no and are never going to be rules defined on
inserts to a table. Obviously if you control both database and application then
you can be more certain about rules but if not consider the situation where the
DB design changes and the table you are currently inserting to becomes a
view. In that situation you need to run maintenance on your application because
of the DB change and more importantly you'd find that if you can't rewrite the
insert procedure to write to the tables (for some reason) then you've
got no access to such information as the OID of an inserted row.

--
Nigel J. Andrews
Director

---
Logictree Systems Limited
Computer Consultants

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Nigel J. Andrews 2002-08-09 21:12:42 Re: uncommited question
Previous Message Rob Brown-Bayliss 2002-08-09 20:55:04 Re: uncommited question