pgsql: Doc: Fix logical replication examples.

2025-07-21 Thread Amit Kapila
Doc: Fix logical replication examples. The definition of \dRp+ was modified in commit 7054186c4e. This patch updates the column list and row filter examples to align with the revised definition. Author: Shlok Kyal Reviewed by: Peter Smith Backpatch-through: 18, where it was introduced Discussio

pgsql: Doc: Fix logical replication examples.

2025-07-21 Thread Amit Kapila
Doc: Fix logical replication examples. The definition of \dRp+ was modified in commit 7054186c4e. This patch updates the column list and row filter examples to align with the revised definition. Author: Shlok Kyal Reviewed by: Peter Smith Backpatch-through: 18, where it was introduced Discussio

pgsql: doc: Inform about aminsertcleanup optional NULLness

2025-07-21 Thread Michael Paquier
doc: Inform about aminsertcleanup optional NULLness This index AM callback has been introduced in c1ec02be1d79 and it is optional, currently only being used by BRIN. Optional callbacks are documented with NULL as possible value in amapi.h and indexam.sgml, but this callback has missed this part o

pgsql: doc: Inform about aminsertcleanup optional NULLness

2025-07-21 Thread Michael Paquier
doc: Inform about aminsertcleanup optional NULLness This index AM callback has been introduced in c1ec02be1d79 and it is optional, currently only being used by BRIN. Optional callbacks are documented with NULL as possible value in amapi.h and indexam.sgml, but this callback has missed this part o

pgsql: doc: Inform about aminsertcleanup optional NULLness

2025-07-21 Thread Michael Paquier
doc: Inform about aminsertcleanup optional NULLness This index AM callback has been introduced in c1ec02be1d79 and it is optional, currently only being used by BRIN. Optional callbacks are documented with NULL as possible value in amapi.h and indexam.sgml, but this callback has missed this part o

pgsql: Log remote NOTICE, WARNING, and similar messages using ereport()

2025-07-21 Thread Fujii Masao
Log remote NOTICE, WARNING, and similar messages using ereport(). Previously, NOTICE, WARNING, and similar messages received from remote servers over replication, postgres_fdw, or dblink connections were printed directly to stderr on the local server (e.g., the subscriber). As a result, these mess

pgsql: ecpg: Fix NULL pointer dereference during connection lookup

2025-07-21 Thread Michael Paquier
ecpg: Fix NULL pointer dereference during connection lookup ECPGconnect() caches established connections to the server, supporting the case of a NULL connection name when a database name is not specified by its caller. A follow-up call to ECPGget_PGconn() to get an established connection from the

pgsql: ecpg: Fix NULL pointer dereference during connection lookup

2025-07-21 Thread Michael Paquier
ecpg: Fix NULL pointer dereference during connection lookup ECPGconnect() caches established connections to the server, supporting the case of a NULL connection name when a database name is not specified by its caller. A follow-up call to ECPGget_PGconn() to get an established connection from the

pgsql: ecpg: Fix NULL pointer dereference during connection lookup

2025-07-21 Thread Michael Paquier
ecpg: Fix NULL pointer dereference during connection lookup ECPGconnect() caches established connections to the server, supporting the case of a NULL connection name when a database name is not specified by its caller. A follow-up call to ECPGget_PGconn() to get an established connection from the

pgsql: ecpg: Fix NULL pointer dereference during connection lookup

2025-07-21 Thread Michael Paquier
ecpg: Fix NULL pointer dereference during connection lookup ECPGconnect() caches established connections to the server, supporting the case of a NULL connection name when a database name is not specified by its caller. A follow-up call to ECPGget_PGconn() to get an established connection from the

pgsql: ecpg: Fix NULL pointer dereference during connection lookup

2025-07-21 Thread Michael Paquier
ecpg: Fix NULL pointer dereference during connection lookup ECPGconnect() caches established connections to the server, supporting the case of a NULL connection name when a database name is not specified by its caller. A follow-up call to ECPGget_PGconn() to get an established connection from the

pgsql: ecpg: Fix NULL pointer dereference during connection lookup

2025-07-21 Thread Michael Paquier
ecpg: Fix NULL pointer dereference during connection lookup ECPGconnect() caches established connections to the server, supporting the case of a NULL connection name when a database name is not specified by its caller. A follow-up call to ECPGget_PGconn() to get an established connection from the

pgsql: ecpg: Fix NULL pointer dereference during connection lookup

2025-07-21 Thread Michael Paquier
ecpg: Fix NULL pointer dereference during connection lookup ECPGconnect() caches established connections to the server, supporting the case of a NULL connection name when a database name is not specified by its caller. A follow-up call to ECPGget_PGconn() to get an established connection from the

pgsql: Expand virtual generated columns before sublink pull-up

2025-07-21 Thread Richard Guo
Expand virtual generated columns before sublink pull-up Currently, we expand virtual generated columns after we have pulled up any SubLinks within the query's quals. This ensures that the virtual generated column references within SubLinks that should be transformed into joins are correctly expan

pgsql: Reduce "Var IS [NOT] NULL" quals during constant folding

2025-07-21 Thread Richard Guo
Reduce "Var IS [NOT] NULL" quals during constant folding In commit b262ad440, we introduced an optimization that reduces an IS [NOT] NULL qual on a NOT NULL column to constant true or constant false, provided we can prove that the input expression of the NullTest is not nullable by any outer joins

pgsql: Centralize collection of catalog info needed early in the planne

2025-07-21 Thread Richard Guo
Centralize collection of catalog info needed early in the planner There are several pieces of catalog information that need to be retrieved for a relation during the early stage of planning. These include relhassubclass, which is used to clear the inh flag if the relation has no children, as well

pgsql: Update comment for ReplicationSlot.last_saved_restart_lsn

2025-07-21 Thread Alexander Korotkov
Update comment for ReplicationSlot.last_saved_restart_lsn Document that restart_lsn can go backwards and explain why this could happen. Discussion: https://postgr.es/m/1d12d2-67235980-35-19a406a0%4063439497 Discussion: https://postgr.es/m/CAPpHfdvuyMrUg0Vs5jPfwLOo1M9B-GP5j_My9URnBX0B%3DnrHKw%40m

pgsql: pg_dump: include comments on not-null constraints on domains, to

2025-07-21 Thread Álvaro Herrera
pg_dump: include comments on not-null constraints on domains, too Commit e5da0fe3c22b introduced catalog entries for not-null constraints on domains; but because commit b0e96f311985 (the original work for catalogued not-null constraints on tables) forgot to teach pg_dump to process the comments fo

pgsql: pg_dump: include comments on not-null constraints on domains, to

2025-07-21 Thread Álvaro Herrera
pg_dump: include comments on not-null constraints on domains, too Commit e5da0fe3c22b introduced catalog entries for not-null constraints on domains; but because commit b0e96f311985 (the original work for catalogued not-null constraints on tables) forgot to teach pg_dump to process the comments fo

pgsql: pg_dump: include comments on not-null constraints on domains, to

2025-07-21 Thread Álvaro Herrera
pg_dump: include comments on not-null constraints on domains, too Commit e5da0fe3c22b introduced catalog entries for not-null constraints on domains; but because commit b0e96f311985 (the original work for catalogued not-null constraints on tables) forgot to teach pg_dump to process the comments fo