Re: read only transaction, temporary tables

From: John DeSoi <desoi(at)pgedit(dot)com>
To: Carl R(dot) Brune <brune(at)ohio(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: read only transaction, temporary tables
Date: 2006-08-08 20:29:06
Message-ID: 43679C8F-75C0-4674-A940-B66DE8AD5A0A@pgedit.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-08-08 20:29:32 Re: DISTINCT to get distinct *substrings*?
Previous Message Tom Lane 2006-08-08 20:18:13 Re: restoring a backup, incompatible with server