Re: hstore improvements?
| От | David E. Wheeler |
|---|---|
| Тема | Re: hstore improvements? |
| Дата | |
| Msg-id | 7204679A-96C9-428A-AAB0-CEAF12FACD4D@kineticode.com обсуждение исходный текст |
| Ответ на | Re: hstore improvements? (Andrew Gierth <andrew@tao11.riddles.org.uk>) |
| Ответы |
Re: hstore improvements?
Re: hstore improvements? |
| Список | pgsql-hackers |
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
В списке pgsql-hackers по дате отправления: