On Mar 13, 2009, at 1:21 PM, Andrew Gierth wrote:

I'm thinking that (hstore -> text[]) should probably return text[],
and maybe (hstore => text[]) returning hstore?

i.e.

select ('a=>1,b=>2,c=>3'::hstore) -> ARRAY['a','b'];
 -- returns '{1,2}'

select ('a=>1,b=>2,c=>3'::hstore) => ARRAY['a','b'];
 -- returns 'a=>1,b=>2'

(by analogy to the existing operators -> for lookup and => for
construction)

Is a more Perlish syntax out of the question?

SELECT ('a=>1,b=>2,c=>3'::hstore)['a', 'b'];
 -- returns '{1,2}'
select ('a=>1,b=>2,c=>3'::hstore){'a','b'};
 -- returns 'a=>1,b=>2'

Best,

David

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to