From: | Andrew Bille <andrewbille(at)gmail(dot)com> |
---|---|
To: | Nathan Bossart <nathandbossart(at)gmail(dot)com> |
Cc: | pgsql-bugs(at)lists(dot)postgresql(dot)org |
Subject: | Re: BUG #19086: pg_dump --data-only selects and do not uses index definitions for the dumped tables. |
Date: | 2025-10-15 02:21:05 |
Message-ID: | CAJnzaryHjaF9WX0eHaKHM-DnV_5z8osC5hL9jyVeoVgjt3dXkA@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
> Is this a hypothetical problem or something you've experienced?
The problem is real: when trying to rescue data from a large corrupted
database, we couldn't wait for the index definition query for more than 3
hours.
On Wed, Oct 15, 2025 at 2:36 AM Nathan Bossart <nathandbossart(at)gmail(dot)com>
wrote:
> On Tue, Oct 14, 2025 at 08:13:52AM +0000, PG Bug reporting form wrote:
> > In case of system indexes corruption the collecting of index definitions
> can
> > take a really long time.
>
> I don't think this qualifies as a bug, but avoiding pg_dump queries when
> possible seems like a good idea. Is this a hypothetical problem or
> something you've experienced?
>
> > - pg_log_info("reading indexes");
> > - getIndexes(fout, tblinfo, numTables);
> > + if (!dataOnly)
> > + {
> > + pg_log_info("reading indexes");
> > + getIndexes(fout, tblinfo, numTables);
> >
> > - pg_log_info("flagging indexes in partitioned tables");
> > - flagInhIndexes(fout, tblinfo, numTables);
> > + pg_log_info("flagging indexes in partitioned tables");
> > + flagInhIndexes(fout, tblinfo, numTables);
> > + }
>
> I think we ordinarily leave it up to the get*() functions to return early.
> For example, getPartitioningInfo() has this near the top:
>
> /* needn't bother if not dumping data */
> if (!fout->dopt->dumpData)
> return;
>
> Also, we need to be certain that nothing getIndexes() gathers is ever used
> for --data-only dumps. That seems plausible, but I haven't looked closely.
>
> --
> nathan
>
From | Date | Subject | |
---|---|---|---|
Next Message | John Naylor | 2025-10-15 02:30:06 | Re: BUG #19080: CancelRequest message documentation bug |
Previous Message | David Rowley | 2025-10-14 23:56:25 | Re: BUG #19086: pg_dump --data-only selects and do not uses index definitions for the dumped tables. |