pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Re: VACUUM WARNING:  skipping "pg_statistic" --- only table or database owner can vacuum it
2+ messages / 1 participants
[nested] [flat]

* Re: VACUUM WARNING:  skipping "pg_statistic" --- only table or database owner can vacuum it
@ 2010-02-09 22:39  Ray Stell <stellr@cns.vt.edu>
  0 siblings, 1 reply; 2+ messages in thread

From: Ray Stell @ 2010-02-09 22:39 UTC (permalink / raw)
  To: pgsql-admin

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.




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

* Re: VACUUM WARNING:  skipping "pg_statistic" --- only table or database owner can vacuum it
@ 2010-02-12 17:02  Ray Stell <stellr@cns.vt.edu>
  parent: Ray Stell <stellr@cns.vt.edu>
  0 siblings, 0 replies; 2+ messages in thread

From: Ray Stell @ 2010-02-12 17:02 UTC (permalink / raw)
  To: pgsql-admin

On Tue, Feb 09, 2010 at 05:39:52PM -0500, Ray Stell wrote:
> On Sat, Jan 30, 2010 at 09:59:36AM -0500, Ray Stell wrote:
> 
> Is autovacuum handing all users off to vacuum all rels?  Even those
> it does not own?  Perhaps "admin" an unfortunate usename choice?


doh...the light comes on.

reading through postinit.c and others makes it clear autovacuum is not the source
of the vacuum.  No doubt the app, Cisco Fabric Manager Server, is doing something
stupid.  Yep:

/var/local/cisco_mds9000
# strings ./jboss/server/default/deploy/dcm.ear/dcm.jar/com/cisco/dcbu/sm/server/db/PostgresWrapper.class | grep -i vacuum
 vacuum_analyze
vacuum analyze
 vacuum_analyze failed:

2. 	Irrelephant 	
Anything that is unrelated to an elephant.
http://www.urbandictionary.com/define.php?term=irrelephant



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


end of thread, other threads:[~2010-02-12 17:02 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-02-09 22:39 Re: VACUUM WARNING:  skipping "pg_statistic" --- only table or database owner can vacuum it Ray Stell <stellr@cns.vt.edu>
2010-02-12 17:02 ` Ray Stell <stellr@cns.vt.edu>

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