pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ian Harding <iharding@pakrat.com>
To: pgsql-sql@postgresql.org
Subject: Re: Temp Tables & Connection Pooling
Date: Sat, 03 Mar 2001 09:38:44 -0800
Message-ID: <3AA12C24.F2AF7B56@pakrat.com> (raw)
References: <5.0.2.1.0.20010303073950.02a1a388@mail.rchmd1.bc.wave.home.com>

Gerald Gutierrez wrote:

> At 12:48 PM 3/2/2001 -0800, David Olbersen wrote:
> >On Fri, 2 Mar 2001, Gerald Gutierrez wrote:
> >
> >->Recently I wanted to implement Dijkstra's algorithm as a stored procedure,
> >->and finding that PL/PGSQL cannot return record sets, I thought about using
> >->a temporary table for the results. If tempoary tables are session-specific,
> >->however, then wouldn't connection pooling make it unusable since the table
> >->might "disappear" from one query to the next? What are alternative
> >->approaches to implementing Dijkstra's algorithm inside the database?
> >
> ><newbie>
> >Wouldn't a VIEW do what you want?
> ></newbie>
>
> No it wouldn't. Executing Dijkstra would involve executing iterative logic
> on multiple tables and storing intermediate results in a form that can be
> returned to the user but does not affect the actual persistent table schema
> (e.g. a record set, or a temporary table). A view is used to provide a
> simplified or alternative way of looking at a set of data, and cannot
> cannot generally multi-step operation that data prior to returning to the user.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

This looks like  a case for a persistent table where the function would write the
data, along with some kind of session identifier, which would be returned from the
function.  Then your could go back to that table with that sessionid and find what
you need.  It is kludgey because it has the potential to leave stale data lying
around, you will have to write all kinds of housekeeping code around it.




view thread (5+ messages)

Message-ID: <3AA12C24.F2AF7B56@pakrat.com>
Permalink:  ../3AA12C24.F2AF7B56@pakrat.com/
Also on:    postgresql.org/message-id/3AA12C24.F2AF7B56@pakrat.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: iharding@pakrat.com
  Subject: Re: Temp Tables & Connection Pooling
  In-Reply-To: <3AA12C24.F2AF7B56@pakrat.com>
  References: <5.0.2.1.0.20010303073950.02a1a388@mail.rchmd1.bc.wave.home.com> <3AA12C24.F2AF7B56@pakrat.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