pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jim C. Nasby <jnasby@pervasive.com>
To: Merlin Moncure <merlin.moncure@rcsonline.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-performance@postgresql.org
Subject: Re: improvise callbacks in plpgsql
Date: Tue, 1 Nov 2005 17:04:40 -0600
Message-ID: <20051101230440.GU20349@pervasive.com> (raw)
In-Reply-To: <6EE64EF3AB31D5448D0007DD34EEB3417DD767@Herge.rcsinc.local>
References: <6EE64EF3AB31D5448D0007DD34EEB3417DD767@Herge.rcsinc.local>

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



view thread (10+ messages)  latest in thread

Message-ID: <20051101230440.GU20349@pervasive.com>
Permalink:  ../20051101230440.GU20349@pervasive.com/
Also on:    postgresql.org/message-id/20051101230440.GU20349@pervasive.com

 · 

reply

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-performance@postgresql.org
  Cc: jnasby@pervasive.com, merlin.moncure@rcsonline.com, tgl@sss.pgh.pa.us
  Subject: Re: improvise callbacks in plpgsql
  In-Reply-To: <20051101230440.GU20349@pervasive.com>

* 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