Re: Allowing DML RULEs that produce Read Only actions during RO xacts

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Allowing DML RULEs that produce Read Only actions during RO xacts
Date: 2009-12-06 16:09:18
Message-ID: 1260115758.13774.45417.camel@ebony
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2009-12-06 16:18:55 Re: Hot standby, recent changes
Previous Message Simon Riggs 2009-12-06 16:05:38 Error message translation, with variable reason text