Re: Default column value

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Default column value
Date: 2016-12-30 14:54:52
Message-ID: 13236.1483109692@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Rich Shepard <rshepard(at)appl-ecosys(dot)com> writes:
> If a column has a default value specified does this mean the column cannot
> contain a NULL value? In other words, is DEFAULT <some_value> NOT NULL
> redundant?

No, because you can explicitly insert a null. DEFAULT only controls
what happens when you omit the column in an INSERT command.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2016-12-30 14:55:36 Re: Default column value
Previous Message btober@computer.org 2016-12-30 14:51:26 Re: LYDB: Feasible to use PG roles instead of application-level security?