Re: Locks on temp table and PREPARE
| От | Tom Lane |
|---|---|
| Тема | Re: Locks on temp table and PREPARE |
| Дата | |
| Msg-id | 18321.1243975010@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Locks on temp table and PREPARE (Emmanuel Cecchet <manu@frogthinker.org>) |
| Ответы |
Re: Locks on temp table and PREPARE
|
| Список | pgsql-hackers |
Emmanuel Cecchet <manu@frogthinker.org> writes:
> Take PG 8.3.0 and try:
> BEGIN;
> CREATE TEMP TABLE foo (x int) ON COMMIT DROP;
> PREPARE TRANSACTION 't1';
> [BEGIN;] <-- doesn't really matter if you start a new transaction or not
> CREATE TEMP TABLE foo (x int); <-- blocks until t1 commits
> I have been tracking down the problem and it looks like
> PostPrepare_Locks is holding the locks on 'foo' for some reason I don't
> really get.
AFAIK that doesn't really have anything to do with the temp-ness of the
table; it'd be the same with a regular table. The problem is you have
an in-doubt tuple in pg_class for pg_temp_NNN.foo, and you are trying
to create another one for the same schema/relname, and so the unique
index check is blocking to see what happens to the other transaction
that's creating/deleting the conflicting tuple.
regards, tom lane
В списке pgsql-hackers по дате отправления: