Hi, On Friday 09 February 2007 08:53, Ashish Karalkar wrote: | I want to automate database creation, user creation,table creation via | script. this script will be run by an external programme to postgresql | server. is there any way? | | what i want to do is as follows: | | | #!/bin/sh | | su - postgres [rest of not working script] | is there any way?? | | right now the scripts stop after switching over to postgres user. assuming the script is run as user root, you can invoke it as su - postgres -c /path/to/script Just remove the "su - postgres" from your script. You might want to look at your init scripts (/etc/init.d/postgresql I assume) for how they do it. Ciao, Thomas -- Thomas Pundt <thomas.pundt@xxxxxxxxxxxx> ---- http://rp-online.de/ ----