pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedClosing all existing PostgreSQL database connections
2+ messages / 2 participants
[nested] [flat]
* Closing all existing PostgreSQL database connections
@ 2007-05-07 07:10 Norbert Radyk <fragiel@wp.pl>
0 siblings, 1 reply; 2+ messages in thread
From: Norbert Radyk @ 2007-05-07 07:10 UTC (permalink / raw)
To: pgsql-jdbc
Hi,
I've got a question about PostgreSQL JDBC API. Is there any way to
close all existing & open connections to the particular database. I
mean the connections made by some external programs too.
I simply need to drop the database to which there are some open
external connections. I cannot get the java.sql.Connection object in
order to close the connection, but maybe there is some other way to do
this?
Regards, Norbert
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Closing all existing PostgreSQL database connections
@ 2007-05-07 10:32 Heikki Linnakangas <heikki@enterprisedb.com>
parent: Norbert Radyk <fragiel@wp.pl>
0 siblings, 0 replies; 2+ messages in thread
From: Heikki Linnakangas @ 2007-05-07 10:32 UTC (permalink / raw)
To: Norbert Radyk <fragiel@wp.pl>; +Cc: pgsql-jdbc
Norbert Radyk wrote:
> I've got a question about PostgreSQL JDBC API. Is there any way to
> close all existing & open connections to the particular database. I
> mean the connections made by some external programs too.
>
> I simply need to drop the database to which there are some open
> external connections. I cannot get the java.sql.Connection object in
> order to close the connection, but maybe there is some other way to do
> this?
Unfortunately there's no supported way to terminate individual backends.
From command line, you can use "kill" to do that, but it's not a very
well-tested codepath and it's not officially supported. IOW, not
recommended on production servers.
There's also a tool called "cutter", which let's you terminate any
TCP/IP connection: http://www.lowth.com/cutter/. I've never used that
myself, but it seems like a safe option.
The easiest option is to just restart postmaster.
--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2007-05-07 10:32 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-05-07 07:10 Closing all existing PostgreSQL database connections Norbert Radyk <fragiel@wp.pl>
2007-05-07 10:32 ` Heikki Linnakangas <heikki@enterprisedb.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox