Hello!
I've found a simple problem in one of subscription tests (`src/test/subscription/t/
009_matviews.pl`).
When running this test, it
completes successfully (All tests successful. Result: PASS) but there is an error in subscriber's logs:
```
logical replication apply worker[1865731] ERROR: logical replication target relation "public.test1" does not exist
```
How do I run the test:
```
# configure
./configure --enable-debug --enable-cassert --enable-tap-tests --with-icu --prefix=$PG_PREFIX
# make ...
cd src/test/subscription
make installcheck PG_TEST_INITDB_EXTRA_OPTS="--locale=C" PROVE_TESTS="t/
009_matviews.pl"
```
The main purpose of this test is to check materialized views behavior, which are not supported by logical replication, but logical decoding does produce change information for them, so we need to make sure they are properly ignored.
The problem I found is about incorrect setup for logical replication: publisher performs INSERT to a table that has not yet been created on subscriber, and this causes an error `target relation does not exist`.
Therefore, I would like to propose a patch with trivial fix for logical replication in subscription test `t/
009_matviews.pl`.
The patch is in attachments to this letter.
The patch was created via: `git format-patch master --base master
`.