Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kShvT-00024g-4n for pgsql-bugs@arkaria.postgresql.org; Wed, 14 Oct 2020 14:38:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kShvS-0008Fh-19 for pgsql-bugs@arkaria.postgresql.org; Wed, 14 Oct 2020 14:38:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kShvR-0008FZ-RJ for pgsql-bugs@lists.postgresql.org; Wed, 14 Oct 2020 14:38:45 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kShvL-0006qB-ML for pgsql-bugs@lists.postgresql.org; Wed, 14 Oct 2020 14:38:44 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 09EEcbQF3599892; Wed, 14 Oct 2020 10:38:37 -0400 From: Tom Lane To: mrechte@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16670: pgstattuple ERROR: relation "sql_implementation_info" does not exist In-reply-to: <16670-4aa3d62f20dd7754@postgresql.org> References: <16670-4aa3d62f20dd7754@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Wed, 14 Oct 2020 12:58:02 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3599890.1602686317.1@sss.pgh.pa.us> Date: Wed, 14 Oct 2020 10:38:37 -0400 Message-ID: <3599891.1602686317@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PG Bug reporting form 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