1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-21 05:21:08 +03:00

Basic foreign table support.

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 Haas
This commit is contained in:
Robert Haas
2011-01-01 23:48:11 -05:00
parent 6600d5e91c
commit 0d692a0dc9
69 changed files with 2275 additions and 211 deletions

View File

@@ -867,12 +867,14 @@ testdb=>
<listitem>
<para>
For each relation (table, view, index, or sequence) matching the
For each relation (table, view, index, sequence or foreign table)
matching the
<replaceable class="parameter">pattern</replaceable>, show all
columns, their types, the tablespace (if not the default) and any
special attributes such as <literal>NOT NULL</literal> or defaults.
Associated indexes, constraints, rules, and triggers are
also shown.
also shown. For foreign tables, the associated foreign
server is shown as well.
(<quote>Matching the pattern</> is defined in
<xref linkend="APP-PSQL-patterns" endterm="APP-PSQL-patterns-title">
below.)
@@ -882,7 +884,8 @@ testdb=&gt;
The command form <literal>\d+</literal> is identical, except that
more information is displayed: any comments associated with the
columns of the table are shown, as is the presence of OIDs in the
table, and the view definition if the relation is a view.
table, the view definition if the relation is a view, and the generic
options if the relation is a foreign table.
</para>
<para>
@@ -895,9 +898,9 @@ testdb=&gt;
<para>
If <command>\d</command> is used without a
<replaceable class="parameter">pattern</replaceable> argument, it is
equivalent to <command>\dtvs</command> which will show a list of
all visible tables, views, and sequences. This is purely a convenience
measure.
equivalent to <command>\dtvsE</command> which will show a list of
all visible tables, views, sequences and foreign tables.
This is purely a convenience measure.
</para>
</note>
</listitem>
@@ -1034,6 +1037,20 @@ testdb=&gt;
</varlistentry>
<varlistentry>
<term><literal>\det[+] [ <link linkend="APP-PSQL-patterns"><replaceable class="parameter">pattern</replaceable></link> ]</literal></term>
<listitem>
<para>
Lists foreign tables (mnemonic: <quote>external tables</quote>).
If <replaceable class="parameter">pattern</replaceable> is
specified, only entries whose table name or schema name matches
the pattern are listed. If the form <literal>\det+</literal>
is used, generic options are also displayed.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>\des[+] [ <link linkend="APP-PSQL-patterns"><replaceable class="parameter">pattern</replaceable></link> ]</literal></term>
<listitem>
@@ -1197,13 +1214,15 @@ testdb=&gt;
<term><literal>\ds[S+] [ <link linkend="APP-PSQL-patterns"><replaceable class="parameter">pattern</replaceable></link> ]</literal></term>
<term><literal>\dt[S+] [ <link linkend="APP-PSQL-patterns"><replaceable class="parameter">pattern</replaceable></link> ]</literal></term>
<term><literal>\dv[S+] [ <link linkend="APP-PSQL-patterns"><replaceable class="parameter">pattern</replaceable></link> ]</literal></term>
<term><literal>\dE[S+] [ <link linkend="APP-PSQL-patterns"><replaceable class="parameter">pattern</replaceable></link> ]</literal></term>
<listitem>
<para>
In this group of commands, the letters
<literal>i</literal>, <literal>s</literal>,
<literal>t</literal>, and <literal>v</literal>
stand for index, sequence, table, and view, respectively.
<literal>t</literal>, <literal>v</literal>, and <literal>E</literal>
stand for index, sequence, table, view, and foreign table,
respectively.
You can specify any or all of
these letters, in any order, to obtain a listing of objects
of these types. For example, <literal>\dit</> lists indexes