Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cy8K7-0003Qa-1T for pgsql-sql@arkaria.postgresql.org; Wed, 12 Apr 2017 02:47:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cy8K6-0001O1-3c for pgsql-sql@arkaria.postgresql.org; Wed, 12 Apr 2017 02:47:58 +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 1cy8K3-0001L9-P5 for pgsql-sql@postgresql.org; Wed, 12 Apr 2017 02:47:55 +0000 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cy8Jw-0001Mg-DR for pgsql-sql@postgresql.org; Wed, 12 Apr 2017 02:47:54 +0000 Received: by mail-pf0-x243.google.com with SMTP id o126so2511110pfb.1 for ; Tue, 11 Apr 2017 19:47:48 -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=PMrhn0FLMv4ERWS1riitLY6nPgAMr06BsJjrZOd3vBg=; b=THxsiw01kTHzDgQUDUrwX5vzfQyBWYYblvPJ30+KwUQ9XjQ2YfkmhqOBW+6Pc4u2jA XPhmCOK0+DaqUnVcw5HJAeZwAszCcPLE2HOudB6DWXrKSsFcdWDE0pomo9vv9ZXAoTHl mQULmpq1gf72zhGrHbtPRQm+EWWhdpAuxXi90StFMMaS0k7zhEFkyjb1K1LhLu5qKeCX Qf2bE3u+lX+w7hi0xf2C2IzGDsLmFhHt53/45VDQcmJHm9BLOfMjaCClS1d9IJhJcQg0 EY3OlJjYrYl8yd4l7rXPvClRfDwKIQvcJHYE0VBamTaKHCTKm079aCLCwQQcJsJ2kc/n EwUQ== 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=PMrhn0FLMv4ERWS1riitLY6nPgAMr06BsJjrZOd3vBg=; b=bwO/In/tYK5TAFcNrQAb5jXbEpnACgXLuVT3XWeQTpy+lkPFCrFF7RVyWkGdzB094a SQPpwZQzL2ivnPQLkfnPzWMyT13HLncJKCH4MTnZjkATDhvgYmUd6YaZgN0gzugUgQJM CExcheUZfKpMBwgUN/Rq7rYhdTBNKzql0AkoN+ji2PPlSIB2f97ttqptZvHC0HQ0BPKY GamBJloHzQNFVuBKzyC4lFuUyzm2SwKvgF4jgOTAdMgZ31g2Q/SpFpgw8GKnTJ4WpbsM S8b8FXTkL3LjcnPK8kOtTsLizaN454O7g3CDNNgTyRK4tr+M9vvv29m3RqkfEK0MXJkC eOIg== X-Gm-Message-State: AFeK/H0udqfNYYTLKjHML1nsO59R0uEokWGscmM8HPrEhM0W075ZezlG2M+b1F5vh6q9dw== X-Received: by 10.98.42.139 with SMTP id q133mr32047366pfq.63.1491965266680; Tue, 11 Apr 2017 19:47:46 -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 s3sm32976049pgn.29.2017.04.11.19.47.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Apr 2017 19:47:45 -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 20:47:45 -0600 Cc: pgsql-sql@postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <2B9243AD-09BA-4E0D-9805-5A1E1409F0FA@gmail.com> 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:43 PM, David G. Johnston wrote: >=20 > On Tuesday, April 11, 2017, Rob Sargent wrote: > If =E2=80=98on commit drop=E2=80=99 does the trick that clears the annoya= nce but still wondering if there=E2=80=99s a way to retain the product of t= he CTE/select for further processing without resorting to a temp table. >=20 > A CTE is a same-query-only temp table. If you need it to persist post qu= ery you have to use a real temporary table. >=20 > David J.=20 Right then. Thought I might be missing some nifty construct. A little sur= prised but oh, well. Thanks for taking the time. 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