Re: BUG #8132: Not Null column should set default value when inserting or setting null

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #8132: Not Null column should set default value when inserting or setting null
Date: 2013-05-02 16:07:22
Message-ID: klu2vk$pq1$1@ger.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hajo(at)Lemcke(dot)com wrote on 02.05.2013 10:18:
> I would like to have the default value replace a given null value if the
> column is specified with not null and default.
>
> The SQL specification only requires to set the default value when the column
> is omitted on insert or update.
>
> I think this is a flaw in the specification because it requires developers
> to create multiple statements for inserts and updates for all combinations
> of default not null columns.

You can use DEFAULT instead of NULL, no need to have different statements.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Devrim GÜNDÜZ 2013-05-03 19:32:26 Re: BUG #7596: Problem with /etc/init.d/postgresql.9.x file
Previous Message Tom Lane 2013-05-02 15:05:11 Re: BUG #8132: Not Null column should set default value when inserting or setting null