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

From David E. Wheeler
Subject Re: hstore ==> and deprecate =>
Date
Msg-id 1740AA8D-A63B-4B6A-9D30-F592FC302FCF@kineticode.com
Whole thread Raw
In response to Re: hstore ==> and deprecate =>  (Florian Pflug <fgp@phlo.org>)
Responses Re: hstore ==> and deprecate =>  (Robert Haas <robertmhaas@gmail.com>)
Re: hstore ==> and deprecate =>  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Jun 17, 2010, at 1:30 PM, Florian Pflug wrote:

> How about turning it into a function
>    hstore hstore(hstore, text[])
> instead?

I just searched through the 2008 spec for a slice/subset operator and came up empty. It seems to define a bunch of
predicatesfor multisets, but not much for arrays. 

And looking again at the options, I'm *okay* with %, but not keen on %> anymore (I could see a future where %> and <%
itas complement @> and <@ by confirming the presence of keys in an hstore: 
   bool = hstore %> text[];

So, frankly, I'm coming back to what Florian has suggested here. What about calling it slice?
   hstore = slice(hstore, text[]);

It'd be nice to have one for arrays, too:
   anyarray[] = slice(anyarray[], int[]);

An operator could always be added later if a good one appeared.

Okay, no more bikeshedding for me on this issue. I'm covered in paint.

Best,

David

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: deprecating =>, take two
Next
From: Dimitri Fontaine
Date:
Subject: Re: deprecating =>, take two