X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 7E39E474E4F for ; Tue, 25 Feb 2003 14:20:13 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 65553-09 for ; Tue, 25 Feb 2003 14:20:02 -0500 (EST) Received: from brasileiro.net (slxwy.dorms.usu.edu [129.123.227.56]) by postgresql.org (Postfix) with ESMTP id C3ED2474E42 for ; Tue, 25 Feb 2003 14:20:02 -0500 (EST) Received: from roberto by brasileiro.net with local (Exim 3.35 #1 (Debian)) id 18nkd9-0007v8-00 for ; Tue, 25 Feb 2003 12:20:43 -0700 Date: Tue, 25 Feb 2003 12:20:43 -0700 From: Roberto Mello To: pgsql-sql@postgresql.org Subject: Return type of triger functions from OPAQUE to TRIGGER in 7.3 Message-ID: <20030225192043.GA30324@cc.usu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline User-Agent: Mutt/1.4i X-message-flag: Please consider using an e-mail program other than Outlook. It's insecure. X-Virus-Scanned: by amavisd-new X-Archive-Number: 200302/561 X-Sequence-Number: 11959 In OpenACS, we have _a lot_ of functions, and many many triggers. Having endured the pains of trying to write upgrade scripts for functions, we were overjoyed with the addition of CREATE OR REPLACE for functions. 7.3 is looking great, so we're starting migrating towards it, with an eye on maintaining 7.2 compatibility for those that need it. We found out a few days ago that in PG 7.3 the return type for trigger functions was redefined from OPAQUE to TRIGGER. What's the rationale behind this? Is this for standards compliance (forgive my ignorance about the standard's details)? Were there other gains to be obtained from this move? It seems that new functions are automatically converted from OPAQUE to TRIGGER return type, but when one tries to CREATE OR REPLACE such function, we get an error saying that the return type of a function can't be redefined. I would classify this as a bug, because it defeats the purpose of CREATE OR REPLACE, at least for triggers. If the behavior of CREATE FUNCTION is to change OPAQUE to TRIGGER, then CREATE OR REPLACE FUNCTION should be consistent with that behavior. So right now we are stuck on either changing the return type of every trigger for TRIGGER (which means no 7.2 compatibility) or stay stuck in 7.2-land. Are there plans to make the behavior of CREATE OR REPLACE FUNCTION consistent with that of CREATE FUNCTION? Thanks, -Roberto -- +----| Roberto Mello - http://www.brasileiro.net/ |------+ + Computer Science Graduate Student, Utah State University + + USU Free Software & GNU/Linux Club - http://fslc.usu.edu/ + Air conditioned environment - Do not open Windows.