Re: Feeding results back into select (was: proposal sql: labeled function params)

Поиск
Список
Период
Сортировка
От D'Arcy J.M. Cain
Тема Re: Feeding results back into select (was: proposal sql: labeled function params)
Дата
Msg-id 20080822164619.71bc4e87.darcy@druid.net
обсуждение исходный текст
Ответ на Re: proposal sql: labeled function params  (Teodor Sigaev <teodor@sigaev.ru>)
Ответы Re: Feeding results back into select  (Teodor Sigaev <teodor@sigaev.ru>)
Список pgsql-hackers
On Sat, 23 Aug 2008 00:03:16 +0400
Teodor Sigaev <teodor@sigaev.ru> wrote:
> select 'a'=>'b';
>    ?column?
> ----------
>    "a"=>"b"

Branching the topic, I have a question about this.  I haven't studied
hstore extensively but this seems like a problem on it's face.
Shouldn't you be able to take the result of a select and pass it back
to a select?  I mean, what happens if you do this?

select "a"=>"b";

I suspect that you would get "ERROR:  column "a" does not exist" if you
do that.  What happens when you try to restore a dump?

I ran into a similar issue with my chkpass type (see contrib) where the
string inserted into the field is stored encrypted with functions to
test for equality basically like the Unix password model works.  If I
just displayed raw strings then a dump and reload would have trashed
all the passwords by re-encrypting them.  What I did was to make a
special case on input.  If the string started with ':' then I strip
that character and insert the string unchanged.  Then I changed the
output to prepend the ':'.  Now dump and reload work.

Just curious.

-- 
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 по дате отправления:

Предыдущее
От: Teodor Sigaev
Дата:
Сообщение: Re: proposal sql: labeled function params
Следующее
От: Tatsuo Ishii
Дата:
Сообщение: Re: WITH RECURSIVE patches 0818