Search Postgresql Archives

Re: python async with psycopg2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 17 Jul 2020 at 20:44, Rita <rmorgan466@xxxxxxxxx> wrote:>

>     curs = conn.cursor()
>     curs.execute("LISTEN mychan0;")
>     #curs.execute("LISTEN mychan1;") #fails!
>     wait_select(conn)

Maybe you have to wait_select after each execute.

This example could be helpful.
https://www.psycopg.org/docs/advanced.html#asynchronous-notifications
Note that you don't need an async connection to receive notification:
a sync one, as long as is in autocommit and you are using an I/O
completion function to wait for readiness, works as well.

-- Daniele





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux