Re: is_superuser versus set_config_option's parallelism check

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: is_superuser versus set_config_option's parallelism check
Date: 2024-08-10 18:38:03
Message-ID: 3170329.1723315083@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Nathan Bossart <nathandbossart(at)gmail(dot)com> writes:
> Regarding returning 0 instead of -1 for the parallel case, I think that
> follows. While doing some additional research, I noticed this return value
> was just added in December (commit 059de3c [0]). Before that, it
> apparently assumed that elevel >= ERROR. With that and your analysis of
> the call sites, it seems highly unlikely that changing it will cause any
> problems.

Hah ... so the failure to think clearly about which value to use
was mine :-(.

> For the errcode, I do see that we pretty consistently use
> ERRCODE_INVALID_TRANSACTION_STATE for "can't do thing during a parallel
> operation." In fact, it looks like all but one use is for parallel errors.

OK, I'll leave that alone but will change the return code.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrei Zubkov 2024-08-10 19:37:25 Re: Vacuum statistics
Previous Message Stepan Neretin 2024-08-10 18:34:43 Re: SPI_connect, SPI_connect_ext return type