Re: read only transaction, temporary tables

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-general(at)postgresql(dot)org, Richard Huxton <dev(at)archonet(dot)com>, "Carl R(dot) Brune" <brune(at)ohio(dot)edu>
Subject: Re: read only transaction, temporary tables
Date: 2006-08-12 15:07:05
Message-ID: 27778.1155395225@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Martijn van Oosterhout <kleptog(at)svana(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message RPK 2006-08-12 15:07:10 Automatic Backup Script
Previous Message Jorge Godoy 2006-08-12 13:55:23 Re: Best approach for a "gap-less" sequence