Re: Default values for nulls not being set.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Donald Fraser" <demolish(at)cwgsy(dot)net>
Cc: "[BUGS]" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Default values for nulls not being set.
Date: 2003-03-04 02:15:26
Message-ID: 19582.1046744126@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Donald Fraser" <demolish(at)cwgsy(dot)net> writes:
> I have a major problem with DEAFAULT values:

Consider attaching a default to the view column. As-is, its default
is NULL (and I can't see any good argument for the factory default
being anything else).

tt=# INSERT INTO vu_tbl_test (id, s_desc) VALUES('2', 'View insert test');
ERROR: ExecInsert: Fail to add null value in not null attribute b_disabled
tt=# alter table vu_tbl_test alter column b_disabled set default '0';
ALTER TABLE
tt=# INSERT INTO vu_tbl_test (id, s_desc) VALUES('2', 'View insert test');
INSERT 0 1
tt=#

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message dinu paul 2003-03-04 06:34:11 Installtion error
Previous Message Peter Eisentraut 2003-03-03 23:16:19 Re: Installation problem under Windows NT 4 german version