How to do a "CREATE DATABASE" and then connect to it? - Mailing list pgsql-general

From Joseph Brenner
Subject How to do a "CREATE DATABASE" and then connect to it?
Date
Msg-id 200606021946.k52JkO395405@mail0.rawbw.com
Whole thread Raw
Responses Re: How to do a "CREATE DATABASE" and then connect to it?
List pgsql-general
After you do a "CREATE DATABASE", how do you programatically
connect to what you just created?

In the psql monitor, you'd use the "\c" command.

If the DATABASE already exists when you connect to postgresql,
you use the name when you connect (e.g. "dbname=...").

I'm getting the impression I need to do this in multiple steps,
which is workable, but seems a little silly.


pgsql-general by date:

Previous
From: Rich Shepard
Date:
Subject: Re: Best open source tool for database design / ERDs?
Next
From: Joseph Brenner
Date:
Subject: Re: Querying for strings that match after prefix