X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3EF4ED8FD7 for ; Wed, 16 Nov 2005 21:04:29 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 81418-03 for ; Thu, 17 Nov 2005 01:04:31 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 76F69D8F35 for ; Wed, 16 Nov 2005 21:04:26 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id jAH14Nev020611; Wed, 16 Nov 2005 20:04:23 -0500 (EST) To: Alvaro Herrera cc: Bruce Momjian , "Goulet, Dick" , Peter Eisentraut , pgsql-interfaces@postgresql.org, Scott Lamb Subject: Re: Incremental results from libpq In-reply-to: <20051117005043.GD24640@surnet.cl> References: <4001DEAF7DF9BD498B58B45051FBEA6502EF55DA@25exch1.vicorpower.vicr.com> <200511162013.jAGKDHY22079@candle.pha.pa.us> <20051117005043.GD24640@surnet.cl> Comments: In-reply-to Alvaro Herrera message dated "Wed, 16 Nov 2005 21:50:43 -0300" Date: Wed, 16 Nov 2005 20:04:23 -0500 Message-ID: <20610.1132189463@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.009 required=5 tests=[AWL=0.009] X-Spam-Score: 0.009 X-Spam-Level: X-Archive-Number: 200511/36 X-Sequence-Number: 5832 Alvaro Herrera writes: > Bruce Momjian wrote: >> How is it better than what we have now? > Global temporary tables are defined only once (not once per session), > and the schema (definition) is known to all sessions. Only the content > is private to each session. Basically, this trades off ease of initialization (you don't have to create the table in each session, 'cause it's already there) for flexibility (all sessions have to use the same definition of the same temp table name). Note that it's *not* global vs local temp tables; that distinction, in the spec, has to do with visibility across module boundaries, an issue that we do not have because we do not have modules. In the spec, all temp tables act this way, and there's actually no way to produce the effect we have of fully session-local temp tables. I don't think we want to buy into the spec definition completely. Still, I can think of lots of applications where all users of the database are running basically the same code and so there's no real need for session-private temp table schemas. In that scenario it's definitely simpler if functions don't have to worry about creating a temp table before they can use it. regards, tom lane