pgsql: Optimize pg_readv/pg_pwritev single vector case.

2023-11-28 Thread Thomas Munro
Optimize pg_readv/pg_pwritev single vector case.

For the trivial case of iovcnt == 1, kernels are measurably slower at
dealing with the more complex arguments of preadv/pwritev than the
equivalent plain old pread/pwrite.  The overheads are worth it for
iovcnt > 1, but for 1 let's just redirect to the cheaper calls.  While
we could leave it to callers to worry about that, we already have to
have our own pg_ wrappers for portability reasons so it seems
reasonable to centralize this knowledge there (thanks to Heikki for this
suggestion).  Try to avoid function call overheads by making them
inlinable, which might also allow the compiler to avoid the branch in
some cases.  For systems that don't have preadv and pwritev (currently:
Windows and [closed] Solaris), we might as well pull the replacement
functions up into the static inline functions too.

Reviewed-by: Heikki Linnakangas 
Discussion: 
https://postgr.es/m/CA+hUKGJkOiOCa+mag4BF+zHo7qo=o9CFheB8=g6ut5tum2g...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/15c9ac3629936a9bb5010155d3656e913027ccb7

Modified Files
--
configure   | 22 +
configure.ac|  6 ++--
src/include/port/pg_iovec.h | 76 -
src/port/meson.build|  2 --
src/port/preadv.c   | 43 -
src/port/pwritev.c  | 43 -
src/tools/msvc/Mkvcbuild.pm |  2 +-
7 files changed, 74 insertions(+), 120 deletions(-)



Re: pgsql: meson: docs: Add {html,man} targets, rename install-doc-*

2023-11-28 Thread Andres Freund
Hi,

On 2023-11-23 08:32:21 -0500, Andrew Dunstan wrote:
> On 2023-11-20 Mo 20:53, Andres Freund wrote:
> > meson: docs: Add {html,man} targets, rename install-doc-*
> >
> > We have toplevel html, man targets in the autoconf build as well. It'd be 
> > odd
> > to have an 'html' target but have the install target be 'install-doc-html',
> > thus rename the install targets to match.
>
>
> This commit of one of its nearby friends appears to have broken crake's docs
> build:
>
> ERROR: Can't invoke target `html`: ambiguous name.Add target type and/or path:
> - ./doc/src/sgml/html:custom
> - ./doc/src/sgml/html:alias
>
> See

Ah, I realize now that this is from meson compile html, not 'ninja html'. That
explains why I couldn't reproduce this initially and why CI didn't complain.
I don't really understand why meson compile complains in this case.  I assume
you don't want to disambiguate as suggested, by building html:alias instead?

Greetings,

Andres Freund




pgsql: Use larger segment file names for pg_notify

2023-11-28 Thread Alexander Korotkov
Use larger segment file names for pg_notify

This avoids the wraparound in async.c and removes the corresponding code
complexity. The maximum amount of allocated SLRU pages for NOTIFY / LISTEN
queue is now determined by the max_notify_queue_pages GUC. The default
value is 1048576. It allows to consume up to 8 GB of disk space which is
exactly the limit we had previously.

Author: Maxim Orlov, Aleksander Alekseev, Alexander Korotkov, Teodor Sigaev
Author: Nikita Glukhov, Pavel Borisov, Yura Sokolov
Reviewed-by: Jacob Champion, Heikki Linnakangas, Alexander Korotkov
Reviewed-by: Japin Li, Pavel Borisov, Tom Lane, Peter Eisentraut, Andres Freund
Reviewed-by: Andrey Borodin, Dilip Kumar, Aleksander Alekseev
Discussion: 
https://postgr.es/m/CACG%3DezZe1NQSCnfHOr78AtAZxJZeCvxrts0ygrxYwe%3DpyyjVWA%40mail.gmail.com
Discussion: 
https://postgr.es/m/CAJ7c6TPDOYBYrnCAeyndkBktO0WG2xSdYduTF0nxq%2BvfkmTF5Q%40mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/2cdf131c46e631addfc386f6106e52a1b8cc3a70

Modified Files
--
doc/src/sgml/config.sgml  |  16 
doc/src/sgml/ref/listen.sgml  |   1 +
doc/src/sgml/ref/notify.sgml  |   1 +
src/backend/commands/async.c  | 122 +++---
src/backend/utils/misc/guc_tables.c   |  10 +++
src/backend/utils/misc/postgresql.conf.sample |   3 +
src/include/commands/async.h  |   1 +
7 files changed, 62 insertions(+), 92 deletions(-)



pgsql: Make use FullTransactionId in 2PC filenames

2023-11-28 Thread Alexander Korotkov
Make use FullTransactionId in 2PC filenames

Switch from using TransactionId to FullTransactionId in naming of 2PC files.
Transaction state file in the pg_twophase directory now have extra 8 bytes in
the name to address an epoch of a given xid.

Author: Maxim Orlov, Aleksander Alekseev, Alexander Korotkov, Teodor Sigaev
Author: Nikita Glukhov, Pavel Borisov, Yura Sokolov
Reviewed-by: Jacob Champion, Heikki Linnakangas, Alexander Korotkov
Reviewed-by: Japin Li, Pavel Borisov, Tom Lane, Peter Eisentraut, Andres Freund
Reviewed-by: Andrey Borodin, Dilip Kumar, Aleksander Alekseev
Discussion: 
https://postgr.es/m/CACG%3DezZe1NQSCnfHOr78AtAZxJZeCvxrts0ygrxYwe%3DpyyjVWA%40mail.gmail.com
Discussion: 
https://postgr.es/m/CAJ7c6TPDOYBYrnCAeyndkBktO0WG2xSdYduTF0nxq%2BvfkmTF5Q%40mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/5a1dfde8334b25e19bf4b3aa75274c547a3aa30f

Modified Files
--
src/backend/access/transam/twophase.c | 50 +++
1 file changed, 45 insertions(+), 5 deletions(-)



pgsql: Index SLRUs by 64-bit integers rather than by 32-bit integers

2023-11-28 Thread Alexander Korotkov
Index SLRUs by 64-bit integers rather than by 32-bit integers

We've had repeated bugs in the area of handling SLRU wraparound in the past,
some of which have caused data loss. Switching to an indexing system for SLRUs
that does not wrap around should allow us to get rid of a whole bunch
of problems and improve the overall reliability of the system.

This particular patch however only changes the indexing and doesn't address
the wraparound per se. This is going to be done in the following patches.

Author: Maxim Orlov, Aleksander Alekseev, Alexander Korotkov, Teodor Sigaev
Author: Nikita Glukhov, Pavel Borisov, Yura Sokolov
Reviewed-by: Jacob Champion, Heikki Linnakangas, Alexander Korotkov
Reviewed-by: Japin Li, Pavel Borisov, Tom Lane, Peter Eisentraut, Andres Freund
Reviewed-by: Andrey Borodin, Dilip Kumar, Aleksander Alekseev
Discussion: 
https://postgr.es/m/CACG%3DezZe1NQSCnfHOr78AtAZxJZeCvxrts0ygrxYwe%3DpyyjVWA%40mail.gmail.com
Discussion: 
https://postgr.es/m/CAJ7c6TPDOYBYrnCAeyndkBktO0WG2xSdYduTF0nxq%2BvfkmTF5Q%40mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/4ed8f0913bfdb5f3551de3c27fc2c2e880abc5a2

Modified Files
--
src/backend/access/rmgrdesc/clogdesc.c|  10 +-
src/backend/access/rmgrdesc/committsdesc.c|  10 +-
src/backend/access/rmgrdesc/mxactdesc.c   |   6 +-
src/backend/access/transam/clog.c |  64 ++
src/backend/access/transam/commit_ts.c|  52 
src/backend/access/transam/multixact.c|  62 +-
src/backend/access/transam/slru.c | 143 +++---
src/backend/access/transam/subtrans.c |  34 +++--
src/backend/commands/async.c  |  20 +--
src/backend/storage/lmgr/predicate.c  |  13 +-
src/include/access/clog.h |   2 +-
src/include/access/commit_ts.h|   2 +-
src/include/access/slru.h |  35 --
src/include/storage/proc.h|   2 +-
src/include/storage/sync.h|   2 +-
src/test/modules/test_slru/expected/test_slru.out |   2 +-
src/test/modules/test_slru/test_slru--1.0.sql |  14 +--
src/test/modules/test_slru/test_slru.c|  32 +++--
18 files changed, 303 insertions(+), 202 deletions(-)



pgsql: Add SLRU tests for 64-bit page case

2023-11-28 Thread Alexander Korotkov
Add SLRU tests for 64-bit page case

4ed8f0913b added 64-bit page numbering for SLRU.  This commit adds tests for
page numbers higher than 2^32.

Author: Maxim Orlov
Reviewed-by: Aleksander Alekseev, Alexander Korotkov
Discussion: 
https://postgr.es/m/CACG%3DezZe1NQSCnfHOr78AtAZxJZeCvxrts0ygrxYwe%3DpyyjVWA%40mail.gmail.com
Discussion: 
https://postgr.es/m/CAJ7c6TPDOYBYrnCAeyndkBktO0WG2xSdYduTF0nxq%2BvfkmTF5Q%40mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/a60b8a58f435c44fc54e904cb05784b49dc04d0e

Modified Files
--
src/test/modules/test_slru/expected/test_slru.out | 135 ++
src/test/modules/test_slru/sql/test_slru.sql  |  38 ++
2 files changed, 173 insertions(+)



pgsql: Clean up usage of bison precedence for non-operator keywords.

2023-11-28 Thread Tom Lane
Clean up usage of bison precedence for non-operator keywords.

Assigning a precedence to a keyword that isn't a kind of expression
operator is rather dangerous, because it might mask grammar
ambiguities that we'd rather know about.  It's much safer to attach
explicit precedences to individual rules, which will affect the
behavior of only that one rule.  Moreover, when we do have to give
a precedence to a non-operator keyword, we should try to give it the
same precedence as IDENT, thereby reducing the risk of surprising
side-effects.

Apply this hard-won knowledge to SET (which I misassigned ages ago
in commit 2647ad658) and some SQL/JSON-related productions
(from commits 6ee30209a, 71bfd1543).

Patch HEAD only, since there's no evidence of actual bugs here.

Discussion: 
https://postgr.es/m/CADT4RqBPdbsZW7HS1jJP319TMRHs1hzUiP=irjyr6uqghcr...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/a916b47e23290ca24ffd083e5128d994f62966f6

Modified Files
--
src/backend/parser/gram.y | 61 ++-
1 file changed, 44 insertions(+), 17 deletions(-)



pgsql: Use BIO_{get,set}_app_data instead of BIO_{get,set}_data.

2023-11-28 Thread Tom Lane
Use BIO_{get,set}_app_data instead of BIO_{get,set}_data.

We should have done it this way all along, but we accidentally got
away with using the wrong BIO field up until OpenSSL 3.2.  There,
the library's BIO routines that we rely on use the "data" field
for their own purposes, and our conflicting use causes assorted
weird behaviors up to and including core dumps when SSL connections
are attempted.  Switch to using the approved field for the purpose,
i.e. app_data.

While at it, remove our configure probes for BIO_get_data as well
as the fallback implementation.  BIO_{get,set}_app_data have been
there since long before any OpenSSL version that we still support,
even in the back branches.

Also, update src/test/ssl/t/001_ssltests.pl to allow for a minor
change in an error message spelling that evidently came in with 3.2.

Tristan Partin and Bo Andreson.  Back-patch to all supported branches.

Discussion: 
https://postgr.es/m/can55fz1eddysyal7mv+osluij2h_u6hvd4qmv-7pk7jkji0...@mail.gmail.com

Branch
--
REL_12_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/0bd682246a619fd8eb9b538f1af61afb991b06b4

Modified Files
--
configure|  2 +-
configure.in |  2 +-
src/backend/libpq/be-secure-openssl.c| 11 +++
src/include/pg_config.h.in   |  3 ---
src/include/pg_config.h.win32|  3 ---
src/interfaces/libpq/fe-secure-openssl.c | 11 +++
src/tools/msvc/Solution.pm   |  1 -
7 files changed, 8 insertions(+), 25 deletions(-)



pgsql: Use BIO_{get,set}_app_data instead of BIO_{get,set}_data.

2023-11-28 Thread Tom Lane
Use BIO_{get,set}_app_data instead of BIO_{get,set}_data.

We should have done it this way all along, but we accidentally got
away with using the wrong BIO field up until OpenSSL 3.2.  There,
the library's BIO routines that we rely on use the "data" field
for their own purposes, and our conflicting use causes assorted
weird behaviors up to and including core dumps when SSL connections
are attempted.  Switch to using the approved field for the purpose,
i.e. app_data.

While at it, remove our configure probes for BIO_get_data as well
as the fallback implementation.  BIO_{get,set}_app_data have been
there since long before any OpenSSL version that we still support,
even in the back branches.

Also, update src/test/ssl/t/001_ssltests.pl to allow for a minor
change in an error message spelling that evidently came in with 3.2.

Tristan Partin and Bo Andreson.  Back-patch to all supported branches.

Discussion: 
https://postgr.es/m/can55fz1eddysyal7mv+osluij2h_u6hvd4qmv-7pk7jkji0...@mail.gmail.com

Branch
--
REL_15_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/5dd30bb54bfec14e5677aff3e306edec79c204ef

Modified Files
--
configure|  2 +-
configure.ac |  2 +-
src/backend/libpq/be-secure-openssl.c| 11 +++
src/include/pg_config.h.in   |  3 ---
src/interfaces/libpq/fe-secure-openssl.c | 11 +++
src/test/ssl/t/001_ssltests.pl   |  4 ++--
src/tools/msvc/Solution.pm   |  2 --
7 files changed, 10 insertions(+), 25 deletions(-)



pgsql: Use BIO_{get,set}_app_data instead of BIO_{get,set}_data.

2023-11-28 Thread Tom Lane
Use BIO_{get,set}_app_data instead of BIO_{get,set}_data.

We should have done it this way all along, but we accidentally got
away with using the wrong BIO field up until OpenSSL 3.2.  There,
the library's BIO routines that we rely on use the "data" field
for their own purposes, and our conflicting use causes assorted
weird behaviors up to and including core dumps when SSL connections
are attempted.  Switch to using the approved field for the purpose,
i.e. app_data.

While at it, remove our configure probes for BIO_get_data as well
as the fallback implementation.  BIO_{get,set}_app_data have been
there since long before any OpenSSL version that we still support,
even in the back branches.

Also, update src/test/ssl/t/001_ssltests.pl to allow for a minor
change in an error message spelling that evidently came in with 3.2.

Tristan Partin and Bo Andreson.  Back-patch to all supported branches.

Discussion: 
https://postgr.es/m/can55fz1eddysyal7mv+osluij2h_u6hvd4qmv-7pk7jkji0...@mail.gmail.com

Branch
--
REL_13_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/efb80468271932ad17557afa977db56bfe3e8bc5

Modified Files
--
configure|  2 +-
configure.in |  2 +-
src/backend/libpq/be-secure-openssl.c| 11 +++
src/include/pg_config.h.in   |  3 ---
src/interfaces/libpq/fe-secure-openssl.c | 11 +++
src/tools/msvc/Solution.pm   |  2 --
6 files changed, 8 insertions(+), 23 deletions(-)



pgsql: Use BIO_{get,set}_app_data instead of BIO_{get,set}_data.

2023-11-28 Thread Tom Lane
Use BIO_{get,set}_app_data instead of BIO_{get,set}_data.

We should have done it this way all along, but we accidentally got
away with using the wrong BIO field up until OpenSSL 3.2.  There,
the library's BIO routines that we rely on use the "data" field
for their own purposes, and our conflicting use causes assorted
weird behaviors up to and including core dumps when SSL connections
are attempted.  Switch to using the approved field for the purpose,
i.e. app_data.

While at it, remove our configure probes for BIO_get_data as well
as the fallback implementation.  BIO_{get,set}_app_data have been
there since long before any OpenSSL version that we still support,
even in the back branches.

Also, update src/test/ssl/t/001_ssltests.pl to allow for a minor
change in an error message spelling that evidently came in with 3.2.

Tristan Partin and Bo Andreson.  Back-patch to all supported branches.

Discussion: 
https://postgr.es/m/can55fz1eddysyal7mv+osluij2h_u6hvd4qmv-7pk7jkji0...@mail.gmail.com

Branch
--
REL_16_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/efa8f606402c3d7ca361932418cbcc2600b6c059

Modified Files
--
configure|  2 +-
configure.ac |  2 +-
meson.build  |  1 -
src/backend/libpq/be-secure-openssl.c| 11 +++
src/include/pg_config.h.in   |  3 ---
src/interfaces/libpq/fe-secure-openssl.c | 11 +++
src/test/ssl/t/001_ssltests.pl   |  6 +++---
src/tools/msvc/Solution.pm   |  2 --
8 files changed, 11 insertions(+), 27 deletions(-)



pgsql: Use BIO_{get,set}_app_data instead of BIO_{get,set}_data.

2023-11-28 Thread Tom Lane
Use BIO_{get,set}_app_data instead of BIO_{get,set}_data.

We should have done it this way all along, but we accidentally got
away with using the wrong BIO field up until OpenSSL 3.2.  There,
the library's BIO routines that we rely on use the "data" field
for their own purposes, and our conflicting use causes assorted
weird behaviors up to and including core dumps when SSL connections
are attempted.  Switch to using the approved field for the purpose,
i.e. app_data.

While at it, remove our configure probes for BIO_get_data as well
as the fallback implementation.  BIO_{get,set}_app_data have been
there since long before any OpenSSL version that we still support,
even in the back branches.

Also, update src/test/ssl/t/001_ssltests.pl to allow for a minor
change in an error message spelling that evidently came in with 3.2.

Tristan Partin and Bo Andreson.  Back-patch to all supported branches.

Discussion: 
https://postgr.es/m/can55fz1eddysyal7mv+osluij2h_u6hvd4qmv-7pk7jkji0...@mail.gmail.com

Branch
--
REL_14_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/b2b1f12882fb561c7d474b834044dd8ed570bfea

Modified Files
--
configure|  2 +-
configure.ac |  2 +-
src/backend/libpq/be-secure-openssl.c| 11 +++
src/include/pg_config.h.in   |  3 ---
src/interfaces/libpq/fe-secure-openssl.c | 11 +++
src/test/ssl/t/001_ssltests.pl   |  4 ++--
src/tools/msvc/Solution.pm   |  2 --
7 files changed, 10 insertions(+), 25 deletions(-)



pgsql: Use BIO_{get,set}_app_data instead of BIO_{get,set}_data.

2023-11-28 Thread Tom Lane
Use BIO_{get,set}_app_data instead of BIO_{get,set}_data.

We should have done it this way all along, but we accidentally got
away with using the wrong BIO field up until OpenSSL 3.2.  There,
the library's BIO routines that we rely on use the "data" field
for their own purposes, and our conflicting use causes assorted
weird behaviors up to and including core dumps when SSL connections
are attempted.  Switch to using the approved field for the purpose,
i.e. app_data.

While at it, remove our configure probes for BIO_get_data as well
as the fallback implementation.  BIO_{get,set}_app_data have been
there since long before any OpenSSL version that we still support,
even in the back branches.

Also, update src/test/ssl/t/001_ssltests.pl to allow for a minor
change in an error message spelling that evidently came in with 3.2.

Tristan Partin and Bo Andreson.  Back-patch to all supported branches.

Discussion: 
https://postgr.es/m/can55fz1eddysyal7mv+osluij2h_u6hvd4qmv-7pk7jkji0...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/c82207a548db47623a2bfa2447babdaa630302b9

Modified Files
--
configure|  2 +-
configure.ac |  2 +-
meson.build  |  1 -
src/backend/libpq/be-secure-openssl.c| 11 +++
src/include/pg_config.h.in   |  3 ---
src/interfaces/libpq/fe-secure-openssl.c | 11 +++
src/test/ssl/t/001_ssltests.pl   |  6 +++---
src/tools/msvc/Solution.pm   |  2 --
8 files changed, 11 insertions(+), 27 deletions(-)



pgsql: Fix comment about ressortgrouprefs being unique in setop plans.

2023-11-28 Thread Heikki Linnakangas
Fix comment about ressortgrouprefs being unique in setop plans.

Author: Richard Guo, Tom Lane
Discussion: 
https://www.postgresql.org/message-id/CAMbWs49rAfFS-yd7=QxtDUrZDFfRBGy4rGBJNyGDH7=clip...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/10a59925a378bd67aa3834c842dad19de9c5e4c0

Modified Files
--
src/backend/optimizer/plan/setrefs.c | 9 -
1 file changed, 8 insertions(+), 1 deletion(-)



pgsql: Remove more statements from stats.sql

2023-11-28 Thread Michael Paquier
Remove more statements from stats.sql

Some of the statements capturing stats reset timestamps have become
unnecessary after a9a8108411e4, so let's remove them.

Author: Bharath Rupireddy
Discussion: 
https://postgr.es/m/CALj2ACUnvB_Yo=O1xApBa4CDqQpW-x=qm35gbn1mqvraxag...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/f36b63623db60e16b910658d6fde6b7931e0ac46

Modified Files
--
src/test/regress/expected/stats.out | 6 --
src/test/regress/sql/stats.sql  | 6 --
2 files changed, 12 deletions(-)



pgsql: Fix assertions with RI triggers in heap_update and heap_delete.

2023-11-28 Thread Heikki Linnakangas
Fix assertions with RI triggers in heap_update and heap_delete.

If the tuple being updated is not visible to the crosscheck snapshot,
we return TM_Updated but the assertions would not hold in that case.
Move them to before the cross-check.

Fixes bug #17893. Backpatch to all supported versions.

Author: Alexander Lakhin
Backpatch-through: 12
Discussion: 
https://www.postgresql.org/message-id/17893-35847009eec517b5%40postgresql.org

Branch
--
REL_12_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/b8a606e21b0619ac378558bdd258c54aee7cb4ed

Modified Files
--
src/backend/access/heap/heapam.c | 41 +++-
src/include/access/tableam.h |  4 ++--
2 files changed, 26 insertions(+), 19 deletions(-)



pgsql: Fix assertions with RI triggers in heap_update and heap_delete.

2023-11-28 Thread Heikki Linnakangas
Fix assertions with RI triggers in heap_update and heap_delete.

If the tuple being updated is not visible to the crosscheck snapshot,
we return TM_Updated but the assertions would not hold in that case.
Move them to before the cross-check.

Fixes bug #17893. Backpatch to all supported versions.

Author: Alexander Lakhin
Backpatch-through: 12
Discussion: 
https://www.postgresql.org/message-id/17893-35847009eec517b5%40postgresql.org

Branch
--
REL_15_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/2873fbfe0d6500a45a316d2d42414a432a96e9f1

Modified Files
--
src/backend/access/heap/heapam.c| 41 +
src/include/access/tableam.h|  4 +--
src/test/isolation/expected/fk-snapshot.out | 22 
src/test/isolation/specs/fk-snapshot.spec   | 17 +++-
4 files changed, 64 insertions(+), 20 deletions(-)



pgsql: Fix assertions with RI triggers in heap_update and heap_delete.

2023-11-28 Thread Heikki Linnakangas
Fix assertions with RI triggers in heap_update and heap_delete.

If the tuple being updated is not visible to the crosscheck snapshot,
we return TM_Updated but the assertions would not hold in that case.
Move them to before the cross-check.

Fixes bug #17893. Backpatch to all supported versions.

Author: Alexander Lakhin
Backpatch-through: 12
Discussion: 
https://www.postgresql.org/message-id/17893-35847009eec517b5%40postgresql.org

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/60f227316c0ebf5f4f8296f11cedc9360e9cb8ae

Modified Files
--
src/backend/access/heap/heapam.c| 41 +
src/include/access/tableam.h|  4 +--
src/test/isolation/expected/fk-snapshot.out | 22 
src/test/isolation/specs/fk-snapshot.spec   | 17 +++-
4 files changed, 64 insertions(+), 20 deletions(-)



pgsql: Fix assertions with RI triggers in heap_update and heap_delete.

2023-11-28 Thread Heikki Linnakangas
Fix assertions with RI triggers in heap_update and heap_delete.

If the tuple being updated is not visible to the crosscheck snapshot,
we return TM_Updated but the assertions would not hold in that case.
Move them to before the cross-check.

Fixes bug #17893. Backpatch to all supported versions.

Author: Alexander Lakhin
Backpatch-through: 12
Discussion: 
https://www.postgresql.org/message-id/17893-35847009eec517b5%40postgresql.org

Branch
--
REL_16_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/9fee3232a1d3661981c3cbf87227bfd02ee36c7b

Modified Files
--
src/backend/access/heap/heapam.c| 41 +
src/include/access/tableam.h|  4 +--
src/test/isolation/expected/fk-snapshot.out | 22 
src/test/isolation/specs/fk-snapshot.spec   | 17 +++-
4 files changed, 64 insertions(+), 20 deletions(-)



pgsql: Fix assertions with RI triggers in heap_update and heap_delete.

2023-11-28 Thread Heikki Linnakangas
Fix assertions with RI triggers in heap_update and heap_delete.

If the tuple being updated is not visible to the crosscheck snapshot,
we return TM_Updated but the assertions would not hold in that case.
Move them to before the cross-check.

Fixes bug #17893. Backpatch to all supported versions.

Author: Alexander Lakhin
Backpatch-through: 12
Discussion: 
https://www.postgresql.org/message-id/17893-35847009eec517b5%40postgresql.org

Branch
--
REL_13_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/e434d3620a91f6f4511de32aaad70c1830949797

Modified Files
--
src/backend/access/heap/heapam.c | 41 +++-
src/include/access/tableam.h |  4 ++--
2 files changed, 26 insertions(+), 19 deletions(-)



pgsql: Fix assertions with RI triggers in heap_update and heap_delete.

2023-11-28 Thread Heikki Linnakangas
Fix assertions with RI triggers in heap_update and heap_delete.

If the tuple being updated is not visible to the crosscheck snapshot,
we return TM_Updated but the assertions would not hold in that case.
Move them to before the cross-check.

Fixes bug #17893. Backpatch to all supported versions.

Author: Alexander Lakhin
Backpatch-through: 12
Discussion: 
https://www.postgresql.org/message-id/17893-35847009eec517b5%40postgresql.org

Branch
--
REL_14_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/59c62a21f2439e425abae5a2e9dd1d53371226ea

Modified Files
--
src/backend/access/heap/heapam.c | 41 +++-
src/include/access/tableam.h |  4 ++--
2 files changed, 26 insertions(+), 19 deletions(-)



pgsql: psql: Add tab completion for view options.

2023-11-28 Thread Dean Rasheed
psql: Add tab completion for view options.

Add support for tab completion of WITH (...) options to CREATE VIEW,
and for the corresponding SET/RESET (...) options in ALTER VIEW.

Christoph Heiss, reviewed by Melih Mutlu, Vignesh C, Jim Jones,
Mikhail Gribkov, David Zhang, Shubham Khanna, and me.

Discussion: https://postgr.es/m/a2075c5a-66f9-a564-f038-9ac044b03...@c8h4.io

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/cd342474890f31a7364c0d1161334546822b639c

Modified Files
--
src/bin/psql/tab-complete.c | 50 +
1 file changed, 46 insertions(+), 4 deletions(-)