Users in pg_shadow

Started by Scott Holmesabout 25 years ago4 messagesgeneral
Jump to latest
#1Scott Holmes
sholmes@pacificnet.net

I have a cron script set up to run VACUUM ANALYZE on two databases that appear
to work fine except for a couple of messages that show up in the log:

FATAL 1: SetUserId: user 'newsltr' is not in 'pg_shadow'
FATAL 1: SetUserId: user 'wcgc_pg' is not in 'pg_shadow'

newsltr and wcgc_pg are the respective names of the databases, there are no
users with these names. This is on a postgresql-7.0.2 running on a Red Hat 6.2

I've seen no problems resulting from this but I would like to understand why.

--
---------------------------------------------------------------------
Scott Holmes http://www.pacificnet.net/~sholmes
sholmes@pacificnet.net

Independent Programmer/Analyst Passport 4GL
PHP HTML Composer PostgreSQL Informix 4GL, SQL
---------------------------------------------------------------------
There are more things in heaven and earth, Horatio,
than are dreamt of in your philosophy
---------------------------------------------------------------------

#2Peter Eisentraut
peter_e@gmx.net
In reply to: Scott Holmes (#1)
Re: Users in pg_shadow

Scott Holmes writes:

I have a cron script set up to run VACUUM ANALYZE on two databases that appear
to work fine except for a couple of messages that show up in the log:

FATAL 1: SetUserId: user 'newsltr' is not in 'pg_shadow'
FATAL 1: SetUserId: user 'wcgc_pg' is not in 'pg_shadow'

newsltr and wcgc_pg are the respective names of the databases, there are no
users with these names. This is on a postgresql-7.0.2 running on a Red Hat 6.2

You should make your cron script to connect as the proper user, probably
using the -U option of psql or vacuumdb. Otherwise the user name defaults
to one of various things, which is probably not desired here.

I've seen no problems resulting from this but I would like to understand why.

Only if the fact that the VACUUM ANALYZE probably didn't actually execute
is not a problem... ;-)

--
Peter Eisentraut peter_e@gmx.net http://yi.org/peter-e/

#3Scott Holmes
sholmes@pacificnet.net
In reply to: Peter Eisentraut (#2)
Re: Users in pg_shadow

Well, I did have the -U argument using $PGUSER. However, I made the all too
common mistake of forgetting that cron may or maynot have particular
environmental variables set.

Thanks...

Show quoted text

You should make your cron script to connect as the proper user, probably
using the -U option of psql or vacuumdb. Otherwise the user name defaults
to one of various things, which is probably not desired here.

--
Peter Eisentraut peter_e@gmx.net http://yi.org/peter-e/

#4Frank Miles
fpm@u.washington.edu
In reply to: Peter Eisentraut (#2)
Re: Users in pg_shadow

One possible part of a cron script:

su --command="psql -d $PGUSER -c 'vacuum analyze;' > /dev/null" $PGUSER

where 'PGUSER' has been defined as the appropriate user name. Of course,
you'll need a bit more if your database has a different name.

HTH...

-frank