After an error - pg_replication_slot is dropped

From: tushar <tushar(dot)ahuja(at)enterprisedb(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: After an error - pg_replication_slot is dropped
Date: 2018-02-16 09:51:54
Message-ID: 40777d83-24bd-6aa6-0b39-1e3e7ee395ed@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Please refer this straight forward scenario  against latest sources of v11.

[centos(at)centos-cpula bin]$ ./psql  postgres
psql (11devel)
Type "help" for help.

postgres=#  SELECT * FROM
pg_create_logical_replication_slot('regression_slot1', 'test_decoding',
true);
    slot_name     |    lsn
------------------+-----------
 regression_slot1 | 0/40001E8
(1 row)

postgres=#
postgres=# select * from pg_replication_slots;
    slot_name     |    plugin     | slot_type | datoid | database |
temporary | active | active_pid | xmin | catalog_xmin | restart_lsn |
confirmed_flush_lsn
------------------+---------------+-----------+--------+----------+-----------+--------+------------+------+--------------+-------------+---------------------
 regression_slot1 | test_decoding | logical   |  13220 | postgres |
t         | t      |      28015 |      |          557 | 0/40001B0 |
0/40001E8
(1 row)

--Try to again create  the same slot , getting an error - which is expected
postgres=#
postgres=#  SELECT * FROM
pg_create_logical_replication_slot('regression_slot1', 'test_decoding',
true);
ERROR:  replication slot "regression_slot1" already exists
postgres=#

--No slot found
postgres=# select * from pg_replication_slots;
 slot_name | plugin | slot_type | datoid | database | temporary |
active | active_pid | xmin | catalog_xmin | restart_lsn |
confirmed_flush_lsn
-----------+--------+-----------+--------+----------+-----------+--------+------------+------+--------------+-------------+---------------------
(0 rows)

--
regards,tushar
EnterpriseDB https://www.enterprisedb.com/
The Enterprise PostgreSQL Company

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message amul sul 2018-02-16 09:55:00 Re: Server crash in pg_replication_slot_advance function
Previous Message amul sul 2018-02-16 09:36:26 Re: Server crash in pg_replication_slot_advance function