MagicStack / MagicStack/asyncpg

asyncpg.exceptions.UndefinedFunctionError: function pg_listening_channels() does not exist

Open
#394 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

need more info
Dominant language
Python
Stars
8.1k
Forks
468
PR merge metrics
No merged PRs in 30d

Description

this is error message

Traceback (most recent call last):
  File "/home/gt/workspace/algo_syncer/base/async_pg.py", line 81, in <module>
    loop.run_until_complete(run_query('SELECT 1'))
  File "/usr/lib/python3.6/asyncio/base_events.py", line 473, in run_until_complete
    return future.result()
  File "/home/gt/workspace/algo_syncer/base/async_pg.py", line 65, in run_query
    await pool.release(con)
  File "/home/gt/.local/lib/python3.6/site-packages/asyncpg/pool.py", line 643, in release
    return await asyncio.shield(ch.release(timeout), loop=self._loop)
  File "/home/gt/.local/lib/python3.6/site-packages/asyncpg/pool.py", line 214, in release
    raise ex
  File "/home/gt/.local/lib/python3.6/site-packages/asyncpg/pool.py", line 204, in release
    await self._con.reset(timeout=budget)
  File "/home/gt/.local/lib/python3.6/site-packages/asyncpg/connection.py", line 1115, in reset
    await self.execute(reset_query, timeout=timeout)
  File "/home/gt/.local/lib/python3.6/site-packages/asyncpg/connection.py", line 273, in execute
    return await self._protocol.query(query, timeout)
  File "asyncpg/protocol/protocol.pyx", line 316, in query
asyncpg.exceptions.UndefinedFunctionError: function pg_listening_channels() does not exist
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

and this is my python3.6 code

import asyncpg
import asyncio
import traceback


dsn  = 'postgres://gpadmin:gpadmin@172.16.16.134:2345/algo'

async def run_query(query):

    pool = await asyncpg.create_pool(dsn, command_timeout=60)
    con = await pool.acquire()

    try:
        if query.startswith('delete from') or query.startswith('insert'):
            result = await con.execute(query)
        else:
            result = await con.fetchval(query)
    except:
        print('Could not complete query "{}"'.format(query))
        print(traceback.format_exc())
        result = None
        exit(1)
    finally:
        await pool.release(con)
    return result


if __name__ == '__main__':
    
    loop = asyncio.get_event_loop()
    loop.run_until_complete(run_query('SELECT 1'))


Please tell me what can i do next

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the traceback at asyncpg/pool.py:204-214 and connection.py:1115, then reproduce the SELECT 1 example against the reported PostgreSQL-compatible server. Done means determining why pg_listening_channels() is unavailable during pool release and identifying a repository-level fix or documented compatibility limitation; the issue names no repository test or target file.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, python
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.