Re: Create user/create database outside template1 - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Create user/create database outside template1
Date
Msg-id 200005251642.MAA26670@candle.pha.pa.us
Whole thread Raw
In response to Re: Create user/create database outside template1  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Create user/create database outside template1  (Vince Vielhaber <vev@michvhf.com>)
Re: Create user/create database outside template1  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > What happens if people issue create user or create database outside
> > template1.  Do we need to prevent it?  Seems they work, but am not sure
> > it is OK.  Do we need to add a check?
> 
> Works fine, no, and no.  The reason the scripts like to connect to
> template1 is that it's the only database they can be sure is there.
> But the commands themselves don't care where you're connected.

Well, thanks.  I was going over that for my book.  If I do createdb from
another database, I guess I get a copy of that database, right? 
Interesting feature that I am sure few people realize.

--  Bruce Momjian                        |  http://www.op.net/~candle pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Create user/create database outside template1
Next
From: Vince Vielhaber
Date:
Subject: Re: Create user/create database outside template1