Re: Proper relational database?

Поиск
Список
Период
Сортировка
От
Тема Re: Proper relational database?
Дата
Msg-id 004901d19d16$5f13a7a0$1d3af6e0$@andl.org
обсуждение исходный текст
Ответ на Re: Proper relational database?  (Raymond Brinzer <ray.brinzer@gmail.com>)
Список pgsql-general
> On Fri, Apr 22, 2016 at 10:45 PM, John R Pierce <pierce@hogranch.com> wrote:
> > a table with no columns would have no primary key...  doesn't that
> > violate one of the fundamental tenets of the relational model ?
>
> Not as I understand it.  A relation must have at least one candidate key.
> That will be the set of all the fields, if no proper subset qualifies.
> Calling one key "primary" is merely convention, so far as I am aware (talking
> relational theory, here, not how databases regard primary keys).

This is a 'soft' requirement. If there is no other key, then the set of all attributes is the key.

> In a table with no columns, the only candidate key is the set of all fields,
> which is the empty set.  If you want to call that the primary key, it
> shouldn't be a problem.  The tuples (all 0 of them) are guaranteed to be
> unique.

The relation with no attributes may have a tuple, which itself has no attributes. Thus there are two such relations,
oneempty and one of degree one. They can be referred to as DUM and DEE, or as false and true. See
http://c2.com/cgi/wiki?TableDumfor example. 

Many experienced users of SQL are aware of situations where they are useful. In Andl they are automatically available
asliterals. 

Regards
David M Bennett FACS

Andl - A New Database Language - andl.org







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

Предыдущее
От: Raymond Brinzer
Дата:
Сообщение: Re: Proper relational database?
Следующее
От: Thomas Munro
Дата:
Сообщение: Re: Proper relational database?