Title: Raise an error when a connection is used while a command is running · Issue #115 · PyGreSQL/PyGreSQL · GitHub
Open Graph Title: Raise an error when a connection is used while a command is running · Issue #115 · PyGreSQL/PyGreSQL
X Title: Raise an error when a connection is used while a command is running · Issue #115 · PyGreSQL/PyGreSQL
Description: When a connection is used again while one of its commands is still running, libpq is entered re-entrantly. This hangs or can crash instead of raising an error. For example, a notice receiver that is called during query() and uses the sam...
Open Graph Description: When a connection is used again while one of its commands is still running, libpq is entered re-entrantly. This hangs or can crash instead of raising an error. For example, a notice receiver that i...
X Description: When a connection is used again while one of its commands is still running, libpq is entered re-entrantly. This hangs or can crash instead of raising an error. For example, a notice receiver that i...
Opengraph URL: https://github.com/PyGreSQL/PyGreSQL/issues/115
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Raise an error when a connection is used while a command is running","articleBody":"When a connection is used again while one of its commands is still running, libpq is entered re-entrantly. This hangs or can crash instead of raising an error. For example, a notice receiver that is called during `query()` and uses the same connection:\n\n```python\nc.query('set client_min_messages=notice')\nc.set_notice_receiver(lambda notice: c.query('select 1'))\nc.query(\"do $$ begin raise notice 'test'; end $$\") # hangs\n```\n\nThe same can happen when another thread uses the connection while a command is running, e.g. `close()` during `query()`.\n\nFor asynchronous queries, the fix for #41 added guards that raise `pg.InterfaceError` in these situations. The same could be done for all commands with a busy flag on the connection, set while libpq is called with the GIL released (`PQexec`, `PQprepare`, `PQgetResult`, the COPY functions, large objects, etc.) and checked at the start of the connection methods and in `close()` and `reset()`.\n\nThis is much less than real thread safety on the connection level (#16, which would need locks), but it turns hangs and crashes into a clear error.\n","author":{"url":"https://github.com/Cito","@type":"Person","name":"Cito"},"datePublished":"2026-11-22T12:15:36Z","url":"https://github.com/PyGreSQL/PyGreSQL/issues/115"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f4b65d0f-aa96-b212-f1e3-44a397597448 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 82B2:1FA32B:B0C44:F6976:6B04631D |
| html-safe-nonce | 018a3ab2ed5d6fff9887cefc9c158874d68cbaf48f6fb431b7ce4b8e8ff7cf83 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MkIyOjFGQTMyQjpCMEM0NDpGNjk3Njo2QjA0NjMxRCIsInZpc2l0b3JfaWQiOiI3NDM1NTcxODgyODQ3NjU4NzgxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 15b53956c78cc68ff7af54d5e534c58964dfb53db7117b46db6703e802d6ce8f |
| hovercard-subject-tag | issue:6542246763 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PyGreSQL/PyGreSQL/115/issue_layout |
| twitter:image | https://opengraph.githubassets.com/483933ee9838ef6d3e6ac0c47036b5ed18f6b2329069926036465e9880f88844/PyGreSQL/PyGreSQL/issues/115 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/483933ee9838ef6d3e6ac0c47036b5ed18f6b2329069926036465e9880f88844/PyGreSQL/PyGreSQL/issues/115 |
| og:image:alt | When a connection is used again while one of its commands is still running, libpq is entered re-entrantly. This hangs or can crash instead of raising an error. For example, a notice receiver that i... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Cito |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2d58451b4bcb73c33c67bfb6b28fb75fe6d5e279daf9b560fa4fd832f3d8c9a6 |
| turbo-cache-control | no-preview |
| go-import | github.com/PyGreSQL/PyGreSQL git https://github.com/PyGreSQL/PyGreSQL.git |
| octolytics-dimension-user_id | 60857770 |
| octolytics-dimension-user_login | PyGreSQL |
| octolytics-dimension-repository_id | 51212044 |
| octolytics-dimension-repository_nwo | PyGreSQL/PyGreSQL |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 51212044 |
| octolytics-dimension-repository_network_root_nwo | PyGreSQL/PyGreSQL |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 03e114520787ad27289207f153520ef97461127c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width