Re: hstore ==> and deprecate =>

From: Florian Pflug <fgp(at)phlo(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, Michael Glaesemann <grzm(at)seespotcode(dot)net>, Merlin Moncure <mmoncure(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: hstore ==> and deprecate =>
Date: 2010-06-12 14:15:54
Message-ID: E2283B6E-C838-4AE7-A6F7-8C4A8E611D14@phlo.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Jun 12, 2010, at 14:57 , Tom Lane wrote:
> But actually, there's another issue here: hstore defines not one but
> three => operators:
>
> text => text yields hstore (with 1 element)
> text[] => text[] yields hstore (with N elements)
> hstore => text[] yields hstore (subset)
>
> It's reasonable to say that the first two are bad design, but I'm
> a bit less willing to say that the last one is. What shall we
> do with that?

Hm, the last one seems to be more akin to
hstore - text yields hstore (key removed)
hstore - text[] yields hstore (keys in array removed)
hstore - hstore yields hstore (keys in hstore removed)

since it's not a constructor like the first two, but rather an (intersection-like) operation on an existing hstore.

Inspired by the already existing
hstore ?& text[] yields boolean (true if set of keys subset of array)
I suggest
hstore & text[]
as a replacement.

best regards,
Florian Pflug

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Baros 2010-06-12 14:17:08 GSoC - Materialized Views - is stale or fresh?
Previous Message Tom Lane 2010-06-12 12:57:42 Re: hstore ==> and deprecate =>