Re: Transactions and temp tables

Поиск
Список
Период
Сортировка
От Emmanuel Cecchet
Тема Re: Transactions and temp tables
Дата
Msg-id 4936DC8D.6070100@frogthinker.org
обсуждение исходный текст
Ответ на Re: Transactions and temp tables  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Список pgsql-hackers
I would really like to have support for temp tables at least for the 
case where the table is created and dropped in the same transaction. But 
I guess that the other limitations on index, sequences and views would 
still hold, right?

manu

Heikki Linnakangas wrote:
> Emmanuel Cecchet wrote:
>> There is a problem with temp tables with on delete rows that are 
>> created inside a transaction.
>> Take the 2pc_on_delete_rows_transaction.sql test case and change the 
>> creation statement, instead of
>> create temp table foo(x int) on commit delete rows;
>> try
>> create temp table foo(x serial primary key) on commit delete rows;
>>
>> The test will fail. It looks like the onCommit field is not properly 
>> updated when serial or primary key is used in that context. I did not 
>> figure out why.
> A serial column uses a sequence behind the scenes.
>
> Hmm. Seems like we would need to treat sequences and indexes the same 
> as tables with ON COMMIT DELETE ROWS, i.e release the locks early and 
> don't error out.
>
> All in all, this is getting pretty messy. My patch felt a bit hackish 
> to begin with, and having to add special cases for sequences and 
> indexes would make it even more so. And what about temporary views? 
> I'm starting to feel that instead of special-casing temp relations, we 
> need to move into the opposite direction and make temp relations more 
> like regular relations. Unfortunately, that's not going to happen in 
> the 8.4 timeframe :-(. Let's try the other approach in 8.5.
>


-- 
Emmanuel Cecchet
FTO @ Frog Thinker 
Open Source Development & Consulting
--
Web: http://www.frogthinker.org
email: manu@frogthinker.org
Skype: emmanuel_cecchet



В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Simple postgresql.conf wizard
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: snapshot leak and core dump with serializable transactions