postgresql/src/backend/commands
Amit Kapila 29b5905470 Fix toast rewrites in logical decoding.
Commit 325f2ec555 introduced pg_class.relwrite to skip operations on
tables created as part of a heap rewrite during DDL. It links such
transient heaps to the original relation OID via this new field in
pg_class but forgot to do anything about toast tables. So, logical
decoding was not able to skip operations on internally created toast
tables. This leads to an error when we tried to decode the WAL for the
next operation for which it appeared that there is a toast data where
actually it didn't have any toast data.

To fix this, we set pg_class.relwrite for internally created toast tables
as well which allowed skipping operations on them during logical decoding.

Author: Bertrand Drouvot
Reviewed-by: David Zhang, Amit Kapila
Backpatch-through: 11, where it was introduced
Discussion: https://postgr.es/m/b5146fb1-ad9e-7d6e-f980-98ed68744a7c@amazon.com
2021-08-25 09:53:07 +05:30
..
aggregatecmds.c SQL-standard function body 2021-04-07 21:47:55 +02:00
alter.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
amcmds.c Fix some typos, grammar and style in docs and comments 2021-02-24 16:13:17 +09:00
analyze.c Revert analyze support for partitioned tables 2021-08-16 17:27:52 -04:00
async.c Remove server and libpq support for old FE/BE protocol version 2. 2021-03-04 10:45:55 +02:00
cluster.c Fix toast rewrites in logical decoding. 2021-08-25 09:53:07 +05:30
collationcmds.c Improve error checking of CREATE COLLATION options. 2021-07-18 11:08:34 +01:00
comment.c Improve error messages about mismatching relkind 2021-07-08 09:44:51 +02:00
constraint.c Pass down "logically unchanged index" hint. 2021-01-13 08:11:00 -08:00
conversioncmds.c Add 'noError' argument to encoding conversion functions. 2021-04-01 11:45:22 +03:00
copy.c Improve reporting of "conflicting or redundant options" errors. 2021-07-15 08:49:45 +01:00
copyfrom.c Fix typos and grammar in documentation and code comments 2021-04-09 13:53:07 +09:00
copyfromparse.c Add heuristic incoming-message-size limits in the server. 2021-04-28 15:50:46 -04:00
copyto.c Centralize the logic for protective copying of utility statements. 2021-06-18 11:22:58 -04:00
createas.c Centralize the logic for protective copying of utility statements. 2021-06-18 11:22:58 -04:00
dbcommands.c Improve reporting of "conflicting or redundant options" errors. 2021-07-15 08:49:45 +01:00
define.c Improve reporting of "conflicting or redundant options" errors. 2021-07-15 08:49:45 +01:00
discard.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
dropcmds.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
event_trigger.c In event triggers, use "pg_temp" only for our own temp schema. 2021-07-27 12:08:20 -04:00
explain.c Use ExplainPropertyInteger for queryid in EXPLAIN 2021-08-09 15:47:23 +12:00
extension.c Improve reporting of "conflicting or redundant options" errors. 2021-07-15 08:49:45 +01:00
foreigncmds.c Improve reporting of "conflicting or redundant options" errors. 2021-07-15 08:49:45 +01:00
functioncmds.c Improve reporting of "conflicting or redundant options" errors. 2021-07-15 08:49:45 +01:00
indexcmds.c Improve error messages about mismatching relkind 2021-07-08 09:44:51 +02:00
lockcmds.c Improve error messages about mismatching relkind 2021-07-08 09:44:51 +02:00
Makefile Split copy.c into four files. 2020-11-23 10:50:50 +02:00
matview.c Really fix the ambiguity in REFRESH MATERIALIZED VIEW CONCURRENTLY. 2021-08-07 13:29:32 -04:00
opclasscmds.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
operatorcmds.c Prevent ALTER TYPE/DOMAIN/OPERATOR from changing extension membership. 2021-08-17 14:29:22 -04:00
policy.c Remove unnecessary failure cases in RemoveRoleFromObjectPolicy(). 2021-06-25 13:59:38 -04:00
portalcmds.c Centralize the logic for protective copying of utility statements. 2021-06-18 11:22:58 -04:00
prepare.c Centralize the logic for protective copying of utility statements. 2021-06-18 11:22:58 -04:00
proclang.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
publicationcmds.c Use l*_node() family of functions where appropriate 2021-07-19 08:20:24 +02:00
schemacmds.c Centralize the logic for protective copying of utility statements. 2021-06-18 11:22:58 -04:00
seclabel.c Improve error messages about mismatching relkind 2021-07-08 09:44:51 +02:00
sequence.c Improve reporting of "conflicting or redundant options" errors. 2021-07-15 08:49:45 +01:00
statscmds.c Improve error messages about mismatching relkind 2021-07-08 09:44:51 +02:00
subscriptioncmds.c Fix Alter Subscription's Add/Drop Publication behavior. 2021-08-24 08:25:21 +05:30
tablecmds.c Fix toast rewrites in logical decoding. 2021-08-25 09:53:07 +05:30
tablespace.c Move InRecovery and standbyState global vars to xlogutils.c. 2021-07-31 09:50:26 +03:00
trigger.c Remove newly added useless assertion check 2021-07-26 12:56:33 -04:00
tsearchcmds.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
typecmds.c Prevent ALTER TYPE/DOMAIN/OPERATOR from changing extension membership. 2021-08-17 14:29:22 -04:00
user.c Improve reporting of "conflicting or redundant options" errors. 2021-07-15 08:49:45 +01:00
vacuum.c Support disabling index bypassing by VACUUM. 2021-06-18 20:04:07 -07:00
variable.c Fix some inappropriately-disallowed uses of ALTER ROLE/DATABASE SET. 2021-04-13 15:10:18 -04:00
view.c Centralize the logic for protective copying of utility statements. 2021-06-18 11:22:58 -04:00