pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #16670: pgstattuple ERROR:  relation "sql_implementation_info" does not exist
2+ messages / 2 participants
[nested] [flat]

* BUG #16670: pgstattuple ERROR:  relation "sql_implementation_info" does not exist
@ 2020-10-14 12:58 PG Bug reporting form <noreply@postgresql.org>
  2020-10-14 14:38 ` Re: BUG #16670: pgstattuple ERROR: relation "sql_implementation_info" does not exist Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: PG Bug reporting form @ 2020-10-14 12:58 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: mrechte@gmail.com

The following bug has been logged on the website:

Bug reference:      16670
Logged by:          Marc Rechté
Email address:      mrechte@gmail.com
PostgreSQL version: 13.0
Operating system:   CentOS8
Description:        

Hello,

I get an error with pgstattuple extension.

On PG13.0:
# 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

On PG12.3:
# 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_packages" does not exist

Note that the where clause on approx_free_percent is the error cause.

Thanks



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #16670: pgstattuple ERROR: relation "sql_implementation_info" does not exist
  2020-10-14 12:58 BUG #16670: pgstattuple ERROR:  relation "sql_implementation_info" does not exist PG Bug reporting form <noreply@postgresql.org>
@ 2020-10-14 14:38 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2020-10-14 14:38 UTC (permalink / raw)
  To: mrechte@gmail.com; +Cc: pgsql-bugs@lists.postgresql.org

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





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2020-10-14 14:38 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-10-14 12:58 BUG #16670: pgstattuple ERROR:  relation "sql_implementation_info" does not exist PG Bug reporting form <noreply@postgresql.org>
2020-10-14 14:38 ` Re: BUG #16670: pgstattuple ERROR: relation "sql_implementation_info" does not exist 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