-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbdr_common.c
33 lines (30 loc) · 887 Bytes
/
bdr_common.c
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
/* -------------------------------------------------------------------------
*
* bdr_common.c
* Utility functions
*
* Functions which can be shared between extension and cli
* (i.e. don't require server side libraries).
*
* Copyright (c) 2015, PostgreSQL Global Development Group
*
* IDENTIFICATION
* bdr_common.c
*
* -------------------------------------------------------------------------
*/
#include "postgres.h"
#include "access/xlogdefs.h"
#include "nodes/pg_list.h"
#include "bdr_internal.h"
/*
* Format slot name string from node identifiers.
*/
void
bdr_slot_name(Name slot_name, const BDRNodeId * const remote_node, Oid local_dboid)
{
snprintf(NameStr(*slot_name), NAMEDATALEN, BDR_SLOT_NAME_FORMAT,
local_dboid, remote_node->sysid, remote_node->timeline, remote_node->dboid,
EMPTY_REPLICATION_NAME);
NameStr(*slot_name)[NAMEDATALEN-1] = '\0';
}