Re: read only transaction, temporary tables

From: "Carl R(dot) Brune" <brune(at)ohio(dot)edu>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: read only transaction, temporary tables
Date: 2006-08-10 14:15:38
Message-ID: Pine.LNX.4.61.0608101015240.14670@cerastes.phy.ohiou.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks for the information clarifications.

Carl B.

On Tue, 8 Aug 2006, Carl R. Brune wrote:

> I should have added that I want to make further use of the temporary
> table after the COMMIT -- the rollback approach you propose makes it
> go away.
>
> Carl Brune
>
> On Tue, 8 Aug 2006, John DeSoi wrote:
>
>>
>> On Aug 8, 2006, at 1:25 PM, Carl R. Brune wrote:
>>
>>> I recently tried to do something like the following
>>>
>>> BEGIN READONLY;
>>> ...
>>> CREATE TEMPORARY TABLE ABC AS SELECT ...
>>> ...
>>> COMMIT;
>>>
>>> and it failed because CREATE is not allowed within a read-only
>>> transaction. The select is something long and complicated (pieced
>>> together with php) and I'm just trying to be careful. What other
>>> alternatives are there for accomplishing this? Preferably
>>> simple ones...
>>
>>
>> How about:
>>
>> BEGIN;
>> ....
>> CREATE TEMPORARY TABLE ABC AS SELECT ...
>> ....
>> ROLLBACK;
>>
>>
>>
>> John DeSoi, Ph.D.
>> http://pgedit.com/
>> Power Tools for PostgreSQL
>>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2006-08-10 14:26:11 Re: Tuning to speed select
Previous Message Nicolas.PAYART 2006-08-10 13:45:29 Setting Slony on a large production database