pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #19043: jdbc connection url is not case insensitive
4+ messages / 4 participants
[nested] [flat]
* BUG #19043: jdbc connection url is not case insensitive
@ 2025-09-05 06:28 PG Bug reporting form <noreply@postgresql.org>
0 siblings, 3 replies; 4+ messages in thread
From: PG Bug reporting form @ 2025-09-05 06:28 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org; +Cc: m.kristo@rewe-group.at
The following bug has been logged on the website:
Bug reference: 19043
Logged by: Marijo Kristo
Email address: m.kristo@rewe-group.at
PostgreSQL version: 17.6
Operating system: Linux
Description:
Hello,
when creating a database in Postgres with the name e.g. "testDB", postgres
creates a database in lowercase testdb.
So far so good, but when trying to connect via psql and passing as database
name "testDB" the connection fails, because it says the database does not
exists.
In my opinion, the libq library should also be case insensitive and
automatically convert this to a lowercase "testdb" and not return an error.
What are your thoughts ?
Best Regards
Ing. Marijo Kristo
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: BUG #19043: jdbc connection url is not case insensitive
@ 2025-09-05 21:13 David G. Johnston <david.g.johnston@gmail.com>
parent: PG Bug reporting form <noreply@postgresql.org>
2 siblings, 0 replies; 4+ messages in thread
From: David G. Johnston @ 2025-09-05 21:13 UTC (permalink / raw)
To: m.kristo@rewe-group.at <m.kristo@rewe-group.at>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
On Thursday, September 4, 2025, PG Bug reporting form <
noreply@postgresql.org> wrote:
> The following bug has been logged on the website:
>
> Bug reference: 19043
> Logged by: Marijo Kristo
> Email address: m.kristo@rewe-group.at
> PostgreSQL version: 17.6
> Operating system: Linux
> Description:
>
> Hello,
>
> when creating a database in Postgres with the name e.g. "testDB", postgres
> creates a database in lowercase testdb.
> So far so good, but when trying to connect via psql and passing as database
> name "testDB" the connection fails, because it says the database does not
> exists.
> In my opinion, the libq library should also be case insensitive and
> automatically convert this to a lowercase "testdb" and not return an error.
>
> What are your thoughts ?
>
Most/All usages of identifiers outside of an SQL Command identifier do not
result in case-folding. And besides, changing any that do is a breaking
change that we are unlikely to accept.
David J.
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: BUG #19043: jdbc connection url is not case insensitive
@ 2025-09-05 21:20 Tom Lane <tgl@sss.pgh.pa.us>
parent: PG Bug reporting form <noreply@postgresql.org>
2 siblings, 0 replies; 4+ messages in thread
From: Tom Lane @ 2025-09-05 21:20 UTC (permalink / raw)
To: m.kristo@rewe-group.at; +Cc: pgsql-bugs@lists.postgresql.org
PG Bug reporting form <noreply@postgresql.org> writes:
> when creating a database in Postgres with the name e.g. "testDB", postgres
> creates a database in lowercase testdb.
> So far so good, but when trying to connect via psql and passing as database
> name "testDB" the connection fails, because it says the database does not
> exists.
> In my opinion, the libq library should also be case insensitive and
> automatically convert this to a lowercase "testdb" and not return an error.
Then it would become impossible to connect to databases that have
upper-case or mixed-case names.
Our general position on such matters is that automatic downcasing
happens in SQL commands, but not in any other context (such as
command-line arguments or connection strings).
regards, tom lane
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: BUG #19043: jdbc connection url is not case insensitive
@ 2025-09-06 00:41 Greg Sabino Mullane <htamfids@gmail.com>
parent: PG Bug reporting form <noreply@postgresql.org>
2 siblings, 0 replies; 4+ messages in thread
From: Greg Sabino Mullane @ 2025-09-06 00:41 UTC (permalink / raw)
To: m.kristo@rewe-group.at; pgsql-bugs@lists.postgresql.org
An alternate view: if you really care about case, double quote the database
on creation, as per your "e.g.":
create database "testDB";
At that point, your psql connection will work. But as with all
non-lowercase objects, extra care will be needed and it will need to be
quoted in some contexts. It's so much easier to just leave database,
schema, table, and column names as lowercase. Then everything just works.
Cheers,
Greg
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2025-09-06 00:41 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-09-05 06:28 BUG #19043: jdbc connection url is not case insensitive PG Bug reporting form <noreply@postgresql.org>
2025-09-05 21:13 ` David G. Johnston <david.g.johnston@gmail.com>
2025-09-05 21:20 ` Tom Lane <tgl@sss.pgh.pa.us>
2025-09-06 00:41 ` Greg Sabino Mullane <htamfids@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox