Re: NULL as a (pseudo-)value not described?

From: David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
To: pgsql-docs(at)postgresql(dot)org
Subject: Re: NULL as a (pseudo-)value not described?
Date: 2014-09-11 01:20:00
Message-ID: 1410398400332-5818543.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

johnlumby wrote
> As far as I can tell,  
> the un-value NULL is not described anywhere in the doc
> as being something that can be assigned to a column.
>
> E.g. :
>    .  not listed as a constant  (well that's reasonable as it isn't)
>     .  not listed as an expression  (is NULL an expression?)
>     .  not explicitly listed under the INSERT and UPDATE commands
>         as a valid syntactic unit as an alternative to an expression
>         (If it is not an expression)
>
> I do see it listed as a valid keyword but there is no description there.
>
> To put it another way,   the following syntax is apparently not permitted
> :
>       UPDATE my_nullable_table SET nullable_col = NULL;
>
> (I am not referring to other null-related constructs such as IS NULL, 
> IFNULL etc)
>
> I have to assume I'm missing something?
> Or is it that NULL is so,  well,  null,   that it cannot be described?

http://www.postgresql.org/docs/9.4/static/ddl-default.html

To your point: null is a constant/literal as defined in

http://www.postgresql.org/docs/9.4/static/sql-expressions.html#SYNTAX-EXPRESS-EVAL

and so can appear in the defined expression area and so your example is
explicitly allowed.

http://www.postgresql.org/docs/9.4/static/bookindex.html#AEN167062 (under
"N")

Pseudo-type has a specific meaning is PostgreSQL which null does not conform
to.

Having brought this to attention why did you go looking for it and where, in
order, did you look?

I'll agree that it seems that a previous recognition that null can always
used as a valid data value is assumed much like it is assumed that 1000 is a
valid value for an integer.

David J.

--
View this message in context: http://postgresql.1045698.n5.nabble.com/NULL-as-a-pseudo-value-not-described-tp5818521p5818543.html
Sent from the PostgreSQL - docs mailing list archive at Nabble.com.

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message David Johnston 2014-09-11 14:03:00 Re: NULL as a (pseudo-)value not described?
Previous Message Bruce Momjian 2014-09-11 00:49:57 Re: [9.3] Should we mention "set_config(...)" in 18.1.3 in Server Configuration?