PostgreSql为用户提供了pgdump、pgdumpall、pgrestore等逻辑备份工具。pgdumpall、pgdump用于导出数据,pgrestore用于导入数据。 pgdumpall利用pgdump分别导出每个database,另外,还会导出role和tablespace等数据,导出数据被保存到sql脚本中。命令行语法选项如下:
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 |
-bash-4.2$ pg_dumpall --help pg_dumpall extracts a PostgreSQL database cluster into an SQL script file. Usage: pg_dumpall [OPTION]... General options: -f, --file=FILENAME output file name -v, --verboseverbose mode -V, --versionoutput version information, then exit --lock-wait-timeout=TIMEOUT fail after waiting TIMEOUT for a table lock -?, --help show this help, then exit Options controlling the output content: -a, --data-only dump only the data, not the schema -c, --clean clean (drop) databases before recreating -E, --encoding=ENCODING dump the data in encoding ENCODING -g, --globals-only dump only global objects, no databases -O, --no-owner skip restoration of object ownership -r, --roles-only dump only roles, no databases or tablespaces -s, --schema-onlydump only the schema, no data -S, --superuser=NAME superuser user name to use in the dump -t, --tablespaces-only dump only tablespaces, no databases or roles -x, --no-privileges do not dump privileges (grant/revoke) --binary-upgrade for use by upgrade utilities only --column-inserts dump data as INSERT commands with column names --disable-dollar-quoting disable dollar quoting, use SQL standard quoting --disable-triggers disable triggers during data-only restore --exclude-database=PATTERN exclude databases whose name matches PATTERN --extra-float-digits=NUM override default setting for extra_float_digits --if-exists use IF EXISTS when dropping objects --insertsdump data as INSERT commands, rather than COPY --load-via-partition-rootload partitions via the root table --no-commentsdo not dump comments --no-publicationsdo not dump publications --no-role-passwords do not dump passwords for roles --no-security-labels do not dump security label assignments --no-subscriptions do not dump subscriptions --no-syncdo not wait for changes to be written safely to disk --no-tablespaces do not dump tablespace assignments --no-unlogged-table-data do not dump unlogged table data --on-conflict-do-nothing add ON CONFLICT DO NOTHING to INSERT commands --quote-all-identifiers quote all identifiers, even if not key words --rows-per-insert=NROWS number of rows per INSERT; implies --inserts --use-set-session-authorization use SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to set ownership Connection options: -d, --dbname=CONNSTR connect using connection string -h, --host=HOSTNAME database server host or socket directory -l, --database=DBNAMEalternative default database -p, --port=PORT database server port number -U, --username=NAME connect as specified database user -w, --no-passwordnever prompt for password -W, --password force password prompt (should happen automatically) --role=ROLENAME do SET ROLE before dump If -f/--file is not used, then the SQL script will be written to the standard output. |
示例
pgdumpall在导出数据时,使用pgdump针对各个数据库分别发起链接,因此,在导出过程中,需要我们多次输入密码信息。
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 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 |
-bash-4.2$ pg_dumpall -v > all.sql Password: --------------在此输入密码------------------ pg_dumpall: executing SELECT pg_catalog.set_config('search_path', '', false); pg_dumpall: executing SELECT oid, rolname, rolsuper, rolinherit, rolcreaterole, rolcreatedb, rolcanlogin, rolconnlimit, rolpassword, rolvaliduntil, rolreplication, rolbypassrls, pg_catalog.shobj_description(oid, 'pg_authid') as rolcomment, rolname = current_user AS is_current_user FROM pg_authid WHERE rolname !~ '^pg_' ORDER BY 2 pg_dumpall: executing SELECT provider, label FROM pg_catalog.pg_shseclabel WHERE classoid = 'pg_catalog.pg_authid'::pg_catalog.regclass AND objoid = '10' pg_dumpall: executing SELECT provider, label FROM pg_catalog.pg_shseclabel WHERE classoid = 'pg_catalog.pg_authid'::pg_catalog.regclass AND objoid = '41054' pg_dumpall: executing SELECT provider, label FROM pg_catalog.pg_shseclabel WHERE classoid = 'pg_catalog.pg_authid'::pg_catalog.regclass AND objoid = '51002' pg_dumpall: executing SELECT provider, label FROM pg_catalog.pg_shseclabel WHERE classoid = 'pg_catalog.pg_authid'::pg_catalog.regclass AND objoid = '50885' pg_dumpall: executing SELECT provider, label FROM pg_catalog.pg_shseclabel WHERE classoid = 'pg_catalog.pg_authid'::pg_catalog.regclass AND objoid = '50587' pg_dumpall: executing SELECT provider, label FROM pg_catalog.pg_shseclabel WHERE classoid = 'pg_catalog.pg_authid'::pg_catalog.regclass AND objoid = '41053' pg_dumpall: executing SELECT setconfig[1] FROM pg_db_role_setting WHERE setdatabase = 0 AND setrole = (SELECT oid FROM pg_authid WHERE rolname = 'postgres') pg_dumpall: executing SELECT setconfig[1] FROM pg_db_role_setting WHERE setdatabase = 0 AND setrole = (SELECT oid FROM pg_authid WHERE rolname = 'readonly') pg_dumpall: executing SELECT setconfig[1] FROM pg_db_role_setting WHERE setdatabase = 0 AND setrole = (SELECT oid FROM pg_authid WHERE rolname = 'tpcc001') pg_dumpall: executing SELECT setconfig[1] FROM pg_db_role_setting WHERE setdatabase = 0 AND setrole = (SELECT oid FROM pg_authid WHERE rolname = 'tpcc002') pg_dumpall: executing SELECT setconfig[1] FROM pg_db_role_setting WHERE setdatabase = 0 AND setrole = (SELECT oid FROM pg_authid WHERE rolname = 'tpcc100') pg_dumpall: executing SELECT setconfig[1] FROM pg_db_role_setting WHERE setdatabase = 0 AND setrole = (SELECT oid FROM pg_authid WHERE rolname = 'user1') pg_dumpall: executing SELECT ur.rolname AS roleid, um.rolname AS member, a.admin_option, ug.rolname AS grantor FROM pg_auth_members a LEFT JOIN pg_authid ur on ur.oid = a.roleid LEFT JOIN pg_authid um on um.oid = a.member LEFT JOIN pg_authid ug on ug.oid = a.grantor WHERE NOT (ur.rolname ~ '^pg_' AND um.rolname ~ '^pg_')ORDER BY 1,2,3 pg_dumpall: executing SELECT oid, spcname, pg_catalog.pg_get_userbyid(spcowner) AS spcowner, pg_catalog.pg_tablespace_location(oid), (SELECT array_agg(acl ORDER BY row_n) FROM (SELECT acl, row_n FROM unnest(coalesce(spcacl,acldefault('t',spcowner))) WITH ORDINALITY AS perm(acl,row_n)WHERE NOT EXISTS ( SELECT 1 FROM unnest(acldefault('t',spcowner))AS init(init_acl) WHERE acl = init_acl)) AS spcacls) AS spcacl, (SELECT array_agg(acl ORDER BY row_n) FROM (SELECT acl, row_n FROM unnest(acldefault('t',spcowner)) WITH ORDINALITY AS initp(acl,row_n)WHERE NOT EXISTS ( SELECT 1 FROM unnest(coalesce(spcacl,acldefault('t',spcowner)))AS permp(orig_acl) WHERE acl = orig_acl)) AS rspcacls) AS rspcacl, array_to_string(spcoptions, ', '),pg_catalog.shobj_description(oid, 'pg_tablespace') FROM pg_catalog.pg_tablespace WHERE spcname !~ '^pg_' ORDER BY 1 pg_dumpall: executing SELECT provider, label FROM pg_catalog.pg_shseclabel WHERE classoid = 'pg_catalog.pg_tablespace'::pg_catalog.regclass AND objoid = '32860' pg_dumpall: executing SELECT datname FROM pg_database d WHERE datallowconn ORDER BY (datname <> 'template1'), datname pg_dumpall: dumping database "template1" pg_dumpall: running ""/usr/pgsql-12/bin/pg_dump" -v -Fp ' dbname=template1'" Password: --------------在此输入密码------------------ pg_dump: last built-in OID is 16383 pg_dump: reading extensions pg_dump: identifying extension members pg_dump: reading schemas pg_dump: reading user-defined tables pg_dump: reading user-defined functions pg_dump: reading user-defined types pg_dump: reading procedural languages pg_dump: reading user-defined aggregate functions pg_dump: reading user-defined operators pg_dump: reading user-defined access methods pg_dump: reading user-defined operator classes pg_dump: reading user-defined operator families pg_dump: reading user-defined text search parsers pg_dump: reading user-defined text search templates pg_dump: reading user-defined text search dictionaries pg_dump: reading user-defined text search configurations pg_dump: reading user-defined foreign-data wrappers pg_dump: reading user-defined foreign servers pg_dump: reading default privileges pg_dump: reading user-defined collations pg_dump: reading user-defined conversions pg_dump: reading type casts pg_dump: reading transforms pg_dump: reading table inheritance information pg_dump: reading event triggers pg_dump: finding extension tables pg_dump: finding inheritance relationships pg_dump: reading column info for interesting tables pg_dump: flagging inherited columns in subtables pg_dump: reading indexes pg_dump: flagging indexes in partitioned tables pg_dump: reading extended statistics pg_dump: reading constraints pg_dump: reading triggers pg_dump: reading rewrite rules pg_dump: reading policies pg_dump: reading publications pg_dump: reading publication membership pg_dump: reading subscriptions pg_dump: reading large objects pg_dump: reading dependency data pg_dump: saving encoding = UTF8 pg_dump: saving standard_conforming_strings = on pg_dump: saving search_path = pg_dump: implied data-only restore pg_dumpall: dumping database "db1" pg_dumpall: running ""/usr/pgsql-12/bin/pg_dump" -v --create -Fp ' dbname=db1'" Password: --------------在此输入密码------------------ pg_dump: last built-in OID is 16383 pg_dump: reading extensions pg_dump: identifying extension members pg_dump: reading schemas pg_dump: reading user-defined tables pg_dump: reading user-defined functions pg_dump: reading user-defined types pg_dump: reading procedural languages pg_dump: reading user-defined aggregate functions pg_dump: reading user-defined operators pg_dump: reading user-defined access methods pg_dump: reading user-defined operator classes pg_dump: reading user-defined operator families pg_dump: reading user-defined text search parsers pg_dump: reading user-defined text search templates pg_dump: reading user-defined text search dictionaries pg_dump: reading user-defined text search configurations pg_dump: reading user-defined foreign-data wrappers pg_dump: reading user-defined foreign servers pg_dump: reading default privileges pg_dump: reading user-defined collations pg_dump: reading user-defined conversions pg_dump: reading type casts pg_dump: reading transforms pg_dump: reading table inheritance information pg_dump: reading event triggers pg_dump: finding extension tables pg_dump: finding inheritance relationships pg_dump: reading column info for interesting tables pg_dump: finding the columns and types of table "public.t" pg_dump: finding the columns and types of table "public.p1" pg_dump: finding the columns and types of table "public.t1" pg_dump: finding the columns and types of table "public.t2" pg_dump: finding default expressions of table "public.t2" pg_dump: finding the columns and types of table "postgres.t4" pg_dump: finding the columns and types of table "schema2.t1" pg_dump: finding the columns and types of table "public.t5" pg_dump: finding the columns and types of table "postgres.t6" pg_dump: finding the columns and types of table "postgres.t7" pg_dump: finding the columns and types of table "postgres.t8" pg_dump: finding check constraints for table "postgres.t8" pg_dump: finding the columns and types of table "postgres.t9" pg_dump: finding check constraints for table "postgres.t9" pg_dump: finding the columns and types of table "postgres.t10" pg_dump: finding the columns and types of table "postgres.blog" pg_dump: finding default expressions of table "postgres.blog" pg_dump: finding the columns and types of table "postgres.class" pg_dump: finding the columns and types of table "postgres.books" pg_dump: finding the columns and types of table "postgres.person" pg_dump: finding the columns and types of table "postgres.sale_detail" pg_dump: finding the columns and types of table "postgres.sale_dtail_y2014m01" pg_dump: finding check constraints for table "postgres.sale_dtail_y2014m01" pg_dump: finding the columns and types of table "postgres.sale_dtail_y2014m02" pg_dump: finding check constraints for table "postgres.sale_dtail_y2014m02" pg_dump: finding the columns and types of table "postgres.sale_dtail_y2014m03" pg_dump: finding check constraints for table "postgres.sale_dtail_y2014m03" pg_dump: finding the columns and types of table "postgres.sale_dtail_y2014m04" pg_dump: finding check constraints for table "postgres.sale_dtail_y2014m04" pg_dump: finding the columns and types of table "postgres.sale_dtail_y2014m05" pg_dump: finding check constraints for table "postgres.sale_dtail_y2014m05" pg_dump: finding the columns and types of table "postgres.sale_dtail_y2014m05_2" pg_dump: finding check constraints for table "postgres.sale_dtail_y2014m05_2" pg_dump: finding the columns and types of table "postgres.student" pg_dump: finding the columns and types of table "postgres.score" pg_dump: finding the columns and types of table "postgres.log_drop_objects" pg_dump: finding the columns and types of table "postgres.contacts" pg_dump: flagging inherited columns in subtables pg_dump: reading indexes pg_dump: reading indexes for table "public.t" pg_dump: reading indexes for table "postgres.t6" pg_dump: reading indexes for table "postgres.t7" pg_dump: reading indexes for table "postgres.t8" pg_dump: reading indexes for table "postgres.t9" pg_dump: reading indexes for table "postgres.blog" pg_dump: reading indexes for table "postgres.class" pg_dump: reading indexes for table "postgres.student" pg_dump: reading indexes for table "postgres.contacts" pg_dump: flagging indexes in partitioned tables pg_dump: reading extended statistics pg_dump: reading constraints pg_dump: reading foreign key constraints for table "postgres.class" pg_dump: reading foreign key constraints for table "postgres.sale_detail" pg_dump: reading foreign key constraints for table "postgres.student" pg_dump: reading triggers pg_dump: reading triggers for table "postgres.class" pg_dump: reading triggers for table "postgres.sale_detail" pg_dump: reading triggers for table "postgres.student" pg_dump: reading rewrite rules pg_dump: reading policies pg_dump: reading row security enabled for table "public.t" pg_dump: reading policies for table "public.t" pg_dump: reading row security enabled for table "public.p1" pg_dump: reading policies for table "public.p1" pg_dump: reading row security enabled for table "public.t1" pg_dump: reading policies for table "public.t1" pg_dump: reading row security enabled for table "public.t2_id_seq" pg_dump: reading policies for table "public.t2_id_seq" pg_dump: reading row security enabled for table "public.t2" pg_dump: reading policies for table "public.t2" pg_dump: reading row security enabled for table "postgres.t4" pg_dump: reading policies for table "postgres.t4" pg_dump: reading row security enabled for table "schema2.t1" pg_dump: reading policies for table "schema2.t1" pg_dump: reading row security enabled for table "public.t5" pg_dump: reading policies for table "public.t5" pg_dump: reading row security enabled for table "postgres.t6" pg_dump: reading policies for table "postgres.t6" pg_dump: reading row security enabled for table "postgres.t7" pg_dump: reading policies for table "postgres.t7" pg_dump: reading row security enabled for table "postgres.t8" pg_dump: reading policies for table "postgres.t8" pg_dump: reading row security enabled for table "postgres.t9" pg_dump: reading policies for table "postgres.t9" pg_dump: reading row security enabled for table "postgres.t10" pg_dump: reading policies for table "postgres.t10" pg_dump: reading row security enabled for table "postgres.blog" pg_dump: reading policies for table "postgres.blog" pg_dump: reading row security enabled for table "postgres.class" pg_dump: reading policies for table "postgres.class" pg_dump: reading row security enabled for table "postgres.books" pg_dump: reading policies for table "postgres.books" pg_dump: reading row security enabled for table "postgres.person" pg_dump: reading policies for table "postgres.person" pg_dump: reading row security enabled for table "postgres.sale_detail" pg_dump: reading policies for table "postgres.sale_detail" pg_dump: reading row security enabled for table "postgres.sale_dtail_y2014m01" pg_dump: reading policies for table "postgres.sale_dtail_y2014m01" pg_dump: reading row security enabled for table "postgres.sale_dtail_y2014m02" pg_dump: reading policies for table "postgres.sale_dtail_y2014m02" pg_dump: reading row security enabled for table "postgres.sale_dtail_y2014m03" pg_dump: reading policies for table "postgres.sale_dtail_y2014m03" pg_dump: reading row security enabled for table "postgres.sale_dtail_y2014m04" pg_dump: reading policies for table "postgres.sale_dtail_y2014m04" pg_dump: reading row security enabled for table "postgres.sale_dtail_y2014m05" pg_dump: reading policies for table "postgres.sale_dtail_y2014m05" pg_dump: reading row security enabled for table "postgres.sale_dtail_y2014m05_2" pg_dump: reading policies for table "postgres.sale_dtail_y2014m05_2" pg_dump: reading row security enabled for table "postgres.student" pg_dump: reading policies for table "postgres.student" pg_dump: reading row security enabled for table "postgres.score" pg_dump: reading policies for table "postgres.score" pg_dump: reading row security enabled for table "postgres.log_drop_objects" pg_dump: reading policies for table "postgres.log_drop_objects" pg_dump: reading row security enabled for table "postgres.contacts" pg_dump: reading policies for table "postgres.contacts" pg_dump: reading publications pg_dump: reading publication membership pg_dump: reading publication membership for table "public.t" pg_dump: reading publication membership for table "public.p1" pg_dump: reading publication membership for table "public.t1" pg_dump: reading publication membership for table "public.t2" pg_dump: reading publication membership for table "postgres.t4" pg_dump: reading publication membership for table "schema2.t1" pg_dump: reading publication membership for table "public.t5" pg_dump: reading publication membership for table "postgres.t6" pg_dump: reading publication membership for table "postgres.t7" pg_dump: reading publication membership for table "postgres.t8" pg_dump: reading publication membership for table "postgres.t9" pg_dump: reading publication membership for table "postgres.t10" pg_dump: reading publication membership for table "postgres.blog" pg_dump: reading publication membership for table "postgres.class" pg_dump: reading publication membership for table "postgres.books" pg_dump: reading publication membership for table "postgres.person" pg_dump: reading publication membership for table "postgres.sale_detail" pg_dump: reading publication membership for table "postgres.sale_dtail_y2014m01" pg_dump: reading publication membership for table "postgres.sale_dtail_y2014m02" pg_dump: reading publication membership for table "postgres.sale_dtail_y2014m03" pg_dump: reading publication membership for table "postgres.sale_dtail_y2014m04" pg_dump: reading publication membership for table "postgres.sale_dtail_y2014m05" pg_dump: reading publication membership for table "postgres.sale_dtail_y2014m05_2" pg_dump: reading publication membership for table "postgres.student" pg_dump: reading publication membership for table "postgres.score" pg_dump: reading publication membership for table "postgres.log_drop_objects" pg_dump: reading publication membership for table "postgres.contacts" pg_dump: reading subscriptions pg_dump: reading large objects pg_dump: reading dependency data pg_dump: saving encoding = UTF8 pg_dump: saving standard_conforming_strings = on pg_dump: saving search_path = pg_dump: saving database definition pg_dump: creating DATABASE "db1" pg_dump: connecting to new database "db1" pg_dump: creating SCHEMA "postgres" pg_dump: creating SCHEMA "schema2" pg_dump: creating FUNCTION "postgres.abort_any_command()" pg_dump: creating FUNCTION "postgres.event_trigger_log_drop()" pg_dump: creating FUNCTION "postgres.sale_detail_insert_trigger()" pg_dump: creating FUNCTION "postgres.student_delete_trigger()" pg_dump: creating TABLE "postgres.blog" pg_dump: creating TABLE "postgres.books" pg_dump: creating TABLE "postgres.class" pg_dump: creating TABLE "postgres.contacts" pg_dump: creating TABLE "postgres.log_drop_objects" pg_dump: creating TABLE "postgres.person" pg_dump: creating TABLE "postgres.sale_detail" pg_dump: creating TABLE "postgres.sale_dtail_y2014m01" pg_dump: creating TABLE "postgres.sale_dtail_y2014m02" pg_dump: creating TABLE "postgres.sale_dtail_y2014m03" pg_dump: creating TABLE "postgres.sale_dtail_y2014m04" pg_dump: creating TABLE "postgres.sale_dtail_y2014m05" pg_dump: creating TABLE "postgres.sale_dtail_y2014m05_2" pg_dump: creating TABLE "postgres.score" pg_dump: creating TABLE "postgres.student" pg_dump: creating TABLE "postgres.t10" pg_dump: creating TABLE "postgres.t4" pg_dump: creating TABLE "postgres.t6" pg_dump: creating TABLE "postgres.t7" pg_dump: creating TABLE "postgres.t8" pg_dump: creating TABLE "postgres.t9" pg_dump: creating TABLE "public.p1" pg_dump: creating TABLE "public.t" pg_dump: creating TABLE "public.t1" pg_dump: creating TABLE "public.t2" pg_dump: creating SEQUENCE "public.t2_id_seq" pg_dump: creating SEQUENCE OWNED BY "public.t2_id_seq" pg_dump: creating TABLE "public.t5" pg_dump: creating TABLE "schema2.t1" pg_dump: creating DEFAULT "public.t2 id" pg_dump: processing data for table "postgres.blog" pg_dump: dumping contents of table "postgres.blog" pg_dump: processing data for table "postgres.books" pg_dump: dumping contents of table "postgres.books" pg_dump: processing data for table "postgres.class" pg_dump: dumping contents of table "postgres.class" pg_dump: processing data for table "postgres.contacts" pg_dump: dumping contents of table "postgres.contacts" pg_dump: processing data for table "postgres.log_drop_objects" pg_dump: dumping contents of table "postgres.log_drop_objects" pg_dump: processing data for table "postgres.person" pg_dump: dumping contents of table "postgres.person" pg_dump: processing data for table "postgres.sale_detail" pg_dump: dumping contents of table "postgres.sale_detail" pg_dump: processing data for table "postgres.sale_dtail_y2014m01" pg_dump: dumping contents of table "postgres.sale_dtail_y2014m01" pg_dump: processing data for table "postgres.sale_dtail_y2014m02" pg_dump: dumping contents of table "postgres.sale_dtail_y2014m02" pg_dump: processing data for table "postgres.sale_dtail_y2014m03" pg_dump: dumping contents of table "postgres.sale_dtail_y2014m03" pg_dump: processing data for table "postgres.sale_dtail_y2014m04" pg_dump: dumping contents of table "postgres.sale_dtail_y2014m04" pg_dump: processing data for table "postgres.sale_dtail_y2014m05" pg_dump: dumping contents of table "postgres.sale_dtail_y2014m05" pg_dump: processing data for table "postgres.sale_dtail_y2014m05_2" pg_dump: dumping contents of table "postgres.sale_dtail_y2014m05_2" pg_dump: processing data for table "postgres.score" pg_dump: dumping contents of table "postgres.score" pg_dump: processing data for table "postgres.student" pg_dump: dumping contents of table "postgres.student" pg_dump: processing data for table "postgres.t10" pg_dump: dumping contents of table "postgres.t10" pg_dump: processing data for table "postgres.t4" pg_dump: dumping contents of table "postgres.t4" pg_dump: processing data for table "postgres.t6" pg_dump: dumping contents of table "postgres.t6" pg_dump: processing data for table "postgres.t7" pg_dump: dumping contents of table "postgres.t7" pg_dump: processing data for table "postgres.t8" pg_dump: dumping contents of table "postgres.t8" pg_dump: processing data for table "postgres.t9" pg_dump: dumping contents of table "postgres.t9" pg_dump: processing data for table "public.p1" pg_dump: dumping contents of table "public.p1" pg_dump: processing data for table "public.t" pg_dump: dumping contents of table "public.t" pg_dump: processing data for table "public.t1" pg_dump: dumping contents of table "public.t1" pg_dump: processing data for table "public.t2" pg_dump: dumping contents of table "public.t2" pg_dump: processing data for table "public.t5" pg_dump: dumping contents of table "public.t5" pg_dump: processing data for table "schema2.t1" pg_dump: dumping contents of table "schema2.t1" pg_dump: executing SEQUENCE SET t2_id_seq pg_dump: creating CONSTRAINT "postgres.class class_pkey" pg_dump: creating CONSTRAINT "postgres.student student_pkey" pg_dump: creating CONSTRAINT "postgres.t6 t6_pkey" pg_dump: creating CONSTRAINT "postgres.t7 t7_pkey" pg_dump: creating CONSTRAINT "postgres.t9 t9_c1_c2_key" pg_dump: creating CONSTRAINT "postgres.t8 un_t8" pg_dump: creating CONSTRAINT "public.t t_pkey" pg_dump: creating INDEX "postgres.blog_ind1" pg_dump: creating INDEX "postgres.idx_contacts_id_new" pg_dump: creating TRIGGER "postgres.student delete_student_trigger" pg_dump: creating TRIGGER "postgres.sale_detail insert_sale_detail_tigger" pg_dump: creating ACL "SCHEMA public" pg_dump: creating ACL "public.TABLE p1" pg_dump: creating ACL "public.TABLE t" pg_dump: creating ACL "public.TABLE t1" pg_dump: creating ACL "public.TABLE t2" pg_dump: creating ACL "public.TABLE t5" pg_dump: creating DEFAULT ACL "public.DEFAULT PRIVILEGES FOR TABLES" pg_dumpall: dumping database "postgres" pg_dumpall: running ""/usr/pgsql-12/bin/pg_dump" -v -Fp ' dbname=postgres'" Password: --------------在此输入密码------------------ pg_dump: last built-in OID is 16383 pg_dump: reading extensions pg_dump: identifying extension members pg_dump: reading schemas pg_dump: reading user-defined tables pg_dump: reading user-defined functions pg_dump: reading user-defined types pg_dump: reading procedural languages pg_dump: reading user-defined aggregate functions pg_dump: reading user-defined operators pg_dump: reading user-defined access methods pg_dump: reading user-defined operator classes pg_dump: reading user-defined operator families pg_dump: reading user-defined text search parsers pg_dump: reading user-defined text search templates pg_dump: reading user-defined text search dictionaries pg_dump: reading user-defined text search configurations pg_dump: reading user-defined foreign-data wrappers pg_dump: reading user-defined foreign servers pg_dump: reading default privileges pg_dump: reading user-defined collations pg_dump: reading user-defined conversions pg_dump: reading type casts pg_dump: reading transforms pg_dump: reading table inheritance information pg_dump: reading event triggers pg_dump: finding extension tables pg_dump: finding inheritance relationships pg_dump: reading column info for interesting tables pg_dump: flagging inherited columns in subtables pg_dump: reading indexes pg_dump: flagging indexes in partitioned tables pg_dump: reading extended statistics pg_dump: reading constraints pg_dump: reading triggers pg_dump: reading rewrite rules pg_dump: reading policies pg_dump: reading publications pg_dump: reading publication membership pg_dump: reading subscriptions pg_dump: reading large objects pg_dump: reading dependency data pg_dump: saving encoding = UTF8 pg_dump: saving standard_conforming_strings = on pg_dump: saving search_path = pg_dump: implied data-only restore pg_dumpall: dumping database "tpcc001" pg_dumpall: running ""/usr/pgsql-12/bin/pg_dump" -v --create -Fp ' dbname=tpcc001'" Password: --------------在此输入密码------------------ pg_dump: last built-in OID is 16383 pg_dump: reading extensions pg_dump: identifying extension members pg_dump: reading schemas pg_dump: reading user-defined tables pg_dump: reading user-defined functions pg_dump: reading user-defined types pg_dump: reading procedural languages pg_dump: reading user-defined aggregate functions pg_dump: reading user-defined operators pg_dump: reading user-defined access methods pg_dump: reading user-defined operator classes pg_dump: reading user-defined operator families pg_dump: reading user-defined text search parsers pg_dump: reading user-defined text search templates pg_dump: reading user-defined text search dictionaries pg_dump: reading user-defined text search configurations pg_dump: reading user-defined foreign-data wrappers pg_dump: reading user-defined foreign servers pg_dump: reading default privileges pg_dump: reading user-defined collations pg_dump: reading user-defined conversions pg_dump: reading type casts pg_dump: reading transforms pg_dump: reading table inheritance information pg_dump: reading event triggers pg_dump: finding extension tables pg_dump: finding inheritance relationships pg_dump: reading column info for interesting tables pg_dump: finding the columns and types of table "public.a_dump" pg_dump: finding the columns and types of table "public.customer" pg_dump: finding the columns and types of table "public.d_dump" pg_dump: finding the columns and types of table "public.district" pg_dump: finding the columns and types of table "public.e_dump" pg_dump: finding the columns and types of table "public.history" pg_dump: finding the columns and types of table "public.item" pg_dump: finding the columns and types of table "public.j_dump" pg_dump: finding the columns and types of table "public.new_order" pg_dump: finding the columns and types of table "public.order_line" pg_dump: finding the columns and types of table "public.orders" pg_dump: finding the columns and types of table "public.stock" pg_dump: finding the columns and types of table "public.warehouse" pg_dump: finding the columns and types of table "tpcc001.table1" pg_dump: flagging inherited columns in subtables pg_dump: reading indexes pg_dump: reading indexes for table "public.customer" pg_dump: reading indexes for table "public.district" pg_dump: reading indexes for table "public.item" pg_dump: reading indexes for table "public.new_order" pg_dump: reading indexes for table "public.order_line" pg_dump: reading indexes for table "public.orders" pg_dump: reading indexes for table "public.stock" pg_dump: reading indexes for table "public.warehouse" pg_dump: flagging indexes in partitioned tables pg_dump: reading extended statistics pg_dump: reading constraints pg_dump: reading triggers pg_dump: reading rewrite rules pg_dump: reading policies pg_dump: reading row security enabled for table "public.a_dump" pg_dump: reading policies for table "public.a_dump" pg_dump: reading row security enabled for table "public.customer" pg_dump: reading policies for table "public.customer" pg_dump: reading row security enabled for table "public.d_dump" pg_dump: reading policies for table "public.d_dump" pg_dump: reading row security enabled for table "public.district" pg_dump: reading policies for table "public.district" pg_dump: reading row security enabled for table "public.e_dump" pg_dump: reading policies for table "public.e_dump" pg_dump: reading row security enabled for table "public.history" pg_dump: reading policies for table "public.history" pg_dump: reading row security enabled for table "public.item" pg_dump: reading policies for table "public.item" pg_dump: reading row security enabled for table "public.j_dump" pg_dump: reading policies for table "public.j_dump" pg_dump: reading row security enabled for table "public.new_order" pg_dump: reading policies for table "public.new_order" pg_dump: reading row security enabled for table "public.order_line" pg_dump: reading policies for table "public.order_line" pg_dump: reading row security enabled for table "public.orders" pg_dump: reading policies for table "public.orders" pg_dump: reading row security enabled for table "public.stock" pg_dump: reading policies for table "public.stock" pg_dump: reading row security enabled for table "public.warehouse" pg_dump: reading policies for table "public.warehouse" pg_dump: reading row security enabled for table "tpcc001.table1" pg_dump: reading policies for table "tpcc001.table1" pg_dump: reading publications pg_dump: reading publication membership pg_dump: reading publication membership for table "public.a_dump" pg_dump: reading publication membership for table "public.customer" pg_dump: reading publication membership for table "public.d_dump" pg_dump: reading publication membership for table "public.district" pg_dump: reading publication membership for table "public.e_dump" pg_dump: reading publication membership for table "public.history" pg_dump: reading publication membership for table "public.item" pg_dump: reading publication membership for table "public.j_dump" pg_dump: reading publication membership for table "public.new_order" pg_dump: reading publication membership for table "public.order_line" pg_dump: reading publication membership for table "public.orders" pg_dump: reading publication membership for table "public.stock" pg_dump: reading publication membership for table "public.warehouse" pg_dump: reading publication membership for table "tpcc001.table1" pg_dump: reading subscriptions pg_dump: reading large objects pg_dump: reading dependency data pg_dump: saving encoding = UTF8 pg_dump: saving standard_conforming_strings = on pg_dump: saving search_path = pg_dump: saving database definition pg_dump: creating DATABASE "tpcc001" pg_dump: connecting to new database "tpcc001" pg_dump: creating SCHEMA "tpcc001" pg_dump: creating FUNCTION "public.dbms_random(integer, integer)" pg_dump: creating FUNCTION "public.delivery(integer, integer)" pg_dump: creating FUNCTION "public.neword(integer, integer, integer, integer, integer, integer)" pg_dump: creating FUNCTION "public.ostat(integer, integer, integer, integer, character varying)" pg_dump: creating FUNCTION "public.payment(integer, integer, integer, integer, numeric, integer, numeric, character varying, character varying, numeric)" pg_dump: creating PROCEDURE "public.pg_dump_test()" pg_dump: creating FUNCTION "public.slev(integer, integer, integer)" pg_dump: creating TABLE "public.a_dump" pg_dump: creating TABLE "public.customer" pg_dump: creating TABLE "public.d_dump" pg_dump: creating TABLE "public.district" pg_dump: creating TABLE "public.e_dump" pg_dump: creating TABLE "public.history" pg_dump: creating TABLE "public.item" pg_dump: creating TABLE "public.j_dump" pg_dump: creating TABLE "public.new_order" pg_dump: creating TABLE "public.order_line" pg_dump: creating TABLE "public.orders" pg_dump: creating TABLE "public.stock" pg_dump: creating TABLE "public.warehouse" pg_dump: creating TABLE "tpcc001.table1" pg_dump: processing data for table "public.a_dump" pg_dump: dumping contents of table "public.a_dump" pg_dump: processing data for table "public.customer" pg_dump: dumping contents of table "public.customer" pg_dump: processing data for table "public.d_dump" pg_dump: dumping contents of table "public.d_dump" pg_dump: processing data for table "public.district" pg_dump: dumping contents of table "public.district" pg_dump: processing data for table "public.e_dump" pg_dump: dumping contents of table "public.e_dump" pg_dump: processing data for table "public.history" pg_dump: dumping contents of table "public.history" pg_dump: processing data for table "public.item" pg_dump: dumping contents of table "public.item" pg_dump: processing data for table "public.j_dump" pg_dump: dumping contents of table "public.j_dump" pg_dump: processing data for table "public.new_order" pg_dump: dumping contents of table "public.new_order" pg_dump: processing data for table "public.order_line" pg_dump: dumping contents of table "public.order_line" pg_dump: processing data for table "public.orders" pg_dump: dumping contents of table "public.orders" pg_dump: processing data for table "public.stock" pg_dump: dumping contents of table "public.stock" pg_dump: processing data for table "public.warehouse" pg_dump: dumping contents of table "public.warehouse" pg_dump: processing data for table "tpcc001.table1" pg_dump: dumping contents of table "tpcc001.table1" pg_dump: creating CONSTRAINT "public.customer customer_i1" pg_dump: creating CONSTRAINT "public.district district_i1" pg_dump: creating CONSTRAINT "public.item item_i1" pg_dump: creating CONSTRAINT "public.new_order new_order_i1" pg_dump: creating CONSTRAINT "public.order_line order_line_i1" pg_dump: creating CONSTRAINT "public.orders orders_i1" pg_dump: creating CONSTRAINT "public.stock stock_i1" pg_dump: creating CONSTRAINT "public.warehouse warehouse_i1" pg_dump: creating INDEX "public.customer_i2" pg_dump: creating INDEX "public.orders_i2" pg_dumpall: dumping database "tpcc002" pg_dumpall: running ""/usr/pgsql-12/bin/pg_dump" -v --create -Fp ' dbname=tpcc002'" Password: --------------在此输入密码------------------ pg_dump: last built-in OID is 16383 pg_dump: reading extensions pg_dump: identifying extension members pg_dump: reading schemas pg_dump: reading user-defined tables pg_dump: reading user-defined functions pg_dump: reading user-defined types pg_dump: reading procedural languages pg_dump: reading user-defined aggregate functions pg_dump: reading user-defined operators pg_dump: reading user-defined access methods pg_dump: reading user-defined operator classes pg_dump: reading user-defined operator families pg_dump: reading user-defined text search parsers pg_dump: reading user-defined text search templates pg_dump: reading user-defined text search dictionaries pg_dump: reading user-defined text search configurations pg_dump: reading user-defined foreign-data wrappers pg_dump: reading user-defined foreign servers pg_dump: reading default privileges pg_dump: reading user-defined collations pg_dump: reading user-defined conversions pg_dump: reading type casts pg_dump: reading transforms pg_dump: reading table inheritance information pg_dump: reading event triggers pg_dump: finding extension tables pg_dump: finding inheritance relationships pg_dump: reading column info for interesting tables pg_dump: finding the columns and types of table "public.customer" pg_dump: finding the columns and types of table "public.district" pg_dump: finding the columns and types of table "public.history" pg_dump: finding the columns and types of table "public.item" pg_dump: finding the columns and types of table "public.warehouse" pg_dump: finding the columns and types of table "public.stock" pg_dump: finding the columns and types of table "public.new_order" pg_dump: finding the columns and types of table "public.orders" pg_dump: finding the columns and types of table "public.order_line" pg_dump: flagging inherited columns in subtables pg_dump: reading indexes pg_dump: reading indexes for table "public.customer" pg_dump: reading indexes for table "public.district" pg_dump: reading indexes for table "public.item" pg_dump: reading indexes for table "public.warehouse" pg_dump: reading indexes for table "public.stock" pg_dump: reading indexes for table "public.new_order" pg_dump: reading indexes for table "public.orders" pg_dump: reading indexes for table "public.order_line" pg_dump: flagging indexes in partitioned tables pg_dump: reading extended statistics pg_dump: reading constraints pg_dump: reading triggers pg_dump: reading rewrite rules pg_dump: reading policies pg_dump: reading row security enabled for table "public.customer" pg_dump: reading policies for table "public.customer" pg_dump: reading row security enabled for table "public.district" pg_dump: reading policies for table "public.district" pg_dump: reading row security enabled for table "public.history" pg_dump: reading policies for table "public.history" pg_dump: reading row security enabled for table "public.item" pg_dump: reading policies for table "public.item" pg_dump: reading row security enabled for table "public.warehouse" pg_dump: reading policies for table "public.warehouse" pg_dump: reading row security enabled for table "public.stock" pg_dump: reading policies for table "public.stock" pg_dump: reading row security enabled for table "public.new_order" pg_dump: reading policies for table "public.new_order" pg_dump: reading row security enabled for table "public.orders" pg_dump: reading policies for table "public.orders" pg_dump: reading row security enabled for table "public.order_line" pg_dump: reading policies for table "public.order_line" pg_dump: reading publications pg_dump: reading publication membership pg_dump: reading publication membership for table "public.customer" pg_dump: reading publication membership for table "public.district" pg_dump: reading publication membership for table "public.history" pg_dump: reading publication membership for table "public.item" pg_dump: reading publication membership for table "public.warehouse" pg_dump: reading publication membership for table "public.stock" pg_dump: reading publication membership for table "public.new_order" pg_dump: reading publication membership for table "public.orders" pg_dump: reading publication membership for table "public.order_line" pg_dump: reading subscriptions pg_dump: reading large objects pg_dump: reading dependency data pg_dump: saving encoding = UTF8 pg_dump: saving standard_conforming_strings = on pg_dump: saving search_path = pg_dump: saving database definition pg_dump: creating DATABASE "tpcc002" pg_dump: connecting to new database "tpcc002" pg_dump: creating FUNCTION "public.dbms_random(integer, integer)" pg_dump: creating FUNCTION "public.delivery(integer, integer)" pg_dump: creating FUNCTION "public.neword(integer, integer, integer, integer, integer, integer)" pg_dump: creating FUNCTION "public.ostat(integer, integer, integer, integer, character varying)" pg_dump: creating FUNCTION "public.payment(integer, integer, integer, integer, numeric, integer, numeric, character varying, character varying, numeric)" pg_dump: creating FUNCTION "public.slev(integer, integer, integer)" pg_dump: creating TABLE "public.customer" pg_dump: creating TABLE "public.district" pg_dump: creating TABLE "public.history" pg_dump: creating TABLE "public.item" pg_dump: creating TABLE "public.new_order" pg_dump: creating TABLE "public.order_line" pg_dump: creating TABLE "public.orders" pg_dump: creating TABLE "public.stock" pg_dump: creating TABLE "public.warehouse" pg_dump: processing data for table "public.customer" pg_dump: dumping contents of table "public.customer" pg_dump: processing data for table "public.district" pg_dump: dumping contents of table "public.district" pg_dump: processing data for table "public.history" pg_dump: dumping contents of table "public.history" pg_dump: processing data for table "public.item" pg_dump: dumping contents of table "public.item" pg_dump: processing data for table "public.new_order" pg_dump: dumping contents of table "public.new_order" pg_dump: processing data for table "public.order_line" pg_dump: dumping contents of table "public.order_line" pg_dump: processing data for table "public.orders" pg_dump: dumping contents of table "public.orders" pg_dump: processing data for table "public.stock" pg_dump: dumping contents of table "public.stock" pg_dump: processing data for table "public.warehouse" pg_dump: dumping contents of table "public.warehouse" pg_dump: creating CONSTRAINT "public.customer customer_i1" pg_dump: creating CONSTRAINT "public.district district_i1" pg_dump: creating CONSTRAINT "public.item item_i1" pg_dump: creating CONSTRAINT "public.new_order new_order_i1" pg_dump: creating CONSTRAINT "public.order_line order_line_i1" pg_dump: creating CONSTRAINT "public.orders orders_i1" pg_dump: creating CONSTRAINT "public.stock stock_i1" pg_dump: creating CONSTRAINT "public.warehouse warehouse_i1" pg_dump: creating INDEX "public.customer_i2" pg_dump: creating INDEX "public.orders_i2" |