Re: Transactions and temp tables

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Emmanuel Cecchet <manu(at)frogthinker(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Transactions and temp tables
Date: 2008-11-17 19:21:14
Message-ID: 4921C42A.3030600@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Emmanuel Cecchet wrote:
> As I have not found yet an elegant solution to deal with the DROP
> CASCADE issue, here is a simpler patch that handles temp tables that are
> dropped at commit time. This is a good first step and we will try to
> elaborate further to support ON COMMIT DELETE ROWS.

The problem with stopping the postmaster seems to still be there..

All the problems are centered around locking. We need to address that
and decide what is sane locking behavior wrt. temp tables and 2PC.

First, there's the case where a temp table is created and dropped in the
same transaction. It seems perfectly sane to me to simply drop all locks
on the dropped table at PREPARE TRANSACTION. Does anyone see a problem
with that? If not, we might as well do that for all tables, not just
temporary ones. It seems just as safe for non-temporary tables.

Secondly, there's the case of accessing a ON COMMIT DELETE ROWS table.
There too, could we simply drop the locks at PREPARE TRANSACTION? I
can't immediately see anything wrong with that.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Merlin Moncure 2008-11-17 19:24:46 Re: Compiling on HP-UX 10.20 fails
Previous Message Zdenek Kotala 2008-11-17 19:05:27 Re: PG_PAGE_LAYOUT_VERSION 5 - time for change