Re: Handle PGRES_COPY_BOTH in psql for logical replication? - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Handle PGRES_COPY_BOTH in psql for logical replication?
Date
Msg-id 20150605072624.GN18006@awork2.anarazel.de
Whole thread Raw
In response to Handle PGRES_COPY_BOTH in psql for logical replication?  ("Shulgin, Oleksandr" <oleksandr.shulgin@zalando.de>)
Responses Re: Handle PGRES_COPY_BOTH in psql for logical replication?  ("Shulgin, Oleksandr" <oleksandr.shulgin@zalando.de>)
List pgsql-hackers
On 2015-06-05 09:20:41 +0200, Shulgin, Oleksandr wrote:
> 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.

How would that look like? It's just binary data you'd get back? And what
would be the feedback messages and such look like, and what would be the
content?

> 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.

You can mostly use the sql functions for that.

Regards,

Andres



pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Restore-reliability mode
Next
From: Jim Nasby
Date:
Subject: Re: RFC: Remove contrib entirely