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

Поиск
Список
Период
Сортировка
От Curt Sampson
Тема Re: Call for objections: put back OIDs in CREATE TABLE
Дата
Msg-id Pine.NEB.4.51.0301240241220.547@angelic.cynic.net
обсуждение исходный текст
Ответ на Re: Call for objections: put back OIDs in CREATE TABLE AS/SELECT INTO  ("Ross J. Reedstrom" <reedstrm@rice.edu>)
Список pgsql-hackers
On Thu, 23 Jan 2003, Ross J. Reedstrom wrote:

> So in the longer term, we need to provide a replacement. Arguably, the
> primary key for a table is the right replacement, but we don't _require_
> a pkey, so what to do in cases where this isn't one?

You're stuck. SQL breaks with relational theory in this way; tables
need not have candidate keys, and thus you can have duplicate rows in
a table. (I.e., mathamatically, a table is not a set, it's a bag.) The
implications of this start to go on and on, but let's not get into that
here.

> Also, the pkey can be _any_ column(s), of _any_ type, which could be
> inconvenient for returning as the result of an insert, for example
> (imagine a text field as pkey, with a _huge_ block of text just
> written into it ...)

Well, this could be worked around to some extent, with some hackery.
But in the end I reckon it's much easier just to have the object system
force you to declare specific a specific object-ID column, if that's
what it takes. So long as you've got a candidate key, even if it's not
the primary key, you're fine.

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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Hannu Krosing
Дата:
Сообщение: Re: Call for objections: put back OIDs in CREATE TABLE
Следующее
От: Curt Sampson
Дата:
Сообщение: Re: Options for growth