PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
fetch.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * fetch.h
4  * Fetching data from a local or remote data directory.
5  *
6  * This file includes the prototypes for functions used to copy files from
7  * one data directory to another. The source to copy from can be a local
8  * directory (copy method), or a remote PostgreSQL server (libpq fetch
9  * method).
10  *
11  * Copyright (c) 2013-2017, PostgreSQL Global Development Group
12  *
13  *-------------------------------------------------------------------------
14  */
15 #ifndef FETCH_H
16 #define FETCH_H
17 
18 #include "c.h"
19 
20 #include "access/xlogdefs.h"
21 
22 #include "filemap.h"
23 
24 /*
25  * Common interface. Calls the copy or libpq method depending on global
26  * config options.
27  */
28 extern void fetchSourceFileList(void);
29 extern char *fetchFile(char *filename, size_t *filesize);
30 extern void executeFileMap(void);
31 
32 /* in libpq_fetch.c */
33 extern void libpqProcessFileList(void);
34 extern char *libpqGetFile(const char *filename, size_t *filesize);
35 extern void libpq_executeFileMap(filemap_t *map);
36 
37 extern void libpqConnect(const char *connstr);
39 
40 /* in copy_fetch.c */
41 extern void copy_executeFileMap(filemap_t *map);
42 
43 typedef void (*process_file_callback_t) (const char *path, file_type_t type, size_t size, const char *link_target);
45 
46 #endif /* FETCH_H */
void traverse_datadir(const char *datadir, process_file_callback_t callback)
Definition: copy_fetch.c:38
void(* process_file_callback_t)(const char *path, file_type_t type, size_t size, const char *link_target)
Definition: fetch.h:43
void fetchSourceFileList(void)
Definition: fetch.c:29
char * fetchFile(char *filename, size_t *filesize)
Definition: fetch.c:55
void executeFileMap(void)
Definition: fetch.c:41
XLogRecPtr libpqGetCurrentXlogInsertLocation(void)
Definition: libpq_fetch.c:127
static void callback(struct sockaddr *addr, struct sockaddr *mask, void *unused)
Definition: test_ifaddrs.c:49
char * datadir
void libpqProcessFileList(void)
Definition: libpq_fetch.c:150
void libpq_executeFileMap(filemap_t *map)
Definition: libpq_fetch.c:412
uint64 XLogRecPtr
Definition: xlogdefs.h:21
char * libpqGetFile(const char *filename, size_t *filesize)
Definition: libpq_fetch.c:341
static char * filename
Definition: pg_dumpall.c:84
void copy_executeFileMap(filemap_t *map)
Definition: copy_fetch.c:210
file_type_t
Definition: filemap.h:35
datapagemap_t * map
Definition: datapagemap.c:20
void libpqConnect(const char *connstr)
Definition: libpq_fetch.c:49
static char * connstr
Definition: pg_dumpall.c:67