mirror of https://github.com/postgres/postgres
Foreign tables are a core component of SQL/MED. This commit does not provide a working SQL/MED infrastructure, because foreign tables cannot yet be queried. Support for foreign table scans will need to be added in a future patch. However, this patch creates the necessary system catalog structure, syntax support, and support for ancillary operations such as COMMENT and SECURITY LABEL. Shigeru Hanada, heavily revised by Robert Haaspull/1/head
parent
6600d5e91c
commit
0d692a0dc9
@ -0,0 +1,315 @@ |
||||
<!-- |
||||
doc/src/sgml/rel/alter_foreign_table.sgml |
||||
PostgreSQL documentation |
||||
--> |
||||
|
||||
<refentry id="SQL-ALTERFOREIGNTABLE"> |
||||
<refmeta> |
||||
<refentrytitle>ALTER FOREIGN TABLE</refentrytitle> |
||||
<manvolnum>7</manvolnum> |
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo> |
||||
</refmeta> |
||||
|
||||
<refnamediv> |
||||
<refname>ALTER FOREIGN TABLE</refname> |
||||
<refpurpose>change the definition of a foreign table</refpurpose> |
||||
</refnamediv> |
||||
|
||||
<indexterm zone="sql-alterforeigntable"> |
||||
<primary>ALTER FOREIGN TABLE</primary> |
||||
</indexterm> |
||||
|
||||
<refsynopsisdiv> |
||||
<synopsis> |
||||
ALTER FOREIGN TABLE <replaceable class="PARAMETER">name</replaceable> |
||||
<replaceable class="PARAMETER">action</replaceable> [, ... ] |
||||
ALTER FOREIGN TABLE <replaceable class="PARAMETER">name</replaceable> |
||||
RENAME [ COLUMN ] <replaceable class="PARAMETER">column</replaceable> TO <replaceable class="PARAMETER">new_column</replaceable> |
||||
ALTER FOREIGN TABLE <replaceable class="PARAMETER">name</replaceable> |
||||
RENAME TO <replaceable class="PARAMETER">new_name</replaceable> |
||||
ALTER FOREIGN TABLE <replaceable class="PARAMETER">name</replaceable> |
||||
SET SCHEMA <replaceable class="PARAMETER">new_schema</replaceable> |
||||
|
||||
<phrase>where <replaceable class="PARAMETER">action</replaceable> is one of:</phrase> |
||||
|
||||
ADD [ COLUMN ] <replaceable class="PARAMETER">column</replaceable> <replaceable class="PARAMETER">type</replaceable> |
||||
DROP [ COLUMN ] [ IF EXISTS ] <replaceable class="PARAMETER">column</replaceable> [ RESTRICT | CASCADE ] |
||||
ALTER [ COLUMN ] <replaceable class="PARAMETER">column</replaceable> [ SET DATA ] TYPE <replaceable class="PARAMETER">type</replaceable> |
||||
ALTER [ COLUMN ] <replaceable class="PARAMETER">column</replaceable> { SET | DROP } NOT NULL |
||||
OWNER TO <replaceable class="PARAMETER">new_owner</replaceable> |
||||
OPTIONS ( [ ADD | SET | DROP ] <replaceable class="PARAMETER">option</replaceable> ['<replaceable class="PARAMETER">value</replaceable>'] [, ... ]) |
||||
</synopsis> |
||||
</refsynopsisdiv> |
||||
|
||||
<refsect1> |
||||
<title>Description</title> |
||||
|
||||
<para> |
||||
<command>ALTER FOREIGN TABLE</command> changes the definition of an |
||||
existing foreign table. There are several subforms: |
||||
|
||||
<variablelist> |
||||
<varlistentry> |
||||
<term><literal>ADD COLUMN</literal></term> |
||||
<listitem> |
||||
<para> |
||||
This form adds a new column to the foreign table, using the same syntax as |
||||
<xref linkend="SQL-CREATEFOREIGNTABLE">. |
||||
</para> |
||||
</listitem> |
||||
</varlistentry> |
||||
|
||||
<varlistentry> |
||||
<term><literal>DROP COLUMN [ IF EXISTS ]</literal></term> |
||||
<listitem> |
||||
<para> |
||||
This form drops a column from a foreign table. |
||||
You will need to say <literal>CASCADE</> if |
||||
anything outside the table depends on the column; for example, |
||||
views. |
||||
If <literal>IF EXISTS</literal> is specified and the column |
||||
does not exist, no error is thrown. In this case a notice |
||||
is issued instead. |
||||
</para> |
||||
</listitem> |
||||
</varlistentry> |
||||
|
||||
<varlistentry> |
||||
<term><literal>SET DATA TYPE</literal></term> |
||||
<listitem> |
||||
<para> |
||||
This form changes the type of a column of a foreign table. |
||||
</para> |
||||
</listitem> |
||||
</varlistentry> |
||||
|
||||
<varlistentry> |
||||
<term><literal>SET</literal>/<literal>DROP NOT NULL</literal></term> |
||||
<listitem> |
||||
<para> |
||||
Mark a column as allowing, or not allowing, null values. |
||||
</para> |
||||
</listitem> |
||||
</varlistentry> |
||||
|
||||
<varlistentry> |
||||
<term><literal>OWNER</literal></term> |
||||
<listitem> |
||||
<para> |
||||
This form changes the owner of the foreign table to the |
||||
specified user. |
||||
</para> |
||||
</listitem> |
||||
</varlistentry> |
||||
|
||||
<varlistentry> |
||||
<term><literal>RENAME</literal></term> |
||||
<listitem> |
||||
<para> |
||||
The <literal>RENAME</literal> forms change the name of a foreign table |
||||
or the name of an individual column in a foreign table. |
||||
</para> |
||||
</listitem> |
||||
</varlistentry> |
||||
|
||||
<varlistentry> |
||||
<term><literal>SET SCHEMA</literal></term> |
||||
<listitem> |
||||
<para> |
||||
This form moves the foreign table into another schema. |
||||
</para> |
||||
</listitem> |
||||
</varlistentry> |
||||
|
||||
<varlistentry> |
||||
<term><literal>OPTIONS ( [ ADD | SET | DROP ] <replaceable class="PARAMETER">option</replaceable> ['<replaceable class="PARAMETER">value</replaceable>'] [, ... ] )</literal></term> |
||||
<listitem> |
||||
<para> |
||||
Change options for the foreign table or the column of the foreign table. |
||||
<literal>ADD</>, <literal>SET</>, and <literal>DROP</> |
||||
specify the action to be performed. <literal>ADD</> is assumed |
||||
if no operation is explicitly specified. Option names must be |
||||
unique; names and values are also validated using the foreign |
||||
data wrapper library. |
||||
</para> |
||||
</listitem> |
||||
</varlistentry> |
||||
|
||||
</variablelist> |
||||
</para> |
||||
|
||||
<para> |
||||
All the actions except <literal>RENAME</literal> and <literal>SET SCHEMA</> |
||||
can be combined into |
||||
a list of multiple alterations to apply in parallel. For example, it |
||||
is possible to add several columns and/or alter the type of several |
||||
columns in a single command. |
||||
</para> |
||||
|
||||
<para> |
||||
You must own the table to use <command>ALTER FOREIGN TABLE</>. |
||||
To change the schema of a foreign table, you must also have |
||||
<literal>CREATE</literal> privilege on the new schema. |
||||
To add the table as a new child of a parent table, you must own the |
||||
parent table as well. |
||||
To alter the owner, you must also be a direct or indirect member of the new |
||||
owning role, and that role must have <literal>CREATE</literal> privilege on |
||||
the table's schema. (These restrictions enforce that altering the owner |
||||
doesn't do anything you couldn't do by dropping and recreating the table. |
||||
However, a superuser can alter ownership of any table anyway.) |
||||
</para> |
||||
</refsect1> |
||||
|
||||
<refsect1> |
||||
<title>Parameters</title> |
||||
|
||||
<variablelist> |
||||
|
||||
<varlistentry> |
||||
<term><replaceable class="PARAMETER">name</replaceable></term> |
||||
<listitem> |
||||
<para> |
||||
The name (possibly schema-qualified) of an existing foreign table to |
||||
alter. |
||||
</para> |
||||
</listitem> |
||||
</varlistentry> |
||||
|
||||
<varlistentry> |
||||
<term><replaceable class="PARAMETER">column</replaceable></term> |
||||
<listitem> |
||||
<para> |
||||
Name of a new or existing column. |
||||
</para> |
||||
</listitem> |
||||
</varlistentry> |
||||
|
||||
<varlistentry> |
||||
<term><replaceable class="PARAMETER">new_column</replaceable></term> |
||||
<listitem> |
||||
<para> |
||||
New name for an existing column. |
||||
</para> |
||||
</listitem> |
||||
</varlistentry> |
||||
|
||||
<varlistentry> |
||||
<term><replaceable class="PARAMETER">new_name</replaceable></term> |
||||
<listitem> |
||||
<para> |
||||
New name for the table. |
||||
</para> |
||||
</listitem> |
||||
</varlistentry> |
||||
|
||||
<varlistentry> |
||||
<term><replaceable class="PARAMETER">type</replaceable></term> |
||||
<listitem> |
||||
<para> |
||||
Data type of the new column, or new data type for an existing |
||||
column. |
||||
</para> |
||||
</listitem> |
||||
</varlistentry> |
||||
|
||||
<varlistentry> |
||||
<term><literal>CASCADE</literal></term> |
||||
<listitem> |
||||
<para> |
||||
Automatically drop objects that depend on the dropped column |
||||
(for example, views referencing the column). |
||||
</para> |
||||
</listitem> |
||||
</varlistentry> |
||||
|
||||
<varlistentry> |
||||
<term><literal>RESTRICT</literal></term> |
||||
<listitem> |
||||
<para> |
||||
Refuse to drop the column if there are any dependent |
||||
objects. This is the default behavior. |
||||
</para> |
||||
</listitem> |
||||
</varlistentry> |
||||
|
||||
<varlistentry> |
||||
<term><replaceable class="PARAMETER">new_owner</replaceable></term> |
||||
<listitem> |
||||
<para> |
||||
The user name of the new owner of the table. |
||||
</para> |
||||
</listitem> |
||||
</varlistentry> |
||||
|
||||
<varlistentry> |
||||
<term><replaceable class="PARAMETER">new_schema</replaceable></term> |
||||
<listitem> |
||||
<para> |
||||
The name of the schema to which the table will be moved. |
||||
</para> |
||||
</listitem> |
||||
</varlistentry> |
||||
</variablelist> |
||||
</refsect1> |
||||
|
||||
<refsect1> |
||||
<title>Notes</title> |
||||
|
||||
<para> |
||||
The key word <literal>COLUMN</literal> is noise and can be omitted. |
||||
</para> |
||||
|
||||
<para> |
||||
Consistency with the foreign server is not checked when a column is |
||||
added or removed with <literal>ADD COLUMN</literal> or |
||||
<literal>DROP COLUMN</literal>, a system <literal>oid</> column is added |
||||
or removed, a <literal>CHECK</> or <literal>NOT NULL</> constraint is |
||||
added, or column type is changed with <literal>ALTER TYPE</>. It is the |
||||
user's responsibility to ensure that the table definition matches the |
||||
remote side. |
||||
</para> |
||||
|
||||
<para> |
||||
Refer to <xref linkend="sql-createforeigntable"> for a further description of valid |
||||
parameters. |
||||
</para> |
||||
</refsect1> |
||||
|
||||
<refsect1> |
||||
<title>Examples</title> |
||||
|
||||
<para> |
||||
To mark a column as not-null: |
||||
<programlisting> |
||||
ALTER FOREIGN TABLE distributors ALTER COLUMN street SET NOT NULL; |
||||
</programlisting> |
||||
</para> |
||||
|
||||
<para> |
||||
To change options of a foreign table: |
||||
<programlisting> |
||||
ALTER FOREIGN TABLE myschema.distributors OPTIONS (ADD opt1 'value', SET opt2, 'value2', DROP opt3 'value3'); |
||||
</programlisting> |
||||
</para> |
||||
|
||||
</refsect1> |
||||
|
||||
<refsect1> |
||||
<title>Compatibility</title> |
||||
|
||||
<para> |
||||
The forms <literal>ADD</literal>, <literal>DROP</>, |
||||
and <literal>SET DATA TYPE</literal> |
||||
conform with the SQL standard. The other forms are |
||||
<productname>PostgreSQL</productname> extensions of the SQL standard. |
||||
Also, the ability to specify more than one manipulation in a single |
||||
<command>ALTER FOREIGN TABLE</> command is an extension. |
||||
</para> |
||||
|
||||
<para> |
||||
<command>ALTER FOREIGN TABLE DROP COLUMN</> can be used to drop the only |
||||
column of a foreign table, leaving a zero-column table. This is an |
||||
extension of SQL, which disallows zero-column foreign tables. |
||||
</para> |
||||
</refsect1> |
||||
</refentry> |
@ -0,0 +1,188 @@ |
||||
<!-- doc/src/sgml/ref/create_foreign_table.sgml --> |
||||
|
||||
<refentry id="SQL-CREATEFOREIGNTABLE"> |
||||
<refmeta> |
||||
<refentrytitle>CREATE FOREIGN TABLE</refentrytitle> |
||||
<manvolnum>7</manvolnum> |
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo> |
||||
</refmeta> |
||||
|
||||
<refnamediv> |
||||
<refname>CREATE FOREIGN TABLE</refname> |
||||
<refpurpose>define a new foreign table</refpurpose> |
||||
</refnamediv> |
||||
|
||||
<indexterm zone="sql-createforeigntable"> |
||||
<primary>CREATE FOREIGN TABLE</primary> |
||||
</indexterm> |
||||
|
||||
<refsynopsisdiv> |
||||
<synopsis> |
||||
CREATE FOREIGN TABLE [ IF NOT EXISTS ] <replaceable class="PARAMETER">table_name</replaceable> ( [ |
||||
{ <replaceable class="PARAMETER">column_name</replaceable> <replaceable class="PARAMETER">data_type</replaceable> [ NULL | NOT NULL ] } |
||||
[, ... ] |
||||
] ) |
||||
SERVER <replaceable class="parameter">server_name</replaceable> |
||||
[ OPTIONS ( <replaceable class="PARAMETER">option</replaceable> '<replaceable class="PARAMETER">value</replaceable>' [, ... ] ) ] |
||||
|
||||
</synopsis> |
||||
</refsynopsisdiv> |
||||
|
||||
<refsect1 id="SQL-CREATEFOREIGNTABLE-description"> |
||||
<title>Description</title> |
||||
|
||||
<para> |
||||
<command>CREATE FOREIGN TABLE</command> will create a new foreign table |
||||
in the current database. The table will be owned by the user issuing the |
||||
command. |
||||
</para> |
||||
|
||||
<para> |
||||
If a schema name is given (for example, <literal>CREATE FOREIGN TABLE |
||||
myschema.mytable ...</>) then the table is created in the specified |
||||
schema. Otherwise it is created in the current schema. |
||||
The name of the foreign table must be |
||||
distinct from the name of any other foreign table, table, sequence, index, |
||||
or view in the same schema. |
||||
</para> |
||||
|
||||
<para> |
||||
<command>CREATE FOREIGN TABLE</command> also automatically creates a data |
||||
type that represents the composite type corresponding to one row of |
||||
the foreign table. Therefore, foreign tables cannot have the same |
||||
name as any existing data type in the same schema. |
||||
</para> |
||||
</refsect1> |
||||
|
||||
<refsect1> |
||||
<title>Parameters</title> |
||||
|
||||
<variablelist> |
||||
|
||||
<varlistentry> |
||||
<term><literal>IF NOT EXISTS</></term> |
||||
<listitem> |
||||
<para> |
||||
Do not throw an error if a relation with the same name already exists. |
||||
A notice is issued in this case. Note that there is no guarantee that |
||||
the existing relation is anything like the one that would have been |
||||
created. |
||||
</para> |
||||
</listitem> |
||||
</varlistentry> |
||||
|
||||
<varlistentry> |
||||
<term><replaceable class="PARAMETER">table_name</replaceable></term> |
||||
<listitem> |
||||
<para> |
||||
The name (optionally schema-qualified) of the table to be created. |
||||
</para> |
||||
</listitem> |
||||
</varlistentry> |
||||
|
||||
<varlistentry> |
||||
<term><replaceable class="PARAMETER">column_name</replaceable></term> |
||||
<listitem> |
||||
<para> |
||||
The name of a column to be created in the new table. |
||||
</para> |
||||
</listitem> |
||||
</varlistentry> |
||||
|
||||
<varlistentry> |
||||
<term><replaceable class="PARAMETER">data_type</replaceable></term> |
||||
<listitem> |
||||
<para> |
||||
The data type of the column. This can include array |
||||
specifiers. For more information on the data types supported by |
||||
<productname>PostgreSQL</productname>, refer to <xref |
||||
linkend="datatype">. |
||||
</para> |
||||
</listitem> |
||||
</varlistentry> |
||||
|
||||
<varlistentry> |
||||
<term><literal>NOT NULL</></term> |
||||
<listitem> |
||||
<para> |
||||
The column is not allowed to contain null values. |
||||
</para> |
||||
</listitem> |
||||
</varlistentry> |
||||
|
||||
<varlistentry> |
||||
<term><literal>NULL</></term> |
||||
<listitem> |
||||
<para> |
||||
The column is allowed to contain null values. This is the default. |
||||
</para> |
||||
|
||||
<para> |
||||
This clause is only provided for compatibility with |
||||
non-standard SQL databases. Its use is discouraged in new |
||||
applications. |
||||
</para> |
||||
</listitem> |
||||
</varlistentry> |
||||
|
||||
<varlistentry> |
||||
<term><literal>OPTIONS ( <replaceable class="PARAMETER">option</replaceable> = '<replaceable class="PARAMETER">value</replaceable>' [, ...] )</literal></term> |
||||
<listitem> |
||||
<para> |
||||
Options to be associated with the new foreign table. |
||||
The allowed option names and values are specific to each foreign |
||||
data wrapper and are validated using the foreign-data wrapper |
||||
library. Option names must be unique. |
||||
</para> |
||||
</listitem> |
||||
</varlistentry> |
||||
|
||||
</variablelist> |
||||
|
||||
</refsect1> |
||||
|
||||
|
||||
<refsect1 id="SQL-CREATEFOREIGNTABLE-examples"> |
||||
<title>Examples</title> |
||||
|
||||
<para> |
||||
Create foreign table <structname>films</> with <structname>film_server</>: |
||||
|
||||
<programlisting> |
||||
CREATE FOREIGN TABLE films ( |
||||
code char(5) NOT NULL, |
||||
title varchar(40) NOT NULL, |
||||
did integer NOT NULL, |
||||
date_prod date, |
||||
kind varchar(10), |
||||
len interval hour to minute |
||||
) |
||||
SERVER film_server; |
||||
</programlisting> |
||||
</para> |
||||
|
||||
</refsect1> |
||||
|
||||
<refsect1 id="SQL-CREATEFOREIGNTABLE-compatibility"> |
||||
<title id="SQL-CREATEFOREIGNTABLE-compatibility-title">Compatibility</title> |
||||
|
||||
<para> |
||||
The <command>CREATE FOREIGN TABLE</command> command largely conforms to the |
||||
<acronym>SQL</acronym> standard; however, much as with |
||||
<link linkend="sql-createtable"><command>CREATE TABLE</></link>, |
||||
<literal>NULL</> constraints and zero-column foreign tables are permitted. |
||||
</para> |
||||
|
||||
</refsect1> |
||||
|
||||
<refsect1> |
||||
<title>See Also</title> |
||||
|
||||
<simplelist type="inline"> |
||||
<member><xref linkend="sql-alterforeigntable"></member> |
||||
<member><xref linkend="sql-dropforeigntable"></member> |
||||
<member><xref linkend="sql-createtable"></member> |
||||
<member><xref linkend="sql-createserver"></member> |
||||
</simplelist> |
||||
</refsect1> |
||||
</refentry> |
@ -0,0 +1,112 @@ |
||||
<!-- doc/src/sggml/ref/drop_foreign_table.sgml --> |
||||
|
||||
<refentry id="SQL-DROPFOREIGNTABLE"> |
||||
<refmeta> |
||||
<refentrytitle>DROP FOREIGN TABLE</refentrytitle> |
||||
<manvolnum>7</manvolnum> |
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo> |
||||
</refmeta> |
||||
|
||||
<refnamediv> |
||||
<refname>DROP FOREIGN TABLE</refname> |
||||
<refpurpose>remove a foreign table</refpurpose> |
||||
</refnamediv> |
||||
|
||||
<indexterm zone="sql-dropforeigntable"> |
||||
<primary>DROP FOREIGN TABLE</primary> |
||||
</indexterm> |
||||
|
||||
<refsynopsisdiv> |
||||
<synopsis> |
||||
DROP FOREIGN TABLE [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceable> [, ...] [ CASCADE | RESTRICT ] |
||||
</synopsis> |
||||
</refsynopsisdiv> |
||||
|
||||
<refsect1> |
||||
<title>Description</title> |
||||
|
||||
<para> |
||||
<command>DROP FOREIGN TABLE</command> removes a foreign table. |
||||
Only the owner of a foreign table can remove it. |
||||
</para> |
||||
</refsect1> |
||||
|
||||
<refsect1> |
||||
<title>Parameters</title> |
||||
|
||||
<variablelist> |
||||
<varlistentry> |
||||
<term><literal>IF EXISTS</literal></term> |
||||
<listitem> |
||||
<para> |
||||
Do not throw an error if the foreign table does not exist. |
||||
A notice is issued in this case. |
||||
</para> |
||||
</listitem> |
||||
</varlistentry> |
||||
|
||||
<varlistentry> |
||||
<term><replaceable class="PARAMETER">name</replaceable></term> |
||||
<listitem> |
||||
<para> |
||||
The name (optionally schema-qualified) of the foreign table to drop. |
||||
</para> |
||||
</listitem> |
||||
</varlistentry> |
||||
|
||||
<varlistentry> |
||||
<term><literal>CASCADE</literal></term> |
||||
<listitem> |
||||
<para> |
||||
Automatically drop objects that depend on the foreign table (such as |
||||
views). |
||||
</para> |
||||
</listitem> |
||||
</varlistentry> |
||||
|
||||
<varlistentry> |
||||
<term><literal>RESTRICT</literal></term> |
||||
<listitem> |
||||
<para> |
||||
Refuse to drop the foreign table if any objects depend on it. This is |
||||
the default. |
||||
</para> |
||||
</listitem> |
||||
</varlistentry> |
||||
</variablelist> |
||||
</refsect1> |
||||
|
||||
<refsect1> |
||||
<title>Examples</title> |
||||
|
||||
<para> |
||||
To destroy two foreign tables, <literal>films</literal> and |
||||
<literal>distributors</literal>: |
||||
|
||||
<programlisting> |
||||
DROP FOREIGN TABLE films, distributors; |
||||
</programlisting> |
||||
</para> |
||||
</refsect1> |
||||
|
||||
<refsect1> |
||||
<title>Compatibility</title> |
||||
|
||||
<para> |
||||
This command conforms to the ISO/IEC 9075-9 (SQL/MED), except that the |
||||
standard only allows one foreign table to be dropped per command, and apart |
||||
from the <literal>IF EXISTS</> option, which is a <productname>PostgreSQL</> |
||||
extension. |
||||
</para> |
||||
</refsect1> |
||||
|
||||
<refsect1> |
||||
<title>See Also</title> |
||||
|
||||
<simplelist type="inline"> |
||||
<member><xref linkend="sql-alterforeigntable"></member> |
||||
<member><xref linkend="sql-createforeigntable"></member> |
||||
</simplelist> |
||||
</refsect1> |
||||
|
||||
</refentry> |
@ -0,0 +1,53 @@ |
||||
/*-------------------------------------------------------------------------
|
||||
* |
||||
* pg_foreign_table.h |
||||
* definition of the system "foreign table" relation (pg_foreign_table) |
||||
* |
||||
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group |
||||
* Portions Copyright (c) 1994, Regents of the University of California |
||||
* |
||||
* src/include/catalog/pg_foreign_table.h |
||||
* |
||||
* NOTES |
||||
* the genbki.sh script reads this file and generates .bki |
||||
* information from the DATA() statements. |
||||
* |
||||
*------------------------------------------------------------------------- |
||||
*/ |
||||
#ifndef PG_FOREIGN_TABLE_H |
||||
#define PG_FOREIGN_TABLE_H |
||||
|
||||
#include "catalog/genbki.h" |
||||
|
||||
/* ----------------
|
||||
* pg_foreign_table definition. cpp turns this into |
||||
* typedef struct FormData_pg_foreign_table |
||||
* ---------------- |
||||
*/ |
||||
#define ForeignTableRelationId 3118 |
||||
|
||||
CATALOG(pg_foreign_table,3118) BKI_WITHOUT_OIDS |
||||
{ |
||||
Oid ftrelid; /* OID of foreign table */ |
||||
Oid ftserver; /* OID of foreign server */ |
||||
text ftoptions[1]; /* FDW-specific options */ |
||||
} FormData_pg_foreign_table; |
||||
|
||||
/* ----------------
|
||||
* Form_pg_foreign_table corresponds to a pointer to a tuple with |
||||
* the format of pg_foreign_table relation. |
||||
* ---------------- |
||||
*/ |
||||
typedef FormData_pg_foreign_table *Form_pg_foreign_table; |
||||
|
||||
/* ----------------
|
||||
* compiler constants for pg_foreign_table |
||||
* ---------------- |
||||
*/ |
||||
|
||||
#define Natts_pg_foreign_table 3 |
||||
#define Anum_pg_foreign_table_ftrelid 1 |
||||
#define Anum_pg_foreign_table_ftserver 2 |
||||
#define Anum_pg_foreign_table_ftoptions 3 |
||||
|
||||
#endif /* PG_FOREIGN_TABLE_H */ |
Loading…
Reference in new issue