From: | Noah Misch <noah(at)leadboat(dot)com> |
---|---|
To: | Mahendra Singh Thalor <mahi6run(at)gmail(dot)com> |
Cc: | Andrew Dunstan <andrew(at)dunslane(dot)net>, Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, jian he <jian(dot)universality(at)gmail(dot)com>, Srinath Reddy <srinath2133(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Re: Non-text mode for pg_dumpall |
Date: | 2025-07-24 17:50:36 |
Message-ID: | 20250724175036.22.nmisch@google.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Thu, Jul 17, 2025 at 03:46:41PM +0530, Mahendra Singh Thalor wrote:
> On Wed, 16 Jul 2025 at 05:50, Noah Misch <noah(at)leadboat(dot)com> wrote:
> > On Thu, Jul 10, 2025 at 12:21:03AM +0530, Mahendra Singh Thalor wrote:
> > > On Wed, 9 Jul 2025 at 02:58, Noah Misch <noah(at)leadboat(dot)com> wrote:
> > > > On Fri, Apr 04, 2025 at 04:11:05PM -0400, Andrew Dunstan wrote:
> > > > > +/*
> > > > > + * get_dbnames_list_to_restore
> > > > > + *
> > > > > + * This will mark for skipping any entries from dbname_oid_list that pattern match an
> > > > > + * entry in the db_exclude_patterns list.
> > > > > + *
> > > > > + * Returns the number of database to be restored.
> > > > > + *
> > > > > + */
> > > > > +static int
> > > > > +get_dbnames_list_to_restore(PGconn *conn,
> > > > > + SimpleOidStringList *dbname_oid_list,
> > > > > + SimpleStringList db_exclude_patterns)
> > > > > +{
> > > > > + int count_db = 0;
> > > > > + PQExpBuffer query;
> > > > > + PGresult *res;
> > > > > +
> > > > > + query = createPQExpBuffer();
> > > > > +
> > > > > + if (!conn)
> > > > > + pg_log_info("considering PATTERN as NAME for --exclude-database option as no db connection while doing pg_restore.");
> > > >
> > > > When do we not have a connection here? We'd need to document this behavior
> > > > variation if it stays, but I'd prefer if we can just rely on having a
> > > > connection.
> > >
> > > Yes, we can document this behavior.
> >
> > My review asked a question there. I don't see an answer to that question.
> > Would you answer that question?
>
> Example: if there is no active database, even postgres/template1, then
> we will consider PATTEREN as NAME. This is the rare case.
> In attached patch, I added one doc line also for this case.
If I change s/pg_log_info/pg_fatal/, check-world still passes. So no test is
reaching the !conn case. If one wanted to write a test that reaches the !conn
test, how would they do that?
From | Date | Subject | |
---|---|---|---|
Next Message | Robert Haas | 2025-07-24 17:58:14 | synchronous_standby_names parser discards errors |
Previous Message | Robert Haas | 2025-07-24 17:50:17 | Re: roles management problem after upgrading in PG 17 |