HomeMogDBMogDB StackUqbar
v2.1

Documentation:v2.1

Supported Versions:

ALTER FOREIGN TABLE

Function

ALTER FOREIGN TABLE modifies a foreign table.

Syntax

AlterForeignTable ::= ALTER FOREIGN TABLE [ IF EXISTS ]  table_name
    OPTIONS ( {[ ADD | SET | DROP ] option ['value']}[, ... ]);
AlterForeignTable ::= ALTER FOREIGN TABLE [ IF EXISTS ] table_name
    ALTER column_name OPTIONS;

Parameter Description

  • table_name

    Specifies the name of an existing foreign table to be modified.

    Value range: an existing foreign table name.

  • option

    Specifies the option of a foreign table or foreign table column to be modified. ADD, SET, and DROP are operations to be performed. If no operation is set explicitly, the default value ADD is used. The option name must be unique (although table options and table column options can share the same name). The name and value of the option are also validated by a class library of a foreign data wrapper.

    • Options supported by oracle_fdw are as follows:

      • table

        Name of a table on the Oracle server. The value must be the same as the table name recorded in the Oracle system catalog. Generally, the value consists of uppercase letters.

      • schema

        Schema (or owner) corresponding to the table. The value must be the same as the table name recorded in the Oracle system catalog. Generally, the value consists of uppercase letters.

    • Options supported by mysql_fdw are as follows:

      • dbname

        Name of the MySQL database.

      • table_name

        Name of a table in the MySQL database.

    • Options supported by postgres_fdw are as follows:

      • schema_name

        Schema name of a remote server. If this option is not specified, the schema name of the foreign table is used as the schema name of the remote server.

      • table_name

        Table name of a remote server. If this option is not specified, the name of the foreign table is used as the table name of the remote server.

      • column_name

        Column name of a table on a remote server. If this option is not specified, the column name of the foreign table is used as the column name of a table on a remote server.

  • Options supported by file_fdw are as follows:

    • filename

      File to be read. This parameter is mandatory and must be an absolute path.

    • format

      File format of the remote server, which is the same as the FORMAT option in the COPY statement. The value can be text, csv, binary, or fixed.

    • header

      Specifies whether a specified file has a header, which is the same as the HEADER option of the COPY statement.

    • delimiter

      File delimiter, which is the same as the DELIMITER option of the COPY statement.

    • quote

      Quote character of a file, which is the same as the QUOTE option of the COPY statement.

    • escape

      Escape character of a file, which is the same as the ESCAPE option of the COPY statement.

    • null

      Null string of a file, which is the same as the NULL option of the COPY statement.

    • encoding

      Encoding of a file, which is the same as the ENCODING option of the COPY statement.

    • force_not_null

      This is a Boolean option. If it is true, the value of the declared field cannot be an empty string. This option is the same as the FORCE_NOT_NULL option of the COPY statement.

    img NOTE: For details about how to use file_fdw, see file_fdw.

  • value

    Specifies the new value of option.

CREATE FOREIGN TABLEDROP FOREIGN TABLE

Copyright © 2011-2024 www.enmotech.com All rights reserved.