0

Does the Postgres client psql have a functionality like the @@ of Oracle SQLPlus?

For those who are wondering what @@ does: it allows to call a relative sql script from another script.

1
  • 1
    psql just has an ordinary include file mechanism, comparable to C's preprocessor. \i other_script.sql does the trick. Commented May 16, 2016 at 20:14

1 Answer 1

1

Quote from the manual:

\ir or \include_relative filename

The \ir command is similar to \i, but resolves relative file names differently. When executing in interactive mode, the two commands behave identically. However, when invoked from a script, \ir interprets file names relative to the directory in which the script is located, rather than the current working directory.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.