Re: Update HSTORE record and then delete if it is now empty - What is the correct sql? - Mailing list pgsql-sql

From Ian Lawrence Barwick
Subject Re: Update HSTORE record and then delete if it is now empty - What is the correct sql?
Date
Msg-id CAB8KJ=iO7V5n4bPRJqec1UL84B7ofs_cd_+DjHibEbpa4jUt9w@mail.gmail.com
Whole thread Raw
In response to Update HSTORE record and then delete if it is now empty - What is the correct sql?  (Ashwin Jayaprakash <ashwin.jayaprakash@gmail.com>)
Responses Re: Update HSTORE record and then delete if it is now empty - What is the correct sql?
List pgsql-sql
2013/2/23 Ashwin Jayaprakash <ashwin.jayaprakash@gmail.com>:
(...)
>
> Q2: What the best way to check if an HSTORE is empty? Is this it
> "array_length(akeys(data), 1) is null"?

Just a quick answer to your second question: I suspect it might be more
efficient to check your HSTORE column against an empty HSTORE, e.g.
 WHERE val = ''::HSTORE

HTH

Ian Barwick



pgsql-sql by date:

Previous
From: Bryan L Nuse
Date:
Subject: Re: Summing & Grouping in a Hierarchical Structure
Next
From: Tom Lane
Date:
Subject: Re: Update HSTORE record and then delete if it is now empty - What is the correct sql?