Re: Postgresql gives error that role goes not exists while it exists

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Craig Ringer <craig(at)2ndquadrant(dot)com>
Cc: Euler Taveira <euler(at)timbira(dot)com(dot)br>, Nick Dro <postgresql(at)walla(dot)co(dot)il>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Postgresql gives error that role goes not exists while it exists
Date: 2017-10-03 15:20:35
Message-ID: 12705.1507044035@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-hackers

Craig Ringer <craig(at)2ndquadrant(dot)com> writes:
> We could only emit a useful HINT if we actually went and looked in the
> relevant catalog for a different-cased version. Which is pretty
> expensive.

There is actually a hint somewhat like that for the specific case of
misspelled column names in DML statements:

postgres=# create table foo ("Iris" int);
CREATE TABLE
postgres=# select iris from foo;
ERROR: column "iris" does not exist
LINE 1: select iris from foo;
^
HINT: Perhaps you meant to reference the column "foo.Iris".

but that's a bit different because the set of column names to be
considered is very constrained --- only columns belonging to tables
listed in FROM. The parser has already sucked in the column name
lists for those tables, so no additional catalog fetches are needed.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2017-10-03 15:26:52 Re: [PATCH] Incremental sort
Previous Message Sokolov Yura 2017-10-03 15:06:30 Re: Two pass CheckDeadlock in contentent case