application_name doesn't seem accepted
See original GitHub issue- 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 https://github.com/MagicStack/asyncpg/issues/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.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Why is the application name not being set for my custom role ...
RoleProvider and implemented all the abstract methods and properties. I'm configuring my provider with an applicationName in the web.config, ...
Read more >Set application name for connection/pool · Issue #204 - GitHub
Hello! A feature request: I would like to be able to set a custom application_name for my connections so that this name displayed...
Read more >Application name field in info.plist doesn't change display ...
I created a fresh new app to test this and seems that Application name filed in info.plist doesn't really change the display name...
Read more >Microsoft Search window disapears immediatly after pressing ...
Go to: C:\Users\[username]\AppData\Local\Microsoft\Windows\Fonts · Right click on the folder -> Properties -> Security Tab -> Edit -> Add · Add ...
Read more >Always set the "applicationName" property when configuring ...
It doesn't throw a connection error, but rather when you attempt to ... ASPNETDB database, and look within the aspnet_Applications table:.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
That said,
should work
The
application_name
, like other server-side options should be passed in theserver_settings
dictionary argument to connect().In your case, SQLAlchemy is incorrectly interpreting the DSN and tries to pass
application_name
directly toconnect()
, and in the explicit argument scenario you should pass it like I’ve shown above.