Reputation: 11091
I want to run
restore
php
)the script will have few lines of code, something like
dropdb <database name>
psql -c "create database <database name> with encoding 'unicode';" -U edutemplate1
psql -d <database name> -f edu.hourly.sql
restore
restore
script as postgres
user?Upvotes: 0
Views: 1211
Reputation: 254886
The command is absolutely the same as you do in console:
sudo -u db1inst1 /path/to/script.sh
Or even:
system('sudo -u db1inst1 /path/to/script.sh');
or
`sudo -u db1inst1 /path/to/script.sh`
Upvotes: 2