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 A8C7B52836 for ; Mon, 23 May 2005 07:02:14 -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 25893-06 for ; Mon, 23 May 2005 10:02:10 +0000 (GMT) Received: from mx-00.sil.at (mx-00.sil.at [62.116.68.196]) by svr1.postgresql.org (Postfix) with ESMTP id CBE1E52838 for ; Mon, 23 May 2005 07:02:06 -0300 (ADT) Received: (qmail-ldap/ctrl 16863 invoked from network); 23 May 2005 10:02:57 -0000 Received: from unknown (HELO jupiter.sonorys.at) ([213.235.243.42]) (envelope-sender ) by mx-00.sil.at (qmail-ldap-1.03) with SMTP for ; 23 May 2005 10:02:57 -0000 Received: from neptun.sonorys.at (neptun.sonorys.at [172.24.1.17]) by jupiter.sonorys.at (8.11.7+Sun/8.11.7) with ESMTP id j4NA1c104935 for ; Mon, 23 May 2005 12:02:58 +0200 (MEST) Received: by neptun.sonorys.at with Internet Mail Service (5.5.2653.19) id <2JD5WVR8>; Mon, 23 May 2005 12:01:38 +0200 Message-ID: From: =?ISO-8859-1?Q?K=D6PFERL_Robert?= To: pgsql-sql@postgresql.org Subject: Re: Calling Functions in RULEs Date: Mon, 23 May 2005 12:01:32 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="ISO-8859-1" X-Virus-Scanned: by amavisd-new at hub.org X-Archive-Number: 200505/181 X-Sequence-Number: 21494 Hi, I had no try wheter this solves your problem, but have you conciddered using an array or a self-written fcn which dicards your results i.E. SELECT my_discard_but_last( q1(), q2(), q3()); or SELECT ARRAY[ q1(), q2(), q3() ]; or SELECT ROW(q1(), q2(), q3()) as my_tripel_type; Have you considdered CASTs? These are just ideas |-----Original Message----- |From: Jan B. [mailto:jan@monso.de] |Sent: Sonntag, 22. Mai 2005 11:24 |To: pgsql-sql@postgresql.org |Subject: [SQL] Calling Functions in RULEs | | |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 ||| | |---------------------------(end of |broadcast)--------------------------- |TIP 2: you can get off all lists at once with the unregister command | (send "unregister YourEmailAddressHere" to |majordomo@postgresql.org) |