Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YZ5kd-0006rC-LD for pgsql-bugs@arkaria.postgresql.org; Fri, 20 Mar 2015 22:50:47 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YZ5kc-0001Br-RC for pgsql-bugs@arkaria.postgresql.org; Fri, 20 Mar 2015 22:50:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YZ5kc-0001Bl-5N for pgsql-bugs@postgresql.org; Fri, 20 Mar 2015 22:50:46 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1YZ5kX-00028c-HT for pgsql-bugs@postgresql.org; Fri, 20 Mar 2015 22:50:45 +0000 Received: from bruce by momjian.us with local (Exim 4.72) (envelope-from ) id 1YZ5kU-0004uJ-U0; Fri, 20 Mar 2015 18:50:38 -0400 Date: Fri, 20 Mar 2015 18:50:38 -0400 From: Bruce Momjian To: bouda@edookit.com Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #12108: Documentation: Limitation of shell types not mentioned Message-ID: <20150320225038.GA6317@momjian.us> References: <20141201003448.2567.45700@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="bWEb1MG/o7IKOlQF" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20141201003448.2567.45700@wrigleys.postgresql.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org --bWEb1MG/o7IKOlQF Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Mon, Dec 1, 2014 at 12:34:48AM +0000, bouda@edookit.com wrote: > The following bug has been logged on the website: > > Bug reference: 12108 > Logged by: Ondřej Bouda > Email address: bouda@edookit.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 http://momjian.us EnterpriseDB http://enterprisedb.com + Everyone has their own god. + --bWEb1MG/o7IKOlQF Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="shell.diff" diff --git a/doc/src/sgml/ref/create_type.sgml b/doc/src/sgml/ref/create_type.sgml new file mode 100644 index f9e1297..a6a4644 *** a/doc/src/sgml/ref/create_type.sgml --- b/doc/src/sgml/ref/create_type.sgml *************** CREATE TYPE