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-2019, 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(const 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); |
36 | extern XLogRecPtr libpqGetCurrentXlogInsertLocation(void); |
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); |
42 | extern void traverse_datadir(const char *datadir, process_file_callback_t callback); |
43 | |
44 | #endif /* FETCH_H */ |
45 | |