public inbox for [email protected]
help / color / mirror / Atom feedFrom: Michael Downey <[email protected]>
To: [email protected] <[email protected]>
Subject: PostgreSQL implicitly double-quoting identifier name with umlaut
Date: Fri, 13 Sep 2024 23:06:11 +0000
Message-ID: <BY3PR05MB7985A889E17333E35AF6B110DB652@BY3PR05MB7985.namprd05.prod.outlook.com> (raw)
PostgreSQL implicitly double-quoting identifier name with umlaut
I an understand this behavior, just trying to find documentation to confirm it.
Server and client encoding are UTF8.
One of our internal users, using our tools, added a column called Örtschaft. We anticipated it would be folded to lower case.
So we inserted our metadata for the column in our metadata with the name örtschaft. With the system query for metadata, we
ended up seeing query mismatches involving this column as we found the actual column name is Örtschaft
in the database.
I looked at the "SQL" of the table in pgadmin and saw this:
"CREATE TABLE IF NOT EXISTS map.mytable2
(
oid bigint,
name1 smallint,
"Örtschaft" integer
)
TABLESPACE pg_default;
ALTER TABLE IF EXISTS map.mytable2
OWNER to map;"
I thought our code might be adding the double quotes inadvertently, but the statement in the Postgres log had the alter table statement with
Örtschaft without double quotes.
After experimenting in SQL, I was able to find that in I could reproduce this in psql and Pgadmin sql.
Ex
In SQL:
alter table map.mytable2 add column Örtschaft7 integer;
PGADMIN interface output (I could not find the exact query statement to produce this)
CREATE TABLE IF NOT EXISTS map.mytable2
(
oid bigint,
name1 smallint,
"Örtschaft" integer,
ortschaft2 integer,
"(tm)rtschaft3" integer,
"Örtschaft4" integer,
"Ã-rtschaft5" integer,
"Ã-rtschaft6" integer,
"Örtschaft7" integer
)
TABLESPACE pg_default;
ALTER TABLE IF EXISTS map.mytable2
OWNER to map;
This behavior seems like an exception to the lower-case folding behavior expectation.
Is this expected?
Is this documented someplace?
Thanks,
Michael
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: PostgreSQL implicitly double-quoting identifier name with umlaut
In-Reply-To: <BY3PR05MB7985A889E17333E35AF6B110DB652@BY3PR05MB7985.namprd05.prod.outlook.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox