Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Advice to configure pathman_ddl_trigger ENABLE ALWAYS on LR replica #106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 20, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,25 @@ drop_partitions(parent REGCLASS,
```
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`.

To remove partitioned table along with all partitions fully, use conventional
`DROP TABLE relation CASCADE`. However, care should be taken in somewhat rare
case when you are running logical replication and `DROP` was executed by
replication apply worker, e.g. via trigger on replicated table. `pg_pathman`
uses `pathman_ddl_trigger` event trigger to remove the record about dropped
table from `pathman_config`, and this trigger by default won't fire on replica,
leading to inconsistent state when `pg_pathman` thinks that the table still
exists, but in fact it doesn't. If this is the case, configure this trigger to
fire on replica too:

```plpgsql
ALTER EVENT TRIGGER pathman_ddl_trigger ENABLE ALWAYS;
```

Physical replication doesn't have this problem since DDL as well as
`pathman_config` table is replicated too; master and slave PostgreSQL instances
are basically identical, and it is only harmful to keep this trigger in `ALWAYS`
mode.


### Additional parameters

Expand Down