Thread: what does opaque mean in create function?

what does opaque mean in create function?

From
Pam Wampler
Date:
In a function what does opaque mean?


What does create function xx_insert() returns opaque as '
    BEGIN
    NEW.txs := 0;
    END;
'
LANGUAGE 'plpgsql';

Re: what does opaque mean in create function?

From
knut.suebert@web.de
Date:
Pam Wampler schrieb:
> In a function what does opaque mean?

If you'd knew it, you had found it in the docs: ;-)

  "23.1. Installing Procedural Languages

   [...]

   The special return type of OPAQUE tells the database that this
   function does not return one of the defined SQL data types and is not
   directly usable in SQL statements."

  "24.3. Trigger Procedures

   PL/pgSQL can be used to define trigger procedures. They are created
   with the usual CREATE FUNCTION command as a function with no arguments
   and a return type of OPAQUE."

At least one possibility for the use of opaque: it returns nothing (or
something internal) for functions used in triggers.

G,
KS