Switch database inside psql?

From: lynch(at)lscorp(dot)com (Richard Lynch)
To: pgsql-general(at)postgreSQL(dot)org
Subject: Switch database inside psql?
Date: 1998-08-06 23:45:04
Message-ID: v02140b77b1efa8a7d563@[207.152.64.133]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'd like to have a single file.sql that will create the same database and
some tables on several different systems. Is it possible to 'switch' to a
different database after one does the create database? So that tables
created would go in the new database and not template1? Or does this
already happen and is just not documented?... I'd be guessing a big no on
the latter, since the psql prompt still says 'template1' after I create a
database...

I get an error message when I try createdb from the command line, but once
I've done psql -u, I can do it, so I guess if I had to do this from some
sort of Perl/sed/awk/??? script (none of which I could write anyway), I'd
need to know how to convince createdb that I *am* a valid database-creator,
by golly.

--
--
-- "TANSTAAFL" Rich lynch(at)lscorp(dot)com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Maarten Boekhold 1998-08-07 09:10:29 Re: [GENERAL] Switch database inside psql?
Previous Message R.Stevens 1998-08-06 22:04:28 Design