From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Stephen Frost <sfrost(at)snowman(dot)net>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: our checks for read-only queries are not great |
Date: | 2020-01-09 20:37:23 |
Message-ID: | CA+TgmoZRWLmv4jwz6+peq-N-a87ddFouERxGTHGBW-QU_xb2nA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Thu, Jan 9, 2020 at 3:07 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> > Maybe the SQL standard has something to say about this?
>
> [ pokes around ... ] Yeah, it does, and I'd say it's pretty clearly
> in agreement with what Peter did, so far as DML ops go. For instance,
> this bit from SQL99's description of DELETE:
>
> 1) If the access mode of the current SQL-transaction or the access
> mode of the branch of the current SQL-transaction at the current
> SQL-connection is read-only, and T is not a temporary table,
> then an exception condition is raised: invalid transaction state
> - read-only SQL-transaction.
>
> UPDATE and INSERT say the same. (I didn't look at later spec versions,
> since Peter's 2003 commit was probably based on SQL99.)
OK. That's good to know.
> You could argue about exactly how to extend that to non-spec
> utility commands, but for the most part allowing them seems
> to make sense if DML is allowed.
But I think we allow them on all tables, not just temp tables, so I
don't think I understand this argument.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
From | Date | Subject | |
---|---|---|---|
Next Message | Robert Haas | 2020-01-09 20:38:50 | Re: our checks for read-only queries are not great |
Previous Message | Robert Haas | 2020-01-09 20:35:23 | Re: Removing pg_pltemplate and creating "trustable" extensions |