pgsql: Fix tab completion for ALTER ROLE|USER ... RESET

2025-07-31 Thread Tomas Vondra
Fix tab completion for ALTER ROLE|USER ... RESET Commit c407d5426b87 added tab completion for ALTER ROLE|USER ... RESET, with the intent to offer only the variables actually set on the role. But as soon as the user started typing something, it would start to offer all possible matching variables.

pgsql: Schema-qualify unnest() in ALTER DATABASE ... RESET

2025-07-31 Thread Tomas Vondra
Schema-qualify unnest() in ALTER DATABASE ... RESET Commit 9df8727c5067 failed to schema-quality the unnest() call in the query used to list the variables in ALTER DATABASE ... RESET. If there's another unnest() function in the search_path, this could cause either failures, or even security issues

pgsql: Schema-qualify unnest() in ALTER DATABASE ... RESET

2025-07-31 Thread Tomas Vondra
Schema-qualify unnest() in ALTER DATABASE ... RESET Commit 9df8727c5067 failed to schema-quality the unnest() call in the query used to list the variables in ALTER DATABASE ... RESET. If there's another unnest() function in the search_path, this could cause either failures, or even security issues

pgsql: Fix tab completion for ALTER ROLE|USER ... RESET

2025-07-31 Thread Tomas Vondra
Fix tab completion for ALTER ROLE|USER ... RESET Commit c407d5426b87 added tab completion for ALTER ROLE|USER ... RESET, with the intent to offer only the variables actually set on the role. But as soon as the user started typing something, it would start to offer all possible matching variables.

pgsql: Fix indentation in pg_numa code

2025-07-01 Thread Tomas Vondra
Fix indentation in pg_numa code Broken by commits 7fe2f67c7c9f, 81f287dc923f and bf1119d74a79. Backpatch to 18, same as the offending commits. Backpatch-through: 18 Branch -- REL_18_STABLE Details --- https://git.postgresql.org/pg/commitdiff/07448b3969d55a2081cdafafc23f68df3392f220 Mod

pgsql: Fix indentation in pg_numa code

2025-07-01 Thread Tomas Vondra
Fix indentation in pg_numa code Broken by commits 7fe2f67c7c9f, 81f287dc923f and bf1119d74a79. Backpatch to 18, same as the offending commits. Backpatch-through: 18 Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/9e345415bcd3c4358350b89edfd710469b8bfaf9 Modified F

pgsql: Add CHECK_FOR_INTERRUPTS into pg_numa_query_pages

2025-07-01 Thread Tomas Vondra
Add CHECK_FOR_INTERRUPTS into pg_numa_query_pages Querying the NUMA status can be quite time consuming, especially with large shared buffers. 8cc139bec34a called numa_move_pages() once, for all buffers, and we had to wait for the syscall to complete. But with the chunking, introduced by 7fe2f67c7

pgsql: Add CHECK_FOR_INTERRUPTS into pg_numa_query_pages

2025-07-01 Thread Tomas Vondra
Add CHECK_FOR_INTERRUPTS into pg_numa_query_pages Querying the NUMA status can be quite time consuming, especially with large shared buffers. 8cc139bec34a called numa_move_pages() once, for all buffers, and we had to wait for the syscall to complete. But with the chunking, introduced by 7fe2f67c7

pgsql: Silence valgrind about pg_numa_touch_mem_if_required

2025-07-01 Thread Tomas Vondra
Silence valgrind about pg_numa_touch_mem_if_required When querying NUMA status of pages in shared memory, we need to touch the memory first to get valid results. This may trigger valgrind reports, because some of the memory (e.g. unpinned buffers) may be marked as noaccess. Solved by adding a val

pgsql: Silence valgrind about pg_numa_touch_mem_if_required

2025-07-01 Thread Tomas Vondra
Silence valgrind about pg_numa_touch_mem_if_required When querying NUMA status of pages in shared memory, we need to touch the memory first to get valid results. This may trigger valgrind reports, because some of the memory (e.g. unpinned buffers) may be marked as noaccess. Solved by adding a val

pgsql: Limit the size of numa_move_pages requests

2025-07-01 Thread Tomas Vondra
Limit the size of numa_move_pages requests There's a kernel bug in do_pages_stat(), affecting systems combining 64-bit kernel and 32-bit user space. The function splits the request into chunks of 16 pointers, but forgets the pointers are 32-bit when advancing to the next chunk. Some of the pointer

pgsql: Limit the size of numa_move_pages requests

2025-07-01 Thread Tomas Vondra
Limit the size of numa_move_pages requests There's a kernel bug in do_pages_stat(), affecting systems combining 64-bit kernel and 32-bit user space. The function splits the request into chunks of 16 pointers, but forgets the pointers are 32-bit when advancing to the next chunk. Some of the pointer

pgsql: amcheck: Fix posting tree checks in gin_index_check()

2025-06-17 Thread Tomas Vondra
amcheck: Fix posting tree checks in gin_index_check() Fix two issues in parent_key validation in posting trees: * It's not enough to check stack->parentblk is valid to determine if the parentkey is valid. It's possible parentblk is set to a valid block number, but parentkey is invalid. So che

pgsql: amcheck: Fix parent key check in gin_index_check()

2025-06-17 Thread Tomas Vondra
amcheck: Fix parent key check in gin_index_check() The checks introduced by commit 14ffaece0fb5 did not get the parent key checks quite right, missing some data corruption cases. In particular: * The "rightlink" check was not working as intended, because rightlink is a BlockNumber, and InvalidB

pgsql: amcheck: Fix checks of entry order for GIN indexes

2025-06-17 Thread Tomas Vondra
amcheck: Fix checks of entry order for GIN indexes This tightens a couple checks in checking GIN indexes, which might have resulted in incorrect results (false positives/negatives). * The code skipped ordering checks if the entries were for different attributes (for multi-column GIN indexes), p

pgsql: amcheck: Remove unused GinScanItem->parentlsn field

2025-06-17 Thread Tomas Vondra
amcheck: Remove unused GinScanItem->parentlsn field The field was introduced by commit 14ffaece0fb5, but is unused and unnecessary. So remove it. Issues reported by Arseniy Mukhin, along with a proposed patch. Review by Andrey M. Borodin, cleanup and minor improvements by me. Author: Arseniy Muk

pgsql: amcheck: Test gin_index_check on a multicolumn index

2025-06-17 Thread Tomas Vondra
amcheck: Test gin_index_check on a multicolumn index Adds a regression test with gin_index_check() on a multicolumn index, to verify it's handled correctly and improve test coverage for code introduced by 14ffaece0fb5. Author: Arseniy Mukhin Reviewed-by: Andrey M. Borodin Discussion: https://p

pgsql: Fix memory leak in _gin_parallel_merge

2025-05-02 Thread Tomas Vondra
frequent resets don't seem to hurt performance, it may even help it a bit. Report and fix by Vinod Sridharan. Author: Vinod Sridharan Reviewed-by: Tomas Vondra Discussion: https://postgr.es/m/CAFMdLD4p0VBd8JG=Nbi=bkv6rzfaigj_sxsfrw-2tnmnzfo...@mail.gmail.com Branch -- master De

Re: pgsql: Add support for basic NUMA awareness

2025-04-16 Thread Tomas Vondra
Ah, I didn't notice the autoheader thing. The patch looks fine to me. Daniel, do you intend to push it, or do you want me to do that? regards -- Tomas Vondra

pgsql: pg_buffercache: Change page_num type to bigint

2025-04-10 Thread Tomas Vondra
pg_buffercache: Change page_num type to bigint The page_num was defined as integer, which should be sufficient for the near future (with 4K pages it's 8TB). But it's virtually free to return bigint, and get a wider range. This was agreed on the thread, but I forgot to tweak this in ba2a3c2302f1.

pgsql: Cleanup of pg_numa.c

2025-04-10 Thread Tomas Vondra
Cleanup of pg_numa.c This moves/renames some of the functions defined in pg_numa.c: * pg_numa_get_pagesize() is renamed to pg_get_shmem_pagesize(), and moved to src/backend/storage/ipc/shmem.c. The new name better reflects that the page size is not related to NUMA, and it's specifically about

pgsql: ci: Check for missing dependencies in meson builds

2025-04-09 Thread Tomas Vondra
ci: Check for missing dependencies in meson builds Extends the Linux and Windows meson builds with a check for missing dependencies by running ninja -t missingdeps after the build. This highlights unindended dependencies. Reviewed-by: Andres Freund https://postgr.es/m/caldsspi5fj0a7ug7fmw2

pgsql: doc: Correct pg_shmem_allocations_numa.size data type

2025-04-08 Thread Tomas Vondra
doc: Correct pg_shmem_allocations_numa.size data type The code in pg_get_shmem_allocations_numa() returned 'size' as int64, but the docs said int32. Report and fix by Noriyoshi Shinoda. Reported-by: Noriyoshi Shinoda Discussion: https://postgr.es/m/dm4pr84mb1734308eb741a6ecff040c27ee...@dm4pr8

pgsql: Add support for basic NUMA awareness

2025-04-07 Thread Tomas Vondra
batching, and is more efficient than get_mempolicy(2). Author: Jakub Wartak Co-authored-by: Bertrand Drouvot Reviewed-by: Andres Freund Reviewed-by: Álvaro Herrera Reviewed-by: Tomas Vondra Discussion: https://postgr.es/m/CAKZiRmxh6KWo0aqRqvmcoaX2jUxZYb4kGp3N%3Dq1w%2BDiH-696Xw

pgsql: Add pg_buffercache_numa view with NUMA node info

2025-04-07 Thread Tomas Vondra
backend, as it touches all memory pages to get reliable information about the NUMA node. This may also force allocation of the shared memory. Author: Jakub Wartak Reviewed-by: Andres Freund Reviewed-by: Bertrand Drouvot Reviewed-by: Tomas Vondra Discussion: https://postgr.es/m

pgsql: Introduce pg_shmem_allocations_numa view

2025-04-07 Thread Tomas Vondra
anonymous shared memory allocations. It also does not show memory allocated using the dynamic shared memory infrastructure. Author: Jakub Wartak Reviewed-by: Andres Freund Reviewed-by: Bertrand Drouvot Reviewed-by: Tomas Vondra Discussion: https://postgr.es/m/CAKZiRmxh6KWo0aqRqvmcoaX2jUxZYb4kGp3N

Re: pgsql: Improve accounting for memory used by shared hash tables

2025-04-05 Thread Tomas Vondra
On 4/4/25 01:43, Tomas Vondra wrote: > On 4/4/25 00:57, David Rowley wrote: >> On Thu, 3 Apr 2025 at 04:16, Tomas Vondra >> wrote: >>> Improve accounting for memory used by shared hash tables >> >> I've not looked into why, but this is causing an issue in

pgsql: Improve accounting for memory used by shared hash tables

2025-04-04 Thread Tomas Vondra
not due to necessity. Author: Rahila Syed Reviewed-by: Andres Freund Reviewed-by: Nazir Bilal Yavuz Reviewed-by: Tomas Vondra Discussion: https://postgr.es/m/cah2l28vhzrankszhqz7dexurxkncxfirnuw68zd7+hvaqas...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/

Re: pgsql: Improve accounting for memory used by shared hash tables

2025-04-03 Thread Tomas Vondra
On 4/4/25 02:41, Tomas Vondra wrote: > On 4/4/25 01:43, Tomas Vondra wrote: >> On 4/4/25 00:57, David Rowley wrote: >>> On Thu, 3 Apr 2025 at 04:16, Tomas Vondra >>> wrote: >>>> Improve accounting for memory used by shared hash tables >>> >

pgsql: Revert "Improve accounting for memory used by shared hash tables

2025-04-03 Thread Tomas Vondra
Revert "Improve accounting for memory used by shared hash tables" This reverts commit f5930f9a98ea65d659d41600a138e608988ad122. This broke the expansion of private hash tables, which reallocates the directory. But that's impossible when it's allocated together with the other fields, and dir_reall

Re: pgsql: Improve accounting for memory used by shared hash tables

2025-04-03 Thread Tomas Vondra
On 4/4/25 00:57, David Rowley wrote: > On Thu, 3 Apr 2025 at 04:16, Tomas Vondra wrote: >> Improve accounting for memory used by shared hash tables > > I've not looked into why, but this is causing an issue in the > join_rel_hash during add_join_rel(). See the attached scr

pgsql: Improve accounting for PredXactList, RWConflictPool and PGPROC

2025-04-02 Thread Tomas Vondra
as a part of the PGPROC structures allocation. Author: Rahila Syed Reviewed-by: Andres Freund Reviewed-by: Nazir Bilal Yavuz Reviewed-by: Tomas Vondra Discussion: https://postgr.es/m/cah2l28vhzrankszhqz7dexurxkncxfirnuw68zd7+hvaqas...@mail.gmail.com Branch -- master Details

Re: pgsql: Allow parallel CREATE INDEX for GIN indexes

2025-04-02 Thread Tomas Vondra
a mistake.  Check please. >> >> Also, this code contains a "pgrminclude ignore", but we don't use >> those anymore. > > Fixed committed. > Thank you! I apparently missed your report on pgsql-committers :-( regards -- Tomas Vondra

pgsql: Remove incidental md5() function use from test

2025-03-30 Thread Tomas Vondra
Remove incidental md5() function use from test Replace md5() with sha256() in tests introduced in 14ffaece0fb5, to allow test to pass in OpenSSL FIPS mode. Reported-by: Tom Lane Discussion: https://postgr.es/m/3518736.1743307...@sss.pgh.pa.us Branch -- master Details --- https://git.po

pgsql: amcheck: Fix indentation in verify_gin.c

2025-03-29 Thread Tomas Vondra
amcheck: Fix indentation in verify_gin.c I forgot to reindent the code after a couple last-minute adjustments just before committing 14ffaece0fb53fed8ddbc46d2b353e1c4834863a. Discussion: https://postgr.es/m/45AC9B0A-2B45-40EE-B08F-BDCF5739D1E1%40yandex-team.ru Branch -- master Details

pgsql: amcheck: Add a test with GIN index on JSONB data

2025-03-29 Thread Tomas Vondra
amcheck: Add a test with GIN index on JSONB data Extend the existing test of GIN checks to also include an index on JSONB data, using the jsonb_path_ops opclass. This is a common enough usage of GIN that it makes sense to have better test coverage for it. Author: Mark Dilger Reviewed-By: Tomas

pgsql: amcheck: Add a GIN index to the CREATE INDEX CONCURRENTLY tests

2025-03-29 Thread Tomas Vondra
list trees. This already helped to identify several issues during development of the GIN amcheck support. Author: Mark Dilger Reviewed-By: Tomas Vondra Reviewed-By: Kirill Reshke Discussion: https://postgr.es/m/BC221A56-977C-418E-A1B8-9EFC881D80C5%40enterprisedb.com Branch -- master

pgsql: amcheck: Add gin_index_check() to verify GIN index

2025-03-29 Thread Tomas Vondra
Borodin. Investigation and fixes for multiple bugs by Kirill Reshke. Author: Grigory Kryachko Author: Heikki Linnakangas Author: Andrey Borodin Reviewed-By: José Villanova Reviewed-By: Aleksander Alekseev Reviewed-By: Nikolay Samokhvalov Reviewed-By: Andres Freund Reviewed-By: Tomas Vondra

pgsql: Fix grammar in GIN README

2025-03-29 Thread Tomas Vondra
Fix grammar in GIN README Author: Kirill Reshke Discussion: https://postgr.es/m/CALdSSPgu9uAhVYojQ0yjG%3Dq5MaqmiSLUJPhz%2B-u7cA6K6Mc9UA%40mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/fb9dff76635d4c32198f30a3cb503588d557d156 Modified Files --

pgsql: amcheck: Move common routines into a separate module

2025-03-29 Thread Tomas Vondra
or: Andrey Borodin Reviewed-By: José Villanova Reviewed-By: Aleksander Alekseev Reviewed-By: Nikolay Samokhvalov Reviewed-By: Andres Freund Reviewed-By: Tomas Vondra Reviewed-By: Mark Dilger Reviewed-By: Peter Geoghegan Reviewed-By: Kirill Reshke Discussion: https://postgr.es/m/45AC9B0A-2B45

pgsql: Keep the decompressed filter in brin_bloom_union

2025-03-26 Thread Tomas Vondra
Keep the decompressed filter in brin_bloom_union The brin_bloom_union() function combines two BRIN summaries, by merging one filter into the other. With bloom, we have to decompress the filters first, but the function failed to update the summary to store the merged filter. As a consequence, the i

pgsql: Keep the decompressed filter in brin_bloom_union

2025-03-26 Thread Tomas Vondra
Keep the decompressed filter in brin_bloom_union The brin_bloom_union() function combines two BRIN summaries, by merging one filter into the other. With bloom, we have to decompress the filters first, but the function failed to update the summary to store the merged filter. As a consequence, the i

pgsql: Keep the decompressed filter in brin_bloom_union

2025-03-26 Thread Tomas Vondra
Keep the decompressed filter in brin_bloom_union The brin_bloom_union() function combines two BRIN summaries, by merging one filter into the other. With bloom, we have to decompress the filters first, but the function failed to update the summary to store the merged filter. As a consequence, the i

pgsql: Keep the decompressed filter in brin_bloom_union

2025-03-26 Thread Tomas Vondra
Keep the decompressed filter in brin_bloom_union The brin_bloom_union() function combines two BRIN summaries, by merging one filter into the other. With bloom, we have to decompress the filters first, but the function failed to update the summary to store the merged filter. As a consequence, the i

pgsql: Keep the decompressed filter in brin_bloom_union

2025-03-26 Thread Tomas Vondra
Keep the decompressed filter in brin_bloom_union The brin_bloom_union() function combines two BRIN summaries, by merging one filter into the other. With bloom, we have to decompress the filters first, but the function failed to update the summary to store the merged filter. As a consequence, the i

pgsql: Enforce memory limit during parallel GIN builds

2025-03-04 Thread Tomas Vondra
pression ratio, ...). So we stick to these conservative values to release memory faster. Author: Tomas Vondra Reviewed-by: Matthias van de Meent, Andy Fan, Kirill Reshke Discussion: https://postgr.es/m/6ab4003f-a8b8-4d75-a67f-f25ad98582dc%40enterprisedb.com Branch -- master Details --- h

pgsql: Compress TID lists when writing GIN tuples to disk

2025-03-04 Thread Tomas Vondra
. First into the per-worker tuplesorts, then into the shared tuplesort. Author: Tomas Vondra Reviewed-by: Matthias van de Meent, Andy Fan, Kirill Reshke Discussion: https://postgr.es/m/6ab4003f-a8b8-4d75-a67f-f25ad98582dc%40enterprisedb.com Branch -- master Details --- https

pgsql: Make FP_LOCK_SLOTS_PER_BACKEND look like a function

2025-03-04 Thread Tomas Vondra
Make FP_LOCK_SLOTS_PER_BACKEND look like a function The FP_LOCK_SLOTS_PER_BACKEND macro looks like a constant, but it depends on the max_locks_per_transaction GUC, and thus can change. This is non-obvious and confusing, so make it look more like a function by renaming it to FastPathLockSlotsPerBac

pgsql: Allow parallel CREATE INDEX for GIN indexes

2025-03-03 Thread Tomas Vondra
infrastructure is a simplified copy of the code used by BTREE indexes, omitting the parts irrelevant for GIN indexes (e.g. uniqueness checks). Original patch by me, with reviews and substantial improvements by Matthias van de Meent, certainly enough to make him a co-author. Author: Tomas Vondra, Matthias

pgsql: Correct relation size estimate with low fillfactor

2025-02-19 Thread Tomas Vondra
Correct relation size estimate with low fillfactor Since commit 29cf61ade3, table_block_relation_estimate_size() considers fillfactor when estimating number of rows in a relation before the first ANALYZE. The formula however did not consider tuples may be larger than available space determined by

pgsql: Correct relation size estimate with low fillfactor

2025-02-19 Thread Tomas Vondra
Correct relation size estimate with low fillfactor Since commit 29cf61ade3, table_block_relation_estimate_size() considers fillfactor when estimating number of rows in a relation before the first ANALYZE. The formula however did not consider tuples may be larger than available space determined by

pgsql: Consider BufFiles when adjusting hashjoin parameters

2025-02-19 Thread Tomas Vondra
Consider BufFiles when adjusting hashjoin parameters Until now ExecChooseHashTableSize() considered only the size of the in-memory hash table, and ignored the memory needed for the batch files. Which can be a significant amount, because each batch needs two BufFiles (each with a BLCKSZ buffer). Th

pgsql: Add tab completion for ALTER USER/ROLE RESET

2025-02-17 Thread Tomas Vondra
: Robins Tharakan Reviewed-By: Tomas Vondra Discussion: https://postgr.es/m/CAEP4nAzqiT6VbVC5r3nq5byLTnPzjniVGzEMpYcnAHQyNzEuaw%40mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/c407d5426b877b41be87f9e679e321bb2c42e47d Modified Files

pgsql: Add tab completion for ALTER DATABASE RESET

2025-02-17 Thread Tomas Vondra
. Author: Robins Tharakan Reviewed-By: Tomas Vondra Discussion: https://postgr.es/m/CAEP4nAzqiT6VbVC5r3nq5byLTnPzjniVGzEMpYcnAHQyNzEuaw%40mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/9df8727c5067916580f82da8b249136391de8544 Modified Files

pgsql: Use the correct sizeof() in BufFileLoadBuffer

2025-01-24 Thread Tomas Vondra
Use the correct sizeof() in BufFileLoadBuffer The sizeof() call should reference buffer.data, because that's the buffer we're reading data into, not the whole PGAlignedBuffer union. This was introduced by 44cac93464, which replaced the simple buffer with a PGAlignedBuffer field. It's benign, beca

pgsql: Use the correct sizeof() in BufFileLoadBuffer

2025-01-24 Thread Tomas Vondra
Use the correct sizeof() in BufFileLoadBuffer The sizeof() call should reference buffer.data, because that's the buffer we're reading data into, not the whole PGAlignedBuffer union. This was introduced by 44cac93464, which replaced the simple buffer with a PGAlignedBuffer field. It's benign, beca

pgsql: Use the correct sizeof() in BufFileLoadBuffer

2025-01-24 Thread Tomas Vondra
Use the correct sizeof() in BufFileLoadBuffer The sizeof() call should reference buffer.data, because that's the buffer we're reading data into, not the whole PGAlignedBuffer union. This was introduced by 44cac93464, which replaced the simple buffer with a PGAlignedBuffer field. It's benign, beca

pgsql: Use the correct sizeof() in BufFileLoadBuffer

2025-01-24 Thread Tomas Vondra
Use the correct sizeof() in BufFileLoadBuffer The sizeof() call should reference buffer.data, because that's the buffer we're reading data into, not the whole PGAlignedBuffer union. This was introduced by 44cac93464, which replaced the simple buffer with a PGAlignedBuffer field. It's benign, beca

pgsql: Use the correct sizeof() in BufFileLoadBuffer

2025-01-24 Thread Tomas Vondra
Use the correct sizeof() in BufFileLoadBuffer The sizeof() call should reference buffer.data, because that's the buffer we're reading data into, not the whole PGAlignedBuffer union. This was introduced by 44cac93464, which replaced the simple buffer with a PGAlignedBuffer field. It's benign, beca

pgsql: Use the correct sizeof() in BufFileLoadBuffer

2025-01-24 Thread Tomas Vondra
Use the correct sizeof() in BufFileLoadBuffer The sizeof() call should reference buffer.data, because that's the buffer we're reading data into, not the whole PGAlignedBuffer union. This was introduced by 44cac93464, which replaced the simple buffer with a PGAlignedBuffer field. It's benign, beca

pgsql: Detect version mismatch in brin_page_items

2024-12-17 Thread Tomas Vondra
Detect version mismatch in brin_page_items Commit dae761a87ed modified brin_page_items() to return the new "empty" flag for each BRIN range. But the new output parameter was added in the middle, which may cause crashes when using the new binary with old function definition. The ideal solution wou

pgsql: Detect version mismatch in brin_page_items

2024-12-17 Thread Tomas Vondra
Detect version mismatch in brin_page_items Commit dae761a87ed modified brin_page_items() to return the new "empty" flag for each BRIN range. But the new output parameter was added in the middle, which may cause crashes when using the new binary with old function definition. The ideal solution wou

pgsql: Update comments about index parallel builds

2024-12-17 Thread Tomas Vondra
Update comments about index parallel builds Commit b43757171470 allowed parallel builds for BRIN, but left behind two comments claiming only btree indexes support parallel builds. Reported by Egor Rogov, along with similar issues in SGML docs. Backpatch to 17, where parallel builds for BRIN were

pgsql: Update comments about index parallel builds

2024-12-17 Thread Tomas Vondra
Update comments about index parallel builds Commit b43757171470 allowed parallel builds for BRIN, but left behind two comments claiming only btree indexes support parallel builds. Reported by Egor Rogov, along with similar issues in SGML docs. Backpatch to 17, where parallel builds for BRIN were

pgsql: doc: Mention BRIN indexes support parallel builds

2024-12-16 Thread Tomas Vondra
doc: Mention BRIN indexes support parallel builds Two places in the documentation suggest B-tree is the only index access method allowing parallel builds. Commit b4375717 added parallel builds for BRIN too, but failed to update the docs. So fix that, and backpatch to 17, where parallel BRIN builds

pgsql: doc: Mention BRIN indexes support parallel builds

2024-12-16 Thread Tomas Vondra
doc: Mention BRIN indexes support parallel builds Two places in the documentation suggest B-tree is the only index access method allowing parallel builds. Commit b4375717 added parallel builds for BRIN too, but failed to update the docs. So fix that, and backpatch to 17, where parallel BRIN builds

pgsql: psql: Tab completion for LATERAL joins

2024-12-16 Thread Tomas Vondra
psql: Tab completion for LATERAL joins When listing selectable objects after a JOIN, offer also LATERAL. Author: Andreas Karlsson Reviewed-By: Tomas Vondra Discussion: https://postgr.es/m/3a7e27bc-d6ed-4cb0-9b21-f21143fc1...@proxel.se Branch -- master Details --- https

pgsql: psql: Tab completion for JOIN ... USING column list

2024-12-16 Thread Tomas Vondra
psql: Tab completion for JOIN ... USING column list For JOIN ... USING, offer attribute names for the first member of the column list. Author: Andreas Karlsson Reviewed-By: Tomas Vondra Discussion: https://postgr.es/m/3a7e27bc-d6ed-4cb0-9b21-f21143fc1...@proxel.se Branch -- master Details

pgsql: psql: Tab completion for JOIN ... ON/USING

2024-12-16 Thread Tomas Vondra
psql: Tab completion for JOIN ... ON/USING Offer ON/USING clauses for join types that require join conditions (i.e. anything except for NATURAL/CROSS joins). Author: Andreas Karlsson Reviewed-By: Tomas Vondra Discussion: https://postgr.es/m/3a7e27bc-d6ed-4cb0-9b21-f21143fc1...@proxel.se Branch

pgsql: psql: Tab completion for ALTER TYPE ... CASCADE/RESTRICT

2024-12-16 Thread Tomas Vondra
psql: Tab completion for ALTER TYPE ... CASCADE/RESTRICT Updates table completion for ALTER TYPE to offer CASCADE/RESTRICT for a number of actions on attributes: ALTER TYPE ... ADD/DROP/RENAME ATTRIBUTE ... [CASCADE|RESTRICT] ALTER TYPE ... TYPE ... [CASCADE|RESTRICT] Author: Kirill Resh

pgsql: psql: Tab completion for CREATE TEMP TABLE ... USING

2024-12-16 Thread Tomas Vondra
psql: Tab completion for CREATE TEMP TABLE ... USING The USING keyword was offered only for persistent tables, not for temporary ones. So improve that. Author: Kirill Reshke Reviewed-By: Karina Litskevich Discussion: https://postgr.es/m/CALdSSPhVELkvutquqrDB=Ujfq_Pjz=6jn-kzh+291kpnvil...@mail.gm

pgsql: psql: Tab completion for CREATE MATERIALIZED VIEW ... USING

2024-12-16 Thread Tomas Vondra
psql: Tab completion for CREATE MATERIALIZED VIEW ... USING The tab completion didn't offer USING for CREATE MATERIALIZED VIEW, so add it, and offer a list of access methods, followed by SELECT. Author: Kirill Reshke Reviewed-By: Karina Litskevich Discussion: https://postgr.es/m/CALdSSPhVELkvutq

pgsql: psql: Tab completion for ALTER TYPE ... ADD ATTRIBUTE

2024-12-16 Thread Tomas Vondra
psql: Tab completion for ALTER TYPE ... ADD ATTRIBUTE Improve psql tab completion for ALTER TYPE ... ADD ATTRIBUTE to offer a list of existing data types (until now no options were offered). Author: Kirill Reshke Reviewed-By: Karina Litskevich Discussion: https://postgr.es/m/CALdSSPhVELkvutquqrD

pgsql: Fix asserts in fast-path locking code

2024-09-23 Thread Tomas Vondra
Fix asserts in fast-path locking code Commit c4d5cb71d229 introduced a couple asserts in the fast-path locking code, upsetting Coverity. The assert in InitProcGlobal() is clearly wrong, as it assigns instead of checking the value. This is harmless, but doesn't check anything. The asserts in FAST

pgsql: Increase the number of fast-path lock slots

2024-09-21 Thread Tomas Vondra
Increase the number of fast-path lock slots Replace the fixed-size array of fast-path locks with arrays, sized on startup based on max_locks_per_transaction. This allows using fast-path locking for workloads that need more locks. The fast-path locking introduced in 9.2 allowed each backend to acq

pgsql: Fix unique key checks in JSON object constructors

2024-09-11 Thread Tomas Vondra
Zhao, with various improvements and tests by me. Reported-by: Alexander Lakhin Author: Junwang Zhao, Tomas Vondra Backpatch-through: 16 Discussion: https://postgr.es/m/18598-3279ed972a234...@postgresql.org Discussion: https://postgr.es/m/caeg8a3jjh0rejf2_o7-8luebo69bxphyexs95_x7+h9amwf

pgsql: Fix unique key checks in JSON object constructors

2024-09-11 Thread Tomas Vondra
Zhao, with various improvements and tests by me. Reported-by: Alexander Lakhin Author: Junwang Zhao, Tomas Vondra Backpatch-through: 16 Discussion: https://postgr.es/m/18598-3279ed972a234...@postgresql.org Discussion: https://postgr.es/m/caeg8a3jjh0rejf2_o7-8luebo69bxphyexs95_x7+h9amwf

pgsql: Fix unique key checks in JSON object constructors

2024-09-11 Thread Tomas Vondra
Zhao, with various improvements and tests by me. Reported-by: Alexander Lakhin Author: Junwang Zhao, Tomas Vondra Backpatch-through: 16 Discussion: https://postgr.es/m/18598-3279ed972a234...@postgresql.org Discussion: https://postgr.es/m/caeg8a3jjh0rejf2_o7-8luebo69bxphyexs95_x7+h9amwf

pgsql: Add PG_TEST_PG_COMBINEBACKUP_MODE to CI tasks

2024-09-10 Thread Tomas Vondra
Add PG_TEST_PG_COMBINEBACKUP_MODE to CI tasks The environment variable PG_TEST_PG_COMBINEBACKUP_MODE has been available since 35a7b288b975, but was not set by any built-in CI tasks. This commit modifies two of the CI tasks to use the alternative modes, to exercise the pg_combinebackup code. The L

pgsql: Document that search_path is reported by the server

2024-08-19 Thread Tomas Vondra
Document that search_path is reported by the server Commit 28a1121fd912 marked search_path as GUC_REPORT, but failed to update the relevant places in docs. There are two places listing the GUC options reported to the client, so update both. Reported-by: Tom Lane Discussion: https://postgr.es/m/C

pgsql: Mark search_path as GUC_REPORT

2024-08-19 Thread Tomas Vondra
Mark search_path as GUC_REPORT Report search_path changes to the client. Multi-tenant applications often map tenants to schemas, and use search_path to pick the tenant a given connection works with. This breaks when a connection pool (like PgBouncer), because the search_path may change unexpectedl

pgsql: Explain dropdb can't use syscache because of TOAST

2024-08-19 Thread Tomas Vondra
Explain dropdb can't use syscache because of TOAST Add a comment explaining dropdb() can't rely on syscache. The issue with flattened rows was fixed by commit 0f92b230f88b, but better to have a clear explanation why the systable scan is necessary. The other places doing in-place updates on pg_data

pgsql: Explain dropdb can't use syscache because of TOAST

2024-08-19 Thread Tomas Vondra
Explain dropdb can't use syscache because of TOAST Add a comment explaining dropdb() can't rely on syscache. The issue with flattened rows was fixed by commit 0f92b230f88b, but better to have a clear explanation why the systable scan is necessary. The other places doing in-place updates on pg_data

pgsql: Explain dropdb can't use syscache because of TOAST

2024-08-19 Thread Tomas Vondra
Explain dropdb can't use syscache because of TOAST Add a comment explaining dropdb() can't rely on syscache. The issue with flattened rows was fixed by commit 0f92b230f88b, but better to have a clear explanation why the systable scan is necessary. The other places doing in-place updates on pg_data

pgsql: Explain dropdb can't use syscache because of TOAST

2024-08-19 Thread Tomas Vondra
Explain dropdb can't use syscache because of TOAST Add a comment explaining dropdb() can't rely on syscache. The issue with flattened rows was fixed by commit 0f92b230f88b, but better to have a clear explanation why the systable scan is necessary. The other places doing in-place updates on pg_data

pgsql: Explain dropdb can't use syscache because of TOAST

2024-08-19 Thread Tomas Vondra
Explain dropdb can't use syscache because of TOAST Add a comment explaining dropdb() can't rely on syscache. The issue with flattened rows was fixed by commit 0f92b230f88b, but better to have a clear explanation why the systable scan is necessary. The other places doing in-place updates on pg_data

pgsql: Explain dropdb can't use syscache because of TOAST

2024-08-19 Thread Tomas Vondra
Explain dropdb can't use syscache because of TOAST Add a comment explaining dropdb() can't rely on syscache. The issue with flattened rows was fixed by commit 0f92b230f88b, but better to have a clear explanation why the systable scan is necessary. The other places doing in-place updates on pg_data

pgsql: Explain dropdb can't use syscache because of TOAST

2024-08-19 Thread Tomas Vondra
Explain dropdb can't use syscache because of TOAST Add a comment explaining dropdb() can't rely on syscache. The issue with flattened rows was fixed by commit 0f92b230f88b, but better to have a clear explanation why the systable scan is necessary. The other places doing in-place updates on pg_data

pgsql: Fix DROP DATABASE for databases with many ACLs

2024-08-18 Thread Tomas Vondra
ple length to match the on-disk tuple. Fixed by reading the tuple from the catalog directly, not from syscache. Report and fix by Ayush Tiwari. Backpatch to 12. The DROP DATABASE fix was backpatched to 11, but 11 is EOL at this point. Reported-by: Ayush Tiwari Author: Ayush Tiwari Reviewed-by: To

pgsql: Fix DROP DATABASE for databases with many ACLs

2024-08-18 Thread Tomas Vondra
ple length to match the on-disk tuple. Fixed by reading the tuple from the catalog directly, not from syscache. Report and fix by Ayush Tiwari. Backpatch to 12. The DROP DATABASE fix was backpatched to 11, but 11 is EOL at this point. Reported-by: Ayush Tiwari Author: Ayush Tiwari Reviewed-by: To

pgsql: Fix DROP DATABASE for databases with many ACLs

2024-08-18 Thread Tomas Vondra
ple length to match the on-disk tuple. Fixed by reading the tuple from the catalog directly, not from syscache. Report and fix by Ayush Tiwari. Backpatch to 12. The DROP DATABASE fix was backpatched to 11, but 11 is EOL at this point. Reported-by: Ayush Tiwari Author: Ayush Tiwari Reviewed-by: To

pgsql: Fix DROP DATABASE for databases with many ACLs

2024-08-18 Thread Tomas Vondra
ple length to match the on-disk tuple. Fixed by reading the tuple from the catalog directly, not from syscache. Report and fix by Ayush Tiwari. Backpatch to 12. The DROP DATABASE fix was backpatched to 11, but 11 is EOL at this point. Reported-by: Ayush Tiwari Author: Ayush Tiwari Reviewed-by: To

pgsql: Fix DROP DATABASE for databases with many ACLs

2024-08-18 Thread Tomas Vondra
ple length to match the on-disk tuple. Fixed by reading the tuple from the catalog directly, not from syscache. Report and fix by Ayush Tiwari. Backpatch to 12. The DROP DATABASE fix was backpatched to 11, but 11 is EOL at this point. Reported-by: Ayush Tiwari Author: Ayush Tiwari Reviewed-by: To

pgsql: Fix DROP DATABASE for databases with many ACLs

2024-08-18 Thread Tomas Vondra
ple length to match the on-disk tuple. Fixed by reading the tuple from the catalog directly, not from syscache. Report and fix by Ayush Tiwari. Backpatch to 12. The DROP DATABASE fix was backpatched to 11, but 11 is EOL at this point. Reported-by: Ayush Tiwari Author: Ayush Tiwari Reviewed-by: To

pgsql: Fix DROP DATABASE for databases with many ACLs

2024-08-18 Thread Tomas Vondra
ple length to match the on-disk tuple. Fixed by reading the tuple from the catalog directly, not from syscache. Report and fix by Ayush Tiwari. Backpatch to 12. The DROP DATABASE fix was backpatched to 11, but 11 is EOL at this point. Reported-by: Ayush Tiwari Author: Ayush Tiwari Reviewed-by: To

pgsql: Add headers needed by pg_combinebackup --clone

2024-06-30 Thread Tomas Vondra
Add headers needed by pg_combinebackup --clone The code for file cloning existed, but was not reachable as it relied on constants from missing headers. Due to that, on Linux --clone always failed with error: file cloning not supported on this platform Fixed by including the missing headers to

pgsql: Add PG_TEST_PG_COMBINEBACKUP_MODE

2024-06-30 Thread Tomas Vondra
Add PG_TEST_PG_COMBINEBACKUP_MODE Introduces an environment variable PG_TEST_PG_COMBINEBACKUP_MODE, that determines copy mode used by pg_combinebackup in TAP tests. Defaults to "--copy" but may be set to "--clone" or "--copy-file-range" to use the alternative stategies. Reported-by: Peter Eisentr

pgsql: Add pg_combinebackup --copy option

2024-06-30 Thread Tomas Vondra
Add pg_combinebackup --copy option Introduces --copy as an alternative to --clone and --copy-file-range. This option simply picks the default mode to copy files, as if none of the options was specified. This makes pg_combinebackup options more consistent with pg_upgrade, and it makes testing simpl

pgsql: createdb: compare strategy case-insensitive

2024-04-21 Thread Tomas Vondra
createdb: compare strategy case-insensitive When specifying the createdb strategy, the documentation suggests valid options are FILE_COPY and WAL_LOG, but the code does case-sensitive comparison and accepts only "file_copy" and "wal_log" as valid. Fixed by doing a case-insensitive comparison usin

pgsql: createdb: compare strategy case-insensitive

2024-04-21 Thread Tomas Vondra
createdb: compare strategy case-insensitive When specifying the createdb strategy, the documentation suggests valid options are FILE_COPY and WAL_LOG, but the code does case-sensitive comparison and accepts only "file_copy" and "wal_log" as valid. Fixed by doing a case-insensitive comparison usin

  1   2   3   4   5   6   7   >