33#include "catalog/pg_class_d.h"
46#define TEXT_DUMP_HEADER "--\n-- PostgreSQL database dump\n--\n\n"
47#define TEXT_DUMPALL_HEADER "--\n-- PostgreSQL database cluster dump\n--\n\n"
110 void *callback_data);
114 void *callback_data);
147 opts->include_everything =
true;
150 opts->dumpSchema =
true;
151 opts->dumpData =
true;
245 AH =
_allocAH(FileSpec,
fmt, compression_spec,
true,
263 pg_fatal(
"could not close output file: %m");
271 if (dopt == NULL && ropt != NULL)
317 pg_fatal(
"unexpected section code %d",
354 pg_fatal(
"parallel restore is not supported with this archive file format");
358 pg_fatal(
"parallel restore is not supported with archives made by pre-8.0 pg_dump");
379 pg_fatal(
"cannot restore from compressed archive (%s)",
401 pg_fatal(
"direct database connections are not supported in pre-1.3 archives");
431 int impliedDataOnly = 1;
455 ahprintf(AH,
"--\n-- PostgreSQL database dump\n--\n\n");
458 ahprintf(AH,
"-- Dumped from database version %s\n",
461 ahprintf(AH,
"-- Dumped by pg_dump version %s\n",
502 if (strcmp(te->
desc,
"DATABASE") != 0 &&
503 strcmp(te->
desc,
"DATABASE PROPERTIES") != 0)
510 bool not_allowed_in_txn =
false;
521 if (strcmp(te->
desc,
"DATABASE") == 0 ||
522 strcmp(te->
desc,
"DATABASE PROPERTIES") == 0)
524 not_allowed_in_txn =
true;
541 if (strcmp(te->
desc,
"BLOB METADATA") == 0)
546 "SELECT pg_catalog.lo_unlink(oid) "
547 "FROM pg_catalog.pg_largeobject_metadata "
548 "WHERE oid = '",
"'");
551 "SELECT pg_catalog.lo_unlink('",
557 strncmp(te->
dropStmt,
"--", 2) == 0)
575 if (strcmp(te->
desc,
"BLOB") == 0)
582 char *dropStmtOrig = dropStmt;
589 if (strncmp(dropStmt,
"ALTER TABLE", 11) == 0)
592 "ALTER TABLE IF EXISTS");
593 dropStmt = dropStmt + 11;
615 if (strcmp(te->
desc,
"DEFAULT") == 0 ||
616 strcmp(te->
desc,
"DATABASE PROPERTIES") == 0 ||
617 strncmp(dropStmt,
"CREATE OR REPLACE VIEW", 22) == 0)
624 if (strcmp(te->
desc,
"CONSTRAINT") == 0 ||
625 strcmp(te->
desc,
"CHECK CONSTRAINT") == 0 ||
626 strcmp(te->
desc,
"FK CONSTRAINT") == 0)
627 strcpy(buffer,
"DROP CONSTRAINT");
629 snprintf(buffer,
sizeof(buffer),
"DROP %s",
632 mark = strstr(dropStmt, buffer);
639 mark + strlen(buffer));
644 pg_log_warning(
"could not find where to insert IF EXISTS in statement \"%s\"",
664 if (not_allowed_in_txn)
737 bool haveACL =
false;
738 bool havePostACL =
false;
795 ahprintf(AH,
"--\n-- PostgreSQL database dump complete\n--\n\n");
845 bool object_is_db =
false;
851 if (strcmp(te->
desc,
"DATABASE") == 0 ||
852 strcmp(te->
desc,
"DATABASE PROPERTIES") == 0)
867 te->
desc, te->namespace, te->
tag);
875 if (strcmp(te->
desc,
"TABLE") == 0)
943 if (strcmp(te->
desc,
"BLOBS") == 0 ||
944 strcmp(te->
desc,
"BLOB COMMENTS") == 0)
951 if (strcmp(te->
desc,
"BLOB COMMENTS") == 0)
969 te->namespace, te->
tag);
987 use_truncate = is_parallel && te->
created &&
1002 ahprintf(AH,
"TRUNCATE TABLE ONLY %s;\n\n",
1035 else if (!defnDumped)
1057 ahprintf(AH,
"COMMIT;\nBEGIN;\n\n");
1084 opts->compression_spec.level = 0;
1085 opts->dumpSchema =
true;
1086 opts->dumpData =
true;
1113 ahprintf(AH,
"ALTER TABLE %s DISABLE TRIGGER ALL;\n\n",
1139 ahprintf(AH,
"ALTER TABLE %s ENABLE TRIGGER ALL;\n\n",
1158 strncmp(te->
defn,
"-- load via partition root ", 27) == 0)
1191 pg_fatal(
"internal error -- WriteData cannot be called outside the context of a DataDumper routine");
1239 if (
opts->nDeps > 0)
1274 const char *fmtName;
1286 strcpy(stamp_str,
"[unknown]");
1288 ahprintf(AH,
";\n; Archive created at %s\n", stamp_str);
1289 ahprintf(AH,
"; dbname: %s\n; TOC Entries: %d\n; Compression: %s\n",
1300 fmtName =
"DIRECTORY";
1306 fmtName =
"UNKNOWN";
1309 ahprintf(AH,
"; Dump Version: %d.%d-%d\n",
1311 ahprintf(AH,
"; Format: %s\n", fmtName);
1315 ahprintf(AH,
"; Dumped from database version: %s\n",
1318 ahprintf(AH,
"; Dumped by pg_dump version: %s\n",
1321 ahprintf(AH,
";\n;\n; Selected TOC Entries:\n;\n");
1334 char *sanitized_name;
1335 char *sanitized_schema;
1336 char *sanitized_owner;
1346 te->
desc, sanitized_schema, sanitized_name,
1349 free(sanitized_name);
1350 free(sanitized_schema);
1351 free(sanitized_owner);
1383 pg_fatal(
"large-object output not supported in chosen format");
1447 "restored %d large objects",
1473 pg_log_info(
"restoring large object with OID %u", oid);
1476 if (old_lo_style && drop)
1484 if (loOid == 0 || loOid != oid)
1485 pg_fatal(
"could not create large object %u: %s",
1490 pg_fatal(
"could not open large object %u: %s",
1496 ahprintf(AH,
"SELECT pg_catalog.lo_open(pg_catalog.lo_create('%u'), %d);\n",
1499 ahprintf(AH,
"SELECT pg_catalog.lo_open('%u', %d);\n",
1524 ahprintf(AH,
"SELECT pg_catalog.lo_close(0);\n\n");
1558 cmnt = strchr(linebuf.
data,
';');
1562 linebuf.
len = cmnt - linebuf.
data;
1566 if (strspn(linebuf.
data,
" \t\r\n") == linebuf.
len)
1570 id = strtol(linebuf.
data, &endptr, 10);
1571 if (endptr == linebuf.
data || id <= 0 || id > AH->
maxDumpId ||
1581 pg_fatal(
"could not find entry for ID %d",
1603 if (fclose(fh) != 0)
1604 pg_fatal(
"could not close TOC file: %m");
1623 int save_errno = errno;
1673 fn = fileno(AH->
FH);
1693 pg_fatal(
"could not open output file: %m");
1710 pg_fatal(
"could not close output file: %m");
1712 AH->
OF = savedOutput;
1723 int save_errno = errno;
1777 "wrote %zu bytes of large object data (result = %d)",
1790 (
const unsigned char *) AH->
lo_buf,
1796 ahprintf(AH,
"SELECT pg_catalog.lowrite(0, %s);\n",
buf->data);
1814 int bytes_written = 0;
1825 ptr = (
const char *) ptr + avail;
1834 bytes_written =
size * nmemb;
1850 bytes_written =
size * nmemb;
1853 if (bytes_written !=
size * nmemb)
1974 if (strcmp(te->
desc,
"TABLE DATA") == 0 && te->
nDeps > 0)
1983 if (tableId <= 0 || tableId > maxDumpId)
1984 pg_fatal(
"bad table dumpId for TABLE DATA item");
1998 if (
id > 0 && id <= AH->maxDumpId)
2024 for (off = 0; off <
sizeof(
pgoff_t); off++)
2076 pg_fatal(
"unexpected data offset flag %d", offsetFlg);
2082 for (off = 0; off < AH->
offSize; off++)
2089 pg_fatal(
"file offset in dump file is too large");
2144 res =
res + (bv << bitShift);
2161 int len = strlen(
c);
2200 pg_fatal(
"directory name too long: \"%s\"", dir);
2213 pg_log_debug(
"attempting to ascertain archive format");
2250 pg_fatal(
"directory \"%s\" does not appear to be a valid archive (\"toc.dat\" does not exist)",
2258 pg_fatal(
"could not open input file \"%s\": %m", AH->
fSpec);
2265 pg_fatal(
"could not open input file: %m");
2268 if ((cnt = fread(
sig, 1, 5, fh)) != 5)
2271 pg_fatal(
"could not read input file: %m");
2273 pg_fatal(
"input file is too short (read %lu, expected 5)",
2274 (
unsigned long) cnt);
2281 if (strncmp(
sig,
"PGDMP", 5) == 0)
2305 pg_fatal(
"input file appears to be a text format dump. Please use psql.");
2311 pg_fatal(
"input file does not appear to be a valid archive (too short?)");
2317 pg_fatal(
"input file does not appear to be a valid archive");
2325 if (fclose(fh) != 0)
2326 pg_fatal(
"could not close input file: %m");
2350 FileSpec ? FileSpec :
"(stdio)",
fmt);
2405 pg_fatal(
"could not open stdout for appending: %m");
2415 (AH->
fSpec == NULL || strcmp(AH->
fSpec,
"") == 0))
2418 _setmode(fileno(
stdout), O_BINARY);
2420 _setmode(fileno(stdin), O_BINARY);
2493 for (
int i = 0;
i < ntes;
i++)
2529 void *callback_data)
2535 pg_fatal(
"worker process failed: exit code %d",
2548 if (strcmp(te->
desc,
"BLOBS") == 0)
2559 if (startPtr != NULL)
2560 (*startPtr) (AH, te);
2657 pg_fatal(
"entry ID %d out of range -- perhaps a corrupt TOC",
2688 if (strcmp(te->
desc,
"COMMENT") == 0 ||
2689 strcmp(te->
desc,
"ACL") == 0 ||
2690 strcmp(te->
desc,
"ACL LANGUAGE") == 0)
2692 else if (strcmp(te->
desc,
"TABLE DATA") == 0 ||
2693 strcmp(te->
desc,
"BLOBS") == 0 ||
2694 strcmp(te->
desc,
"BLOB COMMENTS") == 0)
2696 else if (strcmp(te->
desc,
"CONSTRAINT") == 0 ||
2697 strcmp(te->
desc,
"CHECK CONSTRAINT") == 0 ||
2698 strcmp(te->
desc,
"FK CONSTRAINT") == 0 ||
2699 strcmp(te->
desc,
"INDEX") == 0 ||
2700 strcmp(te->
desc,
"RULE") == 0 ||
2701 strcmp(te->
desc,
"TRIGGER") == 0)
2726 is_supported =
true;
2728 is_supported =
false;
2733 if (strcmp(tmp,
"true") == 0)
2734 is_supported =
false;
2740 pg_log_warning(
"restoring tables WITH OIDS is not supported anymore");
2753 if (depIdx >= depSize)
2758 sscanf(tmp,
"%d", &deps[depIdx]);
2796 if (strcmp(te->
desc,
"ENCODING") == 0)
2798 else if (strcmp(te->
desc,
"STDSTRINGS") == 0)
2800 else if (strcmp(te->
desc,
"SEARCHPATH") == 0)
2814 ptr1 = strchr(defn,
'\'');
2816 ptr2 = strchr(++ptr1,
'\'');
2822 pg_fatal(
"unrecognized encoding \"%s\"",
2827 pg_fatal(
"invalid ENCODING item: %s",
2839 ptr1 = strchr(te->
defn,
'\'');
2840 if (ptr1 && strncmp(ptr1,
"'on'", 4) == 0)
2842 else if (ptr1 && strncmp(ptr1,
"'off'", 5) == 0)
2845 pg_fatal(
"invalid STDSTRINGS item: %s",
2862 const char *missing_name;
2869 if (missing_name != NULL)
2870 pg_fatal(
"schema \"%s\" not found", missing_name);
2876 if (missing_name != NULL)
2877 pg_fatal(
"table \"%s\" not found", missing_name);
2883 if (missing_name != NULL)
2884 pg_fatal(
"index \"%s\" not found", missing_name);
2890 if (missing_name != NULL)
2891 pg_fatal(
"function \"%s\" not found", missing_name);
2897 if (missing_name != NULL)
2898 pg_fatal(
"trigger \"%s\" not found", missing_name);
2916 if (strcmp(te->
desc,
"ENCODING") == 0 ||
2917 strcmp(te->
desc,
"STDSTRINGS") == 0 ||
2918 strcmp(te->
desc,
"SEARCHPATH") == 0)
2926 if (strcmp(te->
desc,
"DATABASE") == 0 ||
2927 strcmp(te->
desc,
"DATABASE PROPERTIES") == 0)
2952 (strcmp(te->
desc,
"PUBLICATION") == 0 ||
2953 strcmp(te->
desc,
"PUBLICATION TABLE") == 0 ||
2954 strcmp(te->
desc,
"PUBLICATION TABLES IN SCHEMA") == 0))
2992 if (strcmp(te->
desc,
"ACL") == 0 ||
2993 strcmp(te->
desc,
"COMMENT") == 0 ||
2994 strcmp(te->
desc,
"SECURITY LABEL") == 0)
2997 if (strncmp(te->
tag,
"DATABASE ", 9) == 0)
3025 bool dumpthis =
false;
3027 for (
int i = 0;
i < te->
nDeps;
i++)
3033 if (strcmp(pte->
desc,
"ACL") == 0)
3064 if (strcmp(te->
desc,
"TABLE") == 0 ||
3065 strcmp(te->
desc,
"TABLE DATA") == 0 ||
3066 strcmp(te->
desc,
"VIEW") == 0 ||
3067 strcmp(te->
desc,
"FOREIGN TABLE") == 0 ||
3068 strcmp(te->
desc,
"MATERIALIZED VIEW") == 0 ||
3069 strcmp(te->
desc,
"MATERIALIZED VIEW DATA") == 0 ||
3070 strcmp(te->
desc,
"SEQUENCE") == 0 ||
3071 strcmp(te->
desc,
"SEQUENCE SET") == 0)
3079 else if (strcmp(te->
desc,
"INDEX") == 0)
3087 else if (strcmp(te->
desc,
"FUNCTION") == 0 ||
3088 strcmp(te->
desc,
"AGGREGATE") == 0 ||
3089 strcmp(te->
desc,
"PROCEDURE") == 0)
3097 else if (strcmp(te->
desc,
"TRIGGER") == 0)
3125 if (strcmp(te->
desc,
"SEQUENCE SET") == 0 ||
3126 strcmp(te->
desc,
"BLOB") == 0 ||
3127 strcmp(te->
desc,
"BLOB METADATA") == 0 ||
3128 (strcmp(te->
desc,
"ACL") == 0 &&
3129 strncmp(te->
tag,
"LARGE OBJECT", 12) == 0) ||
3130 (strcmp(te->
desc,
"COMMENT") == 0 &&
3131 strncmp(te->
tag,
"LARGE OBJECT", 12) == 0) ||
3132 (strcmp(te->
desc,
"SECURITY LABEL") == 0 &&
3133 strncmp(te->
tag,
"LARGE OBJECT", 12) == 0))
3144 strncmp(te->
defn,
"-- load via partition root ", 27) == 0)
3151 if ((strcmp(te->
desc,
"<Init>") == 0) && (strcmp(te->
tag,
"Max OID") == 0))
3167 (strcmp(te->
desc,
"BLOB") == 0 ||
3168 strcmp(te->
desc,
"BLOB METADATA") == 0 ||
3169 (strcmp(te->
desc,
"ACL") == 0 &&
3170 strncmp(te->
tag,
"LARGE OBJECT", 12) == 0) ||
3171 (strcmp(te->
desc,
"COMMENT") == 0 &&
3172 strncmp(te->
tag,
"LARGE OBJECT", 12) == 0) ||
3173 (strcmp(te->
desc,
"SECURITY LABEL") == 0 &&
3174 strncmp(te->
tag,
"LARGE OBJECT", 12) == 0))))
3194 if (strcmp(te->
desc,
"ACL") == 0 ||
3195 strcmp(te->
desc,
"ACL LANGUAGE") == 0 ||
3196 strcmp(te->
desc,
"DEFAULT ACL") == 0)
3198 if (strcmp(te->
desc,
"EVENT TRIGGER") == 0 ||
3199 strcmp(te->
desc,
"MATERIALIZED VIEW DATA") == 0)
3208 if (strcmp(te->
desc,
"COMMENT") == 0 &&
3209 strncmp(te->
tag,
"EVENT TRIGGER ", 14) == 0)
3227 if (strcmp(te->
desc,
"ACL") == 0 ||
3228 strcmp(te->
desc,
"ACL LANGUAGE") == 0 ||
3229 strcmp(te->
desc,
"DEFAULT ACL") == 0)
3246 ahprintf(AH,
"SET statement_timeout = 0;\n");
3247 ahprintf(AH,
"SET lock_timeout = 0;\n");
3248 ahprintf(AH,
"SET idle_in_transaction_session_timeout = 0;\n");
3249 ahprintf(AH,
"SET transaction_timeout = 0;\n");
3252 ahprintf(AH,
"SET client_encoding = '%s';\n",
3256 ahprintf(AH,
"SET standard_conforming_strings = %s;\n",
3268 ahprintf(AH,
"SET check_function_bodies = false;\n");
3271 ahprintf(AH,
"SET xmloption = content;\n");
3274 ahprintf(AH,
"SET client_min_messages = warning;\n");
3276 ahprintf(AH,
"SET escape_string_warning = off;\n");
3280 ahprintf(AH,
"SET row_security = on;\n");
3282 ahprintf(AH,
"SET row_security = off;\n");
3329 pg_fatal(
"could not set session user to \"%s\": %s",
3442 if (!schemaName || *schemaName ==
'\0' ||
3450 if (strcmp(schemaName,
"pg_catalog") != 0)
3461 "could not set \"search_path\" to \"%s\": %s",
3498 if (have && strcmp(want, have) == 0)
3503 if (strcmp(want,
"") == 0)
3522 "could not set \"default_tablespace\" to %s: %s",
3557 if (have && strcmp(want, have) == 0)
3571 "could not set \"default_table_access_method\": %s",
3593 const char *tableam = te->
tableam;
3620 "could not alter table access method: %s",
3643 if (strcmp(
type,
"COLLATION") == 0 ||
3644 strcmp(
type,
"CONVERSION") == 0 ||
3645 strcmp(
type,
"DOMAIN") == 0 ||
3646 strcmp(
type,
"FOREIGN TABLE") == 0 ||
3647 strcmp(
type,
"MATERIALIZED VIEW") == 0 ||
3648 strcmp(
type,
"SEQUENCE") == 0 ||
3649 strcmp(
type,
"STATISTICS") == 0 ||
3650 strcmp(
type,
"TABLE") == 0 ||
3651 strcmp(
type,
"TEXT SEARCH DICTIONARY") == 0 ||
3652 strcmp(
type,
"TEXT SEARCH CONFIGURATION") == 0 ||
3653 strcmp(
type,
"TYPE") == 0 ||
3654 strcmp(
type,
"VIEW") == 0 ||
3656 strcmp(
type,
"DATABASE") == 0 ||
3657 strcmp(
type,
"PROCEDURAL LANGUAGE") == 0 ||
3658 strcmp(
type,
"SCHEMA") == 0 ||
3659 strcmp(
type,
"EVENT TRIGGER") == 0 ||
3660 strcmp(
type,
"FOREIGN DATA WRAPPER") == 0 ||
3661 strcmp(
type,
"SERVER") == 0 ||
3662 strcmp(
type,
"PUBLICATION") == 0 ||
3663 strcmp(
type,
"SUBSCRIPTION") == 0)
3666 if (te->namespace && *te->namespace)
3671 else if (strcmp(
type,
"BLOB") == 0)
3680 else if (strcmp(
type,
"AGGREGATE") == 0 ||
3681 strcmp(
type,
"FUNCTION") == 0 ||
3682 strcmp(
type,
"OPERATOR") == 0 ||
3683 strcmp(
type,
"OPERATOR CLASS") == 0 ||
3684 strcmp(
type,
"OPERATOR FAMILY") == 0 ||
3685 strcmp(
type,
"PROCEDURE") == 0)
3692 last = first + strlen(first) - 1;
3695 while (last >= first && (*last ==
'\n' || *last ==
';'))
3705 else if (strcmp(
type,
"CAST") == 0 ||
3706 strcmp(
type,
"CHECK CONSTRAINT") == 0 ||
3707 strcmp(
type,
"CONSTRAINT") == 0 ||
3708 strcmp(
type,
"DATABASE PROPERTIES") == 0 ||
3709 strcmp(
type,
"DEFAULT") == 0 ||
3710 strcmp(
type,
"FK CONSTRAINT") == 0 ||
3711 strcmp(
type,
"INDEX") == 0 ||
3712 strcmp(
type,
"RULE") == 0 ||
3713 strcmp(
type,
"TRIGGER") == 0 ||
3714 strcmp(
type,
"ROW SECURITY") == 0 ||
3715 strcmp(
type,
"POLICY") == 0 ||
3716 strcmp(
type,
"USER MAPPING") == 0)
3721 pg_fatal(
"don't know how to set owner for object type \"%s\"",
type);
3745 if (te->
relkind != RELKIND_PARTITIONED_TABLE)
3752 char *sanitized_name;
3753 char *sanitized_schema;
3754 char *sanitized_owner;
3764 ahprintf(AH,
"-- TOC entry %d (class %u OID %u)\n",
3781 ahprintf(AH,
"-- %sName: %s; Type: %s; Schema: %s; Owner: %s",
3782 pfx, sanitized_name, te->
desc, sanitized_schema,
3785 free(sanitized_name);
3786 free(sanitized_schema);
3787 free(sanitized_owner);
3791 char *sanitized_tablespace;
3794 ahprintf(AH,
"; Tablespace: %s", sanitized_tablespace);
3795 free(sanitized_tablespace);
3821 strcmp(te->
desc,
"SCHEMA") == 0 && strncmp(te->
defn,
"--", 2) != 0)
3825 else if (strcmp(te->
desc,
"BLOB METADATA") == 0)
3829 else if (strcmp(te->
desc,
"ACL") == 0 &&
3830 strncmp(te->
tag,
"LARGE OBJECTS", 13) == 0)
3834 else if (te->
defn && strlen(te->
defn) > 0)
3846 strcmp(te->
desc,
"FUNCTION") != 0 &&
3847 strcmp(te->
desc,
"PROCEDURE") != 0)
3849 const char *p = te->
defn;
3852 while ((p = strchr(p,
';')) != NULL)
3871 (strcmp(te->
desc,
"SCHEMA") == 0 &&
3872 strncmp(te->
defn,
"--", 2) == 0)) &&
3876 if (strcmp(te->
desc,
"BLOB METADATA") == 0)
3897 ahprintf(AH,
"ALTER %s OWNER TO %s;\n\n",
3907 if (te->
relkind == RELKIND_PARTITIONED_TABLE)
3944 return pg_strdup(want_hyphen ?
"-" :
"");
3948 for (s = result; *s !=
'\0'; s++)
3950 if (*s ==
'\n' || *s ==
'\r')
4007 if (strncmp(tmpMag,
"PGDMP", 5) != 0)
4008 pg_fatal(
"did not find magic string in file header");
4014 if (vmaj > 1 || (vmaj == 1 && vmin > 0))
4022 pg_fatal(
"unsupported version (%d.%d) in file header",
4027 pg_fatal(
"sanity check on integer size (%lu) failed",
4030 if (AH->
intSize >
sizeof(
int))
4031 pg_log_warning(
"archive was made on a machine with larger integers, some operations might fail");
4041 pg_fatal(
"expected format (%d) differs from format found in file (%d)",
4063 pg_log_warning(
"archive is compressed, but this installation does not support compression (%s) -- no data will be available",
4135 if (
fseeko(fp, tpos, SEEK_SET) != 0)
4195 skipped_some =
false;
4196 for (next_work_item = AH->
toc->
next; next_work_item != AH->
toc; next_work_item = next_work_item->
next)
4207 skipped_some =
true;
4235 next_work_item->
desc, next_work_item->
tag);
4324 if (next_work_item != NULL)
4331 next_work_item->
desc, next_work_item->
tag);
4340 next_work_item->
desc, next_work_item->
tag);
4446 for (k = 0; k < te2->
nDeps; k++)
4536 for (te = pending_list->
pending_next; te != pending_list; te = next_te)
4578 bool conflicts =
false;
4589 if (running_te == NULL)
4647 void *callback_data)
4663 else if (status != 0)
4664 pg_fatal(
"worker process failed: exit code %d",
4719 if (strcmp(te->
desc,
"BLOB COMMENTS") == 0 && te->
nDeps == 0)
4725 if (strcmp(te2->
desc,
"BLOBS") == 0)
4756 if (depid <= AH->maxDumpId && AH->
tocsByDumpId[depid] != NULL)
4784 if (depid <= AH->maxDumpId && AH->
tocsByDumpId[depid] != NULL)
4828 if (olddep <= AH->maxDumpId &&
4837 te->
dumpId, olddep, tabledataid);
4872 if (strcmp(te->
desc,
"INDEX") == 0)
4891 if (depid <= AH->maxDumpId && AH->
tocsByDumpId[depid] != NULL &&
4894 lockids[nlockids++] = depid;
4970 pg_log_info(
"table \"%s\" could not be created, will not restore its data",
int lo_write(int fd, const char *buf, int len)
void ParallelBackupEnd(ArchiveHandle *AH, ParallelState *pstate)
void WaitForWorkers(ArchiveHandle *AH, ParallelState *pstate, WFW_WaitOption mode)
ParallelState * ParallelBackupStart(ArchiveHandle *AH)
void DispatchJobForTocEntry(ArchiveHandle *AH, ParallelState *pstate, TocEntry *te, T_Action act, ParallelCompletionPtr callback, void *callback_data)
bool IsEveryWorkerIdle(ParallelState *pstate)
void binaryheap_remove_node(binaryheap *heap, int n)
void binaryheap_add(binaryheap *heap, bh_node_type d)
void binaryheap_free(binaryheap *heap)
binaryheap * binaryheap_allocate(int capacity, binaryheap_comparator compare, void *arg)
#define binaryheap_size(h)
#define binaryheap_empty(h)
#define binaryheap_get_node(h, n)
#define ngettext(s, p, n)
#define Assert(condition)
bool EndCompressFileHandle(CompressFileHandle *CFH)
char * supports_compression(const pg_compress_specification compression_spec)