You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In postgres and some others, EXPLAIN ANALYZE executes the query it's explaining, which might itself not be a read query. For example:
EXPLAIN ANALYZE DELETEFROM abc;
...will actually delete from the table, but sqlparser classifies it as OtherRead rather than Delete. It's possible this is intentional, as EXPLAIN ANALYZE results in an explanation meant to be read, but it's also unintuitive here, since the underlying query is not a read operation. In the above, not even walking the tree exposes the DELETE part.
I would like a way to verify read-only SELECTs, DESCRIBEs and non-mutating EXPLAINs, but I don't think I can do that simply with a type switch, as OtherRead won't capture the mutating EXPLAIN ANALYZE case.
The text was updated successfully, but these errors were encountered:
In postgres and some others,
EXPLAIN ANALYZE
executes the query it's explaining, which might itself not be a read query. For example:...will actually delete from the table, but sqlparser classifies it as
OtherRead
rather thanDelete
. It's possible this is intentional, asEXPLAIN ANALYZE
results in an explanation meant to be read, but it's also unintuitive here, since the underlying query is not a read operation. In the above, not even walking the tree exposes theDELETE
part.I would like a way to verify read-only
SELECT
s,DESCRIBE
s and non-mutatingEXPLAIN
s, but I don't think I can do that simply with a type switch, asOtherRead
won't capture the mutatingEXPLAIN ANALYZE
case.The text was updated successfully, but these errors were encountered: