Re: oid's in views.

From: "Josh Berkus" <josh(at)agliodbs(dot)com>
To: "Aasmund Midttun Godal" <postgresql(at)envisity(dot)com>, josh(at)agliodbs(dot)com
Cc: pgsql-sql(at)postgresql(dot)org, dado(at)wildbrain(dot)com
Subject: Re: oid's in views.
Date: 2001-10-29 16:35:13
Message-ID: web-494080@davinci.ethosmedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Aasmund,

> Well, the first time I thought your solution, I chose not to use it
> as it requires large modifications in my data-structure. However it
> has grown on me and I am now considering whether or not to use it. My
> first thought though: your usq is very much like postgres' oid's.

Yes. My original design had been to use the OIDs for this purpose, but
a couple members of the core team pointed out some difficulties in using
OIDs as an integral part of your data structure.

> I
> have read somewhere that the postgres oid's are not really unique, is
> this true?

Only for very large databases. OIDs are a 4-byte signed integer,
meaning an upper limit of 2.4 billion. If your database accumulates
more total objects than that, the OIDs will start to "roll over".
However, this only becomes a problem for the database when objects of
the same type get assigned the same OID ... which nobody has yet
reported in the field.

>secondly do you use your usq's to perform updates on views
> which are joins of tables where rows in two or more tables share a
> usq (but being unique in each table).

Nope, since the whole point of USQs is to be unique in the database.
This is entirely possible due only to PostgreSQL's independent sequence
implementation, which allows me to be sure that now two distinct rows
will ever have the same USQ.

> Finally, do you not feel that these USQ are in contradiction to many
> of the philosophies entrenched in SQL? (not that it matters :).

Yes. Fabian Pascal and CJ Date would chew me out for this design, I
think. It does not adhere to the exisiting rules for Relational
Database Design, and the implementation is entirely proprietary, due to
the dependance on a platform-specific sequencing mechanism. Further, as
Dado pointed out, it's very difficult from the multi-child table to tell
what where the parent record is. Lastly, I cannot use standard
REFERENCES constraints, having to instead write my own constraints and
triggers, further limiting RDBMS platform independance.

However, given all that, the convenience of this design is enormous, and
consistency-checking procedures are easy to write given the
consolidation of most activity into a few tables.

-Josh

______AGLIO DATABASE SOLUTIONS___________________________
Josh Berkus
Complete information technology josh(at)agliodbs(dot)com
and data management solutions (415) 565-7293
for law firms, small businesses fax 621-2533
and non-profit organizations. San Francisco

Attachment Content-Type Size
unknown_filename text/plain 2 bytes
unknown_filename text/plain 2 bytes
unknown_filename text/plain 2 bytes

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Frank Wiles 2001-10-29 16:50:27 Re: delete queires
Previous Message sharmad 2001-10-29 15:34:08 postgresql error