pgsql: Update MERGE docs to mention that ONLY is supported.

2022-12-09 Thread Dean Rasheed
Update MERGE docs to mention that ONLY is supported. Commit 7103ebb7aa added support for MERGE, which included support for inheritance hierarchies, but didn't document the fact that ONLY could be specified before the source and/or target tables to exclude tables inheriting from the tables specifie

pgsql: Update MERGE docs to mention that ONLY is supported.

2022-12-09 Thread Dean Rasheed
Update MERGE docs to mention that ONLY is supported. Commit 7103ebb7aa added support for MERGE, which included support for inheritance hierarchies, but didn't document the fact that ONLY could be specified before the source and/or target tables to exclude tables inheriting from the tables specifie

pgsql: Add USER SET parameter values for pg_db_role_setting

2022-12-09 Thread Alexander Korotkov
Add USER SET parameter values for pg_db_role_setting The USER SET flag specifies that the variable should be set on behalf of an ordinary role. That lets ordinary roles set placeholder variables, which permission requirements are not known yet. Such a value wouldn't be used if the variable final

Re: pgsql: Add USER SET parameter values for pg_db_role_setting

2022-12-09 Thread Alexander Korotkov
On Fri, Dec 9, 2022 at 1:22 PM Alexander Korotkov wrote: > Add USER SET parameter values for pg_db_role_setting I've seen buildfarm failures at sifaka and longfin and discovering them. -- Regards, Alexander Korotkov

Re: pgsql: Add USER SET parameter values for pg_db_role_setting

2022-12-09 Thread Alexander Korotkov
On Fri, Dec 9, 2022 at 1:44 PM Alexander Korotkov wrote: > On Fri, Dec 9, 2022 at 1:22 PM Alexander Korotkov > wrote: > > Add USER SET parameter values for pg_db_role_setting > > I've seen buildfarm failures at sifaka and longfin and discovering them. I appears to be related to invalid role name

pgsql: Fix invalid role names introduced in 096dd80f3c

2022-12-09 Thread Alexander Korotkov
Fix invalid role names introduced in 096dd80f3c 096dd80f3c added new regression tests dealing with roles. By oversight, role names didn't start with regress_ prefix. This commit fixes that. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/beecbe8e5001249f0ad51f828d

pgsql: Add test scaffolding for soft error reporting from input functio

2022-12-09 Thread Tom Lane
Add test scaffolding for soft error reporting from input functions. pg_input_is_valid() returns boolean, while pg_input_error_message() returns the primary error message if the input is bad, or NULL if the input is OK. The main reason for having two functions is so that we can test both the detai

pgsql: Create infrastructure for "soft" error reporting.

2022-12-09 Thread Tom Lane
Create infrastructure for "soft" error reporting. Postgres' standard mechanism for reporting errors (ereport() or elog()) is used for all sorts of error conditions. This means that throwing an exception via ereport(ERROR) requires an expensive transaction or subtransaction abort and cleanup, sinc

pgsql: Convert a few datatype input functions to use "soft" error repor

2022-12-09 Thread Tom Lane
Convert a few datatype input functions to use "soft" error reporting. This patch converts the input functions for bool, int2, int4, int8, float4, float8, numeric, and contrib/cube to the new soft-error style. array_in and record_in are also converted. There's lots more to do, but this is enough t

pgsql: Const-ify a couple of datetime parsing subroutines.

2022-12-09 Thread Tom Lane
Const-ify a couple of datetime parsing subroutines. More could be done in this line, but I just grabbed some low-hanging fruit. Principal objective was to remove the need for several ugly unconstify() usages in formatting.c. Branch -- master Details --- https://git.postgresql.org/pg/com

pgsql: meson: Improve PG_VERSION_STR generation

2022-12-09 Thread Andres Freund
meson: Improve PG_VERSION_STR generation Previously the host operating system and 32/64 bit were not included and the build machine's cpu was used, which is potentially wrong for cross builds. Author: Juan José Santamaría Flecha Author: Andres Freund Discussion: https://postgr.es/m/cac+axb16gw

pgsql: Allow DateTimeParseError to handle bad-timezone error messages.

2022-12-09 Thread Tom Lane
Allow DateTimeParseError to handle bad-timezone error messages. Pay down some ancient technical debt (dating to commit 022fd9966): fix a couple of places in datetime parsing that were throwing ereport's immediately instead of returning a DTERR code that could be interpreted by DateTimeParseError.

pgsql: Convert datetime input functions to use "soft" error reporting.

2022-12-09 Thread Tom Lane
Convert datetime input functions to use "soft" error reporting. This patch converts the input functions for date, time, timetz, timestamp, timestamptz, and interval to the new soft-error style. There's some related stuff in formatting.c that remains to be cleaned up, but that seems like a separabl

pgsql: Restructure soft-error handling in formatting.c.

2022-12-09 Thread Tom Lane
Restructure soft-error handling in formatting.c. Replace the error trapping scheme introduced in 5bc450629 with our shiny new errsave/ereturn mechanism. This doesn't have any real functional impact (although I think that the new coding is able to report a few more errors softly than v15 did). An

pgsql: Fix macro definitions in pgstatfuncs.c

2022-12-09 Thread Michael Paquier
Fix macro definitions in pgstatfuncs.c Buildfarm member wrasse has been complaining about empty declarations as an effect of 8018ffb and 83a1a1b due to extra semicolons. While on it, remove also the last backslash of the macros definitions, causing more lines to be eaten in it than necessary, per

pgsql: Add subquery pullup handling for WindowClause runCondition

2022-12-09 Thread David Rowley
Add subquery pullup handling for WindowClause runCondition 9d9c02ccd added code to allow WindowAgg to take some shortcuts when a monotonic WindowFunc reached some value that it could never come back from due to the function's monotonic nature. That commit added a runCondition field to WindowClaus

pgsql: Add subquery pullup handling for WindowClause runCondition

2022-12-09 Thread David Rowley
Add subquery pullup handling for WindowClause runCondition 9d9c02ccd added code to allow WindowAgg to take some shortcuts when a monotonic WindowFunc reached some value that it could never come back from due to the function's monotonic nature. That commit added a runCondition field to WindowClaus