Re: hstore ==> and deprecate => - Mailing list pgsql-hackers

From Tom Lane
Subject Re: hstore ==> and deprecate =>
Date
Msg-id 27967.1276816510@sss.pgh.pa.us
Whole thread Raw
In response to Re: hstore ==> and deprecate =>  (Josh Berkus <josh@agliodbs.com>)
Responses Re: hstore ==> and deprecate =>  ("David E. Wheeler" <david@kineticode.com>)
Re: hstore ==> and deprecate =>  (Andrew Dunstan <andrew@dunslane.net>)
Re: hstore ==> and deprecate =>  (Josh Berkus <josh@agliodbs.com>)
List pgsql-hackers
Josh Berkus <josh@agliodbs.com> writes:
> Currently for hstore, %% returns a flattened array and %# returns a
> two-dimensional array.  That means that it makes sense that the operator
> which returns an hstore subset should be something based on %, either
> %>, %% or just %.

But %% and %# are prefix operators.  Extrapolating from those to an
infix operator seems a bit thin.  Nonetheless, something using % seems
better than something using &, for the other reasons you mention.

> I vote for % .

I'd vote for %>, out of those.  Reason: the operator isn't commutative,
in fact left and right inputs aren't even the same datatype, so a glyph
that looks asymmetric seems more natural.

> Using % would also mean that sometime in the future we can implement !%
> as "elements NOT in this list" (i.e. ' a => 1, b => 2, c => 5' !% 'a, b'
> == 'c => 5' )

You can prepend ! to any operator name at all, so that's not much of
a differentiator.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Why aren't master and slave DBs binary identical?
Next
From: "David E. Wheeler"
Date:
Subject: Re: hstore ==> and deprecate =>