Search Postgresql Archives

Re: Default column value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.klaver@xxxxxxxxxxx


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux