Received: from mail1.rdc2.bc.home.com (mail1.rdc2.bc.home.com [24.2.10.84]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f23Fewx19034 for ; Sat, 3 Mar 2001 10:40:58 -0500 (EST) (envelope-from pozix@home.com) Received: from elrond.home.com ([24.113.128.171]) by mail1.rdc2.bc.home.com (InterMail vM.4.01.03.00 201-229-121) with ESMTP id <20010303154053.UPRX25888.mail1.rdc2.bc.home.com@elrond.home.com>; Sat, 3 Mar 2001 07:40:53 -0800 Message-Id: <5.0.2.1.0.20010303073950.02a1a388@mail.rchmd1.bc.wave.home.com> X-Sender: pozix@mail.rchmd1.bc.wave.home.com X-Mailer: QUALCOMM Windows Eudora Version 5.0.2 Date: Sat, 03 Mar 2001 07:43:24 -0800 To: David Olbersen From: Gerald Gutierrez Subject: Re: Temp Tables & Connection Pooling Cc: In-Reply-To: References: <5.0.2.1.0.20010302103136.02a1a388@mail.rchmd1.bc.wave.home.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Archive-Number: 200103/38 X-Sequence-Number: 1683 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? > > >Wouldn't a VIEW do what you want? > 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.