Re: gexec from command prompt? - Mailing list pgsql-general

From David G. Johnston
Subject Re: gexec from command prompt?
Date
Msg-id CAKFQuwYHok08eO=M9YZNR1CCFh4ReWEv3gJJv5MTFibyzEPGMQ@mail.gmail.com
Whole thread Raw
In response to Re: gexec from command prompt?  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-general
On Thu, Jan 12, 2023 at 10:34 AM Pavel Stehule <pavel.stehule@gmail.com> wrote:

čt 12. 1. 2023 v 18:25 odesílatel Ron <ronljohnsonjr@gmail.com> napsal:

Removing "\\exec" from the statement, and appending -c "\\gexec" to the psql
command technically worked, but did not run the commands.

I don't know why, but \g* commands don't work from the -c option. But in this case it is not necessary


Well, the -c option states:

command must be either a command string that is completely parsable by the server (i.e., it contains no psql-specific features), or a single backslash command. Thus you cannot mix SQL and psql meta-commands within a -c option.

Thus any meta-command that interacts with server-parsed SQL is rendered useless in -c

David J.

pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: gexec from command prompt?
Next
From: David Rowley
Date:
Subject: Re: Why is a hash join preferred when it does not fit in work_mem