Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
Facebook
Downloads
Home
>
mailing lists
python async with psycopg2 - Mailing list pgsql-general
From
Rita
Subject
python async with psycopg2
Date
July 17, 2020
22:44:26
Msg-id
CAOF-Kfh1P9eanS0hecw_E9Awdsmn3b4uYpnV5SdL8Xz31U2rBw@mail.gmail.com
Whole thread
Raw
Responses
Re: python async with psycopg2
List
pgsql-general
Tree view
I am trying to listen to multiple channels thru pg_notify mechanism.
select pg_notify('mychan0',foo');
select pg_notify('mychan'1,'bar');
In python I have something like this
import select,time
import psycopg2
import psycopg2.extensions
from psycopg2.extras import wait_select
DSN="dbname=mydb user=user host=localhost"
def main():
conn = psycopg2.connect(DSN,async_=True)
wait_select(conn)
curs = conn.cursor()
curs.execute("LISTEN mychan0;")
#curs.execute("LISTEN mychan1;") #fails!
wait_select(conn)
while True:
wait_select(conn)
while conn.notifies:
print("Notify: %s"%conn.notifies.pop().payload)
time.sleep(1)
conn.close()
I keep getting
psycopg2.ProgrammingError: execute cannot be used while an asynchronous query is underway
I prefer to stick with psycopg2 library instead of a wrapper.
What am I doing wrong?
--
---
Get your facts first, then you can distort them as you please.
--
pgsql-general
by date:
Previous
From:
Ailleen Pace
Date:
17 July 2020, 22:08:09
Subject:
DB Authentication with Label Security
Next
From:
Daniele Varrazzo
Date:
17 July 2020, 23:07:26
Subject:
Re: python async with psycopg2
Есть вопросы? Напишите нам!
Соглашаюсь с условиями обработки персональных данных
I confirm that I have read and accepted PostgresPro’s
Privacy Policy
.
I agree to get Postgres Pro discount offers and other marketing communications.
✖
×
×
Everywhere
Documentation
Mailing list
List:
all lists
pgsql-general
pgsql-hackers
buildfarm-members
pgadmin-hackers
pgadmin-support
pgsql-admin
pgsql-advocacy
pgsql-announce
pgsql-benchmarks
pgsql-bugs
pgsql-chat
pgsql-cluster-hackers
pgsql-committers
pgsql-cygwin
pgsql-docs
pgsql-hackers-pitr
pgsql-hackers-win32
pgsql-interfaces
pgsql-jdbc
pgsql-jobs
pgsql-novice
pgsql-odbc
pgsql-patches
pgsql-performance
pgsql-php
pgsql-pkg-debian
pgsql-pkg-yum
pgsql-ports
pgsql-rrreviewers
pgsql-ru-general
pgsql-sql
pgsql-students
pgsql-testers
pgsql-translators
pgsql-www
psycopg
Period
anytime
within last day
within last week
within last month
within last 6 months
within last year
Sort by
date
reverse date
rank
Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
By continuing to browse this website, you agree to the use of cookies. Go to
Privacy Policy
.
I accept cookies