Re: Checking empty array

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Alexis Beuraud *EXTERN*" <alexis(at)siatel(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Checking empty array
Date: 2007-10-30 13:24:01
Message-ID: D960CB61B694CF459DCFB4B0128514C26ABD74@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alexis Beuraud wrote:
> What is the correct way to check whether an array is empty?
>
> Here is what I do, in pseudo-code:
>
> -- Is my array empty now?
> IF (myarray isnull) THEN

Try this:

IF array_lower(myarray, 1) IS NULL THEN ... END IF

Yours,
Laurenz Albe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2007-10-30 13:41:51 Re: Collation sequence and use of operatings system's locale
Previous Message Filip Rembiałkowski 2007-10-30 13:07:58 Re: Data cube in PostgreSQL