Re: BUG #12108: Documentation: Limitation of shell types not mentioned

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: bouda(at)edookit(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #12108: Documentation: Limitation of shell types not mentioned
Date: 2015-03-20 22:50:38
Message-ID: 20150320225038.GA6317@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Dec 1, 2014 at 12:34:48AM +0000, bouda(at)edookit(dot)com wrote:
> The following bug has been logged on the website:
>
> Bug reference: 12108
> Logged by: Ondřej Bouda
> Email address: bouda(at)edookit(dot)com
> PostgreSQL version: 9.3.5
> Operating system: Windows 7
> Description:
>
> According to an older discussion [1], shell types may only be used by
> functions implemented in C. Indeed, in current versions, functions in, e.g.,
> SQL or PL/pgSQL cannot be defined if an argument type or the return type is
> just a shell type.
>
> This is not mentioned in the documentation, however. On the contrary, the
> CREATE TYPE documentation suggests creating a shell type as the "tricky" way
> to define a range type with a canonical function. Neither CREATE FUNCTION
> documentation mentions such a limitation. Thus, when implementing an SQL or
> PL/pgSQL prototype for some new canonical function, one gets stuck on an
> unexpected error.
>
> I suggest mentioning the limitation on the CREATE TYPE page, in the
> paragraph saying how to specify the canonical function.

I have update the docs with the attached patch. I also noticed that
there is a sentence down at the bottom saying:

Also, to avoid accidentally cluttering the catalogs with shell types as
a result of simple typos in function definitions, a shell type will only
be made this way when the input function is written in C.

I think this explains why only C functions are supported.

Let me know if you have any additional suggestions.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +

Attachment Content-Type Size
shell.diff text/x-diff 1.2 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2015-03-21 01:52:54 Re: ALTER TABLE documentation or parser bug
Previous Message Bruce Momjian 2015-03-20 21:13:02 Re: minor: contrib/btree_gin/btree_gin.c uses DirectFunctionCall3(inet_in,..)