diff --git a/docs/src/main/sphinx/sql.md b/docs/src/main/sphinx/sql.md index a5f5ac675cfe..589144205f37 100644 --- a/docs/src/main/sphinx/sql.md +++ b/docs/src/main/sphinx/sql.md @@ -51,6 +51,7 @@ sql/revoke sql/revoke-roles sql/rollback sql/select +sql/set-path sql/set-role sql/set-session sql/set-time-zone diff --git a/docs/src/main/sphinx/sql/set-path.rst b/docs/src/main/sphinx/sql/set-path.rst new file mode 100644 index 000000000000..b6b241922e58 --- /dev/null +++ b/docs/src/main/sphinx/sql/set-path.rst @@ -0,0 +1,52 @@ +======== +SET PATH +======== + +Synopsis +-------- + +.. code-block:: text + + SET PATH path-element[, ...] + +Description +----------- + +Define a collection of paths to functions or table functions in specific +catalogs and schemas for the current session. + +Each path-element uses a period-separated syntax to specify the catalog name and +schema location ``.`` of the function, or only the schema +location ```` in the current catalog. The current catalog is set with +:doc:`use`, or as part of a client tool connection. Catalog and schema must +exist. + +Examples +-------- + +The following example sets a path to access functions in the ``system`` schema +of the ``example`` catalog:: + + SET PATH example.system; + +The catalog uses the PostgreSQL connector, and you can therefore use the +:ref:`query table function ` directly, without the +full catalog and schema qualifiers:: + + SELECT + * + FROM + TABLE( + query( + query => 'SELECT + * + FROM + tpch.nation' + ) + ); + +See also +-------- + +:doc:`use` +