dbcli / dbcli/pgcli

Cancelling query send does not cancel query

Ouverte
#1,607 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Python
Étoiles
13.4k
Forks
612
Merge moyen
6 j 14 h
PR mergées (30 j)
10

Description

I'd expect ctrl-c or ctrl-d that cancels a query in the foreground, to also cancel that query on the backend (the postgres server).

for example:

```sql
postgres> SELECT some_long_running_query();
^C^Ccancelled query
postgres> select 1;
sending query failed: another command is already in progress
Time: 0.004s
postgres>
A transaction is ongoing. Choose `c` to COMMIT, `r` to ROLLBACK, `a` to abort exit, `force` to exit anyway. [a]: a
postgres> select 1;
A transaction is ongoing. Choose `c` to COMMIT, `r` to ROLLBACK, `a` to abort exit, `force` to exit anyway. [a]: r
sending query failed: another command is already in progress
another command is already in progress
another command is already in progress
another command is already in progress
Time: 0.004s
```

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Reproduce the Ctrl-C or Ctrl-D sequence from the issue against a PostgreSQL server, then trace pgcli's foreground query cancellation and subsequent command handling. Done means cancelling the foreground query also cancels it on the backend, so a later `select 1;` does not fail with another command already in progress.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
postgresql, python
Domaine
cli, databases
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
Calme
Clarté
Plutôt claire
Accessibilité débutants
52/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.