X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 8AAECDB72E for ; Tue, 1 Nov 2005 19:04:39 -0400 (AST) 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 24173-03 for ; Tue, 1 Nov 2005 23:04:36 +0000 (GMT) Received: from flake.decibel.org (flake.decibel.org [67.100.216.10]) by svr1.postgresql.org (Postfix) with ESMTP id 9AA11DB722 for ; Tue, 1 Nov 2005 19:04:37 -0400 (AST) Received: by flake.decibel.org (Postfix, from userid 1001) id 7843915257; Tue, 1 Nov 2005 17:04:40 -0600 (CST) Date: Tue, 1 Nov 2005 17:04:40 -0600 From: "Jim C. Nasby" To: Merlin Moncure Cc: Tom Lane , pgsql-performance@postgresql.org Subject: Re: improvise callbacks in plpgsql Message-ID: <20051101230440.GU20349@pervasive.com> References: <6EE64EF3AB31D5448D0007DD34EEB3417DD767@Herge.rcsinc.local> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6EE64EF3AB31D5448D0007DD34EEB3417DD767@Herge.rcsinc.local> X-Operating-System: FreeBSD 4.11-RELEASE-p10 i386 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.9i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.007 required=5 tests=[AWL=0.007] X-Spam-Score: 0.007 X-Spam-Level: X-Archive-Number: 200511/15 X-Sequence-Number: 15272 Would you be willing to write up an example of this? We often get asked about support for WITH, so I bet there's other people who would be very interested in what you've got. On Tue, Nov 01, 2005 at 05:13:48PM -0500, Merlin Moncure wrote: > > The body of callit() need be little more than OidFunctionCall1() > > plus whatever error checking and security checking you want to > > include. > > esp=# create table test(f text); > CREATE TABLE > > esp=# create function test() returns void as > $$ > begin > insert into test values ('called'); > end; > $$ language plpgsql; > > esp=# create or replace function test2() returns void as > esp-# $$ > esp$# declare > esp$# r record; > esp$# begin > esp$# select into r 'abc'; > esp$# perform callit('test()'::regprocedure, r); > esp$# end; > esp$# > esp$# $$ language plpgsql; > CREATE FUNCTION > > esp=# select test2(); > > esp=# select * from test; > f > -------- > called > (1 row) > > one word... > w00t > > Merlin > > ---------------------------(end of broadcast)--------------------------- > TIP 5: don't forget to increase your free space map settings > -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461