Return type of triger functions from OPAQUE to TRIGGER in 7.3

From: Roberto Mello <rmello(at)cc(dot)usu(dot)edu>
To: pgsql-sql(at)postgresql(dot)org
Subject: Return type of triger functions from OPAQUE to TRIGGER in 7.3
Date: 2003-02-25 19:20:43
Message-ID: 20030225192043.GA30324@cc.usu.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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.

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2003-02-25 21:10:14 Re: Return type of triger functions from OPAQUE to TRIGGER in 7.3
Previous Message Edmund Lian 2003-02-25 18:48:19 Re: Denormalizing during select