Re: Non-text mode for pg_dumpall
jian he <jian.universality@gmail.com>
From: jian he <jian.universality@gmail.com>
To: Mahendra Singh Thalor <mahi6run@gmail.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>,
Guillaume Lelarge <guillaume@lelarge.info>, Nathan Bossart <nathandbossart@gmail.com>,
Magnus Hagander <magnus@hagander.net>, Tom Lane <tgl@sss.pgh.pa.us>, Andrew Dunstan <andrew@dunslane.net>, PostgreSQL-development <pgsql-hackers@postgresql.org>,
Dilip Kumar <dilipbalaut@gmail.com>
Date: 2025-01-23T09:28:36Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Add non-text output formats to pg_dumpall
- 763aaa06f034 19 (unreleased) landed
-
Improve pg_dump/pg_dumpall help synopses and terminology
- dec6643487bb 18.0 cited
-
Non text modes for pg_dumpall, correspondingly change pg_restore
- 1495eff7bdb0 18.0 landed
-
Doc: manually break lines in wide UUID examples.
- a6524105d20b 18.0 cited
Attachments
- v11-0002-minor-coesmetic-change-not-in-pg_restore.c.no-cfbot (application/octet-stream)
- v11-0004-preliminary-work-for-pg_restore-exclude-datab.no-cfbot (application/octet-stream)
- v11-0001-move-expand_dbname_patterns-to-common_dumpall.no-cfbot (application/octet-stream)
- v11-0003-minor-coesmetic-change-in-pg_restore.c.no-cfbot (application/octet-stream)
hi.
The four patches attached are to solve the
TODO1: We need to think for --exclude-database=PATTERN for pg_restore.
it is based on your v11_pg_dumpall-with-directory-tar-custom-format-21-jan.patch
0001. pg_dumpall --exclude-database=PATTERN already works,
main function resolve pattern matching is expand_dbname_patterns.
make it an extern function, so pg_restore --exclude-database can also use it.
0002 cosmetic code changes not in pg_restore.c
0003 cosmetic code changes in pg_restore.c
0004 fully implement pg_restore --exclude-database=PATTERN
similar to pg_dumpall.c
declare two file static variables:
static SimpleStringList database_exclude_names = {NULL, NULL};
static SimpleStringList db_exclude_patterns = {NULL, NULL};
I also deleted the function is_full_pattern.
I use
$BIN10/pg_restore --exclude-database=*x* --exclude-database=*s*
--exclude-database=*t* --verbose --file=test.sql x1.dump
the verbose message to verify my changes.