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 1rcY33-000hbT-5B for pgsql-general@arkaria.postgresql.org; Tue, 20 Feb 2024 21:53:09 +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 1rcY30-001c0J-Qy for pgsql-general@arkaria.postgresql.org; Tue, 20 Feb 2024 21:53:07 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rcY30-001c0A-Gg for pgsql-general@lists.postgresql.org; Tue, 20 Feb 2024 21:53:07 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rcY2x-0003QT-2w for pgsql-general@lists.postgresql.org; Tue, 20 Feb 2024 21:53:05 +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 41KLr1BO277380; Tue, 20 Feb 2024 16:53:01 -0500 From: Tom Lane To: sud cc: pgsql-general@lists.postgresql.org Subject: Re: Question on Table creation In-reply-to: References: Comments: In-reply-to sud message dated "Wed, 21 Feb 2024 02:49:20 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <277378.1708465981.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 20 Feb 2024 16:53:01 -0500 Message-ID: <277379.1708465981@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk sud writes: > We are newly creating tables in postgres 15.4 version and we got the DDL > auto generated from one of the tools and they look something like below. > (note- I have modified the exact names to some dummy names.) These are a= ll > failing because the schema which already exists in the database having n= ame > 'schema_name' which is all lower case.So then i modified the script to > remove the double quotes from all the table/column/schema names, as it > seems postgres makes things case sensitive if they are put in quotes. > But then encountered the opposite, i.e. some places where it's showing t= he > object already created in the database as Upper case or mixed case like > schema owner which is showing as "*S*chema_*O*wner" as I see in the > information_schema.schemata data dictionary. And here the scripts failin= g > if removing the quotes from the schema owner. I'd advise reading this section carefully: https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX= -IDENTIFIERS Notably, the advice to "always quote a particular name or never quote it" could be a useful rule for you here. regards, tom lane