pgsql: Prevent reindex of invalid indexes on TOAST tables

2020-03-09 Thread Michael Paquier
Prevent reindex of invalid indexes on TOAST tables Such indexes can only be duplicated leftovers of a previously failed REINDEX CONCURRENTLY command, and a valid equivalent is guaranteed to exist. As toast indexes can only be dropped if invalid, reindexing these would lead to useless duplicated i

pgsql: Prevent reindex of invalid indexes on TOAST tables

2020-03-09 Thread Michael Paquier
Prevent reindex of invalid indexes on TOAST tables Such indexes can only be duplicated leftovers of a previously failed REINDEX CONCURRENTLY command, and a valid equivalent is guaranteed to exist. As toast indexes can only be dropped if invalid, reindexing these would lead to useless duplicated i

pgsql: Tidy up XLogSource code in xlog.c.

2020-03-09 Thread Fujii Masao
Tidy up XLogSource code in xlog.c. This commit replaces 0 used as an initial value of XLogSource variable, with XLOG_FROM_ANY. Also this commit changes those variable so that XLogSource instead of int is used as the type for them. These changes are for code readability and debugger-friendliness.

pgsql: Fix pg_dump/pg_restore to restore event triggers later.

2020-03-09 Thread Tom Lane
Fix pg_dump/pg_restore to restore event triggers later. Previously, event triggers were restored just after regular triggers (and FK constraints, which are basically triggers). This is risky since an event trigger, once installed, could interfere with subsequent restore commands. Worse, because

pgsql: Fix pg_dump/pg_restore to restore event triggers later.

2020-03-09 Thread Tom Lane
Fix pg_dump/pg_restore to restore event triggers later. Previously, event triggers were restored just after regular triggers (and FK constraints, which are basically triggers). This is risky since an event trigger, once installed, could interfere with subsequent restore commands. Worse, because

pgsql: Fix pg_dump/pg_restore to restore event triggers later.

2020-03-09 Thread Tom Lane
Fix pg_dump/pg_restore to restore event triggers later. Previously, event triggers were restored just after regular triggers (and FK constraints, which are basically triggers). This is risky since an event trigger, once installed, could interfere with subsequent restore commands. Worse, because

pgsql: Fix pg_dump/pg_restore to restore event triggers later.

2020-03-09 Thread Tom Lane
Fix pg_dump/pg_restore to restore event triggers later. Previously, event triggers were restored just after regular triggers (and FK constraints, which are basically triggers). This is risky since an event trigger, once installed, could interfere with subsequent restore commands. Worse, because

pgsql: Fix pg_dump/pg_restore to restore event triggers later.

2020-03-09 Thread Tom Lane
Fix pg_dump/pg_restore to restore event triggers later. Previously, event triggers were restored just after regular triggers (and FK constraints, which are basically triggers). This is risky since an event trigger, once installed, could interfere with subsequent restore commands. Worse, because

pgsql: Fix pg_dump/pg_restore to restore event triggers later.

2020-03-09 Thread Tom Lane
Fix pg_dump/pg_restore to restore event triggers later. Previously, event triggers were restored just after regular triggers (and FK constraints, which are basically triggers). This is risky since an event trigger, once installed, could interfere with subsequent restore commands. Worse, because

pgsql: Introduce LogicalTapeSetExtend().

2020-03-09 Thread Jeff Davis
Introduce LogicalTapeSetExtend(). Increases the number of tapes in a logical tape set. This will be important for disk-based hash aggregation, because the maximum number of tapes is not known ahead of time. While discussing this change, it was observed to regress the performance of Sort for at le

pgsql: Fix bug that causes to report waiting in PS display twice, in ho

2020-03-09 Thread Fujii Masao
Fix bug that causes to report waiting in PS display twice, in hot standby. Previously "waiting" could appear twice via PS in case of lock conflict in hot standby mode. Specifically this issue happend when the delay in WAL application determined by max_standby_archive_delay and max_standby_streamin

pgsql: Fix bug that causes to report waiting in PS display twice, in ho

2020-03-09 Thread Fujii Masao
Fix bug that causes to report waiting in PS display twice, in hot standby. Previously "waiting" could appear twice via PS in case of lock conflict in hot standby mode. Specifically this issue happend when the delay in WAL application determined by max_standby_archive_delay and max_standby_streamin

pgsql: Fix bug that causes to report waiting in PS display twice, in ho

2020-03-09 Thread Fujii Masao
Fix bug that causes to report waiting in PS display twice, in hot standby. Previously "waiting" could appear twice via PS in case of lock conflict in hot standby mode. Specifically this issue happend when the delay in WAL application determined by max_standby_archive_delay and max_standby_streamin

pgsql: Fix bug that causes to report waiting in PS display twice, in ho

2020-03-09 Thread Fujii Masao
Fix bug that causes to report waiting in PS display twice, in hot standby. Previously "waiting" could appear twice via PS in case of lock conflict in hot standby mode. Specifically this issue happend when the delay in WAL application determined by max_standby_archive_delay and max_standby_streamin

pgsql: Fix bug that causes to report waiting in PS display twice, in ho

2020-03-09 Thread Fujii Masao
Fix bug that causes to report waiting in PS display twice, in hot standby. Previously "waiting" could appear twice via PS in case of lock conflict in hot standby mode. Specifically this issue happend when the delay in WAL application determined by max_standby_archive_delay and max_standby_streamin

pgsql: Fix bug that causes to report waiting in PS display twice, in ho

2020-03-09 Thread Fujii Masao
Fix bug that causes to report waiting in PS display twice, in hot standby. Previously "waiting" could appear twice via PS in case of lock conflict in hot standby mode. Specifically this issue happend when the delay in WAL application determined by max_standby_archive_delay and max_standby_streamin

pgsql: Add tg_updatedcols to TriggerData

2020-03-09 Thread Peter Eisentraut
Add tg_updatedcols to TriggerData This allows a trigger function to determine for an UPDATE trigger which columns were actually updated. This allows some optimizations in generic trigger functions such as lo_manage and tsvector_update_trigger. Reviewed-by: Daniel Gustafsson Discussion: https:/

pgsql: Code simplification

2020-03-09 Thread Peter Eisentraut
Code simplification Initialize TriggerData to 0 for the whole struct together, instead of each field separately. Reviewed-by: Daniel Gustafsson Discussion: https://www.postgresql.org/message-id/flat/[email protected] Branch -- master Details --- http