CREATE OPERATOR query

Поиск
Список
Период
Сортировка
От Robins Tharakan
Тема CREATE OPERATOR query
Дата
Msg-id CAEP4nAw83qOywTH9STYCGxcGEZ+pjvSLN8Hyz_f-tZYODxVfHQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: CREATE OPERATOR query  (Robins Tharakan <tharakan@gmail.com>)
Список pgsql-docs
Hi,

While trying to create regression tests for CREATE OPERATOR, I am able to create an operator despite not have USAGE / ALL access to the given argument type. Shouldn't the following SQL throw an error? 

BEGIN TRANSACTION;
CREATE ROLE rol_op3;
CREATE TYPE type_op3 AS ENUM ('new', 'open', 'closed');
CREATE FUNCTION fn_op3(type_op3, type_op3)
RETURNS type_op3 AS $$
    SELECT NULL::type_op3;
$$ LANGUAGE sql IMMUTABLE;
REVOKE ALL ON TYPE type_op3 FROM rol_op3;
SET ROLE rol_op3;
CREATE OPERATOR #*# (
   leftarg = type_op3,
   rightarg = type_op3,
   procedure = fn_op3
);
RESET ROLE;
ROLLBACK;

This what the doc says:

> To be able to create an operator, you must have USAGE privilege on the argument types and the return type, as well as EXECUTE privilege on the underlying function. If a commutator or negator operator is specified, you must own these operators.

Any pointers would be helpful.

Thanks
--
Robins Tharakan

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

Предыдущее
От: Greg Smith
Дата:
Сообщение: VALUES lists aliases
Следующее
От: Robins Tharakan
Дата:
Сообщение: Re: CREATE OPERATOR query