pg_foreign_server

A system catalogue table storing foreign server definitions for FDWs

pg_foreign_server is a system catalogue table storing foreign server definitions for FDWs defined with the CREATE SERVER command.

pg_foreign_server was introduced in PostgreSQL 8.4.

psql command

\des lists foreign servers.

Definition by PostgreSQL version

pg_foreign_server (PostgreSQL 13)

          Table "pg_catalog.pg_foreign_server"
   Column   |   Type    | Collation | Nullable | Default
------------+-----------+-----------+----------+---------
 oid        | oid       |           | not null |
 srvname    | name      |           | not null |
 srvowner   | oid       |           | not null |
 srvfdw     | oid       |           | not null |
 srvtype    | text      | C         |          |
 srvversion | text      | C         |          |
 srvacl     | aclitem[] |           |          |
 srvoptions | text[]    | C         |          |
Indexes:
    "pg_foreign_server_name_index" UNIQUE, btree (srvname)
    "pg_foreign_server_oid_index" UNIQUE, btree (oid)
    

Documentation: pg_foreign_server

pg_foreign_server (PostgreSQL 12)

          Table "pg_catalog.pg_foreign_server"
   Column   |   Type    | Collation | Nullable | Default
------------+-----------+-----------+----------+---------
 oid        | oid       |           | not null |
 srvname    | name      |           | not null |
 srvowner   | oid       |           | not null |
 srvfdw     | oid       |           | not null |
 srvtype    | text      | C         |          |
 srvversion | text      | C         |          |
 srvacl     | aclitem[] |           |          |
 srvoptions | text[]    | C         |          |
Indexes:
    "pg_foreign_server_name_index" UNIQUE, btree (srvname)
    "pg_foreign_server_oid_index" UNIQUE, btree (oid)
    

Documentation: pg_foreign_server

pg_foreign_server (PostgreSQL 11)

          Table "pg_catalog.pg_foreign_server"
   Column   |   Type    | Collation | Nullable | Default
------------+-----------+-----------+----------+---------
 srvname    | name      |           | not null |
 srvowner   | oid       |           | not null |
 srvfdw     | oid       |           | not null |
 srvtype    | text      |           |          |
 srvversion | text      |           |          |
 srvacl     | aclitem[] |           |          |
 srvoptions | text[]    |           |          |
Indexes:
    "pg_foreign_server_name_index" UNIQUE, btree (srvname)
    "pg_foreign_server_oid_index" UNIQUE, btree (oid)
    

Documentation: pg_foreign_server

pg_foreign_server (PostgreSQL 10)

          Table "pg_catalog.pg_foreign_server"
   Column   |   Type    | Collation | Nullable | Default
------------+-----------+-----------+----------+---------
 srvname    | name      |           | not null |
 srvowner   | oid       |           | not null |
 srvfdw     | oid       |           | not null |
 srvtype    | text      |           |          |
 srvversion | text      |           |          |
 srvacl     | aclitem[] |           |          |
 srvoptions | text[]    |           |          |
Indexes:
    "pg_foreign_server_name_index" UNIQUE, btree (srvname)
    "pg_foreign_server_oid_index" UNIQUE, btree (oid)
    

Documentation: pg_foreign_server

pg_foreign_server (PostgreSQL 9.6)

Table "pg_catalog.pg_foreign_server"
   Column   |   Type    | Modifiers
------------+-----------+-----------
 srvname    | name      | not null
 srvowner   | oid       | not null
 srvfdw     | oid       | not null
 srvtype    | text      |
 srvversion | text      |
 srvacl     | aclitem[] |
 srvoptions | text[]    |
Indexes:
    "pg_foreign_server_name_index" UNIQUE, btree (srvname)
    "pg_foreign_server_oid_index" UNIQUE, btree (oid)
    

Documentation: pg_foreign_server

pg_foreign_server (PostgreSQL 9.5)

Table "pg_catalog.pg_foreign_server"
   Column   |   Type    | Modifiers
------------+-----------+-----------
 srvname    | name      | not null
 srvowner   | oid       | not null
 srvfdw     | oid       | not null
 srvtype    | text      |
 srvversion | text      |
 srvacl     | aclitem[] |
 srvoptions | text[]    |
Indexes:
    "pg_foreign_server_name_index" UNIQUE, btree (srvname)
    "pg_foreign_server_oid_index" UNIQUE, btree (oid)
    

Documentation: pg_foreign_server

pg_foreign_server (PostgreSQL 9.4)

Table "pg_catalog.pg_foreign_server"
   Column   |   Type    | Modifiers
------------+-----------+-----------
 srvname    | name      | not null
 srvowner   | oid       | not null
 srvfdw     | oid       | not null
 srvtype    | text      |
 srvversion | text      |
 srvacl     | aclitem[] |
 srvoptions | text[]    |
Indexes:
    "pg_foreign_server_name_index" UNIQUE, btree (srvname)
    "pg_foreign_server_oid_index" UNIQUE, btree (oid)
    

Documentation: pg_foreign_server

pg_foreign_server (PostgreSQL 9.3)

Table "pg_catalog.pg_foreign_server"
   Column   |   Type    | Modifiers
------------+-----------+-----------
 srvname    | name      | not null
 srvowner   | oid       | not null
 srvfdw     | oid       | not null
 srvtype    | text      |
 srvversion | text      |
 srvacl     | aclitem[] |
 srvoptions | text[]    |
Indexes:
    "pg_foreign_server_name_index" UNIQUE, btree (srvname)
    "pg_foreign_server_oid_index" UNIQUE, btree (oid)
    

Documentation: pg_foreign_server

pg_foreign_server (PostgreSQL 9.2)

Table "pg_catalog.pg_foreign_server"
   Column   |   Type    | Modifiers
------------+-----------+-----------
 srvname    | name      | not null
 srvowner   | oid       | not null
 srvfdw     | oid       | not null
 srvtype    | text      |
 srvversion | text      |
 srvacl     | aclitem[] |
 srvoptions | text[]    |
Indexes:
    "pg_foreign_server_name_index" UNIQUE, btree (srvname)
    "pg_foreign_server_oid_index" UNIQUE, btree (oid)
    

Documentation: pg_foreign_server

pg_foreign_server (PostgreSQL 9.1)

Table "pg_catalog.pg_foreign_server"
   Column   |   Type    | Modifiers
------------+-----------+-----------
 srvname    | name      | not null
 srvowner   | oid       | not null
 srvfdw     | oid       | not null
 srvtype    | text      |
 srvversion | text      |
 srvacl     | aclitem[] |
 srvoptions | text[]    |
Indexes:
    "pg_foreign_server_name_index" UNIQUE, btree (srvname)
    "pg_foreign_server_oid_index" UNIQUE, btree (oid)
    

Documentation: pg_foreign_server

pg_foreign_server (PostgreSQL 9.0)

Table "pg_catalog.pg_foreign_server"
   Column   |   Type    | Modifiers
------------+-----------+-----------
 srvname    | name      | not null
 srvowner   | oid       | not null
 srvfdw     | oid       | not null
 srvtype    | text      |
 srvversion | text      |
 srvacl     | aclitem[] |
 srvoptions | text[]    |
Indexes:
    "pg_foreign_server_name_index" UNIQUE, btree (srvname)
    "pg_foreign_server_oid_index" UNIQUE, btree (oid)
    

Documentation: pg_foreign_server

pg_foreign_server (PostgreSQL 8.4)

Table "pg_catalog.pg_foreign_server"
   Column   |   Type    | Modifiers
------------+-----------+-----------
 srvname    | name      | not null
 srvowner   | oid       | not null
 srvfdw     | oid       | not null
 srvtype    | text      |
 srvversion | text      |
 srvacl     | aclitem[] |
 srvoptions | text[]    |
Indexes:
    "pg_foreign_server_name_index" UNIQUE, btree (srvname)
    "pg_foreign_server_oid_index" UNIQUE, btree (oid)
    

Documentation: pg_foreign_server

Change history

This table has not been modified since it was first added in PostgreSQL 8.4.

Examples

postgres=# CREATE SERVER fdw_test
  FOREIGN DATA WRAPPER postgres_fdw
  OPTIONS (
    host 'remotehost',
    port '5432,
    dbname 'postgres'
 );
CREATE SERVER

postgres=# SELECT * FROM pg_foreign_server ;
-[ RECORD 1 ]------------------------------------------
oid        | 16459
srvname    | fdw_test
srvowner   | 10
srvfdw     | 16458
srvtype    |
srvversion |
srvacl     |
srvoptions | {host=remotehost,port=5432,dbname=postgres}

Categories

Foreign Data Wrapper (FDW), System catalogue

See also

CREATE SERVER, ALTER SERVER, DROP SERVER, pg_user_mapping, pg_user_mappings