Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U0GsT-0007fk-0C for pgsql-sql@arkaria.postgresql.org; Tue, 29 Jan 2013 19:29:53 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1U0GsR-0005HC-V5 for pgsql-sql@arkaria.postgresql.org; Tue, 29 Jan 2013 19:29:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U0GsR-0005GM-5E for pgsql-sql@postgresql.org; Tue, 29 Jan 2013 19:29:51 +0000 Received: from dub0-omc2-s20.dub0.hotmail.com ([157.55.1.159]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U0GsL-0007pW-PM for pgsql-sql@postgresql.org; Tue, 29 Jan 2013 19:29:50 +0000 Received: from DUB116-W10 ([157.55.1.137]) by dub0-omc2-s20.dub0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 29 Jan 2013 11:29:40 -0800 X-EIP: [qaOG3XCA6LNQHVHI79M+C6B32EywZYaJ] X-Originating-Email: [kong_mansatiansin@hotmail.com] Message-ID: Content-Type: multipart/alternative; boundary="_9ec64a61-b2ab-489d-980b-a570d21bb1d4_" From: Kong Man To: CC: Subject: Re: Writeable CTE Not Working? Date: Tue, 29 Jan 2013 11:29:40 -0800 Importance: Normal In-Reply-To: References: , MIME-Version: 1.0 X-OriginalArrivalTime: 29 Jan 2013 19:29:40.0851 (UTC) FILETIME=[FBC90430:01CDFE56] X-Pg-Spam-Score: -1.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 --_9ec64a61-b2ab-489d-980b-a570d21bb1d4_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Hi Victor=2C > I see 2 problems with this query: > 1) CTE is just a named subquery=2C in your query I see no reference to > the =93upd_code=94 CTE. > Therefore it is never gets called=3B So=2C in conclusion=2C my misconception about CTE in general was that all C= TE get called without being referenced. Thank you much for the explanation. =20 -Kong = --_9ec64a61-b2ab-489d-980b-a570d21bb1d4_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable
Hi Victor=2C

>=3B I see 2 problems with this query:
>=3B 1) C= TE is just a named subquery=2C in your query I see no reference to
>= =3B the =93upd_code=94 CTE.
>=3B Therefore it is never gets called= =3B

So=2C in conclusion=2C my misconception about CTE in general was= that all CTE get called without being referenced.

Thank you much fo= r the explanation. =3B
-Kong

= --_9ec64a61-b2ab-489d-980b-a570d21bb1d4_--