Re: DEFAULT Constraint based on table type?

Поиск
Список
Период
Сортировка
От Rod Taylor
Тема Re: DEFAULT Constraint based on table type?
Дата
Msg-id 1133215075.69767.30.camel@home
обсуждение исходный текст
Ответ на DEFAULT Constraint based on table type?  ("Announce" <truthhurts@insightbb.com>)
Список pgsql-sql
On Mon, 2005-11-28 at 14:22 -0600, Announce wrote:
> Lets say I have the following tables.
> 
> CREATE TABLE animals(id primary key, name varchar, type varchar);
> CREATE TABLE dogs (breed varchar)            INHERITS (animals);
> CREATE TABLE birds (bool hasFeathers) INHERITS (animals);

r=# alter table birds alter type set default 'Bird';
ALTER TABLE
r=# \d birds                       Table "public.birds"  Column    |       Type        |             Modifiers
-------------+-------------------+-----------------------------------id          | integer           | not nullname
  | character varying |type        | character varying | default 'Bird'::character varyinghasfeathers | boolean
 |
 
Inherits: animals

r=# \d animals        Table "public.animals"Column |       Type        | Modifiers
--------+-------------------+-----------id     | integer           | not nullname   | character varying |type   |
charactervarying |
 
Indexes:   "animals_pkey" PRIMARY KEY, btree (id)



-- 



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

Предыдущее
От: Jaime Casanova
Дата:
Сообщение: Re: DEFAULT Constraint based on table type?
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: join if all matches