pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Roberto Mello <rmello@cc.usu.edu>
To: pgsql-sql@postgresql.org
Subject: Return type of triger functions from OPAQUE to TRIGGER in 7.3
Date: Tue, 25 Feb 2003 12:20:43 -0700
Message-ID: <20030225192043.GA30324@cc.usu.edu> (raw)

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.



view thread (6+ messages)  latest in thread

Message-ID: <20030225192043.GA30324@cc.usu.edu>
Permalink:  ../20030225192043.GA30324@cc.usu.edu/
Also on:    postgresql.org/message-id/20030225192043.GA30324@cc.usu.edu

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: rmello@cc.usu.edu
  Subject: Re: Return type of triger functions from OPAQUE to TRIGGER in 7.3
  In-Reply-To: <20030225192043.GA30324@cc.usu.edu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox