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

From Tom Lane
Subject Re: read only transaction, temporary tables
Date
Msg-id 27778.1155395225@sss.pgh.pa.us
Whole thread Raw
In response to Re: read only transaction, temporary tables  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
Martijn van Oosterhout <kleptog@svana.org> writes:
> Temporary tables still get an entry in pg_class, so for truly readonly
> systems they wouldn't work.

The "READONLY" transaction status is a security mechanism, not a
performance-enhancing mechanism.  It makes no pretense of preventing
all disk writes.  I think a reasonable description of the feature
is that it's supposed to prevent you from making any database changes
that are visible to other transactions.

Having said that, though, the point about pg_class is a good one:
if you could create a temp table then you'd be making a catalog
change that would be visible to other transactions if they cared
to look.  So at some level or other I'd say it violates the concept
of READONLY.

(And having said *that*, I'd be all for avoiding making any permanent
catalog entries for temp tables, if I could think of a reasonably
noninvasive way to do it...)

            regards, tom lane

pgsql-general by date:

Previous
From: RPK
Date:
Subject: Migrating PostgreSQL database to MySQL/MS Access
Next
From: John Meyer
Date:
Subject: Re: Automatic Backup Script