Skip site navigation (1) Skip section navigation (2)

Re: can't get connection during pg_dump

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Steve Linabery <slinabery(at)worldcycling(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: can't get connection during pg_dump
Date: 2006-03-30 17:17:11
Message-ID: 15977.1143739031@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-adminpgsql-hackers
Steve Linabery <slinabery(at)worldcycling(dot)com> writes:
> I just replicated the problem, see below for explanation, but here is ps output:

> postgres 25817  3201 55 10:20 ?        00:02:54 postgres: postgres db_being_dumped [local] COPY               
> postgres 27956  3201 46 10:24 ?        00:00:36 postgres: postgres db_being_dumped [local] COPY               
> postgres 28124  3201  0 10:25 ?        00:00:00 postgres: dbusername template1 obfus.ip.address.36(49528) DROP DATABASE waiting
> postgres 28180  3201  0 10:25 ?        00:00:00 postgres: dbusername db_being_dumped obfus.ip.address.37(48997) startup waiting
> postgres 28183  3201  0 10:25 ?        00:00:00 postgres: dbusername db_being_dumped obfus.ip.address.36(49532) startup waiting

Hm.  DROP DATABASE takes ExclusiveLock on pg_database, which blocks new
incoming connections, and both of those things are intentional (part of
the point of the lock is to block new connections to the victim
database, so it's hard to see how we could avoid this).

What doesn't seem so essential though is for pg_dump to be holding a
conflicting lock on pg_database.  In fact, a plain AccessShareLock
wouldn't block DROP DATABASE, so I'm not entirely sure that pg_dump
is at fault.  Could we see the contents of pg_locks for this situation?

			regards, tom lane

In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2006-03-30 17:25:32
Subject: Re: pg_class catalog question...
Previous:From: Heikki LinnakangasDate: 2006-03-30 16:51:03
Subject: Re: Index vacuum improvements

pgsql-admin by date

Next:From: lmyhoDate: 2006-03-30 17:27:50
Subject: Re: Postgresql server does not start!:( -Re: PostgreSQl newbie!
Previous:From: Scott MarloweDate: 2006-03-30 17:12:59
Subject: Re: Postgresql server does not start!:( -Re: PostgreSQl

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group