Re: read only transaction, temporary tables - Mailing list pgsql-general

From Carl R. Brune
Subject Re: read only transaction, temporary tables
Date
Msg-id Pine.LNX.4.61.0608082239010.9372@cerastes.phy.ohiou.edu
Whole thread Raw
In response to Re: read only transaction, temporary tables  (John DeSoi <desoi@pgedit.com>)
Responses Re: read only transaction, temporary tables  (Richard Huxton <dev@archonet.com>)
Re: read only transaction, temporary tables  ("Carl R. Brune" <brune@ohio.edu>)
List pgsql-general
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
>

pgsql-general by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: DROP TABLESPACE fails
Next
From: Martijn van Oosterhout
Date:
Subject: Re: clients and libs and versions (oh my)