Re: trouble with trigger/function??? - Mailing list pgsql-general

From Tom Lane
Subject Re: trouble with trigger/function???
Date
Msg-id 17605.970583595@sss.pgh.pa.us
Whole thread Raw
In response to Re: trouble with trigger/function???  (Nelson Ferreira Jr <nelson@radix.com.br>)
List pgsql-general
Nelson Ferreira Jr <nelson@radix.com.br> writes:
>       The return type of the function must be OPAQUE, it means that the NEW
> variable is returned  (NEW represents the row that is being inserted and so
> fired the trigger)

Type "OPAQUE" means too many different things at the moment --- in some
uses it means "VOID" and in some other ones it means "some type that's
not described in pg_type".  ON-INSERT trigger functions have to return
the tuple to be inserted, and HeapTuple is not a type known to pg_type,
so OPAQUE is the right declaration; but it's confusing and error-prone.

I've been thinking about proposing a cleanup that would replace OPAQUE
with multiple special-purpose pseudo-datatypes, but I'm not sure that
improving clarity is worth the price of making everyone change all
their trigger function definitions ...

            regards, tom lane

pgsql-general by date:

Previous
From: "chris markiewicz"
Date:
Subject: RE: trouble with trigger/function???
Next
From: Tom Lane
Date:
Subject: Re: trouble with trigger/function???