Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-general by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group