Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c5e899e

Browse files
authored
Merge pull request #106 from arssher/rel_future_beta
Advice to configure pathman_ddl_trigger ENABLE ALWAYS on LR replica
2 parents 64b78a5 + 5d91fc5 commit c5e899e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

+19
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,25 @@ drop_partitions(parent REGCLASS,
251251
```
252252
Drop partitions of the `parent` table (both foreign and local relations). If `delete_data` is `false`, the data is copied to the parent table first. Default is `false`.
253253

254+
To remove partitioned table along with all partitions fully, use conventional
255+
`DROP TABLE relation CASCADE`. However, care should be taken in somewhat rare
256+
case when you are running logical replication and `DROP` was executed by
257+
replication apply worker, e.g. via trigger on replicated table. `pg_pathman`
258+
uses `pathman_ddl_trigger` event trigger to remove the record about dropped
259+
table from `pathman_config`, and this trigger by default won't fire on replica,
260+
leading to inconsistent state when `pg_pathman` thinks that the table still
261+
exists, but in fact it doesn't. If this is the case, configure this trigger to
262+
fire on replica too:
263+
264+
```plpgsql
265+
ALTER EVENT TRIGGER pathman_ddl_trigger ENABLE ALWAYS;
266+
```
267+
268+
Physical replication doesn't have this problem since DDL as well as
269+
`pathman_config` table is replicated too; master and slave PostgreSQL instances
270+
are basically identical, and it is only harmful to keep this trigger in `ALWAYS`
271+
mode.
272+
254273

255274
### Additional parameters
256275

0 commit comments

Comments
 (0)