pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #6252: After drop the default database 'postgres', I can not create a database by 'createdb.exe'
4+ messages / 4 participants
[nested] [flat]

* BUG #6252: After drop the default database 'postgres', I can not create a database by 'createdb.exe'
@ 2011-10-12 06:48  Can not create DB by 'createdb.exe' when DB 'postgres' is droped <yanghui328@gmail.com>
  0 siblings, 2 replies; 4+ messages in thread

From: Can not create DB by 'createdb.exe' when DB 'postgres' is droped @ 2011-10-12 06:48 UTC (permalink / raw)
  To: pgsql-bugs


The following bug has been logged online:

Bug reference:      6252
Logged by:          Can not create DB by 'createdb.exe' when DB 'postgres'
is droped
Email address:      yanghui328@gmail.com
PostgreSQL version: 9.0.5
Operating system:   Windows XP SP2
Description:        After drop the default database 'postgres', I can not
create a database by 'createdb.exe'
Details: 

1.drop database 'postgres'
2.create a database by createdb.exe
the follow error message will dispaly:
Can not create DB by 'createdb.exe' when database 'postgres' is droped

PS:file: '\postgresql-9.0.5\src\bin\scripts\createdb.c'
   Line: 195
   Source: conn = connectDatabase(strcmp(dbname, "postgres") == 0 ?
"template1" : "postgres", host, port, username, prompt_password, progname);

*Sorry for my poor English



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #6252: After drop the default database 'postgres', I can not create a database by 'createdb.exe'
@ 2011-10-12 16:28  Kevin Grittner <Kevin.Grittner@wicourts.gov>
  parent: Can not create DB by 'createdb.exe' when DB 'postgres' is droped <yanghui328@gmail.com>
  1 sibling, 1 reply; 4+ messages in thread

From: Kevin Grittner @ 2011-10-12 16:28 UTC (permalink / raw)
  To: yanghui328@gmail.com; pgsql-bugs

<yanghui328@gmail.com> wrote: 
 
> 1.drop database 'postgres'
> 2.create a database by createdb.exe
> the follow error message will dispaly:
> Can not create DB by 'createdb.exe' when database 'postgres' is
> droped
 
To create a database, the createdb executable has to connect to the
cluster.  A connection is always to some specific database.  The
postgres database was added specifically so that such utilities
could make a connection somewhere so they could do their work.  If
you drop it, you break those applications.
 
This is not a bug.  The workaround is to not drop the database which
is automatically created on installation.
 
-Kevin



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #6252: After drop the default database 'postgres', I can not create a database by 'createdb.exe'
@ 2011-10-12 16:57  John R Pierce <pierce@hogranch.com>
  parent: Kevin Grittner <Kevin.Grittner@wicourts.gov>
  0 siblings, 0 replies; 4+ messages in thread

From: John R Pierce @ 2011-10-12 16:57 UTC (permalink / raw)
  To: pgsql-bugs

On 10/12/11 9:28 AM, Kevin Grittner wrote:
> This is not a bug.  The workaround is to not drop the database which
> is automatically created on installation.

or to explicitly connect to another database to do the create

-- 
john r pierce                            N 37, W 122
santa cruz ca                         mid-left coast




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #6252: After drop the default database 'postgres', I can not create a database by 'createdb.exe'
@ 2011-10-13 02:55  Craig Ringer <ringerc@ringerc.id.au>
  parent: Can not create DB by 'createdb.exe' when DB 'postgres' is droped <yanghui328@gmail.com>
  1 sibling, 0 replies; 4+ messages in thread

From: Craig Ringer @ 2011-10-13 02:55 UTC (permalink / raw)
  To: Can not create DB by 'createdb.exe' when DB 'postgres' is droped <yanghui328@gmail.com>; +Cc: pgsql-bugs

On 10/12/2011 02:48 PM, Can not create DB by 'createdb.exe' when DB 
'postgres' is droped wrote:
>
> The following bug has been logged online:
>
> Bug reference:      6252
> Logged by:          Can not create DB by 'createdb.exe' when DB 'postgres'
> is droped
> Email address:      yanghui328@gmail.com
> PostgreSQL version: 9.0.5
> Operating system:   Windows XP SP2
> Description:        After drop the default database 'postgres', I can not
> create a database by 'createdb.exe'
> Details:
>
> 1.drop database 'postgres'
> 2.create a database by createdb.exe
> the follow error message will dispaly:
> Can not create DB by 'createdb.exe' when database 'postgres' is droped

Yep. You need to use a `CREATE DATABASE' command from psql to re-create 
the `postgres' database after connecting to the "template1" database, eg:

template1=> CREATE DATABASE postgres WITH OWNER postgres;

--
Craig Ringer



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2011-10-13 02:55 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-10-12 06:48 BUG #6252: After drop the default database 'postgres', I can not create a database by 'createdb.exe' Can not create DB by 'createdb.exe' when DB 'postgres' is droped <yanghui328@gmail.com>
2011-10-12 16:28 ` Kevin Grittner <Kevin.Grittner@wicourts.gov>
2011-10-12 16:57   ` John R Pierce <pierce@hogranch.com>
2011-10-13 02:55 ` Craig Ringer <ringerc@ringerc.id.au>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox