Thread: [BUGS] BUG #14500: error message displays "schema dot relation" in doublequotes all together

The following bug has been logged on the website:

Bug reference:      14500
Logged by:          Vladimir Svedov
Email address:      vodevsh@gmail.com
PostgreSQL version: 9.6.1
Operating system:   Linux
Description:

Hi,
I'm not sure if it's a bug or feature, but I find error message misleading.
ERROR: relation [“schema_name.table_name”] does not exist gives an
impression that schema name is part of relation name. Should not it be
ERROR: relation [“schema name”].["table_name"] does not exist instead? I
doubt it's a bug, because this message seems version not specific. But does
not it look wrong?
Thanks.


--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

On Tue, Jan 17, 2017 at 4:09 AM, <vodevsh@gmail.com> wrote:
The following bug has been logged on the website:

Bug reference:      14500
Logged by:          Vladimir Svedov
Email address:      vodevsh@gmail.com
PostgreSQL version: 9.6.1
Operating system:   Linux
Description:

Hi,
I'm not sure if it's a bug or feature, but I find error message misleading.
ERROR: relation [“schema_name.table_name”] does not exist gives an
impression that schema name is part of relation name. Should not it be
ERROR: relation [“schema name”].["table_name"] does not exist instead? I
doubt it's a bug, because this message seems version not specific. But does
not it look wrong?

​I see the confusion but supposedly you'd have to write your alternate version:

relation ""schema_name"."table_name"" does not exist - and the excess of quotes in that situation would be problematic.

More to the point, the double quotes are not part of the identifiers but rather offset the item being named from the rest of the sentence fragment.  ​The portion within the quotes is case-sensitive and reflects that value being looked up after any case-folding happens.

Its definitely not a bug and doesn't seem like something that would be worth it to change.

David J.

On Tue, Jan 17, 2017 at 5:09 AM,  <vodevsh@gmail.com> wrote:

> I'm not sure if it's a bug or feature, but I find error message misleading.
> ERROR: relation [“schema_name.table_name”] does not exist gives an
> impression that schema name is part of relation name. Should not it be
> ERROR: relation [“schema name”].["table_name"] does not exist instead? I
> doubt it's a bug, because this message seems version not specific. But does
> not it look wrong?

I doubt that it can really be considered a bug, since it is
functioning as designed.

On the other hand, it's annoying for copy/paste, especially with camel
case names.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Thank you for the reply!
I understand that double quotes here do not mean a relation exact name, but rather identify the object in general.
Yet, look at this sample:

t=# select * from public."Mixed.Case";
ERROR:  relation "public.Mixed.Case" does not exist
LINE 1: select * from public."Mixed.Case";
                      ^



2017-01-17 15:19 GMT+00:00 David G. Johnston <david.g.johnston@gmail.com>:
On Tue, Jan 17, 2017 at 4:09 AM, <vodevsh@gmail.com> wrote:
The following bug has been logged on the website:

Bug reference:      14500
Logged by:          Vladimir Svedov
Email address:      vodevsh@gmail.com
PostgreSQL version: 9.6.1
Operating system:   Linux
Description:

Hi,
I'm not sure if it's a bug or feature, but I find error message misleading.
ERROR: relation [“schema_name.table_name”] does not exist gives an
impression that schema name is part of relation name. Should not it be
ERROR: relation [“schema name”].["table_name"] does not exist instead? I
doubt it's a bug, because this message seems version not specific. But does
not it look wrong?

​I see the confusion but supposedly you'd have to write your alternate version:

relation ""schema_name"."table_name"" does not exist - and the excess of quotes in that situation would be problematic.

More to the point, the double quotes are not part of the identifiers but rather offset the item being named from the rest of the sentence fragment.  ​The portion within the quotes is case-sensitive and reflects that value being looked up after any case-folding happens.

Its definitely not a bug and doesn't seem like something that would be worth it to change.

David J.


On Tue, Jan 17, 2017 at 8:24 AM, Kevin Grittner <kgrittn@gmail.com> wrote:
On Tue, Jan 17, 2017 at 5:09 AM,  <vodevsh@gmail.com> wrote:

> I'm not sure if it's a bug or feature, but I find error message misleading.
> ERROR: relation [“schema_name.table_name”] does not exist gives an
> impression that schema name is part of relation name. Should not it be
> ERROR: relation [“schema name”].["table_name"] does not exist instead? I
> doubt it's a bug, because this message seems version not specific. But does
> not it look wrong?

I doubt that it can really be considered a bug, since it is
functioning as designed.

On the other hand, it's annoying for copy/paste, especially with camel
case names.


​While I don't disagree for the examples I've seen​ you would just copy from the LINE 1 of context...

David J.

"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Tue, Jan 17, 2017 at 4:09 AM, <vodevsh@gmail.com> wrote:
>> I'm not sure if it's a bug or feature, but I find error message misleading.
>> ERROR: relation [“schema_name.table_name”] does not exist gives an
>> impression that schema name is part of relation name. Should not it be
>> ERROR: relation [“schema name”].["table_name"] does not exist instead? I
>> doubt it's a bug, because this message seems version not specific. But does
>> not it look wrong?

> More to the point, the double quotes are not part of the identifiers but
> rather offset the item being named from the rest of the sentence fragment.

Yes.  In a translated message you might see something like

    Relation »schema_name.table_name« existiert nicht

That is, the double quotes here are not SQL syntax but part of the human
language that the error message is written in.  It's unfortunate in this
context that SQL's identifier quoting character is the same as we use in
English, because it invites confusion like the OP's.  But the only way
to fix that would be to go over to non-ASCII quoting characters (curly
quotes, say) in the English message texts, and that would create tons of
practical problems.  Plus, if you didn't look closely enough to see the
difference between curly quotes and plain double quotes, you'd still
be confused.

            regards, tom lane


--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Only because when I get the error, I look closely the error message, not to the code I just entered.
In fact I noticed error message and LINE 1 have different quoting only when you told me.

Thank again for your time

2017-01-17 15:33 GMT+00:00 David G. Johnston <david.g.johnston@gmail.com>:
On Tue, Jan 17, 2017 at 8:24 AM, Kevin Grittner <kgrittn@gmail.com> wrote:
On Tue, Jan 17, 2017 at 5:09 AM,  <vodevsh@gmail.com> wrote:

> I'm not sure if it's a bug or feature, but I find error message misleading.
> ERROR: relation [“schema_name.table_name”] does not exist gives an
> impression that schema name is part of relation name. Should not it be
> ERROR: relation [“schema name”].["table_name"] does not exist instead? I
> doubt it's a bug, because this message seems version not specific. But does
> not it look wrong?

I doubt that it can really be considered a bug, since it is
functioning as designed.

On the other hand, it's annoying for copy/paste, especially with camel
case names.


​While I don't disagree for the examples I've seen​ you would just copy from the LINE 1 of context...

David J.


As David pointed I can use my line with error pointer for copy/paste ugly names, not the error message.
Thank you for you time!

2017-01-17 15:35 GMT+00:00 Tom Lane <tgl@sss.pgh.pa.us>:
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Tue, Jan 17, 2017 at 4:09 AM, <vodevsh@gmail.com> wrote:
>> I'm not sure if it's a bug or feature, but I find error message misleading.
>> ERROR: relation [“schema_name.table_name”] does not exist gives an
>> impression that schema name is part of relation name. Should not it be
>> ERROR: relation [“schema name”].["table_name"] does not exist instead? I
>> doubt it's a bug, because this message seems version not specific. But does
>> not it look wrong?

> More to the point, the double quotes are not part of the identifiers but
> rather offset the item being named from the rest of the sentence fragment.

Yes.  In a translated message you might see something like

        Relation »schema_name.table_name« existiert nicht

That is, the double quotes here are not SQL syntax but part of the human
language that the error message is written in.  It's unfortunate in this
context that SQL's identifier quoting character is the same as we use in
English, because it invites confusion like the OP's.  But the only way
to fix that would be to go over to non-ASCII quoting characters (curly
quotes, say) in the English message texts, and that would create tons of
practical problems.  Plus, if you didn't look closely enough to see the
difference between curly quotes and plain double quotes, you'd still
be confused.

                        regards, tom lane