Re: pgsql: Only allow returning string types or bytea from json_serialize

2022-07-10 Thread Kyotaro Horiguchi
At Mon, 11 Jul 2022 12:49:11 +0900, Michael Paquier wrote in > On Fri, Jul 08, 2022 at 07:20:14PM +0900, Michael Paquier wrote: > > Yeah, I think that you are right, so let's fix this. If Andrew does > > not show up, I'll take care of it. > > Okay, this one is done, then. Thanks for the patch

pgsql: Convert macros to static inline functions (bufpage.h)

2022-07-10 Thread Peter Eisentraut
Convert macros to static inline functions (bufpage.h) Remove PageIsValid() and PageSizeIsValid(), which weren't used and seem unnecessary. Some code using these formerly-macros needs some adjustments because it was previously playing loose with the Page vs. PageHeader types, which is no longer po

pgsql: Fix lock assertions in dshash.c.

2022-07-10 Thread Thomas Munro
Fix lock assertions in dshash.c. dshash.c previously maintained flags to be able to assert that you didn't hold any partition lock. These flags could get out of sync with reality in error scenarios. Get rid of all that, and make assertions about the locks themselves instead. Since LWLockHeldByM

pgsql: Fix lock assertions in dshash.c.

2022-07-10 Thread Thomas Munro
Fix lock assertions in dshash.c. dshash.c previously maintained flags to be able to assert that you didn't hold any partition lock. These flags could get out of sync with reality in error scenarios. Get rid of all that, and make assertions about the locks themselves instead. Since LWLockHeldByM

pgsql: Fix lock assertions in dshash.c.

2022-07-10 Thread Thomas Munro
Fix lock assertions in dshash.c. dshash.c previously maintained flags to be able to assert that you didn't hold any partition lock. These flags could get out of sync with reality in error scenarios. Get rid of all that, and make assertions about the locks themselves instead. Since LWLockHeldByM

pgsql: Fix lock assertions in dshash.c.

2022-07-10 Thread Thomas Munro
Fix lock assertions in dshash.c. dshash.c previously maintained flags to be able to assert that you didn't hold any partition lock. These flags could get out of sync with reality in error scenarios. Get rid of all that, and make assertions about the locks themselves instead. Since LWLockHeldByM

pgsql: Fix lock assertions in dshash.c.

2022-07-10 Thread Thomas Munro
Fix lock assertions in dshash.c. dshash.c previously maintained flags to be able to assert that you didn't hold any partition lock. These flags could get out of sync with reality in error scenarios. Get rid of all that, and make assertions about the locks themselves instead. Since LWLockHeldByM

pgsql: Fix lock assertions in dshash.c.

2022-07-10 Thread Thomas Munro
Fix lock assertions in dshash.c. dshash.c previously maintained flags to be able to assert that you didn't hold any partition lock. These flags could get out of sync with reality in error scenarios. Get rid of all that, and make assertions about the locks themselves instead. Since LWLockHeldByM

pgsql: Build de-escaped JSON strings in larger chunks during lexing

2022-07-10 Thread John Naylor
Build de-escaped JSON strings in larger chunks during lexing During COPY BINARY with large JSONB blobs, it was found that half the time was spent parsing JSON, with much of that spent in separate appendStringInfoChar() calls for each input byte. Add lookahead loop to json_lex_string() to allow ba

Re: pgsql: Only allow returning string types or bytea from json_serialize

2022-07-10 Thread Michael Paquier
On Fri, Jul 08, 2022 at 07:20:14PM +0900, Michael Paquier wrote: > Yeah, I think that you are right, so let's fix this. If Andrew does > not show up, I'll take care of it. Okay, this one is done, then. Thanks for the patch, Horiguchi-san. -- Michael signature.asc Description: PGP signature

pgsql: Fix two portability issues with the tests of test_oat_hooks

2022-07-10 Thread Michael Paquier
Fix two portability issues with the tests of test_oat_hooks This addresses two issues in the tests of test_oat_hooks: - The role regress_test_user was being left behind, preventing the test to succeed on repeated runs. It makes sense to leave some objects behind to have more coverage for pg_upgra

pgsql: Fix two portability issues with the tests of test_oat_hooks

2022-07-10 Thread Michael Paquier
Fix two portability issues with the tests of test_oat_hooks This addresses two issues in the tests of test_oat_hooks: - The role regress_test_user was being left behind, preventing the test to succeed on repeated runs. It makes sense to leave some objects behind to have more coverage for pg_upgra

pgsql: Improve error message with JSON_SERIALIZE()

2022-07-10 Thread Michael Paquier
Improve error message with JSON_SERIALIZE() The error message introduced in 3c633f3 can share the same format string with an existing message used for JSON(), reducing the translation effort. Author: Kyotaro Horiguchi Discussion: https://postgr.es/m/20220708.154135.2123613118233840495.horikyota.

pgsql: Improve error message with JSON_SERIALIZE()

2022-07-10 Thread Michael Paquier
Improve error message with JSON_SERIALIZE() The error message introduced in 3c633f3 can share the same format string with an existing message used for JSON(), reducing the translation effort. Author: Kyotaro Horiguchi Discussion: https://postgr.es/m/20220708.154135.2123613118233840495.horikyota.

pgsql: Improve two comments related to a boolean DefElem's value

2022-07-10 Thread Michael Paquier
Improve two comments related to a boolean DefElem's value The original comments mentioned a "parameter" as something not defined in a fast-exit path to assume a true status. This is rather confusing as the parameter DefElem is defined, and the intention is to check if its value is defined. This

pgsql: doc: Fix inconsistent quotes in some jsonb fields

2022-07-10 Thread Michael Paquier
doc: Fix inconsistent quotes in some jsonb fields Single quotes are not allowed in json internals, double quotes are. Reported-by: Eric Mutta Discussion: https://postgr.es/m/[email protected] Backpatch-through: 14 Branch -- REL_14_STABLE Details -

pgsql: doc: Fix inconsistent quotes in some jsonb fields

2022-07-10 Thread Michael Paquier
doc: Fix inconsistent quotes in some jsonb fields Single quotes are not allowed in json internals, double quotes are. Reported-by: Eric Mutta Discussion: https://postgr.es/m/[email protected] Backpatch-through: 14 Branch -- REL_15_STABLE Details -

pgsql: doc: Fix inconsistent quotes in some jsonb fields

2022-07-10 Thread Michael Paquier
doc: Fix inconsistent quotes in some jsonb fields Single quotes are not allowed in json internals, double quotes are. Reported-by: Eric Mutta Discussion: https://postgr.es/m/[email protected] Backpatch-through: 14 Branch -- master Details ---

pgsql: Tidy up claimed supported CPUs and OSes.

2022-07-10 Thread Thomas Munro
Tidy up claimed supported CPUs and OSes. * Remove arbitrary mention of certain endianness and bitness variants; it's enough to say that applicable variants are expected to work. * List RISC-V (known to work, being tested). * List SuperH and M88K (code exists, unknown status, like M68K). * D