I thought I could add the commands and run the create script by doing: sudo -u postgres psql -U user -W -d mydb --file=/home/user/dev/mydb_create.sql
I thought that, running my script as the superuser, it would have the privileges necessary to install the extension, but I still got a "permission denied" error.
can the postgres user access /home/user/dev ?
thats aside from the rest of potentially wrong stuff the other guys mentioned.
Oops! That *could* create havoc, couldn't it? Still, should be easy enough to rectify.