jakob / jakob/Postico

Executing multiple statements shouldn't stop on error

Open
#174 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
485
Forks
8
PR merge metrics
No merged PRs in 30d

Description

It seems when executing multiple statements and one of them encounters an error, the remaining statements are not executed. I believe the default behaviour should be that all statements are executed regardless of any errors.

That is how psql treats its input by default (could be changed by ON_ERROR_STOP parameter). The same does phpPgAdmin when executing a query. Adminer has an option "Stop on error", which is disabled by default.

I got caught up by this recently when I was running series of database queries which were wrapped in a transaction block (BEGIN; .... COMMIT;). An error in one of the queries stopped execution so the final COMMIT statement was't reached and the database wasn't rolled back into the pre-transaction state. Furthermore, being in the middle of failed transaction causes any Postico operations to fail until COMMIT is explicitly executed.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the Postico code path that executes multiple statements and handles statement errors, then inspect how transaction blocks are submitted. Compare the current behavior with the requested default of continuing after an error, including the BEGIN/COMMIT example. Done means remaining statements execute and the behavior is covered by an appropriate test.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, python
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.