Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tARN0-00Fkit-6h for pgsql-general@arkaria.postgresql.org; Mon, 11 Nov 2024 10:10:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tARMx-00D63a-Lw for pgsql-general@arkaria.postgresql.org; Mon, 11 Nov 2024 10:10:04 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tARMx-00D63Q-14 for pgsql-general@lists.postgresql.org; Mon, 11 Nov 2024 10:10:03 +0000 Received: from fout-a7-smtp.messagingengine.com ([103.168.172.150]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tARMt-001LF3-CK for pgsql-general@postgresql.org; Mon, 11 Nov 2024 10:10:03 +0000 Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfout.phl.internal (Postfix) with ESMTP id 810D113806A2; Mon, 11 Nov 2024 05:09:58 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Mon, 11 Nov 2024 05:09:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1731319798; x=1731406198; bh=R rtRsZX5QI15tI9FtB9yXzLWjf9q170Q9jNhGVHyDds=; b=oNkDOYKmNb84iVk0V 64/7mDK0228+IWsp3RRZf1iLMFueR/LvLM5xlAV3gB4P+H9VeVrHm6V7S7rXjGGx 1MN+7zuCinBz+wLXKu4cSh5/jWXgzUjJPXbz1+NFR2lHntOnXWA00Zv/KEo3cJ5d 7tonUp8xG7lOdlcjUQcqFRwWO/eqy9WGSQOprA+Y4wBAXETbBt2tictTPb2vSY3r GhNSZYf3ea1AsioEsUwbrO1Gjv1+zYh4QK8KNcElrlHK2PFl/MZW3tpDEQbo6hoM Yz9MyZWlGaltRFvhGUNmvDG4yMFL/bJlWKQVE+Qw6f0V7ZGHoc4yyCtUHLlkjGty rpLJw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddruddvgdduvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecu hfhrohhmpeetlhhvrghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrd hnohdqihhprdhorhhgqeenucggtffrrghtthgvrhhnpeektdfhkeevudeugfeuleetkefg jeegkeeuudduueevuedvudffgffgteeihfdvfeenucffohhmrghinhepphhoshhtghhrvg hsqhhlrdhorhhgpdgvnhhtvghrphhrihhsvggusgdrtghomhenucevlhhushhtvghrufhi iigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghlvhhhrd hnohdqihhprdhorhhgpdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdp rhgtphhtthhopehrvghshhhkvghkihhrihhllhesghhmrghilhdrtghomhdprhgtphhtth hopehpghhsqhhlqdhgvghnvghrrghlsehpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 11 Nov 2024 05:09:57 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1731319794; bh=iztPGdtP7QMJA0cjXHALc3lZ/+p3AG8jAncvqnEdIWk=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=F+ZrjyeNVLIEERLsD+JIq1fthY43USY/VYVU3FQy5yBDU2EW98Ow/ADssg+MECm9k TJc/oTGEbshm7vWL4E0pKjdFO0NiXTJRtd9XFajHTu6R6HHQ/Nv3NACWxRBjjLo3G6 QqggmSjBjeGhLBL3IfjQdKb/z/LOEJnUqjgHh4MGgbrQlhLyKjBLELL06cy0kln2hu yl5tB03au5T5XJapLyIfNCUAHkXGJnfYleldNJjkzX6DYGHLOu93qVhSmbBkjZsqxr VBn5gHw10BteDhTBkazZD4wDnOOoTSwq7pl32UpIc/TpjSJLYWLKAdxeZGzZuBiNMI HB3HOjkCNQZbQ== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id F345EE3; Mon, 11 Nov 2024 11:09:53 +0100 (CET) Date: Mon, 11 Nov 2024 11:09:53 +0100 From: Alvaro Herrera To: Kirill Reshke Cc: pgsql-general@postgresql.org Subject: Re: CREATE SCHEMA ... CREATE M.V. support Message-ID: <202411111009.ckna4vp7ahyk@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello Kirill On 2024-Nov-11, Kirill Reshke wrote: > I was exploring the PostgreSQL parser and discovered a very > interesting feature. Users can create schema along with schema objects > in single SQL. Yeah, it's pretty cool. > Support for materialized views began in 9.3. Perhaps, then, this is > simply something that was overlooked for support? Yeah, I don't know why but people seem generally uninterested in expanding support of commands under CREATE SCHEMA, which I think is a pity. However, keep in mind that the set of commands allowed is dictated by the SQL standard, which says ::= CREATE SCHEMA [ ] [ ... ] ::= | | | | | | | | | | | | | | | Materialized views are not in the SQL standard, so if we do decide to support them under CREATE SCHEMA, it would be an extension to the standard. (IMO it's quite a natural one at that.) > It appears that supporting this is as simple as changing this parser's > non-terminal [2]. However, perhaps there are justifications for why we > forbid this? > > [2] https://git.postgresql.org/cgit/postgresql.git/tree/src/backend/parser/gram.y?h=14e87ffa5c543b5f30ead7413084c25f7735039f#n1580 I don't think so, or at least I'm not aware of them. Looking at the object list in the standard document, it looks like we're missing quite some stuff there. > P.S. is this the correct place to make this question? No, this is more a pgsql-hackers question. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "¿Cómo puedes confiar en algo que pagas y que no ves, y no confiar en algo que te dan y te lo muestran?" (Germán Poo)