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
|
/*-------------------------------------------------------------------------
*
* pglogical_relcache.h
* pglogical relation cache
*
* Copyright (c) 2015, PostgreSQL Global Development Group
*
* IDENTIFICATION
* pglogical_relcache.h
*
*-------------------------------------------------------------------------
*/
#ifndef PGLOGICAL_RELCACHE_H
#define PGLOGICAL_RELCACHE_H
#include "storage/lock.h"
typedef struct PGLogicalRemoteRel
{
uint32 relid;
char *nspname;
char *relname;
int natts;
char **attnames;
/* Only returned by info function, not protocol. */
bool hasRowFilter;
} PGLogicalRemoteRel;
typedef struct PGLogicalRelation
{
/* 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;
} PGLogicalRelation;
extern void pglogical_relation_cache_update(uint32 remoteid,
char *schemaname, char *relname,
int natts, char **attnames);
extern void pglogical_relation_cache_updater(PGLogicalRemoteRel *remoterel);
extern PGLogicalRelation *pglogical_relation_open(uint32 remoteid,
LOCKMODE lockmode);
extern void pglogical_relation_close(PGLogicalRelation * rel,
LOCKMODE lockmode);
extern void pglogical_relation_invalidate_cb(Datum arg, Oid reloid);
struct PGLogicalTupleData;
#endif /* PGLOGICAL_RELCACHE_H */
|