Re: CLUSTER, REINDEX, VACUUM in "read only" transaction? - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: CLUSTER, REINDEX, VACUUM in "read only" transaction?
Date
Msg-id 48F4C648.6010100@gmx.net
Whole thread Raw
In response to CLUSTER, REINDEX, VACUUM in "read only" transaction?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: CLUSTER, REINDEX, VACUUM in "read only" transaction?
List pgsql-hackers
Tom Lane wrote:
> So I was looking for other omissions in utility.c, and I noticed that
> check_xact_readonly() doesn't reject CLUSTER, REINDEX, or VACUUM.
> Now the notion of "read only" that we're trying to enforce is pretty
> weak (I think it's effectively "no writes to non-temp tables").
> But I can't see that CLUSTER is a read-only operation even under the
> weakest definitions, and I'm not seeing the rationale for REINDEX or
> VACUUM here either.

I think the way the SQL standard meant the read-only flag is that the 
transaction doesn't change the structure of or the data in the database 
as seen by the next guy.  So all of these commands are OK, I think.

A theoretical use case is that you should be able to do the maximum set 
of useful work in read-only mode on a Slony-I slave.  No I haven't 
checked what Slony does with these three commands, so let me have it. :-)

Other definitions might be OK, but I can't see one offhand that is based 
on the current behavior but disallows these three commands.  "No disk 
writes" or "no big locks" is probably not what the SQL standard meant.


pgsql-hackers by date:

Previous
From: "Dave Page"
Date:
Subject: Re: 8.3 .4 + Vista + MingW + initdb = ACCESS_DENIED
Next
From: Hannu Krosing
Date:
Subject: Re: Window Functions