Re: \dt shows table but \d <table> says the table doesn't exist ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, David Gauthier <dfgpostgres(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: \dt shows table but \d <table> says the table doesn't exist ?
Date: 2024-05-03 21:28:20
Message-ID: 2747922.1714771700@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Magnus Hagander <magnus(at)hagander(dot)net> writes:
> On Fri, May 3, 2024 at 11:08 PM Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
> wrote:
>> This:
>> "Did not find any relation named "public.some_idIds"."
>> to me indicates it did look for the properly cased name.

> That is arguably a really bad error message, because it puts those quotes
> there whether needed or not. if you put the quotes in there, you get:
> Did not find any relation named "public."some_idIds"".

This is one of the places where it's unfortunate that our English-text
rule for quoting a string to set it off from the rest of the error
message collides with SQL's rule for quoting an identifier. Leaving
out the outer quotes would be contrary to our style guide, but having
them there can be confusing too to people who know SQL well.

It'd be better if we could show the transformed search string, but
since it's been marked up to be a regex I fear that'd introduce
even more confusion than it solves.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Isaac Morland 2024-05-03 22:08:25 Re: \dt shows table but \d <table> says the table doesn't exist ?
Previous Message Tom Lane 2024-05-03 21:15:11 Re: \dt shows table but \d <table> says the table doesn't exist ?