Re: Add SHELL_EXIT_CODE to psql

From: Maxim Orlov <orlovmg(at)gmail(dot)com>
To: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
Cc: vignesh C <vignesh21(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Add SHELL_EXIT_CODE to psql
Date: 2023-02-22 14:43:45
Message-ID: CACG=ezY7=dik8PcjA9kaLRgg=zo2bgA9Q5t6k4TQGi6tQWn5AQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 30 Jan 2023 at 23:23, Corey Huinker <corey(dot)huinker(at)gmail(dot)com> wrote:

>
>
> I rebased, but there are no code differences.
>

The patch set seem to be in a good shape and pretty stable for quite a
while.
Could you add one more minor improvement, a new line after variables
declaration?

+ int exit_code =
wait_result_to_exit_code(result);
+ char buf[32];
...here
+ snprintf(buf, sizeof(buf), "%d", exit_code);
+ SetVariable(pset.vars, "SHELL_EXIT_CODE", buf);
+ SetVariable(pset.vars, "SHELL_ERROR", "true");

+ char exit_code_buf[32];
... and here
+ snprintf(exit_code_buf, sizeof(exit_code_buf), "%d",
+ wait_result_to_exit_code(exit_code));
+ SetVariable(pset.vars, "SHELL_EXIT_CODE", exit_code_buf);
+ SetVariable(pset.vars, "SHELL_ERROR", "true");

After this changes, I think, we make this patch RfC, shall we?

--
Best regards,
Maxim Orlov.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2023-02-22 14:49:48 Re: pgindent vs. git whitespace check
Previous Message Alvaro Herrera 2023-02-22 14:41:12 Re: LWLock deadlock in brinRevmapDesummarizeRange