Re: default value - Mailing list pgsql-admin

From Tom Lane
Subject Re: default value
Date
Msg-id 29435.1055425645@sss.pgh.pa.us
Whole thread Raw
In response to default value  ("Nathalie Boulos" <nathalieboulos@hotmail.com>)
List pgsql-admin
"Nathalie Boulos" <nathalieboulos@hotmail.com> writes:
> When i insert a value into a field in the table directly, all the other
> fields take their default values normaly, but the problem is if i insert
> into the rule and not into the table, all the fields who has default values
> do not take them. those fields remains empty.
> So the default value does not work if i insert into a rule ???

A rule has its own defaults --- set them with ALTER TABLE rule SET DEFAULT.

(IIRC this works since about 7.2; it won't work on old Postgresen.)

            regards, tom lane

pgsql-admin by date:

Previous
From: Stef
Date:
Subject: triggers to foreign keys
Next
From: Tom Lane
Date:
Subject: Re: triggers to foreign keys