Re: Creating DB - Mailing list pgsql-novice

From Tom Lane
Subject Re: Creating DB
Date
Msg-id 9406.996675222@sss.pgh.pa.us
Whole thread Raw
In response to Creating DB  ("Lorenzo De Vito" <lorenzodevito@email.it>)
List pgsql-novice
"Lorenzo De Vito" <lorenzodevito@email.it> writes:
> Is the only way to create DB in a C code to connect to Template1 and then e=
> xec the SQL string "CREATE DATABASE databasename" ?
> Can I create DB without connecting to template1 ?

You have to connect to *some* DB.  Doesn't have to be template1, but
that's the most usual choice since it's certain to exist.

            regards, tom lane

pgsql-novice by date:

Previous
From: Helge Bahmann
Date:
Subject: Re: How to restart postmaster after a violent shutdown ?
Next
From: Tom Lane
Date:
Subject: Re: How to restart postmaster after a violent shutdown ?