Re: Get rid of system attributes in pg_attribute?

From: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Get rid of system attributes in pg_attribute?
Date: 2005-02-22 16:18:52
Message-ID: 200502221118.53335.xzilla@users.sourceforge.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tuesday 22 February 2005 10:32, Tom Lane wrote:
> Robert Treat <xzilla(at)users(dot)sourceforge(dot)net> writes:
> >>> Does anyone know of
> >>> client code that actually pays attention to pg_attribute rows with
> >>> negative attnums?
> >
> > Well, the corner case would be for those times when we use oid for
> > updating specific rows in a table, if a user creates there own oid column
> > then you could have trouble. Actually we already have a safegaurd for
> > this in phppgadmin so we wont cause mistakes, it's just that those
> > updates probably won't work... others might not have been so thorough
> > though.
>
> Anyone who's not checking that has been at risk ever since we invented
> WITHOUT OIDS:
>
> regression=# create table foo (oid text);
> ERROR: column name "oid" conflicts with a system column name
> regression=# create table foo (oid text) without oids;
> CREATE TABLE
>

Actually I was thinking more the case where someone creates their own column
names oid where they have no intention of those values being unique. If you
weren't already checking for duplicate oid's you could be in for trouble.

> Probably ctid is the more interesting case; I'm pretty sure ODBC relies
> on ctid as a short-term-unique row identifier.
>

Yeah... how many utility tools out there reference system columns explicitly?
I think we need a scheme for allowing them to keep working even with user
defined columns of the same name.

--
Robert Treat
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-02-22 16:24:31 Re: Get rid of system attributes in pg_attribute?
Previous Message Tom Lane 2005-02-22 15:40:45 Re: big problem