| From: | Greg Smith <greg(at)2ndquadrant(dot)com> | 
|---|---|
| To: | Joao Ferreira gmail <joao(dot)miguel(dot)c(dot)ferreira(at)gmail(dot)com> | 
| Cc: | pgsql-general(at)postgresql(dot)org | 
| Subject: | Re: safelly erasing dirs/files | 
| Date: | 2009-11-14 19:38:51 | 
| Message-ID: | 4AFF074B.1090105@2ndquadrant.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | 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(at)2ndQuadrant(dot)com  www.2ndQuadrant.com
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Joao Ferreira gmail | 2009-11-14 19:42:50 | Re: safelly erasing dirs/files | 
| Previous Message | Bill Moran | 2009-11-14 19:35:21 | Re: safelly erasing dirs/files |