Re: DEFAULT Constraint based on table type? - Mailing list pgsql-sql

From Rod Taylor
Subject Re: DEFAULT Constraint based on table type?
Date
Msg-id 1133215075.69767.30.camel@home
Whole thread Raw
In response to DEFAULT Constraint based on table type?  ("Announce" <truthhurts@insightbb.com>)
List 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 by date:

Previous
From: Jaime Casanova
Date:
Subject: Re: DEFAULT Constraint based on table type?
Next
From: Bruno Wolff III
Date:
Subject: Re: join if all matches