Re: Question on Table creation - Mailing list pgsql-general

From Tom Lane
Subject Re: Question on Table creation
Date
Msg-id 277379.1708465981@sss.pgh.pa.us
Whole thread Raw
In response to Question on Table creation  (sud <suds1434@gmail.com>)
List pgsql-general
sud <suds1434@gmail.com> 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 all
> failing because the schema which already exists in the database having name
> '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 the
> 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 failing
> 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



pgsql-general by date:

Previous
From: sud
Date:
Subject: Question on Table creation
Next
From: Adrian Klaver
Date:
Subject: Re: Question on Table creation