Re: BUG #16670: pgstattuple ERROR: relation "sql_implementation_info" does not exist

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #16670: pgstattuple ERROR: relation "sql_implementation_info" does not exist
Дата
Msg-id 3599891.1602686317@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #16670: pgstattuple ERROR: relation "sql_implementation_info" does not exist  (PG Bug reporting form <noreply@postgresql.org>)
Список pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> # select tablename,
> (pgstattuple_approx(tablename::regclass)).approx_free_space from pg_tables
> where schemaname = 'public'  and
> (pgstattuple_approx(tablename::regclass)).approx_free_percent > 10;
> ERROR:  relation "sql_implementation_info" does not exist

This is not a bug.  We don't guarantee anything about the evaluation
order of WHERE clauses.  Even if we did, this query has got bugs of
its own: it will fail on tablenames that would require quoting,
such as names containing spaces, dots, uppercase letters, etc.

You could write

(quote_ident(schemaname)||'.'||quote_ident(tablename))::regclass

to avoid both of those issues.  There are still going to be some race
condition problems around just-dropped tables, though.

            regards, tom lane



В списке pgsql-bugs по дате отправления:

Предыдущее
От: PG Bug reporting form
Дата:
Сообщение: BUG #16670: pgstattuple ERROR: relation "sql_implementation_info" does not exist
Следующее
От: Thomas Munro
Дата:
Сообщение: Re: BUG #16663: DROP INDEX did not free up disk space: idle connection hold file marked as deleted