Handle PGRES_COPY_BOTH in psql for logical replication?

From: "Shulgin, Oleksandr" <oleksandr(dot)shulgin(at)zalando(dot)de>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Handle PGRES_COPY_BOTH in psql for logical replication?
Date: 2015-06-05 07:20:41
Message-ID: CACACo5Sc9w0FACFOQUsppySqh1LRCG7cDR5aA40wb1S7-4e0Gw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello Hackers,

At the moment one can open up a replication connection using psql and use
all of the commands available on this special type of connection, except
for START_REPLICATION:

$ psql -d "dbname=test replication=database"
psql (9.4.1)
Type "help" for help.

test=# IDENTIFY_SYSTEM;
systemid | timeline | xlogpos | dbname
---------------------+----------+-----------+---------
6146106447402521313 | 1 | 0/76422B0 | bw_test
(1 row)

test=# START_REPLICATION SLOT test LOGICAL 0/0;
unexpected PQresultStatus: 8
test=#

This is due to PGRES_COPY_BOTH not being handled in psql. With
introduction of logical replication I think it makes sense to support this
mode, for the sake of (semi-)interactive testing from psql.

For example, one could try replication from different wal positions,
different output plugins and/or plugin options, w/o re-establishing the
connection, interactively by editing the command directly in psql prompt,
as opposed to using pg_recvlogical and editing the command line switches.

I can make a patch if there's general interest for this feature.

Cheers.
--
Alex

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2015-06-05 07:25:34 Re: Restore-reliability mode
Previous Message Simon Riggs 2015-06-05 06:50:31 Re: [CORE] Restore-reliability mode