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 1mhZnO-0003bK-SE for pgsql-docs@arkaria.postgresql.org; Mon, 01 Nov 2021 16:04:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mhZnM-0001G4-Mo for pgsql-docs@arkaria.postgresql.org; Mon, 01 Nov 2021 16:04:24 +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 1mhZnM-0001EW-G7 for pgsql-docs@lists.postgresql.org; Mon, 01 Nov 2021 16:04:24 +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 1mhZnK-0004b6-0h for pgsql-docs@lists.postgresql.org; Mon, 01 Nov 2021 16:04:23 +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 1A1G4GNA1139299; Mon, 1 Nov 2021 12:04:17 -0400 From: Tom Lane To: Laurenz Albe cc: "Daniel Westermann (DWE)" , "pgsql-docs@lists.postgresql.org" Subject: Re: Be more clear what names can be used for tables with "CREATE TABLE"? In-reply-to: <13dcf5e60a2cdfd8ea68da9a2569287e342e87ab.camel@cybertec.at> References: <13dcf5e60a2cdfd8ea68da9a2569287e342e87ab.camel@cybertec.at> Comments: In-reply-to Laurenz Albe message dated "Mon, 01 Nov 2021 05:39:43 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1139297.1635782656.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 01 Nov 2021 12:04:16 -0400 Message-ID: <1139298.1635782656@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Laurenz Albe writes: > On Sat, 2021-10-30 at 11:08 +0000, Daniel Westermann (DWE) wrote: >> in the documentation for CREATE TABLE we have this sentence: >> "The name of the table must be distinct from the name of any other tabl= e, sequence, index, view, or foreign table in the same schema." >> At least materialized views are missing: > Technically speaking, it is "objects stored in pg_class". We use "relation" for that concept in the code, and I believe that that terminology is also used in the manual. I'm inclined to propose "The name of the table must be distinct from the name of any other relation (table, sequence, index, view, materialized view, or foreign table) in the same schema." I think the existing wording might be that way because somebody figured that "view" could subsume "materialized view". Which isn't an unreasonable position, but we haven't done it like that consistently. I don't think we need to be similarly exhaustive about enumerating the kinds of types that there are. regards, tom lane