From: Jan B. <jan@monso.de>
To: pgsql-sql@postgresql.org
Subject: Calling Functions in RULEs
Date: Sun, 22 May 2005 09:24:10 +0000
Message-ID: <42904FBA.3080500@monso.de> (raw)
Hello,
I would like to call multiple PL/pgSQL procedures (i.e. functions
returning void) from INSERT, UPDATE and DELETE RULEs.
Using "SELECT some_procedure();" is a possible way to do that, but it
causes a dummy result table to be delivered to the application invoking
the INSERT/UPDATE/DELETE. When using multiple SELECTs to call multiple
functions inside the RULE, multiple result tables will be delivered to
the application, which is very unhandy and causes trouble especially
when using asynchronous command processing. Though "psql" does only show
the last result table, all dummy result tables have to be fetched by
PGgetResult(), when using asynchronous mode with libpq.
Is there any tidy way to call a void-function inside a RULE without
creating a result table that is passed to the application?
Using a command like "UPDATE dummy_table SET dummy=1 WHERE
some_procedure() NOTNULL;" would work, but that would be very dirty.
Does a command like "PERFORM" (from PG/pgSQL) exist in SQL too, which
discards the (void) result of the function call?
Thanks for helping
Jan Behrens
||
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: jan@monso.de
Subject: Re: Calling Functions in RULEs
In-Reply-To: <42904FBA.3080500@monso.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox