su-like behavior - Mailing list pgsql-admin

From David Lutterkort
Subject su-like behavior
Date
Msg-id 1139010516.27326.211.camel@currant.watzmann.net
Whole thread Raw
Responses Re: su-like behavior
List pgsql-admin
Hi,

I want to run some sql scripts through psql from a process that runs as
root. Since I have no reason to trust the sql scripts, I want to run
them in psql as a specific database user that doesn't have a
corresponding login account, i.e. I want to do something like

        [start as root]
        su - postgres
        psql DBNAME DBUSER < script.sql

or
        [start as root]
        su - postgres
        psql
        \connect DBNAME DBUSER
        \i script.sql

The problem is that I haven't been able to do this without being
prompted for a password. Is this possible, i.e. is there a way to go
from a superuser (postgres) to a less privileged user without having to
supply the password ?

thanks,
David



pgsql-admin by date:

Previous
From: Tom Lane
Date:
Subject: Re: strange hung processes
Next
From: Bruno Wolff III
Date:
Subject: Re: su-like behavior