Re: gexec from command prompt?

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Ron <ronljohnsonjr(at)gmail(dot)com>, "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: gexec from command prompt?
Date: 2023-01-12 18:41:29
Message-ID: CAKFQuwYHok08eO=M9YZNR1CCFh4ReWEv3gJJv5MTFibyzEPGMQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Jan 12, 2023 at 10:34 AM Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
wrote:

>
> čt 12. 1. 2023 v 18:25 odesílatel Ron <ronljohnsonjr(at)gmail(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Rowley 2023-01-13 01:38:26 Re: Why is a hash join preferred when it does not fit in work_mem
Previous Message Alvaro Herrera 2023-01-12 18:04:08 Re: gexec from command prompt?