Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation for SET PATH #17658

Merged
merged 1 commit into from
Jun 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions docs/src/main/sphinx/sql.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
52 changes: 52 additions & 0 deletions docs/src/main/sphinx/sql/set-path.rst
Original file line number Diff line number Diff line change
@@ -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 ``<catalog>.<schema>`` of the function, or only the schema
location ``<schema>`` 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
mosabua marked this conversation as resolved.
Show resolved Hide resolved
of the ``example`` catalog::

SET PATH example.system;

The catalog uses the PostgreSQL connector, and you can therefore use the
:ref:`query table function <postgresql-query-function>` directly, without the
full catalog and schema qualifiers::

SELECT
mosabua marked this conversation as resolved.
Show resolved Hide resolved
*
FROM
TABLE(
query(
query => 'SELECT
*
FROM
tpch.nation'
)
);

mosabua marked this conversation as resolved.
Show resolved Hide resolved
See also
--------

:doc:`use`