pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedHow does PG know when a database is being accessed
5+ messages / 4 participants
[nested] [flat]
* How does PG know when a database is being accessed
@ 2003-04-08 13:56 Nick Fankhauser - Doxpop <nickf@doxpop.com>
0 siblings, 0 replies; 5+ messages in thread
From: Nick Fankhauser - Doxpop @ 2003-04-08 13:56 UTC (permalink / raw)
To: pgsql-admin
Hi-
This is a problem I've observed on version 7.2.1.
I've been doing some setup work that involves dropping & recreating
databases a couple of times and I've noticed that once in a while, I'll get
the "database is being accessed by other users" message, even after
restarting the postmaster. This of course prevents me from dropping the DB.
I'd expect to get this if I've killed a client connection and the postmaster
hasn't had time to notice that the connection is defunct, but I was
surprised that restarting the postmaster didn't clear out the connections.
A couple of hours later, I can drop the database with no problem, and I
haven't done anything in the meantime, so I presume that a cleanup process
has run & tidied things up.
How are connections tracked & why does a record of a defunct client process
seem to persist through a restart?
Thanks
-Nick
---------------------------------------------------------------------
Nick Fankhauser
nickf@doxpop.com Phone 1.765.965.7363 Fax 1.765.962.9788
doxpop - Court records at your fingertips - http://www.doxpop.com/
^ permalink raw reply [nested|flat] 5+ messages in thread
* How does PG know when a database is being accessed ?
@ 2003-04-08 14:23 Nick Fankhauser <nickf@ontko.com>
0 siblings, 1 reply; 5+ messages in thread
From: Nick Fankhauser @ 2003-04-08 14:23 UTC (permalink / raw)
To: pgsql-admin
Hi-
This is a problem I've observed on version 7.2.1.
I've been doing some setup work that involves dropping & recreating
databases a couple of times and I've noticed that once in a while, I'll get
the "database is being accessed by other users" message, even after
restarting the postmaster. This of course prevents me from dropping the DB.
I'd expect to get this if I've killed a client connection and the postmaster
hasn't had time to notice that the connection is defunct, but I was
surprised that restarting the postmaster didn't clear out the connections.
A couple of hours later, I can drop the database with no problem, and I
haven't done anything in the meantime, so I presume that a cleanup process
has run & tidied things up.
How are connections tracked & why does a record of a defunct client process
seem to persist through a restart?
Thanks
-Nick
---------------------------------------------------------------------
Nick Fankhauser
nickf@doxpop.com Phone 1.765.965.7363 Fax 1.765.962.9788
doxpop - Court records at your fingertips - http://www.doxpop.com/
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: How does PG know when a database is being accessed ?
@ 2003-04-08 14:50 Tom Lane <tgl@sss.pgh.pa.us>
parent: Nick Fankhauser <nickf@ontko.com>
0 siblings, 1 reply; 5+ messages in thread
From: Tom Lane @ 2003-04-08 14:50 UTC (permalink / raw)
To: nickf@ontko.com; +Cc: pgsql-admin
"Nick Fankhauser" <nickf@ontko.com> writes:
> I'd expect to get this if I've killed a client connection and the postmaster
> hasn't had time to notice that the connection is defunct, but I was
> surprised that restarting the postmaster didn't clear out the connections.
It most certainly does. You sure you don't have new connections coming
in all the time?
regards, tom lane
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: How does PG know when a database is being accessed ?
@ 2003-04-08 14:54 Nick Fankhauser <nickf@ontko.com>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 5+ messages in thread
From: Nick Fankhauser @ 2003-04-08 14:54 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-admin
> It most certainly does. You sure you don't have new connections coming
> in all the time?
Pretty sure- That was my first thought as well, so I checked for stray
processes. I'm in the middle of something else right now, but this evening
I'll see if I can reproduce the problem and supply the details.
-Nick
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: How does PG know when a database is being accessed ?
@ 2003-04-18 19:07 Andrew Biagioni <andrew.biagioni@e-greek.net>
parent: Nick Fankhauser <nickf@ontko.com>
0 siblings, 0 replies; 5+ messages in thread
From: Andrew Biagioni @ 2003-04-18 19:07 UTC (permalink / raw)
To: nickf@ontko.com; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-admin
Nick Fankhauser wrote:
>>It most certainly does. You sure you don't have new connections coming
>>in all the time?
>>
>>
>
>Pretty sure- That was my first thought as well, so I checked for stray
>processes. I'm in the middle of something else right now, but this evening
>I'll see if I can reproduce the problem and supply the details.
>
>-Nick
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 5: Have you checked our extensive FAQ?
>
>http://www.postgresql.org/docs/faqs/FAQ.html
>
>
What happens to me occasionally, is that I open pgAdminII and (in some
versions and/or configurations) that opens all the DBs and delete-locks
them. Other times I connect via psql (on a linux box) to the actual DB
I'm trying to drop.
In other words, I found that often I'm the culprit myself. I now check
regularly by executing:
$ ps auxwww | grep "^postgres" | grep -v grep | grep [database name]
and that shows me who is connected to the DB.
Andrew
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2003-04-18 19:07 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-04-08 13:56 How does PG know when a database is being accessed Nick Fankhauser - Doxpop <nickf@doxpop.com>
2003-04-08 14:23 How does PG know when a database is being accessed ? Nick Fankhauser <nickf@ontko.com>
2003-04-08 14:50 ` Re: How does PG know when a database is being accessed ? Tom Lane <tgl@sss.pgh.pa.us>
2003-04-08 14:54 ` Re: How does PG know when a database is being accessed ? Nick Fankhauser <nickf@ontko.com>
2003-04-18 19:07 ` Re: How does PG know when a database is being accessed ? Andrew Biagioni <andrew.biagioni@e-greek.net>
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