Re: Permissions for CREATE OPERATOR CLASS

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)atentus(dot)com>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Permissions for CREATE OPERATOR CLASS
Date: 2002-08-23 22:01:38
Message-ID: 23594.1030140098@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)atentus(dot)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 of
foo_in(cstring) returns foo
foo_in(opaque) returns foo
foo_in(cstring) returns opaque
foo_in(opaque) returns opaque
while the output must be one of
foo_out(foo) returns cstring
foo_out(opaque) returns cstring
foo_out(foo) returns opaque
foo_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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2002-08-23 22:14:28 pg_attribute.attisinherited ?
Previous Message Oleg Bartunov 2002-08-23 20:06:39 Re: [GENERAL] integer[] Update Questions