Unix Technical Forum

BUG #2333: dropdb ignores the database name argument

This is a discussion on BUG #2333: dropdb ignores the database name argument within the pgsql Bugs forums, part of the PostgreSQL category; --> The following bug has been logged online: Bug reference: 2333 Logged by: kevin barnes Email address: vinbarnes@gmail.com PostgreSQL version: ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Bugs

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 10:50 AM
kevin barnes
 
Posts: n/a
Default BUG #2333: dropdb ignores the database name argument


The following bug has been logged online:

Bug reference: 2333
Logged by: kevin barnes
Email address: vinbarnes@gmail.com
PostgreSQL version: 8.1
Operating system: ubuntu 5.10
Description: dropdb ignores the database name argument
Details:

In the 8.1 release on Unbuntu 5.10 there is an error with the dropdb command
in /usr/bin. The error manifests itself by not respecting the DBNAME
argument. It assumes that you want to connect to a database named 'postgres'
and ignores whatever argument you give it. The error returned is:

dropdb: database removal failed: ERROR: database "postgres" does not exist

The error is actually correct, because I do not have a database named
postgres, but the command does not work correctly.

I downgraded through apt-get to 8.0 and dropdb works as expected. I believe
the version I was running was 8.1.3.

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 10:50 AM
Bruce Momjian
 
Posts: n/a
Default Re: BUG #2333: dropdb ignores the database name argument

kevin barnes wrote:
>
> The following bug has been logged online:
>
> Bug reference: 2333
> Logged by: kevin barnes
> Email address: vinbarnes@gmail.com
> PostgreSQL version: 8.1
> Operating system: ubuntu 5.10
> Description: dropdb ignores the database name argument
> Details:
>
> In the 8.1 release on Unbuntu 5.10 there is an error with the dropdb command
> in /usr/bin. The error manifests itself by not respecting the DBNAME
> argument. It assumes that you want to connect to a database named 'postgres'
> and ignores whatever argument you give it. The error returned is:
>
> dropdb: database removal failed: ERROR: database "postgres" does not exist
>
> The error is actually correct, because I do not have a database named
> postgres, but the command does not work correctly.
>
> I downgraded through apt-get to 8.0 and dropdb works as expected. I believe
> the version I was running was 8.1.3.


I think something strange is happening in your installation. I can not
reproduce your failure.

--
Bruce Momjian http://candle.pha.pa.us
SRA OSS, Inc. http://www.sraoss.com

+ If your life is a hard drive, Christ can be your backup. +

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-10-2008, 10:50 AM
Alvaro Herrera
 
Posts: n/a
Default Re: BUG #2333: dropdb ignores the database name argument

kevin barnes wrote:

> In the 8.1 release on Unbuntu 5.10 there is an error with the dropdb command
> in /usr/bin. The error manifests itself by not respecting the DBNAME
> argument. It assumes that you want to connect to a database named 'postgres'
> and ignores whatever argument you give it. The error returned is:
>
> dropdb: database removal failed: ERROR: database "postgres" does not exist
>
> The error is actually correct, because I do not have a database named
> postgres, but the command does not work correctly.


I think what is happening here is that dropdb is trying to connect to
the postgres database to issue the DROP DATABASE command, and fails
because it doesn't exist. I thought it was fixed not long ago to retry
by connecting to template1 if postgres didn't exist; maybe it wasn't
really done and I'm misremembering, or maybe you're using a version
without the fix (and thus you should upgrade).

The obvious workaround is to create a database named postgres.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:17 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com