Re: hstore ==> and deprecate =>

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: "David E(dot) Wheeler" <david(at)kineticode(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: hstore ==> and deprecate =>
Date: 2010-06-17 23:15:10
Message-ID: 27967.1276816510@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Josh Berkus <josh(at)agliodbs(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message KaiGai Kohei 2010-06-18 00:23:39 Re: modular se-pgsql as proof-of-concept
Previous Message Andrew Dunstan 2010-06-17 23:05:34 Re: Why aren't master and slave DBs binary identical?