Re: Feeding results back into select - Mailing list pgsql-hackers

From D'Arcy J.M. Cain
Subject Re: Feeding results back into select
Date
Msg-id 20080823084020.16e8ebe4.darcy@druid.net
Whole thread Raw
In response to Re: Feeding results back into select  (Teodor Sigaev <teodor@sigaev.ru>)
List pgsql-hackers
On Sat, 23 Aug 2008 14:04:30 +0400
Teodor Sigaev <teodor@sigaev.ru> wrote:
> >> select 'a'=>'b';
> >>    ?column?
> >> ----------
> >>    "a"=>"b"
> "a"=>"b" is a value of hstore type, so query should be:
> select '"a"=>"b"'::hstore;

Of course.  Now that I understand it's blindingly obvious that the
double quotes above are part of the string and the insert would be; INSERT INTO table (hfield) VALUES ('"a"=>"b"');

> " character was chosen to simplify escaping,

To prevent; INSERT INTO table (hfield) VALUES ('''a''=>''b''');

I guess my brain was pointed elsewhere when I asked.  Thanks for not
treating me like an idiot.  :-)

-- 
D'Arcy J.M. Cain <darcy@druid.net>         |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: CREATE CAST too strict?
Next
From: Peter Eisentraut
Date:
Subject: Re: [GENERAL] Surprising syntax error