Обсуждение: what does opaque mean in create function?

Поиск
Список
Период
Сортировка

what does opaque mean in create function?

От
Pam Wampler
Дата:
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?

От
knut.suebert@web.de
Дата:
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