On Friday, July 26, 2024, Ayush Vatsa <ayushvatsa1...@gmail.com> wrote:
>
> I wanted to modify the SQL script of an extension by creating multiple
> objects within it.
> My aim is to make minimal changes to the existing script. To achieve this,
> I have created an
> external script and am attempting to run it within the extension script
> using the \i command.
>
> However, when I try to create the extension, I encounter the following
> error:
> ERROR: syntax error at or near "\"
>
> Could anyone advise on how I might resolve this issue? Alternatively, is
> there another way to create SQL objects outside of the main extension
> script, such that these objects are created when the extension script is
> executed?
>

Extension scripts are executed directly by the server as SQL, not via psql,
so using psql features will not work.  In short, your extension script for
a given version must be singular as the concept of “include files” is not
understood by the execution environment.

David J.

Reply via email to