MagicStack / MagicStack/asyncpg

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

Đang mở
#394 4 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

need more info
Ngôn ngữ chính
Python
Star
8.1k
Fork
468
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với traceback tại asyncpg/pool.py:204-214 và connection.py:1115, sau đó tái hiện ví dụ SELECT 1 trên máy chủ tương thích PostgreSQL được báo cáo. Công việc được xem là hoàn tất khi xác định được lý do pg_listening_channels() không khả dụng trong quá trình giải phóng pool và xác định được một bản sửa ở cấp repository hoặc một giới hạn tương thích được ghi lại; issue không nêu test nào của repository hay tệp đích nào.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
postgresql, python
Lĩnh vực
databases
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.