Should array_length() Return NULL - Mailing list pgsql-hackers

From David E. Wheeler
Subject Should array_length() Return NULL
Date
Msg-id BDFA4E0A-4B50-4BF4-8126-91DC5214130D@justatheory.com
Whole thread Raw
Responses Re: Should array_length() Return NULL  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hackers,

This surprised me:
   david=# select array_length('{}'::text[], 1);    array_length    --------------          [null]

I had expecte dit to retur 0. I might expect NULL for a NULL param, but not one that's defined but has no elements.

Best,

David


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Re: Doc patch making firm recommendation for setting the value of commit_delay
Next
From: Tom Lane
Date:
Subject: Re: in-catalog Extension Scripts and Control parameters (templates?)