X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3439B5288E for ; Sun, 22 May 2005 06:23:54 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 43630-01 for ; Sun, 22 May 2005 09:23:53 +0000 (GMT) Received: from srv04.flexidesk.de (h97696.serverkompetenz.net [81.169.138.170]) by svr1.postgresql.org (Postfix) with ESMTP id C0BDF52882 for ; Sun, 22 May 2005 06:23:52 -0300 (ADT) Received: from localhost ([127.0.0.1] helo=[84.189.121.235]) by srv04.flexidesk.de with asmtp (Exim 3.35 #1 (Debian)) id 1DZmWL-00031q-00 for ; Sun, 22 May 2005 11:13:17 +0200 Message-ID: <42904FBA.3080500@monso.de> Date: Sun, 22 May 2005 09:24:10 +0000 From: "Jan B." User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050514) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Calling Functions in RULEs Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200505/179 X-Sequence-Number: 21492 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 ||