Re: Allowing DML RULEs that produce Read Only actions during RO xacts - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Allowing DML RULEs that produce Read Only actions during RO xacts
Date
Msg-id 1260115758.13774.45417.camel@ebony
Whole thread Raw
In response to Re: Allowing DML RULEs that produce Read Only actions during RO xacts  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Sun, 2009-12-06 at 10:26 -0500, Tom Lane wrote:
> 
> > +     /*
> > +      * If we're running a SELECT, allow it. This ensures that a
> > +      * write rule such as ON INSERT DO SELECT can be executed in
> > +      * a read-only session.
> > +      */
> > +     if (plannedstmt->commandType == CMD_SELECT)
> > +             return;
> 
> This will fail, very nastily, in writable-CTE cases.

If the feature is not able to be added easily, then I'm not interested
either. It's a nice-to-have and I have no time for anything more, so if
it gives problems in other areas, I would not pursue further.

One question: would a writable-CTE be running in a read-only xact?

-- Simon Riggs           www.2ndQuadrant.com



pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Error message translation, with variable reason text
Next
From: Simon Riggs
Date:
Subject: Re: Hot standby, recent changes