Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cy8cM-00053J-M5 for pgsql-sql@arkaria.postgresql.org; Wed, 12 Apr 2017 03:06:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cy8cM-0000en-6L for pgsql-sql@arkaria.postgresql.org; Wed, 12 Apr 2017 03:06:50 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cy8bL-0007Gz-3b for pgsql-sql@postgresql.org; Wed, 12 Apr 2017 03:05:47 +0000 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cy8bD-0001js-Vd for pgsql-sql@postgresql.org; Wed, 12 Apr 2017 03:05:45 +0000 Received: by mail-pf0-x241.google.com with SMTP id c198so2576330pfc.0 for ; Tue, 11 Apr 2017 20:05:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=yDW1kcyiOPAbBN1mdOea9p9PgM2Tu5NmVvj9Ukt8wtA=; b=DXiGbbE/Z32HcEIrE1K6l8MSUo7YkoafZoP+5wikHN/OiLPzicvYhSVn1OTX/648AY qxIeBUfId7iQSKPF2zAJ1Je62baRQ8kBQk3NueDVuY6o59qPYaZigyPkI3F6A5MMSpcW ImBX+JGvLGQYEtUu6tT6+38x9H1nD8StH8LzJiJsMN5K8hQtdnmH7cfhCGIvcB39Lcfs qmv3ovnBzAjwD5HizdUB6zsJS0oXsb7a+PxGR4AXKDTenAimJ2ptptVylo1p9PGIEH51 gvwwmUJOtiZW+eiJY6GqJoZcKGX0y59tqqXQD/0irqfEXFRiLBsAU07qi/yP8tbkin6e OqpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=yDW1kcyiOPAbBN1mdOea9p9PgM2Tu5NmVvj9Ukt8wtA=; b=JvloNEc3Q6bFPjTcmKG5Bv2qd+/iOBdpePu5Yk8U/aEoNQuNdmA+mRPOUK0T3pteoe Tua5JR9Hvgxx2Khm+PwALEBjeIfyEQSQVEab/La+VUyqrbjk87mDFtxmgW9HYW8hrYx6 wp2QZ5/hCxovczj5Cb1+mB8JOFhGNahaKZ/x7wUy69ZbAcemr4vqp8APyzcKyE2BHPCc IYB8mTbFTsyEzg4UsopZVwdDKK0K7d1c7aHjV8hTg8joL4BnzGKwACpdpv/H8M8xr5O7 vdGqlvwkelQn7JU/zkNiJBWx/dbAE9fUo9OmYLv/0bxeFgRxH0f34QJmMGrdcdHtye5j aHlQ== X-Gm-Message-State: AN3rC/6mNeRq3YdIsbryLzFucLjodILBJIis91uX+MrpNfOr7JQN2QhQZ2J6tiarOCQODg== X-Received: by 10.84.168.132 with SMTP id f4mr21204046plb.134.1491966338660; Tue, 11 Apr 2017 20:05:38 -0700 (PDT) Received: from [192.168.1.100] (c-98-202-89-42.hsd1.ut.comcast.net. [98.202.89.42]) by smtp.gmail.com with ESMTPSA id q5sm7511067pgn.59.2017.04.11.20.05.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Apr 2017 20:05:37 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: CTEs and re-use From: Rob Sargent In-Reply-To: Date: Tue, 11 Apr 2017 21:05:36 -0600 Cc: pgsql-sql@postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <286BDFF8-0632-4B2D-92C8-5B7B6B39E059@gmail.com> To: "David G. Johnston" X-Mailer: Apple Mail (2.3273) X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org > On Apr 11, 2017, at 8:47 PM, David G. Johnston wrote: >=20 > On Tuesday, April 11, 2017, Rob Sargent wrote: >=20 > I=E2=80=99m really just bumping into the annoyance of manually dropping t= he 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 functio= n without the temp table - that=E2=80=99s the SQL question - and presumed t= he specifics of the function would come in useful. >=20 >=20 > I'm not positive what you are thinking here but the names of temporary ta= bles are session-unique. They are not prone to concurrent use namespace co= llisions and not do not interfere with permanent tables either. They are p= laced into a temporary schema that is only visible to the current session. >=20 > David J.=20 Of course =E2=80=98on commit drop=E2=80=99 works like a charm.=20 Thanks a ton. rjs --=20 Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql