Return type of triger functions from OPAQUE to TRIGGER in 7.3 - Mailing list pgsql-sql

From Roberto Mello
Subject Return type of triger functions from OPAQUE to TRIGGER in 7.3
Date
Msg-id 20030225192043.GA30324@cc.usu.edu
Whole thread Raw
Responses Re: Return type of triger functions from OPAQUE to TRIGGER in 7.3  (Josh Berkus <josh@agliodbs.com>)
List 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.


pgsql-sql by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Denormalizing during select
Next
From: Josh Berkus
Date:
Subject: Re: Return type of triger functions from OPAQUE to TRIGGER in 7.3