Re: safelly erasing dirs/files - Mailing list pgsql-general

From Greg Smith
Subject Re: safelly erasing dirs/files
Date
Msg-id 4AFF074B.1090105@2ndquadrant.com
Whole thread Raw
In response to safelly erasing dirs/files  (Joao Ferreira gmail <joao.miguel.c.ferreira@gmail.com>)
List pgsql-general
Joao Ferreira gmail wrote:
> How can I safelly erase (with rm command in Linux) files or dirs
> concerning a specific database ?
>
You can't do it with rm; you need to execute the SQL "drop" command
somehow to clean up all the references to that database.  If you want to
remove a database from the command line, there's a wrapper script named
dropdb you can use to do that:

http://www.postgresql.org/docs/current/static/app-dropdb.html

Note that removing a database will require connecting to the server as a
superuser or owner of the database.  If you want to do that in a script,
you might need to setup a .pgpass file:
http://www.postgresql.org/docs/current/static/libpq-pgpass.html

--
Greg Smith    2ndQuadrant   Baltimore, MD
PostgreSQL Training, Services and Support
greg@2ndQuadrant.com  www.2ndQuadrant.com


pgsql-general by date:

Previous
From: Bill Moran
Date:
Subject: Re: safelly erasing dirs/files
Next
From: Joao Ferreira gmail
Date:
Subject: Re: safelly erasing dirs/files