Re: CREATE DATABASE - Mailing list pgsql-general

From Tom Lane
Subject Re: CREATE DATABASE
Date
Msg-id 25136.1154635750@sss.pgh.pa.us
Whole thread Raw
In response to Re: CREATE DATABASE  (Rafal Pietrak <rafal@zorro.isa-geek.com>)
Responses Re: CREATE DATABASE  ("Nikolay Samokhvalov" <samokhvalov@gmail.com>)
List pgsql-general
Rafal Pietrak <rafal@zorro.isa-geek.com> writes:
> To put it the other way around: I don't remember me creating a database
> and *needing* to stay within the initiator (like template1) - that's why
> I've ventured the feature request. If not a 'CONNECT' option, may be z
> "SET parameter" for a session user?

The reason neither of these are going to happen is that you're confusing
a server-side SQL command (viz CREATE DATABASE) with a client-side
operation (viz choosing to drop the server connection and make a new one
to a different database).  The server cannot force the client to do
that, and we're unlikely to look favorably on adding syntax that the
server is supposed to ignore while the client starts parsing every
command to see if it's in there.

You could imagine inventing a psql operation like

    \create_and_connect_to dbname ... other createdb parameters ...

but it still seems more like a kluge than a useful feature.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: PITR timeline question
Next
From: Scott Marlowe
Date:
Subject: Re: Well, Pervasive is now out....