pgsql: Add support for LIKE in CREATE FOREIGN TABLE

2025-02-18 Thread Michael Paquier
Add support for LIKE in CREATE FOREIGN TABLE LIKE enables the creation of foreign tables based on the column definitions, constraints and objects of the defined source relation(s). This feature mirrors the behavior of CREATE TABLE LIKE, but ignores the INCLUDING sub-options that do not make sense

pgsql: doc: Fix some issues with JSON_TABLE() examples

2025-02-18 Thread Amit Langote
doc: Fix some issues with JSON_TABLE() examples 1. Remove an unused PASSING variable. 2. Adjust formatting of JSON data used in an example to be valid under strict mode Reported-by: Miłosz Chmura Author: Robert Treat Discussion: https://postgr.es/m/173859550337.1071.4748984213168572...@

pgsql: doc: Fix some issues with JSON_TABLE() exampls

2025-02-18 Thread Amit Langote
doc: Fix some issues with JSON_TABLE() exampls 1. Remove an unused PASSING variable. 2. Adjust formatting of JSON data used in an example to be valid under strict mode Reported-by: Miłosz Chmura Author: Robert Treat Discussion: https://postgr.es/m/173859550337.1071.4748984213168572...@w

pgsql: Invalidate inactive replication slots.

2025-02-18 Thread Amit Kapila
Invalidate inactive replication slots. This commit introduces idle_replication_slot_timeout GUC that allows inactive slots to be invalidated at the time of checkpoint. Because checkpoints happen checkpoint_timeout intervals, there can be some lag between when the idle_replication_slot_timeout was

pgsql: Avoid null pointer dereference crash after OOM in Snowball stemm

2025-02-18 Thread Tom Lane
Avoid null pointer dereference crash after OOM in Snowball stemmers. Absorb upstream bug fix (their commit e322673a841d9abd69994ae8cd20e191090b6ef4), which prevents a null pointer dereference crash if SN_create_env() gets a malloc failure at just the wrong point. Thanks to Maksim Korotkov for dis

pgsql: Avoid null pointer dereference crash after OOM in Snowball stemm

2025-02-18 Thread Tom Lane
Avoid null pointer dereference crash after OOM in Snowball stemmers. Absorb upstream bug fix (their commit e322673a841d9abd69994ae8cd20e191090b6ef4), which prevents a null pointer dereference crash if SN_create_env() gets a malloc failure at just the wrong point. Thanks to Maksim Korotkov for dis

pgsql: Avoid null pointer dereference crash after OOM in Snowball stemm

2025-02-18 Thread Tom Lane
Avoid null pointer dereference crash after OOM in Snowball stemmers. Absorb upstream bug fix (their commit e322673a841d9abd69994ae8cd20e191090b6ef4), which prevents a null pointer dereference crash if SN_create_env() gets a malloc failure at just the wrong point. Thanks to Maksim Korotkov for dis

pgsql: Avoid null pointer dereference crash after OOM in Snowball stemm

2025-02-18 Thread Tom Lane
Avoid null pointer dereference crash after OOM in Snowball stemmers. Absorb upstream bug fix (their commit e322673a841d9abd69994ae8cd20e191090b6ef4), which prevents a null pointer dereference crash if SN_create_env() gets a malloc failure at just the wrong point. Thanks to Maksim Korotkov for dis

pgsql: Avoid null pointer dereference crash after OOM in Snowball stemm

2025-02-18 Thread Tom Lane
Avoid null pointer dereference crash after OOM in Snowball stemmers. Absorb upstream bug fix (their commit e322673a841d9abd69994ae8cd20e191090b6ef4), which prevents a null pointer dereference crash if SN_create_env() gets a malloc failure at just the wrong point. Thanks to Maksim Korotkov for dis

pgsql: Fix unsafe access to BufferDescriptors

2025-02-18 Thread Richard Guo
Fix unsafe access to BufferDescriptors When considering a local buffer, the GetBufferDescriptor() call in BufferGetLSNAtomic() would be retrieving a shared buffer with a bad buffer ID. Since the code checks whether the buffer is shared before using the retrieved BufferDesc, this issue did not lea

pgsql: Fix unsafe access to BufferDescriptors

2025-02-18 Thread Richard Guo
Fix unsafe access to BufferDescriptors When considering a local buffer, the GetBufferDescriptor() call in BufferGetLSNAtomic() would be retrieving a shared buffer with a bad buffer ID. Since the code checks whether the buffer is shared before using the retrieved BufferDesc, this issue did not lea

pgsql: Update to latest Snowball sources.

2025-02-18 Thread Tom Lane
Update to latest Snowball sources. It's been some time since we did this, partly because the upstream snowball project hasn't formally tagged a new release since 2021. The main motivation for doing it now is to absorb a bug fix (their commit e322673a841d9abd69994ae8cd20e191090b6ef4), which prevent

pgsql: Fix unsafe access to BufferDescriptors

2025-02-18 Thread Richard Guo
Fix unsafe access to BufferDescriptors When considering a local buffer, the GetBufferDescriptor() call in BufferGetLSNAtomic() would be retrieving a shared buffer with a bad buffer ID. Since the code checks whether the buffer is shared before using the retrieved BufferDesc, this issue did not lea

pgsql: Fix unsafe access to BufferDescriptors

2025-02-18 Thread Richard Guo
Fix unsafe access to BufferDescriptors When considering a local buffer, the GetBufferDescriptor() call in BufferGetLSNAtomic() would be retrieving a shared buffer with a bad buffer ID. Since the code checks whether the buffer is shared before using the retrieved BufferDesc, this issue did not lea

pgsql: Fix unsafe access to BufferDescriptors

2025-02-18 Thread Richard Guo
Fix unsafe access to BufferDescriptors When considering a local buffer, the GetBufferDescriptor() call in BufferGetLSNAtomic() would be retrieving a shared buffer with a bad buffer ID. Since the code checks whether the buffer is shared before using the retrieved BufferDesc, this issue did not lea

pgsql: Fix unsafe access to BufferDescriptors

2025-02-18 Thread Richard Guo
Fix unsafe access to BufferDescriptors When considering a local buffer, the GetBufferDescriptor() call in BufferGetLSNAtomic() would be retrieving a shared buffer with a bad buffer ID. Since the code checks whether the buffer is shared before using the retrieved BufferDesc, this issue did not lea

pgsql: Fix freeing a child join's SpecialJoinInfo

2025-02-18 Thread Richard Guo
Fix freeing a child join's SpecialJoinInfo In try_partitionwise_join, we try to break down the join between two partitioned relations into joins between matching partitions. To achieve this, we iterate through each pair of partitions from the two joining relations and create child join relations

pgsql: Fix freeing a child join's SpecialJoinInfo

2025-02-18 Thread Richard Guo
Fix freeing a child join's SpecialJoinInfo In try_partitionwise_join, we try to break down the join between two partitioned relations into joins between matching partitions. To achieve this, we iterate through each pair of partitions from the two joining relations and create child join relations

pgsql: test_escape: Fix handling of short options in getopt_long()

2025-02-18 Thread Michael Paquier
test_escape: Fix handling of short options in getopt_long() This addresses two errors in the module, based on the set of options supported: - '-c', for --conninfo, was not listed. - '-f', for --force-unsupported, was not listed. While on it, these are now listed in an alphabetical order. Author:

pgsql: test_escape: Fix handling of short options in getopt_long()

2025-02-18 Thread Michael Paquier
test_escape: Fix handling of short options in getopt_long() This addresses two errors in the module, based on the set of options supported: - '-c', for --conninfo, was not listed. - '-f', for --force-unsupported, was not listed. While on it, these are now listed in an alphabetical order. Author:

pgsql: test_escape: Fix handling of short options in getopt_long()

2025-02-18 Thread Michael Paquier
test_escape: Fix handling of short options in getopt_long() This addresses two errors in the module, based on the set of options supported: - '-c', for --conninfo, was not listed. - '-f', for --force-unsupported, was not listed. While on it, these are now listed in an alphabetical order. Author:

pgsql: test_escape: Fix handling of short options in getopt_long()

2025-02-18 Thread Michael Paquier
test_escape: Fix handling of short options in getopt_long() This addresses two errors in the module, based on the set of options supported: - '-c', for --conninfo, was not listed. - '-f', for --force-unsupported, was not listed. While on it, these are now listed in an alphabetical order. Author:

pgsql: test_escape: Fix handling of short options in getopt_long()

2025-02-18 Thread Michael Paquier
test_escape: Fix handling of short options in getopt_long() This addresses two errors in the module, based on the set of options supported: - '-c', for --conninfo, was not listed. - '-f', for --force-unsupported, was not listed. While on it, these are now listed in an alphabetical order. Author:

pgsql: test_escape: Fix handling of short options in getopt_long()

2025-02-18 Thread Michael Paquier
test_escape: Fix handling of short options in getopt_long() This addresses two errors in the module, based on the set of options supported: - '-c', for --conninfo, was not listed. - '-f', for --force-unsupported, was not listed. While on it, these are now listed in an alphabetical order. Author:

pgsql: Make the description of some GUCs more consistent

2025-02-18 Thread Michael Paquier
Make the description of some GUCs more consistent This commit improves the description of a couple of GUCs, to be more consistent with the style of their surroundings: * array_nulls * enable_self_join_elimination * optimize_bounded_sort * row_security * synchronize_seqscans Author: Kyotaro Horigu

pgsql: Tag refs/tags/REL_17_4 was created

2025-02-18 Thread noreply
Tag refs/tags/REL_17_4 was created.

pgsql: Tag refs/tags/REL_16_8 was created

2025-02-18 Thread noreply
Tag refs/tags/REL_16_8 was created.

pgsql: Tag refs/tags/REL_13_20 was created

2025-02-18 Thread noreply
Tag refs/tags/REL_13_20 was created.

pgsql: Tag refs/tags/REL_15_12 was created

2025-02-18 Thread noreply
Tag refs/tags/REL_15_12 was created.

pgsql: Tag refs/tags/REL_14_17 was created

2025-02-18 Thread noreply
Tag refs/tags/REL_14_17 was created.

pgsql: doc: add example of sign mismatch with POSIX/ISO-8601 time zones

2025-02-18 Thread Bruce Momjian
doc: add example of sign mismatch with POSIX/ISO-8601 time zones Author: Laurenz Albe Discussion: https://postgr.es/m/eb4d1e15c6822c1937be1491118500dd9201492f.ca...@cybertec.at Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/06dc1ffd24096f7c71d1abeaa9e96fec4db9313

pgsql: Update outdated comments in nodeAgg.c.

2025-02-18 Thread Jeff Davis
Update outdated comments in nodeAgg.c. Author: Zhang Mingli Reviewed-by: Richard Guo Discussion: https://postgr.es/m/198a8d1e-0792-4e7f-828e-902aa342f36e@Spark Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/a1f7f80bfef105c8c02153e8832d4106df3cf459 Modified Files -

Re: pgsql: Reduce scope of heap vacuum per_buffer_data

2025-02-18 Thread Melanie Plageman
On Tue, Feb 18, 2025 at 9:30 AM Melanie Plageman wrote: > > Reduce scope of heap vacuum per_buffer_data > > Move lazy_scan_heap()'s per_buffer_data variable into a tighter scope. > In lazy_scan_heap()'s phase I heap vacuuming, the read stream API > returns a pointer to the next block number to vac

pgsql: Reduce scope of heap vacuum per_buffer_data

2025-02-18 Thread Melanie Plageman
Reduce scope of heap vacuum per_buffer_data Move lazy_scan_heap()'s per_buffer_data variable into a tighter scope. In lazy_scan_heap()'s phase I heap vacuuming, the read stream API returns a pointer to the next block number to vacuum. As long as read_stream_next_buffer() returns a valid buffer, pe

pgsql: Add PGErrorVerbosity to typedefs.list

2025-02-18 Thread Daniel Gustafsson
Add PGErrorVerbosity to typedefs.list PGErrorVerbosity was missing which resulted in incorrect whitespace alignment going back all the way to e3860ffa4dd0. No backpatch for this though since we don't pgindent backbranches. Author: Jelte Fennema-Nio Reviewed-by: Daniel Gustafsson Discussion: h

pgsql: Fix poorly written regression test

2025-02-18 Thread David Rowley
Fix poorly written regression test bd10ec529 added code to allow redundant functionally dependent GROUP BY columns to be removed using unique indexes and NOT NULL constraints as proofs of functional dependency. In that commit, I (David) added a test to ensure that when there are multiple indexes