forked from pgEdge/spock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
spock_queue.h
40 lines (32 loc) · 1.1 KB
/
spock_queue.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*-------------------------------------------------------------------------
*
* spock_node.h
* spock node and connection catalog manipulation functions
*
* Copyright (c) 2021-2022, OSCG Partners, LLC
* Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, The Regents of the University of California
*
*-------------------------------------------------------------------------
*/
#ifndef SPOCK_QUEUE_H
#define SPOCK_QUEUE_H
#include "utils/jsonb.h"
#define QUEUE_COMMAND_TYPE_SQL 'Q'
#define QUEUE_COMMAND_TYPE_TRUNCATE 'T'
#define QUEUE_COMMAND_TYPE_TABLESYNC 'A'
#define QUEUE_COMMAND_TYPE_SEQUENCE 'S'
typedef struct QueuedMessage
{
TimestampTz queued_at;
List *replication_sets;
char *role;
char message_type;
Jsonb *message;
} QueuedMessage;
extern void queue_message(List *replication_sets, Oid roleoid,
char message_type, char *message);
extern QueuedMessage *queued_message_from_tuple(HeapTuple queue_tup);
extern Oid get_queue_table_oid(void);
extern void create_truncate_trigger(Relation rel);
#endif /* SPOCK_NODE_H */