Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ftze3-00046m-6B for pgsql-docs@arkaria.postgresql.org; Sun, 26 Aug 2018 18:20:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ftzdz-0006Hd-6J for pgsql-docs@arkaria.postgresql.org; Sun, 26 Aug 2018 18:20:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ftr1y-00054M-L1 for pgsql-docs@lists.postgresql.org; Sun, 26 Aug 2018 09:08:22 +0000 Received: from forward5o.cmail.yandex.net ([37.9.109.249]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ftr1u-0005nm-CG for pgsql-docs@lists.postgresql.org; Sun, 26 Aug 2018 09:08:22 +0000 Received: from mxback1j.mail.yandex.net (mxback1j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10a]) by forward5o.cmail.yandex.net (Yandex) with ESMTP id 67F4420C85; Sun, 26 Aug 2018 12:08:16 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback1j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id gVCDCAG7K1-8F3OQbEL; Sun, 26 Aug 2018 12:08:15 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1535274495; bh=T787AgqJnFisNeA1hNo4tlI5T+H2iBgncUfw7k4/RZ4=; h=From:To:In-Reply-To:References:Subject:Date:Message-Id; b=OFpnm0ZCr+le8hzw24uclg+wmUGPLLI8oEoHirMfJT27GD919mYfsk6rB74Ui5w1/ ZpBvG886s9RLkKookW6MIWXfw1i/Qa4USm7hMCn/LGspjrDiTK5EI1TRN83qVjfcgl L9mYlBr5k6TP0EAxgphCPMeTI8zeZtlaokmaktJQ= Authentication-Results: mxback1j.mail.yandex.net; dkim=pass header.i=@yandex.ru Received: by sas2-db6b18f976b3.qloud-c.yandex.net with HTTP; Sun, 26 Aug 2018 12:08:15 +0300 From: KES Envelope-From: kes-kes@yandex.com To: Bruce Momjian , "pgsql-docs@lists.postgresql.org" In-Reply-To: <20180824202957.GC18798@momjian.us> References: <153492989238.1378.11935777086367711326@wrigleys.postgresql.org> <20180824202957.GC18798@momjian.us> Subject: Re: Documentation does not cover multiple WITH in one query MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sun, 26 Aug 2018 12:08:15 +0300 Message-Id: <9733511535274495@sas2-db6b18f976b3.qloud-c.yandex.net> Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Thank you. That is I am looking for. Never thought that 'WITH' syntax is described at 'SELECT'. Will be very helpful if this will be mentioned on this page: https://www.postgresql.org/docs/10/static/queries-with.html For an example: [ WITH [ RECURSIVE ] with_query [, ...] ] and with_query is shown as: with_query_name [ ( column_name [, ...] ) ] AS ( select | values | insert | update | delete ) For full syntax of `WITH` see https://www.postgresql.org/docs/10/static/sql-select.html Thanks. 24.08.2018, 23:30, "Bruce Momjian" : > On Wed, Aug 22, 2018 at 09:24:52AM +0000, PG Doc comments form wrote: >>  The following documentation comment has been logged on the website: >> >>  Page: https://www.postgresql.org/docs/10/static/queries-with.html >>  Description: >> >>  Hi. I have found >>  [DOC](https://www.postgresql.org/docs/10/static/queries-with.html) >> >>  it is fine, but did not cover multiple WITH in one query. >> >>  I found answer only [here](https://stackoverflow.com/a/38137037/4632019) >> >>  May you please add the example: >> >>      WITH table1 AS (...), table2 AS (...) SELECT * FROM table1, table2 > > Well, the SELECT manual has: > >        [ WITH [ RECURSIVE ] with_query [, ...] ] > > and with_query is shown as: > >        with_query_name [ ( column_name [, ...] ) ] AS ( select | values | insert | update | delete ) > > This is standard SQL. I don't think we are going to be able to show > every possible syntax. > > -- >   Bruce Momjian http://momjian.us >   EnterpriseDB http://enterprisedb.com > > + As you are, so once was I. As I am, so you will be. + > + Ancient Roman grave inscription +