Re: hstore for audit logging: Finding differences between two hstore values

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: Sergey Konoplev <sergey(dot)konoplev(at)postgresql-consulting(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: hstore for audit logging: Finding differences between two hstore values
Date: 2012-07-13 08:18:46
Message-ID: 4FFFD9E6.7000506@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 07/13/2012 02:15 PM, Sergey Konoplev wrote:
> On Fri, Jul 13, 2012 at 9:51 AM, Craig Ringer
> <craig(at)postnewspapers(dot)com(dot)au> wrote:
>> ... but it feels like there must be a smarter way.
> Well, may be kind of (h1 - h2), (h2 - h1) and derivatives will make sense?
>
>

I apparently have the reading skills of a stoned mole, as I completely
missed the subtraction operator in hstore's operators table.

"hstore - hstore | delete matching pairs from left operand"

I was thinking in terms of union/intersection/difference, didn't find
matching terms in the hstore docs, and managed to repeatedly overlook
the -(hstore,hstore) operator in the table. Thanks.

On the upside I've come up with the a truly insanely verbose and slow
way to implement the -(hstore,hstore) operator. Yay?

--
Craig Ringer

POST Newspapers
276 Onslow Rd, Shenton Park
Ph: 08 9381 3088 Fax: 08 9388 2258
ABN: 50 008 917 717
http://www.postnewspapers.com.au/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Marc Mamin 2012-07-13 10:20:44 WITH RECURSIVE question
Previous Message KOTa 2012-07-13 07:56:09 Re: installation problem with postgres password