tds_fdw
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
tds_fdw | 2.0.5 | FDW | PostgreSQL | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 8620 | tds_fdw | No | Yes | No | Yes | No | Yes | - |
| Related | babelfishpg_tds odbc_fdw jdbc_fdw oracle_fdw wrappers multicorn mysql_fdw orafce db2fce db2_fdw |
|---|
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PGDG | 2.0.5 | 1817161514 | tds_fdw | - |
| RPM | PGDG | 2.0.5 | 1817161514 | tds_fdw_$v | - |
| DEB | PGDG | 2.0.5 | 1817161514 | postgresql-$v-tds-fdw | - |
Install
You can install tds_fdw directly. First, make sure the PGDG repository is added and enabled:
Install the extension using pig or apt/yum/dnf:
Create Extension:
Usage
- Sources: README, foreign server, foreign table, user mapping, foreign schema, variables
tds_fdw is a foreign data wrapper for querying TDS databases such as Sybase and Microsoft SQL Server through a DB-Library implementation such as FreeTDS.
Create Server
Server Options: servername (server address or DSN, supports comma-separated failover list), port, database, dbuse (0 for direct connection, non-0 for dbuse()), tds_version (protocol version), language, character_set, msg_handler (notice or blackhole), sqlserver_ansi_mode, fdw_startup_cost, fdw_tuple_cost.
Create User Mapping
For Azure SQL databases, use the format username@servername for the username option.
Create Foreign Table
Map a remote table directly:
Or use a custom SQL query:
Table Options: table_name or query (one required, mutually exclusive), schema_name, match_column_names (map by name vs position), use_remote_estimate, local_tuple_estimate, row_estimate_method (execute or showplan_all).
Column Options: column_name (remote column name if different from local).
Query and Debug
Import Foreign Schema
Import Options: import_default, import_not_null, and keep_custom_types for preserving Sybase user-defined types when matching PostgreSQL domains already exist.
Planner And Runtime Notes
The upstream README says the current version does not support join pushdown or write operations. It does support WHERE and column pushdown when match_column_names is enabled.
Set diagnostic memory-stat variables with PostgreSQL SET, for example:
Available variables are tds_fdw.show_before_row_memory_stats, tds_fdw.show_after_row_memory_stats, and tds_fdw.show_finished_memory_stats.
Pigsty package metadata is version 2.0.5 from PGDG for PostgreSQL 14-18. Upstream docs say the FDW should support PostgreSQL 9.2+ and the current build matrix includes PostgreSQL 13-18, but this stub follows the packaged PostgreSQL versions from db/extension.csv.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)