COMMUTATOR doesn't seem to work

Поиск
Список
Период
Сортировка
От D'Arcy Cain
Тема COMMUTATOR doesn't seem to work
Дата
Msg-id 4FE341EE.5000302@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>)
Список pgsql-hackers
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 <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.
IM: darcy@Vex.Net


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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Catalog/Metadata consistency during changeset extraction from wal
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Catalog/Metadata consistency during changeset extraction from wal