pgsql: Fix pg_rewind debug output to print the source timeline history

2024-08-08 Thread Heikki Linnakangas
Fix pg_rewind debug output to print the source timeline history getTimelineHistory() is called twice, to read the source and the target timeline history files. However, the loop to print the file with the --debug option used the wrong variable when dealing with the source. As a result, the source'

pgsql: Fix pg_rewind debug output to print the source timeline history

2024-08-08 Thread Heikki Linnakangas
Fix pg_rewind debug output to print the source timeline history getTimelineHistory() is called twice, to read the source and the target timeline history files. However, the loop to print the file with the --debug option used the wrong variable when dealing with the source. As a result, the source'

pgsql: Fix pg_rewind debug output to print the source timeline history

2024-08-08 Thread Heikki Linnakangas
Fix pg_rewind debug output to print the source timeline history getTimelineHistory() is called twice, to read the source and the target timeline history files. However, the loop to print the file with the --debug option used the wrong variable when dealing with the source. As a result, the source'

pgsql: Fix pg_rewind debug output to print the source timeline history

2024-08-08 Thread Heikki Linnakangas
Fix pg_rewind debug output to print the source timeline history getTimelineHistory() is called twice, to read the source and the target timeline history files. However, the loop to print the file with the --debug option used the wrong variable when dealing with the source. As a result, the source'

pgsql: Fix pg_rewind debug output to print the source timeline history

2024-08-08 Thread Heikki Linnakangas
Fix pg_rewind debug output to print the source timeline history getTimelineHistory() is called twice, to read the source and the target timeline history files. However, the loop to print the file with the --debug option used the wrong variable when dealing with the source. As a result, the source'

pgsql: Fix pg_rewind debug output to print the source timeline history

2024-08-08 Thread Heikki Linnakangas
Fix pg_rewind debug output to print the source timeline history getTimelineHistory() is called twice, to read the source and the target timeline history files. However, the loop to print the file with the --debug option used the wrong variable when dealing with the source. As a result, the source'

pgsql: Fix pg_rewind debug output to print the source timeline history

2024-08-08 Thread Heikki Linnakangas
Fix pg_rewind debug output to print the source timeline history getTimelineHistory() is called twice, to read the source and the target timeline history files. However, the loop to print the file with the --debug option used the wrong variable when dealing with the source. As a result, the source'

pgsql: Add a caveat to hash_seq_init_with_hash_value() header comment

2024-08-08 Thread Alexander Korotkov
Add a caveat to hash_seq_init_with_hash_value() header comment The typical use-case for hash_seq_init_with_hash_value() is syscache callback. Add a caveat that the default hash function doesn't match syscache hash function. So, one needs to define a custom hash function. Reported-by: Pavel Steh

Re: pgsql: Introduce hash_search_with_hash_value() function

2024-08-08 Thread Alexander Korotkov
On Thu, Aug 8, 2024 at 7:45 AM Pavel Stehule wrote: > st 7. 8. 2024 v 22:25 odesílatel Alexander Korotkov > napsal: >> >> On Wed, Aug 7, 2024 at 1:34 PM Pavel Stehule wrote: >> > st 7. 8. 2024 v 12:22 odesílatel Alexander Korotkov >> > napsal: >> >> Thank you. >> >> Please see 40064a8ee1 take

pgsql: Refactor error messages to reduce duplication

2024-08-08 Thread Alvaro Herrera
Refactor error messages to reduce duplication I also took the liberty of changing errmsg("COPY DEFAULT only available using COPY FROM") to errmsg("COPY %s cannot be used with %s", "DEFAULT", "COPY TO") because the original wording is unlike all other messages that indicate option

pgsql: Refactor error messages to reduce duplication

2024-08-08 Thread Alvaro Herrera
Refactor error messages to reduce duplication I also took the liberty of changing errmsg("COPY DEFAULT only available using COPY FROM") to errmsg("COPY %s cannot be used with %s", "DEFAULT", "COPY TO") because the original wording is unlike all other messages that indicate option

pgsql: Refuse ATTACH of a table referenced by a foreign key

2024-08-08 Thread Alvaro Herrera
Refuse ATTACH of a table referenced by a foreign key Trying to attach a table as a partition which is already on the referenced side of a foreign key on the partitioned table that it is being attached to, leads to strange behavior: we try to clone the foreign key from the parent to the partition,

pgsql: Refuse ATTACH of a table referenced by a foreign key

2024-08-08 Thread Alvaro Herrera
Refuse ATTACH of a table referenced by a foreign key Trying to attach a table as a partition which is already on the referenced side of a foreign key on the partitioned table that it is being attached to, leads to strange behavior: we try to clone the foreign key from the parent to the partition,

pgsql: Refuse ATTACH of a table referenced by a foreign key

2024-08-08 Thread Alvaro Herrera
Refuse ATTACH of a table referenced by a foreign key Trying to attach a table as a partition which is already on the referenced side of a foreign key on the partitioned table that it is being attached to, leads to strange behavior: we try to clone the foreign key from the parent to the partition,

pgsql: Refuse ATTACH of a table referenced by a foreign key

2024-08-08 Thread Alvaro Herrera
Refuse ATTACH of a table referenced by a foreign key Trying to attach a table as a partition which is already on the referenced side of a foreign key on the partitioned table that it is being attached to, leads to strange behavior: we try to clone the foreign key from the parent to the partition,

pgsql: Refuse ATTACH of a table referenced by a foreign key

2024-08-08 Thread Alvaro Herrera
Refuse ATTACH of a table referenced by a foreign key Trying to attach a table as a partition which is already on the referenced side of a foreign key on the partitioned table that it is being attached to, leads to strange behavior: we try to clone the foreign key from the parent to the partition,

pgsql: Refuse ATTACH of a table referenced by a foreign key

2024-08-08 Thread Alvaro Herrera
Refuse ATTACH of a table referenced by a foreign key Trying to attach a table as a partition which is already on the referenced side of a foreign key on the partitioned table that it is being attached to, leads to strange behavior: we try to clone the foreign key from the parent to the partition,

pgsql: Refuse ATTACH of a table referenced by a foreign key

2024-08-08 Thread Alvaro Herrera
Refuse ATTACH of a table referenced by a foreign key Trying to attach a table as a partition which is already on the referenced side of a foreign key on the partitioned table that it is being attached to, leads to strange behavior: we try to clone the foreign key from the parent to the partition,

pgsql: libpq: Add suppress argument to pqTraceOutputNchar

2024-08-08 Thread Alvaro Herrera
libpq: Add suppress argument to pqTraceOutputNchar In future commits we're going to trace authentication related messages. Some of these messages contain challenge bytes as part of a challenge-response flow. Since these bytes are different for every connection, we want to normalize them when the

pgsql: Change the misleading local end_lsn for prepared transactions.

2024-08-08 Thread Amit Kapila
Change the misleading local end_lsn for prepared transactions. The apply worker was using XactLastCommitEnd as local end_lsn for applying prepare and rollback_prepare. The XactLastCommitEnd value is the end lsn of the last commit applied before the prepare transaction which makes no sense. This LS

pgsql: Remove obsolete RECHECK keyword completely

2024-08-08 Thread Peter Eisentraut
Remove obsolete RECHECK keyword completely This used to be part of CREATE OPERATOR CLASS and ALTER OPERATOR FAMILY, but it has done nothing (except issue a NOTICE) since PostgreSQL 8.4. Commit 30e7c175b81 removed support for dumping from pre-9.2 servers, so this no longer serves any need. This n