Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
a8e5f53
catalog: add pg_foreign_catalog, pg_foreign_volume, pg_lake_table
MisterRaindrop Jul 2, 2026
c2bb7c0
nodes: add parse nodes for Iceberg lake-table DDL
MisterRaindrop Jul 2, 2026
b028fb8
parser: add grammar for CREATE ICEBERG TABLE / FOREIGN CATALOG / VOLUME
MisterRaindrop Jul 2, 2026
5a679b2
commands: implement CREATE/DROP FOREIGN CATALOG and FOREIGN VOLUME
MisterRaindrop Jul 2, 2026
b4704be
commands: implement CREATE ICEBERG TABLE
MisterRaindrop Jul 2, 2026
a81bd6b
bin: pg_dump skip and psql tab completion for lake-table DDL
MisterRaindrop Jul 2, 2026
73172e8
tests: add lake_table regression test, refresh catalog expecteds
MisterRaindrop Jul 2, 2026
5be5f9f
Use ASF license header for new lake-table source files
MisterRaindrop Jul 6, 2026
272d910
Move ASF license header to top of file header block
MisterRaindrop Jul 6, 2026
c70fbf9
foreigncmds: flatten IF NOT EXISTS duplicate handling
MisterRaindrop Jul 7, 2026
5105d02
parser/commands: unify lake-table DROP syntax with CREATE
MisterRaindrop Jul 10, 2026
f21763c
commands: make foreign catalog type a required first-class column
MisterRaindrop Jul 10, 2026
7e6e7ca
Update src/backend/foreign/foreign.c
MisterRaindrop Jul 10, 2026
70b451a
Update src/include/commands/laketablecmds.h
MisterRaindrop Jul 10, 2026
32bda14
psql: complete only iceberg tables for DROP ICEBERG TABLE
MisterRaindrop Jul 10, 2026
f6d3286
commands: finish ValidateLakeTableOptions -> ValidateLakeTableStmt re…
MisterRaindrop Jul 10, 2026
afe4142
commands: reject plain DROP TABLE on an iceberg table
MisterRaindrop Jul 14, 2026
9e4e0c2
doc: add reference pages for the iceberg lake-table DDL commands
MisterRaindrop Jul 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions contrib/pax_storage/src/test/regress/expected/oidjoins.out
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,10 @@ NOTICE: checking pg_foreign_data_wrapper {fdwhandler} => pg_proc {oid}
NOTICE: checking pg_foreign_data_wrapper {fdwvalidator} => pg_proc {oid}
NOTICE: checking pg_foreign_server {srvowner} => pg_authid {oid}
NOTICE: checking pg_foreign_server {srvfdw} => pg_foreign_data_wrapper {oid}
NOTICE: checking pg_foreign_catalog {fcowner} => pg_authid {oid}
NOTICE: checking pg_foreign_catalog {fcserver} => pg_foreign_server {oid}
NOTICE: checking pg_foreign_volume {fvowner} => pg_authid {oid}
NOTICE: checking pg_foreign_volume {fvserver} => pg_foreign_server {oid}
Comment thread
MisterRaindrop marked this conversation as resolved.
NOTICE: checking pg_user_mapping {umuser} => pg_authid {oid}
NOTICE: checking pg_user_mapping {umserver} => pg_foreign_server {oid}
NOTICE: checking pg_compression {compconstructor} => pg_proc {oid}
Expand All @@ -247,6 +251,9 @@ NOTICE: checking pg_foreign_table {ftrelid} => pg_class {oid}
NOTICE: checking pg_foreign_table {ftserver} => pg_foreign_server {oid}
NOTICE: checking pg_foreign_table_seg {ftsrelid} => pg_class {oid}
NOTICE: checking pg_foreign_table_seg {ftsserver} => pg_foreign_server {oid}
NOTICE: checking pg_lake_table {ltrelid} => pg_class {oid}
NOTICE: checking pg_lake_table {ltforeign_catalog} => pg_foreign_catalog {oid}
NOTICE: checking pg_lake_table {ltforeign_volume} => pg_foreign_volume {oid}
NOTICE: checking pg_policy {polrelid} => pg_class {oid}
NOTICE: checking pg_policy {polroles} => pg_authid {oid}
NOTICE: checking pg_default_acl {defaclrole} => pg_authid {oid}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,16 @@ pg_enum|t
pg_event_trigger|t
pg_extension|t
pg_extprotocol|t
pg_foreign_catalog|t
pg_foreign_data_wrapper|t
pg_foreign_server|t
pg_foreign_table|t
pg_foreign_table_seg|t
pg_foreign_volume|t
pg_index|t
pg_inherits|t
pg_init_privs|t
pg_lake_table|t
pg_language|t
pg_largeobject|t
pg_largeobject_metadata|t
Expand Down
6 changes: 6 additions & 0 deletions doc/src/sgml/ref/allfiles.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,13 @@ Complete list of usable sgml source files in this directory.
<!ENTITY createDynamicTable SYSTEM "create_dynamic_table.sgml">
<!ENTITY createEventTrigger SYSTEM "create_event_trigger.sgml">
<!ENTITY createExtension SYSTEM "create_extension.sgml">
<!ENTITY createForeignCatalog SYSTEM "create_foreign_catalog.sgml">
<!ENTITY createForeignDataWrapper SYSTEM "create_foreign_data_wrapper.sgml">
<!ENTITY createForeignTable SYSTEM "create_foreign_table.sgml">
<!ENTITY createForeignVolume SYSTEM "create_foreign_volume.sgml">
<!ENTITY createFunction SYSTEM "create_function.sgml">
<!ENTITY createGroup SYSTEM "create_group.sgml">
<!ENTITY createIcebergTable SYSTEM "create_iceberg_table.sgml">
<!ENTITY createIndex SYSTEM "create_index.sgml">
<!ENTITY createLanguage SYSTEM "create_language.sgml">
<!ENTITY createMaterializedView SYSTEM "create_materialized_view.sgml">
Expand Down Expand Up @@ -118,10 +121,13 @@ Complete list of usable sgml source files in this directory.
<!ENTITY dropDynamicTable SYSTEM "drop_dynamic_table.sgml">
<!ENTITY dropEventTrigger SYSTEM "drop_event_trigger.sgml">
<!ENTITY dropExtension SYSTEM "drop_extension.sgml">
<!ENTITY dropForeignCatalog SYSTEM "drop_foreign_catalog.sgml">
<!ENTITY dropForeignDataWrapper SYSTEM "drop_foreign_data_wrapper.sgml">
<!ENTITY dropForeignTable SYSTEM "drop_foreign_table.sgml">
<!ENTITY dropForeignVolume SYSTEM "drop_foreign_volume.sgml">
<!ENTITY dropFunction SYSTEM "drop_function.sgml">
<!ENTITY dropGroup SYSTEM "drop_group.sgml">
<!ENTITY dropIcebergTable SYSTEM "drop_iceberg_table.sgml">
<!ENTITY dropIndex SYSTEM "drop_index.sgml">
<!ENTITY dropLanguage SYSTEM "drop_language.sgml">
<!ENTITY dropMaterializedView SYSTEM "drop_materialized_view.sgml">
Expand Down
144 changes: 144 additions & 0 deletions doc/src/sgml/ref/create_foreign_catalog.sgml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
<!--
doc/src/sgml/ref/create_foreign_catalog.sgml
PostgreSQL documentation
-->

<refentry id="sql-createforeigncatalog">
<indexterm zone="sql-createforeigncatalog">
<primary>CREATE FOREIGN CATALOG</primary>
</indexterm>

<refmeta>
<refentrytitle>CREATE FOREIGN CATALOG</refentrytitle>
<manvolnum>7</manvolnum>
<refmiscinfo>SQL - Language Statements</refmiscinfo>
</refmeta>

<refnamediv>
<refname>CREATE FOREIGN CATALOG</refname>
<refpurpose>define a new foreign catalog</refpurpose>
</refnamediv>

<refsynopsisdiv>
<synopsis>
CREATE FOREIGN CATALOG [ IF NOT EXISTS ] <replaceable class="parameter">catalog_name</replaceable>
SERVER <replaceable class="parameter">server_name</replaceable>
TYPE '<replaceable class="parameter">catalog_type</replaceable>'
[ OPTIONS ( <replaceable class="parameter">option</replaceable> '<replaceable class="parameter">value</replaceable>' [, ...] ) ]
</synopsis>
</refsynopsisdiv>

<refsect1 id="sql-createforeigncatalog-description">
<title>Description</title>

<para>
<command>CREATE FOREIGN CATALOG</command> defines a new foreign catalog.
Foreign catalog names are global within a database. The user who creates
the catalog becomes its owner.
</para>

<para>
Creating a foreign catalog requires <literal>USAGE</literal> privilege on
the referenced foreign server.
</para>

<para>
The required catalog type is stored verbatim. Provider-specific validation
of the catalog type and options is outside the kernel, and generic options
currently have no kernel validator.
</para>
</refsect1>

<refsect1>
<title>Parameters</title>

<variablelist>
<varlistentry>
<term><literal>IF NOT EXISTS</literal></term>
<listitem>
<para>
Do not throw an error if a foreign catalog with the same name already
exists. A notice is issued in this case.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><replaceable class="parameter">catalog_name</replaceable></term>
<listitem>
<para>
The database-global name of the foreign catalog to be created.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><replaceable class="parameter">server_name</replaceable></term>
<listitem>
<para>
The name of an existing foreign server for the catalog.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><replaceable class="parameter">catalog_type</replaceable></term>
<listitem>
<para>
The required provider-specific catalog type. The value is stored
verbatim.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><replaceable class="parameter">option</replaceable></term>
<listitem>
<para>
The name of a provider-specific option for the catalog.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><replaceable class="parameter">value</replaceable></term>
<listitem>
<para>
The value of a provider-specific catalog option.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>

<refsect1 id="sql-createforeigncatalog-examples">
<title>Examples</title>

<para>
Create a Hive catalog that uses the foreign server
<literal>hive_srv</literal>:
<programlisting>
CREATE FOREIGN CATALOG hive_cat SERVER hive_srv TYPE 'hive' OPTIONS (uri 'thrift://localhost:9083');
</programlisting></para>
</refsect1>

<refsect1 id="sql-createforeigncatalog-compatibility">
<title>Compatibility</title>

<para>
<command>CREATE FOREIGN CATALOG</command> is an
<productname>Apache Cloudberry</productname> extension and is not defined in
the <acronym>SQL</acronym> standard.
</para>
</refsect1>

<refsect1>
<title>See Also</title>

<simplelist type="inline">
<member><xref linkend="sql-dropforeigncatalog"/></member>
<member><xref linkend="sql-createicebergtable"/></member>
<member><xref linkend="sql-createserver"/></member>
</simplelist>
</refsect1>
</refentry>
133 changes: 133 additions & 0 deletions doc/src/sgml/ref/create_foreign_volume.sgml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
<!--
doc/src/sgml/ref/create_foreign_volume.sgml
PostgreSQL documentation
-->

<refentry id="sql-createforeignvolume">
<indexterm zone="sql-createforeignvolume">
<primary>CREATE FOREIGN VOLUME</primary>
</indexterm>

<refmeta>
<refentrytitle>CREATE FOREIGN VOLUME</refentrytitle>
<manvolnum>7</manvolnum>
<refmiscinfo>SQL - Language Statements</refmiscinfo>
</refmeta>

<refnamediv>
<refname>CREATE FOREIGN VOLUME</refname>
<refpurpose>define a new foreign volume</refpurpose>
</refnamediv>

<refsynopsisdiv>
<synopsis>
CREATE FOREIGN VOLUME [ IF NOT EXISTS ] <replaceable class="parameter">volume_name</replaceable>
SERVER <replaceable class="parameter">server_name</replaceable>
[ OPTIONS ( <replaceable class="parameter">option</replaceable> '<replaceable class="parameter">value</replaceable>' [, ...] ) ]
</synopsis>
</refsynopsisdiv>

<refsect1 id="sql-createforeignvolume-description">
<title>Description</title>

<para>
<command>CREATE FOREIGN VOLUME</command> defines a new foreign volume.
Foreign volume names are global within a database. The user who creates
the volume becomes its owner.
</para>

<para>
Creating a foreign volume requires <literal>USAGE</literal> privilege on
the referenced foreign server.
</para>

<para>
Volume options are provider-specific. Provider-specific option validation
is outside the kernel, and generic options currently have no kernel
validator.
</para>
</refsect1>

<refsect1>
<title>Parameters</title>

<variablelist>
<varlistentry>
<term><literal>IF NOT EXISTS</literal></term>
<listitem>
<para>
Do not throw an error if a foreign volume with the same name already
exists. A notice is issued in this case.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><replaceable class="parameter">volume_name</replaceable></term>
<listitem>
<para>
The database-global name of the foreign volume to be created.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><replaceable class="parameter">server_name</replaceable></term>
<listitem>
<para>
The name of an existing foreign server for the volume.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><replaceable class="parameter">option</replaceable></term>
<listitem>
<para>
The name of a provider-specific option for the volume.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><replaceable class="parameter">value</replaceable></term>
<listitem>
<para>
The value of a provider-specific volume option.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>

<refsect1 id="sql-createforeignvolume-examples">
<title>Examples</title>

<para>
Create a volume for an object storage prefix using the foreign server
<literal>s3_srv</literal>:
<programlisting>
CREATE FOREIGN VOLUME s3_vol SERVER s3_srv OPTIONS (path 's3://bucket/prefix');
</programlisting></para>
</refsect1>

<refsect1 id="sql-createforeignvolume-compatibility">
<title>Compatibility</title>

<para>
<command>CREATE FOREIGN VOLUME</command> is an
<productname>Apache Cloudberry</productname> extension and is not defined in
the <acronym>SQL</acronym> standard.
</para>
</refsect1>

<refsect1>
<title>See Also</title>

<simplelist type="inline">
<member><xref linkend="sql-dropforeignvolume"/></member>
<member><xref linkend="sql-createicebergtable"/></member>
<member><xref linkend="sql-createserver"/></member>
</simplelist>
</refsect1>
</refentry>
Loading
Loading