forked from pgEdge/spock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
spock_relcache.h
62 lines (52 loc) · 1.57 KB
/
spock_relcache.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*-------------------------------------------------------------------------
*
* spock_relcache.h
* spock relation cache
*
* Copyright (c) 2022-2023, pgEdge, Inc.
* Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, The Regents of the University of California
*
*-------------------------------------------------------------------------
*/
#ifndef SPOCK_RELCACHE_H
#define SPOCK_RELCACHE_H
#include "storage/lock.h"
typedef struct SpockRemoteRel
{
uint32 relid;
char *nspname;
char *relname;
int natts;
char **attnames;
/* Only returned by info function, not protocol. */
bool hasRowFilter;
char relkind;
bool ispartition;
} SpockRemoteRel;
typedef struct SpockRelation
{
/* Info coming from the remote side. */
uint32 remoteid;
char *nspname;
char *relname;
int natts;
char **attnames;
/* Mapping to local relation, filled as needed. */
Oid reloid;
Relation rel;
int *attmap;
/* Additional cache, only valid as long as relation mapping is. */
bool hasTriggers;
} SpockRelation;
extern void spock_relation_cache_update(uint32 remoteid,
char *schemaname, char *relname,
int natts, char **attnames);
extern void spock_relation_cache_updater(SpockRemoteRel *remoterel);
extern SpockRelation *spock_relation_open(uint32 remoteid,
LOCKMODE lockmode);
extern void spock_relation_close(SpockRelation * rel,
LOCKMODE lockmode);
extern void spock_relation_invalidate_cb(Datum arg, Oid reloid);
struct SpockTupleData;
#endif /* SPOCK_RELCACHE_H */