Re: Error on failed COMMIT - Mailing list pgsql-hackers

From Vladimir Sitnikov
Subject Re: Error on failed COMMIT
Date
Msg-id CAB=Je-EX8T2jmPS7J9PFcirXAP+XuvaEsRfKrtS-WxMx43OCKA@mail.gmail.com
Whole thread Raw
In response to Re: Error on failed COMMIT  (Laurenz Albe <laurenz.albe@cybertec.at>)
Responses Re: Error on failed COMMIT  (Robert Haas <robertmhaas@gmail.com>)
List 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

pgsql-hackers by date:

Previous
From: Julien Rouhaud
Date:
Subject: Re: Allow auto_explain to log plans before queries are executed
Next
From: ilmari@ilmari.org (Dagfinn Ilmari Mannsåker)
Date:
Subject: Re: [PATCH] pg_upgrade: report the reason for failing to open the cluster version file