ALTER FOREIGN TABLE

A DDL command to modify a foreign table

ALTER FOREIGN TABLE is a DDL command to modify a foreign table.

ALTER FOREIGN TABLE was added in PostgreSQL 9.1.

Change history

  • PostgreSQL 13
    • ALTER FOREIGN TABLE ... RENAME COLUMN returns ALTER FOREIGN TABLE (instead of ALTER TABLE) on successful command completion (commit 979766c0)
  • PostgreSQL 12
    • ALTER FOREIGN TABLE ... SET WITH OIDS syntax removed (commit 578b2297)
    • support for generated columns via the GENERATED ALWAYS AS ... STORED clause added (commit fc22b662)
  • PostgreSQL 9.5
    • ALTER FOREIGN TABLE ... INHERIT / NO INHERIT syntax added (commit cb1ca4d8)
    • ALTER FOREIGN TABLE ... SET WITH / WITHOUT OIDS syntax added (commit cb1ca4d8)
    • ALTER FOREIGN TABLE ... ALTER COLUMN ... SET STORAGE syntax added (commit cb1ca4d8)
    • CURRENT_USER / SESSION_USER can now be used to specify user names (commit 31eae602)
    • support for CHECK constraints added (commit fc2ac1fb)
  • PostgreSQL 9.4
    • support for enabling/disabling triggers added (commit 7cbe57c3)
  • PostgreSQL 9.3
    • ALTER FOREIGN TABLE ... ALTER COLUMN ... SET DEFAULT ... / DROP DEFAULT syntax added (commit a0c6dfee)
  • PostgreSQL 9.2
    • ALTER FOREIGN TABLE IF EXISTS ... syntax added (commit b8a91d9d)
    • ALTER FOREIGN TABLE ... ALTER COLUMN ... OPTIONS (...) clause added (commit c4096c76)
    • ALTER FOREIGN TABLE ... SET STATISTICS / SET (...) / RESET (...) syntax added (commit 263d9de6)
  • PostgreSQL 9.1

Categories

DDL, Foreign Data Wrapper (FDW)

See also

CREATE FOREIGN TABLE, DROP FOREIGN TABLE, foreign table