Calling void functions

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Subject: Calling void functions
Date: 2007-04-02 08:02:26
Message-ID: 200704021002.26282.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I'm informed that the last statement of a function that returns void cannot be
a SELECT. How else is one supposed to call another function which also
returns void?

E.g.,

CREATE FUNCTION foo (a int, b int) RETURNS void
LANGUAGE plpgsql
AS $$ do important things $$;

CREATE FUNCTION foo (a int) RETURNS void
LANGUAGE sql
AS $$ SELECT foo($1, default-value); $$;

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Daniel Caune 2007-04-02 12:52:09 Re: Calling void functions
Previous Message Tom Lane 2007-04-01 18:51:50 Re: Sequence vs Serial