Skip to main content

ArpePGSQL — Connection guide

Everything you can put in front of ArpePGSQL to point it at a PostgreSQL server, in one place: the three ways to supply connection details, every option the driver accepts, and the PostgreSQL-specific rules (TLS / sslmode, SCRAM channel binding, integrated authentication with Kerberos on Linux and SSPI on Windows, GSS transport encryption).

For how each authentication method works (SCRAM-SHA-256 + channel binding, Kerberos, Windows integrated authentication, gssencmode), see Authentication. For the licence, see Licensing.


Three ways to connect​

Every driver in the Arpeio family accepts the same three connection forms. They can be mixed; a discrete option always wins over the same field taken from a connection_string or a uri, regardless of the order they are set.

FormOption keyGrammarBest for
Discrete optionsadbc.arpepgsql.<field>one option per fieldprogrammatic clients, secrets kept out of a single string
Connection stringadbc.arpepgsql.connection_string (alias connection_string)ADO.NET Key=Value;…pasting an existing SQL Server / SqlClient-style string
Connection URIuripostgresql://… URLportable tooling, copy-paste from libpq / psql / ADBC tools
Python
import adbc_driver_manager.dbapi as dbapi

# Discrete options
conn = dbapi.connect(driver="arpepgsql", db_kwargs={
"adbc.arpepgsql.server": "localhost",
"adbc.arpepgsql.database": "tpch",
"adbc.arpepgsql.username": "alice",
"adbc.arpepgsql.password": "<password>",
"adbc.arpepgsql.sslmode": "require",
}, autocommit=True)

# Connection string (ADO.NET grammar)
conn = dbapi.connect(driver="arpepgsql", db_kwargs={
"adbc.arpepgsql.connection_string":
"Server=localhost;Database=tpch;User ID=alice;Password=<password>",
}, autocommit=True)

# Connection URI (libpq grammar)
conn = dbapi.connect(driver="arpepgsql", db_kwargs={
"uri": "postgresql://alice:<password>@localhost:5432/tpch?sslmode=require",
}, autocommit=True)

Precedence is per field: a field taken from connection_string/uri is applied only if no discrete adbc.arpepgsql.* option already set it.


Option reference​

All options are string-typed and live under the adbc.arpepgsql.* namespace (most also accept a short bare alias, noted below). Set them as ADBC database options before the connection is opened. Statement/ingest options are set on the statement — see Statement & ingest options.

Database-level vs connection-level keys​

Every option on this page is a database option (db_kwargs, AdbcDatabaseSetOption), copied to each connection when it is created. Most adbc.arpepgsql.* names are also accepted as connection options (conn_kwargs, AdbcConnectionSetOption), except connection_string, trusted, login_timeout, socket_timeout, buffer_size and the licence options, which are database-only.

A short bare alias means exactly the same as its adbc.arpepgsql.* key and is accepted wherever that key is, with the same validation:

Bare keyDatabase levelConnection level
server, hostname, database, username, password, port, application_name, app_name, auth_mode, sslmode, ssl_root_cert, channel_binding, encrypt, trust_server_cert, require_password_encryption, require_kerberos, gssencmode, krbsrvname, krb5_keytab, krb5_ccache, krb5_spn, krb5_principal, krb5_password, geospatial, json_extension, uuid_casing, numeric_format, numeric_special, array_lower_bound, temporal_infinity, copy_format, query_timeout✓✓
trusted, connection_string, uri✓—

Note the spelling difference for the Kerberos options: the full keys are dotted (adbc.arpepgsql.krb5.spn), the bare aliases use an underscore (krb5_spn), and the full key for auth_mode is adbc.arpepgsql.auth_type.

Target — where to connect​

OptionAliasDefaultMeaning
adbc.arpepgsql.connection_stringconnection_string—ADO.NET Key=Value;… string, see Connection string. Database level only.
uri——libpq-style postgresql://… URI, see Connection URI. Database level only.
adbc.arpepgsql.serverserver, hostname—Host name or address. As a discrete option an IPv6 literal is given bare (::1); inside a connection_string or uri it takes the bracketed form [::1]. In a connection_string value, a tcp: prefix and a :port or ,port suffix are also accepted (db.example.com:5433, tcp:db.example.com,5433, tcp:db.example.com:5433).
adbc.arpepgsql.portport5432TCP port, 1..65535.
adbc.arpepgsql.databasedatabaseserver default (the role's default DB)Initial database. A connection sees exactly one database at a time (no cross-database queries); switch with adbc.connection.catalog.
adbc.arpepgsql.usernameusernamePGUSER (required; PostgreSQL needs a role name)Login role.
adbc.arpepgsql.passwordpasswordPGPASSWORD, else the password filePassword for the password-family auth methods. See PostgreSQL environment variables.
adbc.arpepgsql.application_nameapplication_name, app_nameunset (not sent; server default)Program name reported to the server (application_name GUC, pg_stat_activity.application_name).

A server, database, username or password longer than 255 bytes, or an ssl_root_cert path longer than 1023 bytes, is rejected with INVALID_ARGUMENT ("… is too long"), whether it is given as an option, in a connection string or through PGUSER / PGPASSWORD / PGSSLROOTCERT.

Authentication​

Full method-by-method detail is in Authentication; the TLS / channel-binding options are under TLS & encryption options and the integrated paths under Kerberos authentication (Linux) and Integrated authentication (Windows).

OptionValuesMeaning
adbc.arpepgsql.username / .passwordstringPassword-family credentials (SCRAM-SHA-256 / MD5 / cleartext, negotiated by the server). Aliases username / password. When unset, PGUSER / PGPASSWORD / the password file are used, see PostgreSQL environment variables.
adbc.arpepgsql.trustedtrue/1/yes/sspi/SSPI, false/0/noIntegrated auth: Kerberos (GSSAPI) on Linux, the logged-in Windows identity (SSPI) on Windows. Set username to the database role to log in as; a password is rejected. Alias trusted (database level only).
adbc.arpepgsql.auth_typesql/SqlPassword, integrated/sspi/trustedSelects the auth mode explicitly. Any other value (the Entra ID / certificate families) is rejected with NOT_IMPLEMENTED. Alias auth_mode.
adbc.arpepgsql.krb5.ccachepathKerberos (Linux): credential cache file to use instead of the ambient one from kinit. Alias krb5_ccache.
adbc.arpepgsql.krb5.keytabpathKerberos (Linux): keytab file, for service accounts that cannot run kinit. Alias krb5_keytab.
adbc.arpepgsql.krb5.principalnameKerberos (Linux): client principal (e.g. alice@EXAMPLE.COM), used with krb5.password, or to pick one principal of a keytab. Alias krb5_principal.
adbc.arpepgsql.krb5.passwordstringKerberos (Linux): password used to obtain a ticket for krb5.principal, which is then required. Alias krb5_password.
adbc.arpepgsql.krb5.spnSPNUse this service principal name verbatim instead of the derived one (e.g. postgres/db.example.com@EXAMPLE.COM on Linux, POSTGRES/db.example.com on Windows). Takes precedence over krbsrvname. Alias krb5_spn.
adbc.arpepgsql.krbsrvnamenameReplace the service part of the derived SPN: default postgres on Linux (giving postgres/<server>, as in libpq) and POSTGRES on Windows (giving POSTGRES/<server>). Ignored when krb5.spn is set. Alias krbsrvname.
adbc.arpepgsql.require_kerberostrue / false (default)Windows: refuse an integrated login that negotiated NTLM (or a package Windows does not report) instead of Kerberos. No effect on Linux, where only Kerberos is used. Alias require_kerberos; RequireKerberos in a connection string, require_kerberos in a URI. See Authentication → NTLM.
adbc.arpepgsql.gssencmodedisable (default) / prefer / requireGSS transport encryption (Linux), negotiated before TLS and the login. require skips TLS entirely. The default differs from libpq's prefer. Alias gssencmode. See Authentication → GSS transport encryption.

TLS & encryption options​

Boolean options (encrypt, trust_server_cert, require_password_encryption, require_kerberos) take true / yes / 1 or false / no / 0, in any case, at both levels. Any other value is rejected with INVALID_ARGUMENT.

OptionDefaultMeaning
adbc.arpepgsql.sslmodepreferdisable / prefer / require / verify-ca / verify-full. require encrypts but does not verify the certificate, unless a root certificate is set (ssl_root_cert or PGSSLROOTCERT): then it verifies the chain, as verify-ca does (like libpq). verify-ca/verify-full always verify (and verify-full also checks the hostname). Alias sslmode.
adbc.arpepgsql.ssl_root_certPGSSLROOTCERT, else ~/.postgresql/root.crt for verify-ca / verify-full, else (verify-full only) the system CA store (details)PEM root-CA file used by verify-ca / verify-full, and by require, which then verifies the chain. verify-ca with no root certificate refuses to connect, as in libpq, and verify-full without one trusts the operating system's CA store. Alias ssl_root_cert.
adbc.arpepgsql.channel_bindingpreferprefer / require / disable. require enforces SCRAM-SHA-256-PLUS channel binding over TLS and refuses a PLUS-stripping downgrade. It also refuses every other method the server may ask for (cleartext, MD5, integrated authentication, or no authentication at all), as libpq does. Alias channel_binding.
adbc.arpepgsql.encryptfalseCompatibility bridge for the ADO.NET TLS vocabulary. With no sslmode, encrypt=true maps to verify-full, or to require when trust_server_cert=true. Given together with an sslmode, the two must agree (see Conflicting TLS settings). Prefer sslmode directly. Alias encrypt.
adbc.arpepgsql.trust_server_certfalsePart of the same bridge (see encrypt). Prefer sslmode directly. Alias trust_server_cert.
adbc.arpepgsql.require_password_encryptionfalsetrue refuses to send a cleartext or MD5 password when the transport is not encrypted, closing the downgrade path left open by sslmode=prefer. Off by default (libpq-compatible). Also available as RequirePasswordEncryption in a connection string and require_password_encryption in a URI. Alias require_password_encryption.

⚠️ Security — the default sslmode=prefer gives no MITM protection. Like libpq, prefer falls back to plaintext when the server declines TLS, and that reply is read before TLS so it is unauthenticated. Over an untrusted network use sslmode=verify-full and/or channel_binding=require. See TLS & sslmode below.

Read-only: negotiated TLS and OpenSSL version​

These options report; they cannot be set (INVALID_ARGUMENT for the connection options, NOT_IMPLEMENTED for the database option).

OptionRead withMeaning
adbc.arpepgsql.tls.versionAdbcConnectionGetOptionThe TLS protocol version the connection's handshake negotiated, e.g. TLSv1.3. Empty before the connection's session opens and on a connection without TLS (sslmode=disable, prefer falling back to plaintext, GSS encryption). Reading it never opens a session.
adbc.arpepgsql.tls.groupAdbcConnectionGetOptionThe key-exchange group, e.g. X25519MLKEM768 (hybrid post-quantum ML-KEM, offered first by the released binaries and used when the server's OpenSSL is 3.5 or later) or x25519.
adbc.arpepgsql.tls.cipherAdbcConnectionGetOptionThe cipher suite, e.g. TLS_AES_256_GCM_SHA384.
adbc.arpepgsql.openssl_versionAdbcDatabaseGetOptionThe OpenSSL built into the driver, as OpenSSL reports it: a string starting with OpenSSL 3.5 (the 3.5 LTS series). No licence or connection is needed. Compare it with an OpenSSL advisory to know whether a deployed driver is affected.
Python
conn.adbc_connection.get_option("adbc.arpepgsql.tls.version")    # "TLSv1.3"
conn.adbc_database.get_option("adbc.arpepgsql.openssl_version") # "OpenSSL 3.5.9 ..."

With the environment variable ARPEIO_ADBC_LOG_TLS=1 the driver also prints one line per TLS handshake to standard error, for example arpepgsql: TLS TLSv1.3 group X25519MLKEM768 cipher TLS_AES_256_GCM_SHA384 peer db.example.com (it can be collected through ADBC instead, see Warnings).

Timeouts & performance​

OptionDefaultMeaning
adbc.arpepgsql.login_timeout30Login budget in seconds (0 = no limit, also as Connection Timeout=0 in a connection string or connect_timeout=0 in a URI). It covers the whole login: the TCP connect, the TLS or GSS encryption handshake, authentication and startup together, so a server that accepts the connection and then stalls fails with login timed out after N s. Each address of a multi-address host gets its own budget.
adbc.arpepgsql.socket_timeout0Per-I/O recv/send timeout in seconds (0 = none). Set it to bound a long-running or stalled query.
adbc.arpepgsql.query_timeout0Longest a statement may run, in seconds (0 = no limit from the driver). See Query timeout. Alias query_timeout.
adbc.arpepgsql.buffer_size32000Rows per streamed Arrow batch (per connection); also the default statement batch_size. Values above 10,000,000 are capped. 0, a negative value or a non-number (including trailing text such as 10abc) is rejected with INVALID_ARGUMENT. A batch is closed early, before the row that would take a utf8 / binary column past Arrow's 2 GiB limit.
adbc.arpepgsql.copy_formatauto (default) / binary / textRead-path extraction strategy. auto uses the fast binary COPY path on real PostgreSQL and falls back to the text row path for PostgreSQL-wire-compatible engines that don't emit a binary COPY stream (e.g. CedarDB), detected once per connection. binary forces binary COPY (clear error if unsupported). text always uses the text row path. Alias copy_format. Env override when the option is unset or auto: ARPEIO_ADBC_COPY_FORMAT.

PostgreSQL-wire-compatible engines. Databases that only speak the PostgreSQL protocol (CedarDB, CockroachDB, Redshift, Materialize, …) may not implement binary COPY TO. In auto (the default) the driver detects this once per connection and uses the text row path, so extraction works unchanged. For best throughput on such a server, set copy_format=text to skip the initial binary-COPY attempt.

In auto, a statement that COPY cannot wrap (SHOW, EXPLAIN, several statements in one string, SELECT INTO: SQLSTATE class 42 or 0A000) runs on the text row path instead. Any other error, such as a cancel, a statement_timeout or a lock_timeout, is reported as is and the statement is not run a second time. An engine that rejects COPY ... TO STDOUT with some other SQLSTATE needs copy_format=text.

Query timeout​

The driver applies query_timeout as the server's statement_timeout, from the connection's next statement, so the server cancels a statement that runs longer. The time counts from when the statement reaches the server until its last row is sent, so the time the application takes to read the rows counts too. It covers every statement on the connection: queries, updates, bound statements, bulk ingest and metadata calls.

  • A timed-out call fails with ADBC_STATUS_TIMEOUT and SQLSTATE 57014 (a result stream with ETIMEDOUT), with the message query timed out: it ran longer than query_timeout (N s) and the server cancelled it. The connection stays usable. Inside a transaction, the timed-out statement aborts the transaction, as any failed statement does: roll back to continue.
  • A cancel gets the same SQLSTATE. The driver reports ADBC_STATUS_CANCELLED when the application called AdbcStatementCancel or AdbcConnectionCancel during the call, whatever the server's lc_messages language. Otherwise it reads the server's message: the English canceling statement due to user request (a pg_cancel_backend from another session) is ADBC_STATUS_CANCELLED, and anything else is ADBC_STATUS_TIMEOUT. So under a translated lc_messages, a pg_cancel_backend from another session reads as a timeout.
  • With 0 the driver sends nothing, so a statement_timeout set on the server, database or role still applies. A SET statement_timeout of your own replaces the driver's until query_timeout changes.
  • It is also a connection option (adbc.arpepgsql.query_timeout or query_timeout, string or integer) and can be changed on an open connection: the next statement applies it, and going back to 0 restores the server's setting.
  • Values above 2147483 (about 24.8 days, PostgreSQL's maximum) are capped.

Type rendering (read path)​

OptionValuesMeaning
adbc.arpepgsql.uuid_casinglower (default) / upperHex-digit case of uuid values rendered to Arrow utf8. lower matches RFC 4122 and PostgreSQL's text output. lowercase / uppercase are accepted spellings. Alias uuid_casing.
adbc.arpepgsql.numeric_formatdecimal (default) / stringHow NUMERIC columns are returned. decimal maps numeric(p,s) to decimal128 (p ≤ 38) or decimal256 (p ≤ 76) and falls back to utf8 for larger or unconstrained numeric. string returns every NUMERIC column as utf8 in PostgreSQL's text form — lossless, NaN included. Alias numeric_format.
adbc.arpepgsql.array_lower_bounderror (default) / ignoreWhat to do with an array value whose lower bound is not 1, which an Arrow list cannot store. error fails the read with a message naming the column; ignore reads it as an ordinary list and drops the bound. Alias array_lower_bound. See Data types → Arrays.
adbc.arpepgsql.numeric_specialerror (default) / nullWhat to do when a NUMERIC NaN / ±Infinity reaches a decimal128/decimal256 column (Arrow decimals cannot represent it). error fails the read with a message naming the column; null reads the value as NULL. Ignored when numeric_format=string. Alias numeric_special.
adbc.arpepgsql.temporal_infinityerror (default) / extremeWhat to do with a date, timestamp or timestamptz holding infinity / -infinity, which Arrow date32 and timestamp cannot hold. error fails the read with a message naming the column and this option. extreme reads infinity as the largest value of the column's Arrow type and -infinity as the smallest, and writes those two values back as infinity / -infinity on ingest and bind, so a table read and ingested with the option holds the same rows. Alias temporal_infinity. See Data types → Infinite dates and timestamps.
adbc.arpepgsql.geospatialgeoarrow.wkb (default) / wkb / binaryHow PostGIS geometry/geography columns are read. geoarrow.wkb returns ISO WKB with GeoArrow metadata, wkb and binary return PostGIS's EWKB. geoarrow is accepted for geoarrow.wkb; varbinary and disable for binary. Alias geospatial. See Data types → Geospatial.
adbc.arpepgsql.json_extensionoff (default) / arrow.jsonarrow.json tags json and jsonb columns with the canonical arrow.json extension on the read path and in GetTableSchema. The columns stay utf8; only the field metadata changes. Alias json_extension. See Data types → Character & binary.

numeric_format, numeric_special, array_lower_bound and temporal_infinity can also be changed on an open connection (AdbcConnectionSetOption); the change applies from the next statement, without reconnecting.

Licence​

OptionMeaning
arpeio.adbc.licenseLicence blob, inline (up to 8191 bytes).
arpeio.adbc.license_filePath to a .lic file (up to 1023 bytes, UTF-8).
arpeio.adbc.license.statusRead-only (database GetOption); reports <state>;code=<ARROW_LIC_*>;tier=<tier>;expires=<epoch>.

The driver also reads the shared ARPEIO_ADBC_LICENCE[_FILE] environment variables and an arpeio_adbc.lic file next to the library. A value longer than these limits is rejected with INVALID_ARGUMENT. Full resolution order in Licensing.

Standard ADBC connection options​

These use the ADBC-standard keys (no arpepgsql namespace):

OptionValuesMeaning
adbc.connection.autocommittrue (default) / falseAutocommit mode: true or 1 enables it, false or 0 disables it, and any other value is rejected with INVALID_ARGUMENT. Also accepted as a database option, inherited by new connections. With false, a transaction begins with the next statement after each commit()/rollback() (manual-commit mode holds across transactions). adbc_ingest runs on the connection's session: with false it joins the open transaction and is committed or rolled back with it; with true, create, replace and create_append run their DDL and COPY in one transaction, so a failed ingest leaves no half-created table and replace keeps the old one. A statement that fails inside a transaction aborts it, as in PostgreSQL: later statements fail with SQLSTATE 25P02 until rollback(). commit() in that state rolls the transaction back and fails with INVALID_STATE and SQLSTATE 25P02 ("the transaction was rolled back, not committed") instead of reporting success, and switching autocommit on fails the same way.
adbc.connection.catalogdatabase nameSwitch to another database on the same server. PostgreSQL binds a session to one database, so this reconnects: temp tables, SET values and advisory locks do not carry over, and the schema becomes the new database's default; manual-commit mode carries over. Refused (INVALID_STATE) inside an open transaction or while a result set is still being read; an unknown database is NOT_FOUND.
adbc.connection.db_schemaschema nameCurrent schema: checked to exist in the current database (NOT_FOUND otherwise), then applied with SET search_path TO "<schema>".

Transaction isolation level and session read-only are not yet exposed as ADBC options on ArpePGSQL; set them from SQL (SET TRANSACTION …, SET default_transaction_read_only) on the connection if needed.

Statement & ingest options​

Set on the statement handle, not the database:

OptionDefaultMeaning
adbc.arpepgsql.batch_sizeinherits buffer_size (32000)Rows per Arrow batch for this statement, 1..max_batch_size.
adbc.arpepgsql.max_batch_size1000000Upper bound for batch_size; must be ≥ the current batch_size.
adbc.ingest.target_table—Target table for adbc_ingest / bulk ingest. Setting it makes the statement a bulk ingest, with or without a mode, and data bound before it becomes the ingest data.
adbc.ingest.modecreatecreate / append / replace / create_append, or the long ADBC forms adbc.ingest.mode.create / .append / .replace / .create_append. Any other value is rejected with NOT_IMPLEMENTED. Unset means create: the table is created, and the ingest fails with ALREADY_EXISTS if it exists; set append to add to an existing table. Python's adbc_ingest() always sends a mode.
adbc.ingest.target_catalog—Must name the connected database (current_database()). Any other value fails with NOT_IMPLEMENTED before any DDL runs, as PostgreSQL cannot write to another database: connect to that database instead.
adbc.ingest.target_db_schema—Target schema for ingest. When unset, the table is created in or looked up in current_schema(), so a temp table of the same name is never written to; an empty search_path is then an error. Cannot be combined with adbc.ingest.temporary (see below).
adbc.ingest.temporaryfalsetrue or 1 ingests into a TEMP table; false or 0 does not. Any other value is rejected with INVALID_ARGUMENT, and the target is always pg_temp, never a permanent table of the same name. Enabling it clears an earlier target_db_schema, and a target_db_schema set after it fails the ingest with INVALID_STATE.

Legacy bulk options & no-ops (back-compat)​

Recognised so strings copied from other Arpeio drivers still load:

OptionDefaultEffect
adbc.arpepgsql.prefetch—No-op.
adbc.arpepgsql.memory_budget_mb—No-op: accepted with any value and ignored. A read's memory is bounded by batch_size.
arpepgsql.bulk_batch_size100000001..100000000. Maximum rows per chunk sent during ingest; a per-chunk size limit is usually reached first, so this rarely needs changing.
arpepgsql.bulk_tablock, arpepgsql.bulk_keep_identity, arpepgsql.bulk_check_constraints, arpepgsql.bulk_fire_triggers, arpepgsql.bulk_keep_nulls—No-ops: stored, never used. Ingest hints from other Arpeio drivers with no PostgreSQL COPY equivalent. The value must still be a boolean (true / yes / 1 or false / no / 0, any case); anything else is INVALID_ARGUMENT.

The integer options (batch_size, max_batch_size, arpepgsql.bulk_batch_size) reject trailing text such as 10abc with INVALID_ARGUMENT. Any other key is rejected with NOT_IMPLEMENTED ("Unknown statement option").

One command at a time​

A connection runs one command at a time. While a result set is still being read, any other command on the same connection (executing another statement, ExecuteSchema, GetParameterSchema, commit(), rollback(), turning autocommit on, setting adbc.connection.db_schema, GetObjects, GetTableSchema, GetStatistics, ingest) returns INVALID_STATE with "a result set is still open on this connection; read it to the end or release it first", as libpq does. Read the stream to the end, or release it, before the next command. Releasing a stream early keeps the connection: the driver reads what is already in flight, then cancels the rest of the result (details below).

With autocommit off, GetObjects, GetTableSchema and GetStatistics run under a savepoint, so a failing catalog query (a missing table, no privilege) is reported with its SQLSTATE and does not abort your transaction.

Releasing a result early. When a stream is released (a reader closed) before its end and the server is still sending after about 250 ms, the driver cancels the query.

  • A statement that writes commits only after its last row, so a cancel undoes it. The 250 ms wait therefore applies only to a statement that, from its text, cannot write: one reading statement with no function call. Any other statement, including INSERT ... RETURNING, a data-changing WITH, SELECT f() or SELECT upper(a), gets about 2 s before the cancel. A write hidden behind a view, an operator or a :: cast cannot be seen from the text, and a tail longer than 2 s is cancelled in every case. Read a result to its end when a statement's writes must be kept.
  • Inside a transaction (autocommit off), the cancel of a plain query (the binary COPY path) is rolled back to an internal savepoint and the transaction carries on. A query with bound parameters, or one on the text row path, runs without that savepoint: the cancel aborts the transaction, as a cancelled statement does with libpq, so the driver waits about 2 s before cancelling such a query. The next statement then fails once with "current transaction is aborted: a result stream released before its end …", and commit() fails with SQLSTATE 25P02 after rolling the transaction back. Call rollback() and run the transaction again; to keep it, read the result to its end.

Release order. Release every statement of a connection before the connection itself. AdbcConnectionRelease returns INVALID_STATE ("N statement(s) still open; release them first") while a statement is still open, and leaves the connection usable. The Python driver manager already refuses to close a connection with open cursors.

Metadata and catalogs. A PostgreSQL connection sees only its own database. GetObjects and GetStatistics match their catalog pattern against current_database(), so another catalog gives an empty result; GetTableSchema with another catalog fails with NOT_FOUND. Without a schema, GetTableSchema and GetStatistics look the table up through the search_path, as an unqualified name in a query.


Connection string (ADO.NET form)​

adbc.arpepgsql.connection_string accepts the ADO.NET Key=Value;… grammar: case-insensitive keywords, quoted values, doubled-quote escapes. Both the ADO.NET keywords (shared across the Arpeio driver family) and the PostgreSQL / Npgsql ones (Host, Port, Username, SSL Mode, …) are accepted, so a string copied from an Npgsql setup loads as is. Keywords map onto the options above.

Keyword(s)Option
Server, Host, Data Source, Address, Addr, Network Addressserver: host, host:port, host,port, [ipv6], [ipv6]:port or [ipv6],port, each optionally after a tcp: prefix (tcp:host,port, tcp:host:port). An IPv6 address must be bracketed; any other protocol prefix (np:, lpc:) is rejected.
Portport. When Server / Host also carries a port, the two must be equal, else the string is rejected with INVALID_ARGUMENT.
Database, Initial Catalogdatabase
User ID, UID, User, Usernameusername
Password, PWDpassword
Application Name, Appapplication_name
Encryptencrypt
TrustServerCertificate, Trust Server Certificatetrust_server_cert
SSL Mode, SslModesslmode (libpq spellings, plus Npgsql's VerifyCA / VerifyFull; Allow maps to prefer; any case)
Root Certificate, SSL Root Cert, SslRootCertssl_root_cert
Channel Binding, ChannelBindingchannel_binding
RequirePasswordEncryptionrequire_password_encryption
Connection Timeout, Connect Timeout, Timeoutlogin_timeout
Integrated Security, Trusted_Connection, Trusted Connectiontrusted (SSPI/true/yes/1 → integrated, false/no/0 → SQL login)
AuthenticationSqlPassword / Sql Password → SQL login; any ActiveDirectory* value → NOT_IMPLEMENTED; anything else → INVALID_ARGUMENT
Authenticatorwinsspi / sspi / krb5 → integrated, sql → SQL login
Krb5 Keytab File, Krb5KeytabFile, krb5-keytabfilekrb5.keytab
Krb5 Credential Cache, Krb5CredentialCache, krb5-credcachefilekrb5.ccache
Krb5 Principal, Krb5Principalkrb5.principal
Krb5 Password, Krb5Passwordkrb5.password
Service Principal Name, ServicePrincipalName, service_principal_namekrb5.spn
KrbSrvNamekrbsrvname
GssEncModegssencmode
RequireKerberosrequire_kerberos
temporal_infinitytemporal_infinity

Boolean keywords (Encrypt, TrustServerCertificate, RequirePasswordEncryption, RequireKerberos) take yes/no/true/false/1/0, case-insensitive. Unknown keywords are rejected.

Server=localhost;Database=tpch;User ID=alice;Password=secret;Integrated Security=false
Host=db.example.com;Port=5433;Database=tpch;Username=alice;Password=secret;SSL Mode=VerifyFull

Connection URI​

The standard ADBC uri option takes a libpq-style PostgreSQL URI, so a string copied from psql, a DATABASE_URL, or other PostgreSQL ADBC tooling works unchanged.

<scheme>://[user[:password]@]host[:port][/dbname][?key=value&…]
  • Schemes (case-insensitive, equivalent): postgresql://, postgres://, and the branded arpepgsql://. The scheme only selects the URL grammar — it never picks the driver, so postgresql:///postgres:// never collide with another PostgreSQL ADBC driver installed alongside this one.
  • The path segment is the database name (as in libpq) — not an instance name.
  • host, userinfo, and query values are percent-decoded; a + in a query value decodes to a space. IPv6 hosts use the bracketed form: postgresql://[::1]:5432/tpch.

Query parameters (unknown or repeated parameters are rejected, as is a parameter for a field the URI already sets, such as user next to a user@ in the authority):

ParameterOption
userusername
passwordpassword
dbnamedatabase (alternative spelling for callers who put it in the query)
application_nameapplication_name
connect_timeoutlogin_timeout
sslmodesslmode
channel_bindingchannel_binding
sslrootcertssl_root_cert
gssencmodegssencmode
krbsrvnamekrbsrvname
require_password_encryptionrequire_password_encryption
require_kerberosrequire_kerberos

Parameter names are matched case-insensitively. sslmode also takes Npgsql's VerifyCA / VerifyFull (and Allow, mapped to prefer), in any case. Options with no URI parameter (copy_format, numeric_*, temporal_infinity, geospatial, uuid_casing, timeouts other than connect_timeout, the krb5.* options) are set as discrete options next to uri.

For the ADO.NET Key=Value; form use connection_string instead of uri.


TLS & sslmode​

ArpePGSQL negotiates TLS the standard PostgreSQL way, before the login. The sslmode values mirror libpq:

sslmodeEncryptsVerifies certificateVerifies hostname
disableno——
prefer (default)if the server offers itnono
requireyesno (yes when a root certificate is set)no
verify-cayesyes (chain to a root certificate, which is required)no
verify-fullyesyes (chain to a root certificate, else the system CA store)yes
  • prefer gives no MITM protection. The server's answer to the TLS request is read before TLS, so an on-path attacker can strip it and observe the cleartext / MD5 / SCRAM-without-binding exchange. Over an untrusted network use verify-full.

  • SCRAM channel binding (channel_binding=require) binds the SCRAM exchange to the server certificate (SCRAM-SHA-256-PLUS), defeating a MITM that proxies the SASL flow even without verify-full. It needs TLS, so it is unavailable under sslmode=disable or active GSS encryption.

  • As in libpq, require with a root certificate (ssl_root_cert or PGSSLROOTCERT) verifies the chain, as verify-ca does: the connection fails if that root certificate does not sign the server's certificate. In the encrypt / trust_server_cert bridge, trust_server_cert=true never verifies.

  • verify-ca / verify-full load the CA chain from ssl_root_cert, else PGSSLROOTCERT, else the default file ~/.postgresql/root.crt (Windows: %APPDATA%\postgresql\root.crt), as libpq does. With none of them:

    • verify-ca fails AdbcDatabaseInit with INVALID_ARGUMENT, as in libpq. It checks no host name, so against the system CA store any certificate a public CA signed would pass. Give it a root certificate or use verify-full.
    • verify-full (and encrypt=true without trust_server_cert=true, which means verify-full) verifies against the operating system's CA store. The host name check is what makes a public CA safe there.

    See Authentication → TLS for where the system CA store is read from on each OS, the TLS version floor, SNI and the OpenSSL configuration file.

  • verify-full checks the certificate against the host the driver connects to. With no server configured that is localhost, which is then also the name checked and sent as SNI.

  • A root certificate file that is replaced or edited is picked up by the next connect; changes to the system CA store are picked up within 10 minutes. Every connect runs a full handshake and verifies the server certificate.

The encrypt / trust_server_cert options are a compatibility bridge for callers who think in the ADO.NET vocabulary. With no explicit sslmode they map to one: encrypt=true is verify-full, encrypt=true with trust_server_cert=true is require, and anything else is the default prefer. Prefer setting sslmode directly.

Conflicting TLS settings​

When encrypt or trust_server_cert is given (as an option, a connection string key or a URI parameter) together with an explicit sslmode, the settings must agree. A contradictory combination fails AdbcDatabaseInit with INVALID_ARGUMENT and a message naming both keys ("Conflicting TLS settings: …"):

SettingConflicts with sslmode
encrypt=true (TLS required)disable, prefer (and Allow, which maps to prefer)
trust_server_cert=true (do not verify)verify-ca, verify-full
trust_server_cert=false (verify)prefer, and require with no root certificate

encrypt=false only means "TLS not required" and agrees with every sslmode. For example Encrypt=yes;SslMode=disable and TrustServerCertificate=true;SslMode=VerifyFull are rejected, while Encrypt=yes;SslMode=require and Encrypt=yes;SslMode=verify-full work.


PostgreSQL environment variables and .pgpass​

Settings that no option, connection string or URI gives fall back to the standard PostgreSQL client environment, the same variables Npgsql reads. They are read once, at AdbcDatabaseInit, and an explicit option always wins:

VariableFillsNotes
PGUSERusername
PGPASSWORDpasswordNot used with integrated (Kerberos / SSPI) authentication.
password filepasswordOnly when no password is given and PGPASSWORD is unset. PGPASSFILE, else ~/.pgpass (Windows: %APPDATA%\postgresql\pgpass.conf).
PGSSLROOTCERTssl_root_cert
~/.postgresql/root.crtssl_root_certOnly for verify-ca / verify-full (and encrypt=true without trust_server_cert=true), when neither the option nor PGSSLROOTCERT gives one. Windows: %APPDATA%\postgresql\root.crt. Used before the system CA store.

The password file uses libpq's format, one entry per line:

hostname:port:database:username:password
  • * in any of the first four fields matches anything.
  • \ escapes : and \.
  • Lines starting with # are comments.
  • The first matching line wins.
  • Matching uses the configured server, port, database and username, and is case-sensitive. As in libpq, an unset server matches as localhost and an unset database as the username.
  • On Linux a file that group or others can read is ignored, with a warning on stderr (or in the collected warnings), as libpq does: chmod 0600 ~/.pgpass.

PGHOST, PGPORT, PGDATABASE and PGSSLMODE are not read (Npgsql doesn't read them either): give the server, port, database and sslmode explicitly. PGSSLCERT / PGSSLKEY have no effect, since TLS client-certificate authentication isn't supported.


Warnings​

The driver's warnings go to standard error by default. A host that logs through its own logger can collect them through ADBC instead, with these options:

OptionSet onDefaultMeaning
arpeio.adbc.warnings_to_stderrdatabase (before AdbcDatabaseInit), inherited by its connections; a connection can set its owntruePrint each warning to standard error.
arpeio.adbc.collect_warningsdatabase (before AdbcDatabaseInit), inherited by its connections; a connection can set its ownfalseKeep each warning in a buffer, read with arpeio.adbc.warnings.
arpeio.adbc.warningsread-only (AdbcDatabaseGetOption / AdbcConnectionGetOption)""The collected warnings, one <level>: <message> line each (<level> is warning or info), separated by \n; an empty string when there are none. Reading does not clear the buffer.
arpeio.adbc.clear_warningsdatabase or connection—true empties the buffer.
  • What each object collects. The database collects the warnings raised by AdbcDatabaseInit: the licence grace period and a password file ignored for its permissions. A connection collects its login warnings (TLS declined under sslmode=prefer; a cleartext password, an MD5 hash or a SCRAM exchange sent over an unencrypted link; the ARPEIO_ADBC_LOG_TLS handshake line, as info:) and the warnings of every statement run on it.
  • Cap. A buffer keeps 100 lines; the last one then reads warning: <N> more warnings dropped. Clear it to collect again.
  • With the defaults, warnings print to standard error as usual and nothing is buffered. Set collect_warnings=true and warnings_to_stderr=false to route them only through ADBC.
Python
conn = dbapi.connect(driver="arpepgsql", db_kwargs={
"uri": "postgresql://alice:<password>@db.example.com/tpch",
"arpeio.adbc.collect_warnings": "true",
"arpeio.adbc.warnings_to_stderr": "false",
})
conn.adbc_database.get_option("arpeio.adbc.warnings") # Init warnings
conn.adbc_connection.get_option("arpeio.adbc.warnings") # login and statement warnings
conn.adbc_connection.set_options(**{"arpeio.adbc.clear_warnings": "true"})

Kerberos authentication (Linux)​

Set adbc.arpepgsql.auth_type=integrated (or adbc.arpepgsql.trusted=true) to log in with a Kerberos ticket (GSSAPI) instead of a password, against a gss line in pg_hba.conf. Set adbc.arpepgsql.username to the PostgreSQL role to log in as; a password is rejected. Mutual authentication is always required and enforced.

Python
# 1. Obtain a ticket:  kinit alice@EXAMPLE.COM
# 2. Connect. The ambient credential cache is used automatically:
conn = dbapi.connect(driver="arpepgsql", db_kwargs={
"adbc.arpepgsql.server": "db.example.com",
"adbc.arpepgsql.database": "mydb",
"adbc.arpepgsql.username": "alice",
"adbc.arpepgsql.auth_type": "integrated",
# optional explicit credentials:
# "adbc.arpepgsql.krb5.ccache": "/tmp/krb5cc_1000",
# "adbc.arpepgsql.krb5.keytab": "/path/to/alice.keytab",
})

A Kerberos login needs MIT Kerberos (libgssapi_krb5.so.2 and libkrb5.so.3) on the host. On a host without them the driver still loads and password logins work; only a Kerberos login fails, with a message naming the package to install (krb5-libs on RHEL, Rocky and Fedora, libgssapi-krb5-2 on Debian and Ubuntu).

The target service principal name is postgres/<server> (no port). Change the service part with adbc.arpepgsql.krbsrvname, or set the whole SPN with adbc.arpepgsql.krb5.spn.

GSS transport encryption (adbc.arpepgsql.gssencmode): disable (the default, unlike libpq's prefer), prefer or require. require encrypts the whole stream over GSSAPI and skips TLS entirely, so it cannot be combined with sslmode=require / verify-ca / verify-full, and SCRAM channel binding is unavailable (plain SCRAM still works inside the encrypted stream). Linux only.

The credential modes and the gssencmode rules are detailed in Authentication.


Integrated authentication (Windows)​

Platform

This section is about the Windows driver, which authenticates through Windows SSPI. On Linux, integrated authentication uses a Kerberos ticket: see Kerberos authentication (Linux).

Set adbc.arpepgsql.auth_type=integrated (or adbc.arpepgsql.trusted=true) to authenticate as the logged-in Windows user, with no password. Set adbc.arpepgsql.username to the PostgreSQL role to log in as; the server checks that your Windows identity maps to it (pg_hba.conf / pg_ident.conf). The driver picks the SSPI package as libpq does: Kerberos for a gss line in pg_hba.conf, Negotiate (Kerberos with NTLM fallback) for an sspi line on a Windows server. Mutual authentication is always required and enforced: the driver refuses a server that reports success without completing the exchange, and refuses password-family requests while this mode is active. Register the server's SPN in Active Directory so Kerberos can be used, and set adbc.arpepgsql.require_kerberos=true to refuse a login that fell back to NTLM.

Python
conn = dbapi.connect(driver="arpepgsql", db_kwargs={
"adbc.arpepgsql.server": "db.example.com",
"adbc.arpepgsql.database": "mydb",
"adbc.arpepgsql.username": "alice",
"adbc.arpepgsql.auth_type": "integrated",
# optional: target SPN when it differs from POSTGRES/db.example.com
# "adbc.arpepgsql.krb5.spn": "postgres/db.example.com",
})

The target service principal name is derived as POSTGRES/<server> (no port), using the server value as given — connect by the fully qualified host name under which the SPN is registered, not by IP address. Change the service part with adbc.arpepgsql.krbsrvname, or set the whole SPN with adbc.arpepgsql.krb5.spn.


See also​