COMMUTATOR doesn't seem to work

Поиск
Список
Период
Сортировка
Искать
От
D'Arcy Cain
Тема
COMMUTATOR doesn't seem to work
Дата
Msg-id
4FE341EE.5000302@druid.net
Список
Дерево обсуждения
COMMUTATOR doesn't seem to work D'Arcy Cain <darcy@druid.net>
Re: COMMUTATOR doesn't seem to work Tom Lane <tgl@sss.pgh.pa.us>
Re: COMMUTATOR doesn't seem to work D'Arcy Cain <darcy@druid.net>
Re: COMMUTATOR doesn't seem to work Tom Lane <tgl@sss.pgh.pa.us>
Re: COMMUTATOR doesn't seem to work D'Arcy Cain <darcy@druid.net>
Re: COMMUTATOR doesn't seem to work Florian Pflug <fgp@phlo.org>
Re: COMMUTATOR doesn't seem to work D'Arcy Cain <darcy@druid.net>
Re: COMMUTATOR doesn't seem to work Tom Lane <tgl@sss.pgh.pa.us>
Re: COMMUTATOR doesn't seem to work D'Arcy Cain <darcy@druid.net>
Re: COMMUTATOR doesn't seem to work Robert Haas <robertmhaas@gmail.com>
Re: COMMUTATOR doesn't seem to work D'Arcy Cain <darcy@druid.net>
Re: COMMUTATOR doesn't seem to work Tom Lane <tgl@sss.pgh.pa.us>
Re: COMMUTATOR doesn't seem to work D'Arcy Cain <darcy@druid.net>
Re: COMMUTATOR doesn't seem to work "Dickson S. Guedes" <listas@guedesoft.net>
Re: COMMUTATOR doesn't seem to work D'Arcy Cain <darcy@druid.net>
Re: COMMUTATOR doesn't seem to work Tom Lane <tgl@sss.pgh.pa.us>
Re: COMMUTATOR doesn't seem to work Florian Pflug <fgp@phlo.org>
Maybe I am using it wrong but I get no error message when I use it.  I
have a type called chkpass (a version is in the additional supplied
modules) and I create the equality operator like this:

CREATE OPERATOR = (        PROCEDURE = eq,        LEFTARG = chkpass,        RIGHTARG = text,        COMMUTATOR = =,        NEGATOR = <>
);

This works;

cosmostest=# SELECT 'aaa'::chkpass = 'aaa'; ?column?
---------- t
(1 row)

But...

cosmostest=# SELECT 'aaa' = 'aaa'::chkpass;
ERROR:  operator is only a shell: text = chkpass
LINE 1: SELECT 'aaa' = 'aaa'::chkpass;

When I look at the operators I see why, sort of...
 public | =    | chkpass       | text           | boolean     | public | =    | text          | chkpass        | -           |

So while it created the operator it didn't set a return type.

I don't know if this is a new issue or I simply got lucky and never
tried the opposite test before but I see this in 9.0.4 and 9.1.3.
Am I using the command improperly?

-- 
D'Arcy J.M. Cain          |  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.
IM: darcy@Vex.Net

В списке pgsql-hackers по дате отправления
От: Andres Freund
Дата:
От: Andres Freund
Дата:
FAQ