Re: Alias hstore's ? to ~ so that it works with JDBC

Поиск
Список
Период
Сортировка
От Alexander Korotkov
Тема Re: Alias hstore's ? to ~ so that it works with JDBC
Дата
Msg-id CAPpHfdvsvzeAsG8__kA1W7kuR4Fi4y3T0Yb1MYZpVCR+2h_=zg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Alias hstore's ? to ~ so that it works with JDBC  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-hackers
On Wed, Feb 6, 2013 at 11:42 PM, Merlin Moncure <mmoncure@gmail.com> wrote:
>> *) hacking pg_operator (carefully look up and change oprname for the
>> specific hstore operator)
>
>
> bad solution. Why not just provide an additional operator?
>
>    CREATE OPERATOR ~ (
>         LEFTARG = hstore,
>         RIGHTARG = text,
>         PROCEDURE = exist,
>         RESTRICT = contsel,
>         JOIN = contjoinsel
>    );

yeah, this is much less hacky way to go.

But, you need to add new operator to opclasses in order to use GiST and GIN indexes. 
Another solution is to create SQL functionw which calls operator:
CREATE FUNCTION exists_inline (hstore, text) RETURNS bool AS $$ SELECT $1 ? $2; $$ LANGUAGE sql;
It will inline and use indexes.

------
With best regards,
Alexander Korotkov.

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Seamus Abshere
Дата:
Сообщение: Re: Alias hstore's ? to ~ so that it works with JDBC
Следующее
От: Jeff Janes
Дата:
Сообщение: Vacuum/visibility is busted