Re: trouble with trigger/function???

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Nelson Ferreira Jr <nelson(at)radix(dot)com(dot)br>
Cc: cmarkiew(at)commnav(dot)com, "Postgres (E-mail)" <pgsql-general(at)postgresql(dot)org>
Subject: Re: trouble with trigger/function???
Date: 2000-10-03 14:33:15
Message-ID: 17605.970583595@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Nelson Ferreira Jr <nelson(at)radix(dot)com(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2000-10-03 14:36:20 Re: trouble with trigger/function???
Previous Message chris markiewicz 2000-10-03 14:25:07 RE: trouble with trigger/function???