pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joe Conway <mail@joeconway.com>
To: Benjamin Stewart <benstewart74@yahoo.com.au>
Cc: pgsql-sql@postgresql.org
Subject: Re: Functions that return Record Sets
Date: Tue, 20 May 2003 18:57:30 -0700
Message-ID: <3ECADD0A.7000409@joeconway.com> (raw)
In-Reply-To: <3ECB5418.6060509@yahoo.com.au>
References: <3ECB5418.6060509@yahoo.com.au>

Benjamin Stewart wrote:
> Sorry if this question has been posted before, but I searched the 
> archives and documentation and was unable to find ther elevant 
> information or any other developers with first hand experience at this.

See:
http://techdocs.postgresql.org/guides/SetReturningFunctions
http://www.brasileiro.net:8080/postgres/cookbook/view-one-recipe.adp?recipe_id=11378

There are plpgsql and sql function examples in the mailing list 
archives. Couple of examples:
   http://archives.postgresql.org/pgsql-general/2002-10/msg00022.php
and
   http://archives.postgresql.org/pgsql-general/2002-12/msg00426.php

There is a recent example in Elein Mustain's "General Bits" column:
http://archives.postgresql.org/pgsql-general/2002-12/msg00426.php

And finally, in the manual see:
general ->
http://developer.postgresql.org/docs/postgres/xfunc-tablefunctions.html
sql ->
http://developer.postgresql.org/docs/postgres/xfunc-sql.html (sec 9.2.4)
C ->
http://developer.postgresql.org/docs/postgres/xfunc-c.html (sec 9.5.6)
plpgsql ->
http://developer.postgresql.org/docs/postgres/plpgsql-control-structures.html
usage ->
http://developer.postgresql.org/docs/postgres/sql-select.html 
(from_item, inputs, from clause, usage)

> I have worked previously with sybase and we have the ability to create a 
> stored procedure (different from a user defined function) that returns a 
> record set that is passed back as and I can use as a standard RS and 
> itterate throught it etc. I am also able to get meta data about field 
> names, type etc from the RS.

Sybase/MSSQL style stored procedures are not currently supported. There 
isn't even general agreement amongst the developers that they should be. 
Personally, I'd like to see them supported and may one day make a 
proposal and (assuming it is accepted) add them to Postgres. But don't 
hold your breath -- it certainly won't happen before 7.4 is released.

Joe




view thread (5+ messages)  latest in thread

Message-ID: <3ECADD0A.7000409@joeconway.com>
Permalink:  ../3ECADD0A.7000409@joeconway.com/
Also on:    postgresql.org/message-id/3ECADD0A.7000409@joeconway.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-sql@postgresql.org
  Cc: mail@joeconway.com, benstewart74@yahoo.com.au
  Subject: Re: Functions that return Record Sets
  In-Reply-To: <3ECADD0A.7000409@joeconway.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