126 reputation
2
bio website
location New Zealand
age
visits member for 5 years, 1 month
seen Jul 10 '12 at 2:13

Nov
13
awarded  Supporter
Nov
12
comment Proper Way to Grant Permissions in PostgreSQL
You could use a .pgpass file in your users home dirctory. Not sure how this would work as you are running the script as root but connecting as demo using ident. I would try putting the file in the demo users home directory. See postgresql.org/docs/8.1/interactive/libpq-pgpass.html
Nov
11
awarded  Teacher
Nov
11
comment Proper Way to Grant Permissions in PostgreSQL
I think the user is important. Try psql -f myfile.sql -d demo -u demo. This should run the commands as the demo user which should mean the objects created will be owned by the demo user.
Nov
10
answered Proper Way to Grant Permissions in PostgreSQL
Nov
10
answered Apache logging: rotating logs on Win32?