MagicStack / MagicStack/asyncpg
no decoder for composite type element in position _ of type OID _
Chưa có ai nhận issue này.
- 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ả
* **asyncpg version**: 0.17.0
* **PostgreSQL version**: 10.5
* **Do you use a PostgreSQL SaaS? If so, which? Can you reproduce
the issue with a local PostgreSQL install?**:
* **Python version**: 3.7.0
* **Platform**: Linux
* **Do you use pgbouncer?**: No
* **Did you install asyncpg with pip?**: pipenv
* **If you built asyncpg locally, which version of Cython did you use?**:
* **Can the issue be reproduced under both asyncio and
[uvloop](https://github.com/magicstack/uvloop)?**: asyncio definitely, untested with uvloop
Whenever I am trying to call a plpgsql stored procedure which returns a custom defined enum, I receive the following error:
`RuntimeError: no decoder for composite type element in position 2 of type OID 88492`
Type with OID 88492 in my database (from pg_catalog.pg_type) is listed as `ssg.logintype` which is defined as below:
```
CREATE TYPE SSG.LOGINTYPE AS ENUM (
'phone',
'email'
);
```
Partial traceback (asyncpg relevant parts):
```
File "/home/mayzie/.local/share/virtualenvs/api-xyfAGMEp/lib/python3.7/site-packages/asyncpg/prepared_stmt.py", line 179, in fetchval
data = await self.__bind_execute(args, 1, timeout)
File "/home/mayzie/.local/share/virtualenvs/api-xyfAGMEp/lib/python3.7/site-packages/asyncpg/prepared_stmt.py", line 203, in __bind_execute
self._state, args, '', limit, True, timeout)
File "asyncpg/protocol/protocol.pyx", line 212, in bind_execute
File "asyncpg/protocol/coreproto.pyx", line 71, in asyncpg.protocol.protocol.CoreProtocol._read_server_messages
File "asyncpg/protocol/coreproto.pyx", line 205, in asyncpg.protocol.protocol.CoreProtocol._process__bind_execute
File "asyncpg/protocol/coreproto.pyx", line 495, in asyncpg.protocol.protocol.CoreProtocol._parse_data_msgs
File "asyncpg/protocol/protocol.pyx", line 770, in asyncpg.protocol.protocol.BaseProtocol._decode_row
File "asyncpg/protocol/prepared_stmt.pyx", line 286, in asyncpg.protocol.protocol.PreparedStatementState._decode_row
File "asyncpg/protocol/codecs/base.pyx", line 257, in asyncpg.protocol.protocol.Codec.decode
File "asyncpg/protocol/codecs/base.pyx", line 166, in asyncpg.protocol.protocol.Codec.decode_scalar
File "asyncpg/protocol/codecs/record.pyx", line 39, in asyncpg.protocol.protocol.anonymous_record_decode
RuntimeError: no decoder for composite type element in position 2 of type OID 88492
```
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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với đường dẫn giải mã được thể hiện trong protocol/codecs/record.pyx và các tệp liên quan đến prepared statement và codec được nêu trong traceback. Tái hiện kết quả của stored procedure bằng PostgreSQL 10.5, một enum tùy chỉnh và một giá trị composite, sau đó lần theo nguyên nhân vì sao phần tử enum không có decoder. Hoàn thành khi kết quả được giải mã mà không gặp RuntimeError đã báo cáo và hành vi này được bao phủ bằng một regression test.
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
- backend, 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
- 30/100