Determining if an hstore is empty

From: Wells Oliver <wellsoliver(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Determining if an hstore is empty
Date: 2013-02-11 19:36:51
Message-ID: CAOC+FBXFrSCgq1kN+5oJ=UTpy4yGM=dy7qemNbDedYGRjFB=zQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

What's the canonical way of doing this? Various failed attempts include:

select array_length(%%'a=>1'::hstore - 'a=>1'::hstore, 1)

select array_length(%%('a=>1'::hstore - 'a=>1'::hstore), 1)

select array_length(avals('a=>1'::hstore - 'a=>1'::hstore), 1);

select array_length(akeys('a=>1'::hstore - 'a=>1'::hstore), 1);

select skeys('a=>1'::hstore - 'a=>1'::hstore) is null

select 'a=>1'::hstore - 'a=>1'::hstore is null

Etc.

--
Wells Oliver
wellsoliver(at)gmail(dot)com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Péter Kovács 2013-02-11 20:14:35 Re: Cache lookup failed for relation
Previous Message Andrew Satori 2013-02-11 19:35:10 Re: fascinating article on postgresql mailing lists