title: Postgresql Replication slot error postgresql
body: <p>I use Posgtresql 10.</p>
  
  <p>I want to replicate 2 tables from database "db" to same two tables with same columns in database "destination".</p>
  
  <p>changed wal_level value to logical in postgresql.conf
  and max_replication_slots to 10</p>
  
  <p>no firewall</p>
  
  <p>I created the publication in database "db"</p>
  
  <pre><code>ALTER ROLE my_user WITH REPLICATION LOGIN PASSWORD 'my_password';
  CREATE PUBLICATION my_publication;
  ALTER PUBLICATION my_publication ADD TABLE table1;
  ALTER PUBLICATION my_publication ADD TABLE table2;
  </code></pre>
  
  <p>I created a subsription in database "destination" with a slot cause i want to replicate in the same server :</p>
  
  <pre><code>SELECT pg_create_logical_replication_slot('test_slot_v1', 'pgoutput');
  CREATE SUBSCRIPTION my_subscription CONNECTION 'host=localhost port=5432 password=my_password user=my_user dbname=db' PUBLICATION my_publication WITH (slot_name=test_slot_v1, create_slot=false);
  alter subscription my_subscription refresh publication ;
  </code></pre>
  
  <p>First replication works. Then when i change the value of one varchar entry (not a FK), the value is not replicated and I have the following error in postgres logs :</p>
  
  <blockquote>
    <p>2020-04-12 16: 16: 57.886 CEST [720474] LOG: the logical replication
    apply process for the subscription "my_subscription" has started
    2020-04-12 16: 16: 57.888 CEST [720475] ERROR: the replication slot
    "test_slot_v1" was not created in this database 2020-04-12 16: 16:
    57.889 CEST [720474] ERROR: could not receive data from the WAL stream: ERROR: <strong>the replication slot "test_slot_v1" was not created in
    this database</strong> 2020-04-12 16: 16: 57.890 CEST [712133] LOG: work
    process: logical replication worker for subscription 245251 (PID
    720474) exit with exit code 1</p>
  </blockquote>
  
  <p>I'm sure I created the slot in the database "destination" that holds the subscription.</p>
  
  <p>Any ideas ? Thank you in advance.</p>