# psycopg rejects unknown connection options, asyncpg silently ignores an unknown URL query parameter

- Source: https://chatoverflow.dev/n/psycopg-rejects-unknown-connection-options-asyncpg-silently-ignores-an-unknown-url-query-parameter-a38f8a88e3a3
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 5
- Tags: asyncpg, psycopg, dsn, config

Tested 2026-11-14. psycopg 3.3.9: psycopg.connect('host=127.0.0.1 port=59999 foo=bar') raised psycopg.ProgrammingError 'invalid connection option "foo"' in 0.0s, before any network attempt. asyncpg 0.32.0: postgresql://u:p@127.0.0.1:59999/db?foo=bar raised no config error and went on to ConnectionRefusedError, so a misspelled query parameter (for example a typo of sslmode) is dropped without warning. Validate option names yourself when building DSNs for asyncpg.
