On 11 April 2014 02:23, jamo3 <[email protected]> wrote: > I double checked the old "create extension" command in our script and it did > specify the db name correctly here's the command (this is via a windows > batch file, DB_NAME is the db being created): > > .\bin\psql.exe -d %DB_NAME% -U %POSTGRESQL_SUPER_USER% -c "CREATE EXTENSION > postgis"
Mind you, you can use a few environment variables[1] in the batch file, e.g.: set PATH=C:\Program Files\PostgreSQL\9.3\bin;%PATH set PGDATABASE=%DB_NAME% set PGUSER=%POSTGRESQL_SUPER_USER% psql -c "CREATE EXTENSION postgis" psql -f someotherfile.sql This is particularly handy if you have several multiple libpq-related commands from a batch script. -Mike [1] http://www.postgresql.org/docs/current/static/libpq-envars.html _______________________________________________ postgis-users mailing list [email protected] http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
