Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mAuq7-0005VG-74 for pgsql-bugs@arkaria.postgresql.org; Tue, 03 Aug 2021 13:52:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mAuq6-0002Bq-36 for pgsql-bugs@arkaria.postgresql.org; Tue, 03 Aug 2021 13:52:14 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mAuq5-0002Bi-SX for pgsql-bugs@lists.postgresql.org; Tue, 03 Aug 2021 13:52:13 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mAuq2-00022p-Rb for pgsql-bugs@lists.postgresql.org; Tue, 03 Aug 2021 13:52:12 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 173Dq5bt1703318; Tue, 3 Aug 2021 09:52:05 -0400 From: Tom Lane To: "David G. Johnston" cc: Guillaume Lelarge , Erik Rijkers , PostgreSQL mailing lists Subject: Re: BUG #17130: Error while executing request In-reply-to: References: <17130-ed04b462a11a08fe@postgresql.org> Comments: In-reply-to "David G. Johnston" message dated "Tue, 03 Aug 2021 06:18:23 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1703316.1627998725.1@sss.pgh.pa.us> Date: Tue, 03 Aug 2021 09:52:05 -0400 Message-ID: <1703317.1627998725@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" writes: > On Tue, Aug 3, 2021 at 6:13 AM Guillaume Lelarge > wrote: >> Actually, the syntax should be valid. You can add a DDL right after CREATE >> SCHEMA without a semicolon in between (see the examples on >> https://www.postgresql.org/docs/13/sql-createschema.html). But I fail to >> explain why it doesn't work here. A workaround would be to add the >> semicolon as you said, but it should work without. > CREATE TABLE and CREATE TABLE AS are two very different commands and only > the former is documented to work. Right. CREATE SCHEMA allows additional DDL to create objects within the schema right away, but it only does DDL not DML, so you can't additionally populate the table as part of the command. regards, tom lane