Re: Postgres problem with partition queries - Mailing list pgsql-admin

From Tom Lane
Subject Re: Postgres problem with partition queries
Date
Msg-id 15222.1291214106@sss.pgh.pa.us
Whole thread Raw
In response to Postgres problem with partition queries  (bakkiya <bakkiya@gmail.com>)
List pgsql-admin
bakkiya <bakkiya@gmail.com> writes:
> We are having a partition table and we are querying some rows in the
> partition.
> select * from events where
>      events.evt_time >= '2010-11-29 00:00:00'
>     AND events.evt_time <= '2010-11-30 23:59:59'
> While this query is in running state, I am issuing a drop statement on a
> partition of this table.
> [ and it blocks ]

This is hardly surprising.  A query on the inheritance tree has to
take AccessShare lock on every member table, because it has to inspect
each table to determine whether it should scan it.  So it's going to
conflict with the exclusive lock needed to drop one of the tables.
That means first that the DROP gets blocked by a pre-existing query,
and second that the waiting DROP also blocks other queries of the same
kind.

            regards, tom lane

pgsql-admin by date:

Previous
From: bakkiya
Date:
Subject: Postgres problem with partition queries
Next
From: "Kevin Grittner"
Date:
Subject: Re: Best Linux filesystem for Postgres data store ?