Skip to content

crash when create view #178

Closed
Closed
@fy0

Description

@fy0
  • asyncpg version: 0.12 (current pip version)
  • PostgreSQL version: 9.6
  • Python version: 3.6
  • Platform: Windows 10
  • 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?
    : No

Code:

async def func():
    asyncpg_conn = await asyncpg.connect('postgresql://postgres@localhost/test')
    sql = 'create view aaa (a) as select 1 from "one_table" where id = $1', (123,)
    print(await asyncpg_conn.fetch(sql[0], *sql[1]))

asyncio.get_event_loop().run_until_complete(func())

Error:

  File "E:\codes\2017\28.stage-two-backend\view\common\association.py", line 163, in func
    print(await asyncpg_conn.fetch(sql[0], *sql[1]))
  File "C:\Anaconda3\lib\site-packages\asyncpg\connection.py", line 341, in fetch
    return await self._execute(query, args, 0, timeout)
  File "C:\Anaconda3\lib\site-packages\asyncpg\connection.py", line 1188, in _execute
    return await self._do_execute(query, executor, timeout)
  File "C:\Anaconda3\lib\site-packages\asyncpg\connection.py", line 1209, in _do_execute
    result = await executor(stmt, None)
  File "asyncpg\protocol\protocol.pyx", line 181, in bind_execute (asyncpg/protocol/protocol.c:66715)
  File "asyncpg\protocol\prepared_stmt.pyx", line 103, in asyncpg.protocol.protocol.PreparedStatementState._encode_bind_msg (asyncpg/protocol/protocol.c:62407)
ValueError: number of arguments (1) does not match number of parameters (0)

Wow, what happened?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions