postgresql/src/include/replication/pgoutput.h
Tom Lane 9de77b5453 Allow logical replication to transfer data in binary format.
This patch adds a "binary" option to CREATE/ALTER SUBSCRIPTION.
When that's set, the publisher will send data using the data type's
typsend function if any, rather than typoutput.  This is generally
faster, if slightly less robust.

As committed, we won't try to transfer user-defined array or composite
types in binary, for fear that type OIDs won't match at the subscriber.
This might be changed later, but it seems like fit material for a
follow-on patch.

Dave Cramer, reviewed by Daniel Gustafsson, Petr Jelinek, and others;
adjusted some by me

Discussion: https://postgr.es/m/CADK3HH+R3xMn=8t3Ct+uD+qJ1KD=Hbif5NFMJ+d5DkoCzp6Vgw@mail.gmail.com
2020-07-18 12:44:51 -04:00

30 lines
677 B
C

/*-------------------------------------------------------------------------
*
* pgoutput.h
* Logical Replication output plugin
*
* Copyright (c) 2015-2020, PostgreSQL Global Development Group
*
* IDENTIFICATION
* pgoutput.h
*
*-------------------------------------------------------------------------
*/
#ifndef PGOUTPUT_H
#define PGOUTPUT_H
#include "nodes/pg_list.h"
typedef struct PGOutputData
{
MemoryContext context; /* private memory context for transient
* allocations */
/* client-supplied info: */
uint32 protocol_version;
List *publication_names;
List *publications;
bool binary;
} PGOutputData;
#endif /* PGOUTPUT_H */