shut down one database?

Started by Ottavio Campanaalmost 19 years ago7 messagesgeneral
Jump to latest
#1Ottavio Campana
ottavio@campana.vi.it

I have postgresql running several databases. I can stop them all by
stopping postgresql, but sometimes I'd like to shut down a single database.

Can I get the same effect of stopping postgresql for only one database?

--
Non c'e' piu' forza nella normalita', c'e' solo monotonia.

#2Bill Moran
wmoran@potentialtech.com
In reply to: Ottavio Campana (#1)
Re: shut down one database?

Ottavio Campana <ottavio@campana.vi.it> wrote:

I have postgresql running several databases. I can stop them all by
stopping postgresql, but sometimes I'd like to shut down a single database.

Can I get the same effect of stopping postgresql for only one database?

You can tweak pg_hba.conf to disallow all access to that particular
database. Will that accomplish what you want?

--
Bill Moran
http://www.potentialtech.com

#3Ottavio Campana
ottavio@campana.vi.it
In reply to: Bill Moran (#2)
Re: shut down one database?

Bill Moran wrote:

Ottavio Campana <ottavio@campana.vi.it> wrote:

I have postgresql running several databases. I can stop them all by
stopping postgresql, but sometimes I'd like to shut down a single database.

Can I get the same effect of stopping postgresql for only one database?

You can tweak pg_hba.conf to disallow all access to that particular
database. Will that accomplish what you want?

well, that would be only a part: I'd also like to stop all the processes
related to that db. Sometimes I have some connection I'd like to close...

--
Non c'e' piu' forza nella normalita', c'e' solo monotonia.

#4Joshua D. Drake
jd@commandprompt.com
In reply to: Ottavio Campana (#3)
Re: shut down one database?

Ottavio Campana wrote:

Bill Moran wrote:

Ottavio Campana <ottavio@campana.vi.it> wrote:

I have postgresql running several databases. I can stop them all by
stopping postgresql, but sometimes I'd like to shut down a single database.

Can I get the same effect of stopping postgresql for only one database?

You can tweak pg_hba.conf to disallow all access to that particular
database. Will that accomplish what you want?

well, that would be only a part: I'd also like to stop all the processes
related to that db. Sometimes I have some connection I'd like to close...

set datallowconn to false in pg_database;

--

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/

#5Ottavio Campana
ottavio@campana.vi.it
In reply to: Joshua D. Drake (#4)
Re: shut down one database?

Joshua D. Drake wrote:

Ottavio Campana wrote:

Bill Moran wrote:

Ottavio Campana <ottavio@campana.vi.it> wrote:

I have postgresql running several databases. I can stop them all by
stopping postgresql, but sometimes I'd like to shut down a single
database.

Can I get the same effect of stopping postgresql for only one database?

You can tweak pg_hba.conf to disallow all access to that particular
database. Will that accomplish what you want?

well, that would be only a part: I'd also like to stop all the processes
related to that db. Sometimes I have some connection I'd like to close...

set datallowconn to false in pg_database;

does it shut down the already existing ones?

--
Non c'e' piu' forza nella normalita', c'e' solo monotonia.

#6Joshua D. Drake
jd@commandprompt.com
In reply to: Ottavio Campana (#5)
Re: shut down one database?

Ottavio Campana wrote:

Joshua D. Drake wrote:

Ottavio Campana wrote:

Bill Moran wrote:

Ottavio Campana <ottavio@campana.vi.it> wrote:

I have postgresql running several databases. I can stop them all by
stopping postgresql, but sometimes I'd like to shut down a single
database.

Can I get the same effect of stopping postgresql for only one database?

You can tweak pg_hba.conf to disallow all access to that particular
database. Will that accomplish what you want?

well, that would be only a part: I'd also like to stop all the processes
related to that db. Sometimes I have some connection I'd like to close...

set datallowconn to false in pg_database;

does it shut down the already existing ones?

It will disallow all connections to whatever database you specify.

--

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/

#7Erik Jones
erik@myemma.com
In reply to: Ottavio Campana (#5)
Re: shut down one database?

On May 31, 2007, at 9:13 PM, Ottavio Campana wrote:

Joshua D. Drake wrote:

Ottavio Campana wrote:

Bill Moran wrote:

Ottavio Campana <ottavio@campana.vi.it> wrote:

I have postgresql running several databases. I can stop them
all by
stopping postgresql, but sometimes I'd like to shut down a single
database.

Can I get the same effect of stopping postgresql for only one
database?

You can tweak pg_hba.conf to disallow all access to that particular
database. Will that accomplish what you want?

well, that would be only a part: I'd also like to stop all the
processes
related to that db. Sometimes I have some connection I'd like to
close...

set datallowconn to false in pg_database;

does it shut down the already existing ones?

No, it does not kill already existing connections to the given database.

Erik Jones

Software Developer | Emma®
erik@myemma.com
800.595.4401 or 615.292.5888
615.292.0777 (fax)

Emma helps organizations everywhere communicate & market in style.
Visit us online at http://www.myemma.com