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 "access/xlogdefs.h"
19 
20 #include "filemap.h"
21 
22 /*
23  * Common interface. Calls the copy or libpq method depending on global
24  * config options.
25  */
26 extern void fetchSourceFileList(void);
27 extern char *fetchFile(char *filename, size_t *filesize);
28 extern void executeFileMap(void);
29 
30 /* in libpq_fetch.c */
31 extern void libpqProcessFileList(void);
32 extern char *libpqGetFile(const char *filename, size_t *filesize);
33 extern void libpq_executeFileMap(filemap_t *map);
34 
35 extern void libpqConnect(const char *connstr);
37 
38 /* in copy_fetch.c */
39 extern void copy_executeFileMap(filemap_t *map);
40 
41 typedef void (*process_file_callback_t) (const char *path, file_type_t type, size_t size, const char *link_target);
43 
44 #endif /* FETCH_H */
void traverse_datadir(const char *datadir, process_file_callback_t callback)
Definition: copy_fetch.c:36
void(* process_file_callback_t)(const char *path, file_type_t type, size_t size, const char *link_target)
Definition: fetch.h:41
void fetchSourceFileList(void)
Definition: fetch.c:28
char * fetchFile(char *filename, size_t *filesize)
Definition: fetch.c:54
void executeFileMap(void)
Definition: fetch.c:40
XLogRecPtr libpqGetCurrentXlogInsertLocation(void)
Definition: libpq_fetch.c:126
static void callback(struct sockaddr *addr, struct sockaddr *mask, void *unused)
Definition: test_ifaddrs.c:48
char * datadir
void libpqProcessFileList(void)
Definition: libpq_fetch.c:149
void libpq_executeFileMap(filemap_t *map)
Definition: libpq_fetch.c:411
uint64 XLogRecPtr
Definition: xlogdefs.h:21
char * libpqGetFile(const char *filename, size_t *filesize)
Definition: libpq_fetch.c:340
static char * filename
Definition: pg_dumpall.c:87
void copy_executeFileMap(filemap_t *map)
Definition: copy_fetch.c:208
file_type_t
Definition: filemap.h:35
datapagemap_t * map
Definition: datapagemap.c:20
void libpqConnect(const char *connstr)
Definition: libpq_fetch.c:48
static char * connstr
Definition: pg_dumpall.c:64