From: | Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> |
---|---|
To: | Rich Shepard <rshepard(at)appl-ecosys(dot)com>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: Default column value |
Date: | 2016-12-30 14:46:17 |
Message-ID: | 94c41a82-29b0-ab64-c3da-ebd8f15e3dac@aklaver.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On 12/30/2016 06:38 AM, Rich Shepard wrote:
> Reading the 9.6 docs suggests an answer to my question, but does not
> explicitly answer it, so I ask here.
>
> 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:
test=> create table default_test(id int, fld_1 varchar DEFAULT NULL);
CREATE TABLE
test=> \d default_test
Table "public.default_test"
Column | Type | Modifiers
--------+-------------------+-----------
id | integer |
fld_1 | character varying |
>
> TIA,
>
> Rich
>
>
--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com
From | Date | Subject | |
---|---|---|---|
Next Message | btober@computer.org | 2016-12-30 14:51:26 | Re: LYDB: Feasible to use PG roles instead of application-level security? |
Previous Message | Rich Shepard | 2016-12-30 14:38:43 | Default column value |