Skip to content

"no codec for array element type" with enum arrays #112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rijenkii opened this issue Apr 2, 2017 · 2 comments
Closed

"no codec for array element type" with enum arrays #112

rijenkii opened this issue Apr 2, 2017 · 2 comments

Comments

@rijenkii
Copy link

rijenkii commented Apr 2, 2017

  • asyncpg version: 0.9.0
  • PostgreSQL version: 9.6.1
  • Python version: 3.6.1
  • Platform: Linux x86_64
  • Do you use pgbouncer?: No
  • Did you install asyncpg with pip?: Yes
  • If you built asyncpg locally, which version of Cython did you use?:
  • Can the issue be reproduced under both asyncio and
    uvloop?
    : Yes

This issue is similar to #82 , but now with enums

Steps:

  1. CREATE TYPE custom_type AS ENUM ('a', 'b');
import asyncio
import asyncpg

async def main():
    conn = await asyncpg.connect(database='test')
    print(await conn.fetch('SELECT $1::custom_type[]', ('a', 'b')))
    await conn.close()

asyncio.get_event_loop().run_until_complete(main())
  File "bug_test.py", line 9, in <module>
    asyncio.get_event_loop().run_until_complete(main())
  File "/usr/lib/python3.6/asyncio/base_events.py", line 466, in run_until_complete
    return future.result()
  File "bug_test.py", line 6, in main
    print(await conn.fetch('SELECT $1::test[]', ('a', 'b')))
  File "/usr/lib/python3.6/site-packages/asyncpg/connection.py", line 269, in fetch
    stmt = await self._get_statement(query, timeout)
  File "/usr/lib/python3.6/site-packages/asyncpg/connection.py", line 221, in _get_statement
    protocol.get_settings().register_data_types(types)
  File "asyncpg/protocol/settings.pyx", line 32, in asyncpg.protocol.protocol.ConnectionSettings.register_data_types (asyncpg/protocol/protocol.c:4675)
  File "asyncpg/protocol/settings.pyx", line 33, in asyncpg.protocol.protocol.ConnectionSettings.register_data_types (asyncpg/protocol/protocol.c:4598)
  File "asyncpg/protocol/codecs/base.pyx", line 373, in asyncpg.protocol.protocol.DataCodecConfig.add_types (asyncpg/protocol/protocol.c:16334)
RuntimeError: no codec for array element type 25923
@rijenkii rijenkii changed the title " no codec for array element type" with enum arrays "no codec for array element type" with enum arrays Apr 2, 2017
@elprans
Copy link
Member

elprans commented Apr 2, 2017

This is the same issue as in #82, and has been fixed in master.

@1st1
Copy link
Member

1st1 commented Apr 2, 2017

We'll release a new version this week with a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants