pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #16265: psql shows (unfolded) relation name in quotes
2+ messages / 2 participants
[nested] [flat]
* BUG #16265: psql shows (unfolded) relation name in quotes
@ 2020-02-19 01:17 PG Bug reporting form <noreply@postgresql.org>
2020-02-19 15:44 ` Re: BUG #16265: psql shows (unfolded) relation name in quotes Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 2+ messages in thread
From: PG Bug reporting form @ 2020-02-19 01:17 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org; +Cc: jltallon@adv-solutions.net
The following bug has been logged on the website:
Bug reference: 16265
Logged by: Jose Luis Tallon
Email address: jltallon@adv-solutions.net
PostgreSQL version: 12.1
Operating system: Linux
Description:
When dealing with schemas containing non-all-lowercase names, psql error
messages can be confusing.
Reproducer below:
-------------------
test=> CREATE TABLE "Schedule";
CREATE TABLE
test=> \dt "Schedule"
List of relations
Schema | Name | Type | Owner
--------+----------+-------+----------
public | Schedule | table | jltallon
(1 row)
test=> \d+ Schedule
Did not find any relation named "Schedule".
-------------------
EXPECTED:
-------------------
test=> \d+ Schedule
Did not find any relation named "schedule".
-------------------
Please note that the only difference lies in case-folding of the unquoted
relation name: psql copies the relation name verbatim to the output message,
whereas it should case-fold it according to standard Postgres rules.
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: BUG #16265: psql shows (unfolded) relation name in quotes
2020-02-19 01:17 BUG #16265: psql shows (unfolded) relation name in quotes PG Bug reporting form <noreply@postgresql.org>
@ 2020-02-19 15:44 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2020-02-19 15:44 UTC (permalink / raw)
To: jltallon@adv-solutions.net; +Cc: pgsql-bugs@lists.postgresql.org
PG Bug reporting form <noreply@postgresql.org> writes:
> -------------------
> test=> \d+ Schedule
> Did not find any relation named "Schedule".
> -------------------
> EXPECTED:
> -------------------
> test=> \d+ Schedule
> Did not find any relation named "schedule".
> -------------------
Yeah, it just reports what you typed. The difficulty in doing differently
is that what you typed might not be *meant* to be interpreted literally,
because it's a pattern not a simple name. What should we do for example
with
regression=# \d+ foo*
Did not find any relation named "foo*".
A more interesting example, perhaps, is that these don't mean the same
thing:
regression=# \d+ "Foo*"
Did not find any relation named ""Foo*"".
regression=# \d+ "Foo"*
Did not find any relation named ""Foo"*".
(If I had a table named "Foot", the first case wouldn't find it but
the second would.) I'm not clear on how we could report a post-processed
version of the input that would distinguish these in a non-confusing way.
Part of the issue is that the double-quote characters are being used in
two different ways. The ones that the error message is wrapping around
the regurgitated input are not to be confused with quotes used in the
input; they're just there to separate the fixed and variable parts of
the message. This is a little easier to follow in some other languages
where different quoting characters are used in error messages, but in
English we've concluded we just have to live with it.
tl;dr: it's not that obvious what would be an improvement here.
regards, tom lane
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2020-02-19 15:44 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-02-19 01:17 BUG #16265: psql shows (unfolded) relation name in quotes PG Bug reporting form <noreply@postgresql.org>
2020-02-19 15:44 ` Tom Lane <tgl@sss.pgh.pa.us>
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