Re: Permissions for CREATE OPERATOR CLASS
От | Tom Lane |
---|---|
Тема | Re: Permissions for CREATE OPERATOR CLASS |
Дата | |
Msg-id | 23594.1030140098@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: Permissions for CREATE OPERATOR CLASS (Alvaro Herrera <alvherre@atentus.com>) |
Список | pgsql-hackers |
Alvaro Herrera <alvherre@atentus.com> writes: > I was playing around and got this: > alvh=> create type my_cash (input = cash_in, output = cash_out, internallength = variable); > ERROR: TypeCreate: function cash_out(opaque) does not exist Yeah, the CREATE TYPE code is now much stricter about the allowed signatures of the I/O functions. The input function for a type foo must be one offoo_in(cstring) returns foofoo_in(opaque) returns foofoo_in(cstring) returns opaquefoo_in(opaque) returns opaque while the output must be one offoo_out(foo) returns cstringfoo_out(opaque) returns cstringfoo_out(foo) returns opaquefoo_out(opaque)returns opaque so unless you use "opaque" you cannot use the same I/O function for two different types. (Possibly the error message should complain about foo_out(foo) not foo_out(opaque).) If we hear a lot of squawks about that, we can discuss how to weaken the rules ... but IMHO the entire point here is to introduce some type safety into the use of I/O functions ... regards, tom lane
В списке pgsql-hackers по дате отправления: