PostgreSQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesPostgreSQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 1st, 2003, 05:33 PM
pablo.gosse pablo.gosse is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Posts: 155 pablo.gosse User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 6 m 5 sec
Reputation Power: 11
PostgreSQL Books and how to manually close connections to Postgres

Hi all. I'm wondering how I can go about closing postgresql connections manually via the command line, or if this is something which should generally not be approached, given that I'm using persistent connections.

Here's the reason for my question:

I've got four applications which hit different databases on the same server, and last night I wanted to drop one of those databases but I was unable to do so as I kept getting an error message which told me there was still a user connected the database.

Now, the database I was trying to drop is used by an application which is in the development stage, which means I am the ONLY person using it.

So when I ran the following command:

ps auxww | grep ^postgres

I got a list of all active postgresql connections, and sure enough there was one connection to the database I wanted to drop, and it was over a day old.

I'm using persistent connections, so I guess I'm looking for two things here:

1) how long persistent connections are kept in the connection pool after they are idle, and

2) how I might go about manually terminating said connection so I may drop the database again if need be?

Also, I've recently been informed that I'm the only person who uses PostgreSQL where I work, and my server administrator is asking that I start to do more of the PostgreSQL administration myself. I have absolutely no problem with this, and am quite excited about the whole process, but I'm going to have to seriously bump up my knowledge of *nix and PostgreSQL.

Can any of the hardened PostgreSQL gurus on this list recommend some good *nix and PostgreSQL books which I could use as learning tools?

Thanks very much in advance,
Pablo

Reply With Quote
  #2  
Old May 1st, 2003, 08:00 PM
a.koepke's Avatar
a.koepke a.koepke is offline
Second highest poster :p
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Jul 2001
Posts: 7,322 a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 8 h 13 m 55 sec
Reputation Power: 31
you can stop the PostgreSQL server and it will drop all connections, then you can start it up again and drop the database
__________________
- Andreas Koepke

Koepke Photography


Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesPostgreSQL Help > PostgreSQL Books and how to manually close connections to Postgres

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap