Alexis Beuraud wrote:
> Dear all,
>
> What is the correct way to check whether an array is empty?
> -- Is my array empty now?
> IF (myarray isnull) THEN
An empty array isn't null (unknown), it's empty.
Try enquiring about it's size:
SELECT array_dims('{}'::integer[]) is null;
?column?
----------
t
You could use array_lower/upper instead too.
--
Richard Huxton
Archonet Ltd