Re: Table inheritance versus views

Поиск
Список
Период
Сортировка
От Curt Sampson
Тема Re: Table inheritance versus views
Дата
Msg-id Pine.NEB.4.44.0208041547420.12724-100000@angelic.cynic.net
обсуждение исходный текст
Ответ на Re: Table inheritance versus views  (Hannu Krosing <hannu@tm.ee>)
Список pgsql-hackers
On 3 Aug 2002, Hannu Krosing wrote:

> hannu=# create table animal (name text, legcount int);
> CREATE
> hannu=# insert into animal values('pig',4);
> INSERT 34183 1
> hannu=# select * from animal;
>  name | legcount
> ------+----------
>  pig  |        4
> (1 row)
>
> hannu=# create table bird (wingcount int) inherits (animal);
> CREATE
> hannu=# insert into bird values('hen',2,2);
> INSERT 34189 1
> hannu=# select * from animal;
>  name | legcount
> ------+----------
>  pig  |        4
>  hen  |        2
> (2 rows)

You can do this just as well with views. In posgres, it's harder
only because you're forced to create rules for updating views. But
it's possible to have the system automatically do the right thing.

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 по дате отправления:

Предыдущее
От: Curt Sampson
Дата:
Сообщение: Re: Why is MySQL more chosen over PostgreSQL
Следующее
От: Joe Conway
Дата:
Сообщение: Re: FUNC_MAX_ARGS benchmarks