Known limits and troubleshooting
The PG port works, but the TDS client cannot log in
| Symptom | What to check | Action |
|---|---|---|
| Connection refused, or the client sees a protocol error immediately | psql speaks PG. tsql speaks TDS. The sockets use different ports. | In native psql as the DBA, inspect SHOW shared_preload_libraries, SHOW listen_addresses and SHOW babelfishpg_tds.port. Check the startup log for a bind failure. After changing the listener, restart and connect to the TDS port explicitly. |
unsupported TDS authentication | A broader HBA entry may select scram-sha-256. localhost can resolve to ::1 and miss an IPv4-only rule. | Inspect the server-reported database, role and source address. Match the physical database and the correct subnet with a supported HBA method. Put that rule first, reload and reconnect. |
| Login succeeds only with certificate validation disabled | The CA may be missing, or the client may use a name absent from the certificate. A stricter driver may also request an unsupported protocol version. | Install the issuing CA on the client, use the certificate hostname and verify the negotiated TLS version on the same session. Tested TLS settings |
| Initialization reports a reserved role or says the supplied login is not the owner | Initialization creates cluster roles and checks the physical database owner. The same cluster may already host an initialized Babelfish database. | Inspect the owner and existing roles in PG. Connect to the intended physical database. Use the existing mapping or start a fresh cluster when an independent mapping is needed. Preserve roles already in use. |
| The application connects but cannot find a table | The driver may have selected master, or a native query may be using a logical schema name. | Check DB_NAME() on TDS and current_database() on PG. Look up the catalog mapping and check the database user’s grants. Name lookup |
Permanent tables work, temporary objects fail
With an effective default of tde_heap, all three T-SQL temporary objects fail at creation. The 2601 in Unexpected catalog OID 2601 referenced in ENR identifies pg_am. On the actual TDS connection, check both default_table_access_method and pg_tde.enforce_encryption. Use heap/off for a runtime login that needs temporary objects and recycle its physical pool connections. All three objects then work, and their data can reach disk in plaintext. Runtime settings and rollback results
A deployment login can create encrypted permanent tables over TDS, or select tde_heap in a dedicated transaction and verify the resulting storage. The runtime login can then read and write them with ordinary T-SQL. Deploy and verify encrypted permanent tables
A session disappears during inspection or a mixed batch
Earlier assertion builds recorded a backend exit during storage inspection of a live T-SQL temporary object, including a table-variable case with default heap. Other connections were interrupted during server reinitialization. Ordinary heap DML and rollback have separate successful results. Keep storage diagnostics on persistent relations. After such a disconnect, inspect the server log and restart history, reconnect and verify the last committed transaction before replaying work.
The four-change candidate corrects statement and cursor reference release and the cleanup of a private scope still in use. Its release and assertion builds passed the transaction, error-handling and cursor cases. The historical records still lack direct evidence of the first incorrect release. Fix scope and build identity
In a separate isolated 19.0.1 FreeTDS run, an additional batch sequence involving a nullable string view and temporary objects ended with a client write error. The output did not establish the failing statement or a server crash. Check client messages and server logs together. Qualify the exact result-set shape and transaction used by the application. Covered procedure and type cases
An import reports success but rows are missing
One freebcp version counted client-side rows while the server reported a bulk-packet length error. SQL batch clients can also report success at process exit after a server error. Inspect server diagnostics, then query target counts and stable key/value totals from a new connection. Reconcile what was committed before retrying a partially applied batch. Driver versions and bulk results
A login cannot be dropped, or the restored server refuses to start
A native PG session is expected to refuse removal of a genuine Babelfish login. Manage that login through TDS. If an ordinary native superuser is misclassified, check that the deployed TDS module matches the 19.0.1 extension tree.
If startup reports a missing Babelfish requirement, restore the matching kernel, module files and preload configuration. Keep the feature marker and any TDE keys with the cluster. A logical archive rejected for a different PG version or migration mode needs a compatible target or an application-level migration. Backup and upgrade conditions