pgsql: Move PartitionPruneInfo out of plan nodes into PlannedStmt

2025-01-29 Thread Amit Langote
Move PartitionPruneInfo out of plan nodes into PlannedStmt This moves PartitionPruneInfo from plan nodes to PlannedStmt, simplifying traversal by centralizing all PartitionPruneInfo structures in a single list in it, which holds all instances for the main query and its subqueries. Instead of plan

pgsql: Handle default NULL insertion a little better.

2025-01-29 Thread Tom Lane
Handle default NULL insertion a little better. If a column is omitted in an INSERT, and there's no column default, the code in preptlist.c generates a NULL Const to be inserted. Furthermore, if the column is of a domain type, we wrap the Const in CoerceToDomain, so as to throw a run-time error if

pgsql: Handle default NULL insertion a little better.

2025-01-29 Thread Tom Lane
Handle default NULL insertion a little better. If a column is omitted in an INSERT, and there's no column default, the code in preptlist.c generates a NULL Const to be inserted. Furthermore, if the column is of a domain type, we wrap the Const in CoerceToDomain, so as to throw a run-time error if

pgsql: Handle default NULL insertion a little better.

2025-01-29 Thread Tom Lane
Handle default NULL insertion a little better. If a column is omitted in an INSERT, and there's no column default, the code in preptlist.c generates a NULL Const to be inserted. Furthermore, if the column is of a domain type, we wrap the Const in CoerceToDomain, so as to throw a run-time error if

pgsql: Handle default NULL insertion a little better.

2025-01-29 Thread Tom Lane
Handle default NULL insertion a little better. If a column is omitted in an INSERT, and there's no column default, the code in preptlist.c generates a NULL Const to be inserted. Furthermore, if the column is of a domain type, we wrap the Const in CoerceToDomain, so as to throw a run-time error if

pgsql: Handle default NULL insertion a little better.

2025-01-29 Thread Tom Lane
Handle default NULL insertion a little better. If a column is omitted in an INSERT, and there's no column default, the code in preptlist.c generates a NULL Const to be inserted. Furthermore, if the column is of a domain type, we wrap the Const in CoerceToDomain, so as to throw a run-time error if

pgsql: Require callers of coerce_to_domain() to supply base type/typmod

2025-01-29 Thread Tom Lane
Require callers of coerce_to_domain() to supply base type/typmod. In view of the issue fixed in commit 0da39aa76, it no longer seems like a great idea for coerce_to_domain() to offer to perform a lookup that its caller probably should have done already. The caller should be providing a value of t

pgsql: Doc: Generated column replication.

2025-01-29 Thread Amit Kapila
Doc: Generated column replication. Commit 7054186c4e added the support to publish generated stored columns. This patch adds detailed documentation for that feature. Author: Peter Smith Reviewed-by: Vignesh C Reviewed-by: Peter Eisentraut Reviewed-by: Amit Kapila Discussion: https://postgr.es/

pgsql: Make BufferIsExclusiveLocked and BufferIsDirty work for local bu

2025-01-29 Thread Tom Lane
Make BufferIsExclusiveLocked and BufferIsDirty work for local buffers. These functions tried to check the state of the buffer's content lock even for local buffers. Since we don't use the content lock for a local buffer, that would lead to a "false" result from LWLockHeldByMeInMode, which would m

pgsql: Avoid breaking SJIS encoding while de-backslashing Windows paths

2025-01-29 Thread Tom Lane
Avoid breaking SJIS encoding while de-backslashing Windows paths. When running on Windows, canonicalize_path() converts '\' to '/' to prevent confusing the Windows command processor. It was doing that in a non-encoding-aware fashion; but in SJIS there are valid two-byte characters whose second by

pgsql: Avoid breaking SJIS encoding while de-backslashing Windows paths

2025-01-29 Thread Tom Lane
Avoid breaking SJIS encoding while de-backslashing Windows paths. When running on Windows, canonicalize_path() converts '\' to '/' to prevent confusing the Windows command processor. It was doing that in a non-encoding-aware fashion; but in SJIS there are valid two-byte characters whose second by

pgsql: Avoid breaking SJIS encoding while de-backslashing Windows paths

2025-01-29 Thread Tom Lane
Avoid breaking SJIS encoding while de-backslashing Windows paths. When running on Windows, canonicalize_path() converts '\' to '/' to prevent confusing the Windows command processor. It was doing that in a non-encoding-aware fashion; but in SJIS there are valid two-byte characters whose second by

pgsql: Avoid breaking SJIS encoding while de-backslashing Windows paths

2025-01-29 Thread Tom Lane
Avoid breaking SJIS encoding while de-backslashing Windows paths. When running on Windows, canonicalize_path() converts '\' to '/' to prevent confusing the Windows command processor. It was doing that in a non-encoding-aware fashion; but in SJIS there are valid two-byte characters whose second by

pgsql: Avoid breaking SJIS encoding while de-backslashing Windows paths

2025-01-29 Thread Tom Lane
Avoid breaking SJIS encoding while de-backslashing Windows paths. When running on Windows, canonicalize_path() converts '\' to '/' to prevent confusing the Windows command processor. It was doing that in a non-encoding-aware fashion; but in SJIS there are valid two-byte characters whose second by

pgsql: Avoid breaking SJIS encoding while de-backslashing Windows paths

2025-01-29 Thread Tom Lane
Avoid breaking SJIS encoding while de-backslashing Windows paths. When running on Windows, canonicalize_path() converts '\' to '/' to prevent confusing the Windows command processor. It was doing that in a non-encoding-aware fashion; but in SJIS there are valid two-byte characters whose second by