ordbms - postgresql errata
| От | Jeff MacDonald |
|---|---|
| Тема | ordbms - postgresql errata |
| Дата | |
| Msg-id | Pine.BSF.4.21.0009190139160.766-100000@rage.hub.org обсуждение исходный текст |
| Ответы |
Re: ordbms - postgresql errata
|
| Список | pgsql-hackers |
i just found a (few) caveat already..
1:
bignose=# create table people(
bignose(# name varchar(64),
bignose(# age int8,
bignose(# sin int4,
bignose(# id serial);
bignose=# create table soldier(
bignose(# rank varchar(32),
bignose(# post varchar(32)) inherits (people);
bignose=# alter table people add column gender int2;
ALTER
bignose=# \d soldier Table "soldier"Attribute | Type | Modifier
-----------+-------------+-------------------------------------------------name | varchar(64) | age | bigint
| sin | integer | id | integer | not null default nextval('people_id_seq'::text)rank |
varchar(32)| post | varchar(32) |
now you can see that the attribute was added to the super class
but the sub class didn't inhereit..
----------- NEXT -------------
bignose=# insert into soldier (name,age,sin) values
bignose-# ('fred',19,12321);
bignose=# select p.* from people* p;name | age | sin | id | gender
------+-----+-------+----+--------fred | 19 | 12321 | 1 | -16968
i didn't specify a gender, but it put in a "randomish" value..
shouldn't it have just left this untouched ?
Jeff MacDonald,
-----------------------------------------------------
PostgreSQL Inc | Hub.Org Networking Services
jeff@pgsql.com | jeff@hub.org
www.pgsql.com | www.hub.org
1-902-542-0713 | 1-902-542-3657
-----------------------------------------------------
Fascimile : 1 902 542 5386
IRC Nick : bignose
В списке pgsql-hackers по дате отправления: