From: | jian he <jian(dot)universality(at)gmail(dot)com> |
---|---|
To: | Mahendra Singh Thalor <mahi6run(at)gmail(dot)com> |
Cc: | Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Guillaume Lelarge <guillaume(at)lelarge(dot)info>, Nathan Bossart <nathandbossart(at)gmail(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Dilip Kumar <dilipbalaut(at)gmail(dot)com> |
Subject: | Re: Non-text mode for pg_dumpall |
Date: | 2025-01-23 09:28:36 |
Message-ID: | CACJufxEFxaiqytZRpL0Xbj8_XEtTm8-A2FE6u_9vigGO3z5oZQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
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.
Attachment | Content-Type | Size |
---|---|---|
v11-0002-minor-coesmetic-change-not-in-pg_restore.c.no-cfbot | application/octet-stream | 2.1 KB |
v11-0004-preliminary-work-for-pg_restore-exclude-datab.no-cfbot | application/octet-stream | 8.7 KB |
v11-0001-move-expand_dbname_patterns-to-common_dumpall.no-cfbot | application/octet-stream | 5.4 KB |
v11-0003-minor-coesmetic-change-in-pg_restore.c.no-cfbot | application/octet-stream | 5.2 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Bertrand Drouvot | 2025-01-23 09:57:50 | Re: per backend WAL statistics |
Previous Message | Sutou Kouhei | 2025-01-23 09:12:10 | Re: Make COPY format extendable: Extract COPY TO format implementations |