Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 0081D6347C6 for ; Tue, 9 Feb 2010 18:40:30 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 76905-09 for ; Tue, 9 Feb 2010 22:40:19 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from locust.cns.vt.edu (locust.cns.vt.edu [198.82.169.14]) by mail.postgresql.org (Postfix) with ESMTP id 6AA9865B04F for ; Tue, 9 Feb 2010 18:39:53 -0400 (AST) Received: by locust.cns.vt.edu (Postfix, from userid 986) id 4011E118DBB; Tue, 9 Feb 2010 17:39:52 -0500 (EST) Date: Tue, 9 Feb 2010 17:39:52 -0500 From: Ray Stell To: pgsql-admin@postgresql.org Subject: Re: VACUUM WARNING: skipping "pg_statistic" --- only table or database owner can vacuum it Message-ID: <20100209223952.GA11857@cns.vt.edu> References: <20100130145936.GA12509@cns.vt.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100130145936.GA12509@cns.vt.edu> User-Agent: Mutt/1.5.17 (2007-11-01) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201002/72 X-Sequence-Number: 33675 On Sat, Jan 30, 2010 at 09:59:36AM -0500, Ray Stell wrote: > Running 8.2.15 on RHEL4 the log reports this from autovacuum along with > other pg_ tables: > > VACUUM WARNING: skipping "pg_database" --- only table or database owner can vacuum it More logging shows the user generating the msg is not superuser. The user is named "admin," as it is an application administrator and it chokes on all the rels in information_schema and pg_catalog. fms=# select * from pg_user where usename = 'admin'; usename | usesysid | usecreatedb | usesuper | usecatupd | passwd | valuntil | useconfig ---------+----------+-------------+----------+-----------+----------+----------+----------- admin | 16385 | f | f | f | ******** | | (1 row) Superuser owns these rels: fms=# select * from pg_tables where tablename = 'sql_sizing'; schemaname | tablename | tableowner | tablespace | hasindexes | hasrules | hastriggers --------------------+------------+------------+------------+------------+----------+------------- information_schema | sql_sizing | postgres | | f | f | f (1 row) This vacuum.c if clause that gets to the warning msg: if (!(pg_class_ownercheck(RelationGetRelid(onerel), GetUserId()) || (pg_database_ownercheck(MyDatabaseId, GetUserId()) && !onerel->rd_rel->relisshared))) The following printf in the vacuum.c clause shows all is well, but raises some questions: 1 pg_class_ownercheck(RelationGetRelid(onerel), GetUserId())=0 2 RelationGetRelid(onerel)=sql_sizing 3 GetUserId()=16385 4 pg_database_ownercheck(MyDatabaseId, GetUserId())=0 5 MyDatabaseId=16384 6 onerel->rd_rel->relisshared=0 Is autovacuum handing all users off to vacuum all rels? Even those it does not own? Perhaps "admin" an unfortunate usename choice? Thanks.