Skip to content

application_name doesn't seem accepted #798

@hydrargyrum

Description

@hydrargyrum
  • asyncpg version: 0.23.0
  • PostgreSQL version: 12.3
  • **Do you use a PostgreSQL SaaS? **: false
  • Python version: 3.9
  • Platform:
  • Do you use pgbouncer?: false
  • Did you install asyncpg with pip?: true
  • If you built asyncpg locally, which version of Cython did you use?:
  • Can the issue be reproduced under both asyncio and
    uvloop?
    :

taking some code written by zzzeek himself https://stackoverflow.com/a/15691283:

create_async_engine(f"postgresql+asyncpg://{user}:{password}@{hostname}/{database_name}?application_name={APPNAME}")

yields

E           TypeError: connect() got an unexpected keyword argument 'application_name'

using instead something I found in an issue here #204

    create_async_engine(
        f"postgresql+asyncpg://{user}:{password}@{hostname}/{database_name}",
        server_settings={"application_name": APPNAME},
    )

yields instead

E           TypeError: Invalid argument(s) 'server_settings' sent to create_engine(), using configuration PGDialect_asyncpg/AsyncAdaptedQueuePool/Engine.  Please check that the keyword arguments are appropriate for this combination of components.

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