agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: Rob Sargent <robjsargent@gmail.com>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: CTEs and re-use
Date: Tue, 11 Apr 2017 21:05:36 -0600
Message-ID: <EBE13082-9D2F-4E9F-BA86-386B93D15FAA@gmail.com> (raw)
In-Reply-To: <CAKFQuwaCXDY=of75=Eam555JDUS_w2VRdjXNsx7+OzBNJ_+8Nw@mail.gmail.com>
References: <c0a06409-5cca-901b-48f8-2740f38eaba4@gmail.com>
	<CAKFQuwaaCewCWEL0ojyzjgS7db09hATgT77SZquoF1CzPSC3bg@mail.gmail.com>
	<286BDFF8-0632-4B2D-92C8-5B7B6B39E059@gmail.com>
	<CAKFQuwaCXDY=of75=Eam555JDUS_w2VRdjXNsx7+OzBNJ_+8Nw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-sql>


> On Apr 11, 2017, at 8:47 PM, David G. Johnston <david.g.johnston@gmail.com> wrote:
> 
> On Tuesday, April 11, 2017, Rob Sargent <robjsargent@gmail.com> wrote:
> 
> I’m really just bumping into the annoyance of manually dropping the temp table as I work this up (though real collision in production would is possible, it would be unlikely) and thought to try to rework the function without the temp table - that’s the SQL question - and presumed the specifics of the function would come in useful.
> 
> 
> I'm not positive what you are thinking here but the names of temporary tables are session-unique.  They are not prone to concurrent use namespace collisions and not do not interfere with permanent tables either.  They are placed into a temporary schema that is only visible to the current session.
> 
> David J. 
Of course ‘on commit drop’ works like a charm. 
Thanks a ton.
rjs



-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql



view thread (6+ messages)  latest in thread

Message-ID: <EBE13082-9D2F-4E9F-BA86-386B93D15FAA@gmail.com>
Permalink:  ../EBE13082-9D2F-4E9F-BA86-386B93D15FAA@gmail.com/
Also on:    postgresql.org/message-id/EBE13082-9D2F-4E9F-BA86-386B93D15FAA@gmail.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: robjsargent@gmail.com, david.g.johnston@gmail.com
  Subject: Re: CTEs and re-use
  In-Reply-To: <EBE13082-9D2F-4E9F-BA86-386B93D15FAA@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox