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 (leland123, rycamor, I'm looking at you ;o) recommend some good *nix and PostgreSQL books which I could use as learning tools?
Thanks very much in advance,
Pablo
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 (leland123, rycamor, I'm looking at you ;o) recommend some good *nix and PostgreSQL books which I could use as learning tools?
Thanks very much in advance,
Pablo