Re: Error on failed COMMIT

From: Vladimir Sitnikov <sitnikov(dot)vladimir(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Dave Cramer <davecramer(at)postgres(dot)rocks>, Shay Rojansky <roji(at)roji(dot)org>, "Haumacher, Bernhard" <haui(at)haumacher(dot)de>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Subject: Re: Error on failed COMMIT
Date: 2020-02-26 18:23:25
Message-ID: CAB=Je-EX8T2jmPS7J9PFcirXAP+XuvaEsRfKrtS-WxMx43OCKA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Just one more data point: drivers do allow users to execute queries in a
free form.
Shat is the user might execute /*comment*/commit/*comment*/ as a free-form
SQL, and they would expect that the resulting
behaviour should be exactly the same as .commit() API call (==silent
rollback is converted to an exception).

That is drivers can add extra logic into .commit() API implementation,
however, turning free-form SQL into exceptions
is hard to do consistently from the driver side.
It is not like "check the response from .commit() result".
It is more like "don't forget to parse user-provided SQL and verify if it
is semantically equivalent to commit"

Pushing full SQL parser to the driver is not the best idea taking into the
account the extensibility the core has.

Vladimir

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dagfinn Ilmari Mannsåker 2020-02-26 18:32:00 Re: [PATCH] pg_upgrade: report the reason for failing to open the cluster version file
Previous Message Julien Rouhaud 2020-02-26 17:51:21 Re: Allow auto_explain to log plans before queries are executed