pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Stanaway <david@netventures.com.au>
To: pgsql-sql@postgresql.org
Cc: Jason Kwok <jason@newhonest.com>
Subject: Re: select from a dynamic table name
Date: Tue, 6 Nov 2001 10:07:50 +1100
Message-ID: <EF404437-D241-11D5-AF6A-0003930FDAB2@netventures.com.au> (raw)
In-Reply-To: <000e01c1636b$c466b380$0201a8c0@newhonest.com>


On Friday, November 2, 2001, at 05:58  PM, Jason Kwok wrote:

> Since I could return a rowset (some records) from a function of pgsql or
> plpgsql, I saved all the records into a temp file. Then I want to get 
> the
> rowset by another select statement from this temp table with dynamic 
> name,
> could I do something like the folowing :
>
> select * from a_dynamic_table_name ?

How about

exec 'select * from '&somefunc();

Where somefunc() returns the name of the temporary table.
You'll have to delete it after, so it will be a little more messy.

There was talk in the list on functions returning record sets being a 
feature of 7.2 and there being some patches for 7.1 that permited it.

Jan Wieck <JanWieck@Yahoo.com> Wrote on Wed Aug 15, 2001  03:49:03  PM 
Australia/Sydney
>     As  said,  in  v7.2  we'll have the ability to return cursors
>     from functions (and I'm looking actually into the ability  of
>     doing  RETURN AND RESUME).  So there is at least some sort of
>     workaround on the horizon.


==============================
David Stanaway
Personal: david@stanaway.net
Work: david@netventures.com.au




view thread (2+ messages)

Message-ID: <EF404437-D241-11D5-AF6A-0003930FDAB2@netventures.com.au>
Permalink:  ../EF404437-D241-11D5-AF6A-0003930FDAB2@netventures.com.au/
Also on:    postgresql.org/message-id/EF404437-D241-11D5-AF6A-0003930FDAB2@netventures.com.au

 · 

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: david@netventures.com.au, jason@newhonest.com
  Subject: Re: select from a dynamic table name
  In-Reply-To: <EF404437-D241-11D5-AF6A-0003930FDAB2@netventures.com.au>

* 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