How To Install Extension Via Script File?
От
Don Parris
Тема
How To Install Extension Via Script File?
Дата
Msg-id
CAJ-7yokSNbY145oEer0z5tG724uRp=t9+oQwMVdxGjOWpmCZVw@mail.gmail.com
Список
Дерево обсуждения
How To Install Extension Via Script File? Don Parris <parrisdc@gmail.com>
Re: How To Install Extension Via Script File? Rob Sargent <robjsargent@gmail.com>
Re: How To Install Extension Via Script File? Don Parris <parrisdc@gmail.com>
Re: How To Install Extension Via Script File? Rob Sargent <robjsargent@gmail.com>
Re: How To Install Extension Via Script File? Chris Travers <chris.travers@gmail.com>
Re: How To Install Extension Via Script File? Tom Lane <tgl@sss.pgh.pa.us>
Re: How To Install Extension Via Script File? John R Pierce <pierce@hogranch.com>
Re: How To Install Extension Via Script File? Don Parris <parrisdc@gmail.com>
Re: How To Install Extension Via Script File? Thomas Kellerer <spam_eater@gmx.net>
Re: How To Install Extension Via Script File? Don Parris <parrisdc@gmail.com>
Re: How To Install Extension Via Script File? Tom Lane <tgl@sss.pgh.pa.us>
Re: How To Install Extension Via Script File? Don Parris <parrisdc@gmail.com>
Re: How To Install Extension Via Script File? Quentin Hartman <qhartman@direwolfdigital.com>
Re: How To Install Extension Via Script File? Don Parris <parrisdc@gmail.com>
Hi all,
I have a database that uses the ltree extension. I typically create a new database like so (as a normal user), using my script file:CREATE DATABASE mydb WITH TEMPLATE template0 ENCODING 'UTF8';
I want a script something like:
CREATE DATABASE mydb WITH TEMPLATE template0 ENCODING 'UTF8';
\c mydb
CREATE EXTENSION ltree;
CREATE TABLE mytable(myfields);
rinse, repeat for additional tables and views.
And to be able to run it from the Bash prompt (as securely as possible).
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.
I did create a password for my postgres user (hence the -W option). And this is on a local box.
How can I run my script?
Thanks!
Don
--
D.C. Parris, FMP, Linux+, ESL Certificate
Minister, Security/FM Coordinator, Free Software Advocate
D.C. Parris, FMP, Linux+, ESL Certificate
Minister, Security/FM Coordinator, Free Software Advocate
GPG Key ID: F5E179BE
В списке pgsql-general по дате отправления