Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita095c69

Browse files
knizhnikkelvich
authored andcommitted
Partly merge with new version of pglogical_output plugin
1 parentfb58fcd commita095c69

File tree

5 files changed

+46
-12
lines changed

5 files changed

+46
-12
lines changed

‎pglogical_config.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
#error <postgres.h> must be included first
66
#endif
77

8+
#include"nodes/pg_list.h"
9+
#include"pglogical_output.h"
10+
811
inlinestaticbool
912
server_float4_byval(void)
1013
{
@@ -45,9 +48,6 @@ server_bigendian(void)
4548
#endif
4649
}
4750

48-
typedefstructListList;
49-
typedefstructPGLogicalOutputDataPGLogicalOutputData;
50-
5151
externintprocess_parameters(List*options,PGLogicalOutputData*data);
5252

5353
externList*prepare_startup_message(PGLogicalOutputData*data);

‎pglogical_hooks.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
/* public interface for hooks */
77
#include"pglogical_output/hooks.h"
8+
#include"pglogical_output.h"
89

910
externvoidload_hooks(PGLogicalOutputData*data);
1011

‎pglogical_output/compat.h

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#ifndefPG_LOGICAL_COMPAT_H
2+
#definePG_LOGICAL_COMPAT_H
3+
4+
#include"pg_config.h"
5+
6+
/* 9.4 lacks replication origins */
7+
#ifPG_VERSION_NUM >=90500
8+
#defineHAVE_REPLICATION_ORIGINS
9+
#else
10+
/* To allow the same signature on hooks in 9.4 */
11+
typedefuint16RepOriginId;
12+
#defineInvalidRepOriginId 0
13+
#endif
14+
15+
/* 9.4 lacks PG_UINT32_MAX */
16+
#ifndefPG_UINT32_MAX
17+
#definePG_UINT32_MAX UINT32_MAX
18+
#endif
19+
20+
#ifndefPG_INT32_MAX
21+
#definePG_INT32_MAX INT32_MAX
22+
#endif
23+
24+
#ifndefPG_INT32_MIN
25+
#definePG_INT32_MIN INT32_MIN
26+
#endif
27+
28+
#endif

‎pglogical_output/hooks.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
#include"utils/palloc.h"
88
#include"replication/reorderbuffer.h"
99

10-
structPGLogicalOutputData;
11-
typedefstructPGLogicalOutputDataPGLogicalOutputData;
10+
#include"pglogical_output/compat.h"
1211

1312
/*
1413
* This header is to be included by extensions that implement pglogical output
@@ -43,6 +42,8 @@ struct PGLogicalRowFilterArgs
4342
void*private_data;
4443
Relationchanged_rel;
4544
enumReorderBufferChangeTypechange_type;
45+
/* detailed row change event from logical decoding */
46+
ReorderBufferChange*change;
4647
};
4748

4849
typedefbool (*pglogical_row_filter_hook_fn)(structPGLogicalRowFilterArgs*args);

‎pglogical_proto.h

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,26 @@
1313
#ifndefPG_LOGICAL_PROTO_H
1414
#definePG_LOGICAL_PROTO_H
1515

16-
typedefvoid (*pglogical_write_rel_fn)(StringInfoout,PGLogicalOutputData*data,Relationrel);
16+
structPGLogicalOutputData;
17+
structPGLRelMetaCacheEntry;
1718

18-
typedefvoid (*pglogical_write_begin_fn)(StringInfoout,PGLogicalOutputData*data,
19+
typedefvoid (*pglogical_write_rel_fn)(StringInfoout,structPGLogicalOutputData*data,
20+
Relationrel/*, struct PGLRelMetaCacheEntry *cache_entry*/);
21+
22+
typedefvoid (*pglogical_write_begin_fn)(StringInfoout,structPGLogicalOutputData*data,
1923
ReorderBufferTXN*txn);
20-
typedefvoid (*pglogical_write_commit_fn)(StringInfoout,PGLogicalOutputData*data,
24+
typedefvoid (*pglogical_write_commit_fn)(StringInfoout,structPGLogicalOutputData*data,
2125
ReorderBufferTXN*txn,XLogRecPtrcommit_lsn);
2226

2327
typedefvoid (*pglogical_write_origin_fn)(StringInfoout,constchar*origin,
2428
XLogRecPtrorigin_lsn);
2529

26-
typedefvoid (*pglogical_write_insert_fn)(StringInfoout,PGLogicalOutputData*data,
30+
typedefvoid (*pglogical_write_insert_fn)(StringInfoout,structPGLogicalOutputData*data,
2731
Relationrel,HeapTuplenewtuple);
28-
typedefvoid (*pglogical_write_update_fn)(StringInfoout,PGLogicalOutputData*data,
32+
typedefvoid (*pglogical_write_update_fn)(StringInfoout,structPGLogicalOutputData*data,
2933
Relationrel,HeapTupleoldtuple,
3034
HeapTuplenewtuple);
31-
typedefvoid (*pglogical_write_delete_fn)(StringInfoout,PGLogicalOutputData*data,
35+
typedefvoid (*pglogical_write_delete_fn)(StringInfoout,structPGLogicalOutputData*data,
3236
Relationrel,HeapTupleoldtuple);
3337

3438
typedefvoid (*write_startup_message_fn)(StringInfoout,List*msg);
@@ -45,7 +49,7 @@ typedef struct PGLogicalProtoAPI
4549
pglogical_write_update_fnwrite_update;
4650
pglogical_write_delete_fnwrite_delete;
4751
pglogical_setup_hooks_fnsetup_hooks;
48-
write_startup_message_fnwrite_startup_message;
52+
write_startup_message_fnwrite_startup_message;
4953
}PGLogicalProtoAPI;
5054

5155

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp