Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I change the maintenance database for Postgres?

I'm running PostgreSQL version 9.0 on OSX version 10.6.6. Somehow one of my development databases has become the maintenance db, not postgres (this db also exists). I can't find any documentation on how to change/set the maintenance db back to postgres.

I can't drop my development database because of this issue...

like image 471
gsiener Avatar asked Apr 17 '11 19:04

gsiener


People also ask

What is maintenance database in PostgreSQL?

Log File Maintenance. PostgreSQL, like any database software, requires that certain tasks be performed regularly to achieve optimum performance. The tasks discussed here are required, but they are repetitive in nature and can easily be automated using standard tools such as cron scripts or Windows' Task Scheduler.

What is the name of the tool that is used to manage PostgreSQL database?

pgAdmin. pgAdmin is a tool that has been specifically designed for database management and has a GUI to manage (or administration) PostgreSQL databases. This also helps the developer to expedite PostgreSQL-specific debugging and analysis.

How do I change servers on pgAdmin?

Connecting To A Server¶ Use the fields on the Server dialog to define the connection properties for each new server that you wish to manage with pgAdmin. To open the Server dialog, right-click on the Servers node of the tree control, and select Server from the Register menu.

Do I need to vacuum postgres?

VACUUM reclaims storage occupied by dead tuples. In normal PostgreSQL operation, tuples that are deleted or obsoleted by an update are not physically removed from their table; they remain present until a VACUUM is done. Therefore it's necessary to do VACUUM periodically, especially on frequently-updated tables.


2 Answers

You can change maintenance db from pgAdmin but you have to be disconnected from the database engine to be able to do that.

First disconnect:

Then in the database server properties:

Choose the desired maintenance database:

like image 94
Răzvan Flavius Panda Avatar answered Sep 17 '22 15:09

Răzvan Flavius Panda


You're not entirely clear on this, but do you mean the "Maintenance DB" selection in pgAdmin III?

Select the server in your "object browser" pane; right click -> Properties

The fifth field is "Maintenance DB"

like image 32
intgr Avatar answered Sep 17 '22 15:09

intgr