Re: [Proposal] Allow users to specify multiple tables in VACUUM commands

From: "Bossart, Nathan" <bossartn(at)amazon(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: [Proposal] Allow users to specify multiple tables in VACUUM commands
Date: 2017-09-12 04:40:00
Views: Raw Message | Whole Thread | Download mbox
Lists: pgsql-hackers

On 9/11/17, 9:28 PM, "Michael Paquier" <michael(dot)paquier(at)gmail(dot)com> wrote:
> + if (include_parts)
> + {
> + List *partition_oids = find_all_inheritors(relid, NoLock, NULL);
> + ListCell *part_lc;
> + foreach(part_lc, partition_oids)
> + {
> + VacuumRelation *tmp = copyObject(relinfo);
> + Oid part_oid = lfirst_oid(part_lc);
> + tmp->oid = part_oid;
> + vacrels_tmp = lappend(vacrels_tmp, tmp);
> + }
> + }
> I thought that you would have changed that as well, but that's not
> completely complete... In my opinion, HEAD is wrong in using the same
> RangeVar for error reporting for a parent table and its partitions, so
> that's not completely the fault of your patch. But I think that as
> this patch makes vacuum routines smarter, you should create a new
> RangeVar using makeRangeVar as you hold the OID of the child partition
> in this code path. This would allow error reports to actually use the
> data of the partition saved here instead of the parent data.

Good catch. I had missed this. It is added in v17.


Attachment Content-Type Size
error_on_duplicate_columns_in_analyze_v4.patch application/octet-stream 6.1 KB
vacuum_multiple_tables_v17.patch application/octet-stream 34.3 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2017-09-12 04:41:53 Re: Support to COMMENT ON DATABASE CURRENT_DATABASE
Previous Message Kyotaro HORIGUCHI 2017-09-12 04:14:41 Re: WAL logging problem in 9.4.3?