Re: Statistics Import and Export

From: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: jian he <jian(dot)universality(at)gmail(dot)com>, Jeff Davis <pgsql(at)j-davis(dot)com>, Nathan Bossart <nathandbossart(at)gmail(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Magnus Hagander <magnus(at)hagander(dot)net>, Stephen Frost <sfrost(at)snowman(dot)net>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, alvherre(at)alvh(dot)no-ip(dot)org, Noah Misch <noah(at)leadboat(dot)com>
Subject: Re: Statistics Import and Export
Date: 2025-01-20 21:26:02
Message-ID: CADkLM=fOpRjuoLq=ZtiVzKAiLuS6RG7b=ROf1YxjV6mgJNc3vQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Jan 18, 2025 at 7:45 PM Michael Paquier <michael(at)paquier(dot)xyz> wrote:

> On Sun, Jan 19, 2025 at 01:00:04AM +0800, jian he wrote:
> > On Fri, Jan 17, 2025 at 10:20 PM jian he <jian(dot)universality(at)gmail(dot)com>
> wrote:
> >> dump and execute the above query generated a warning
> >> WARNING: missing lock for relation "tenk1_hundred" (OID 18431,
> >> relkind i) @ TID (15,34)
> >
> > This seems to be an existing issue.
> > For pg_restore_relation_stats, we don't have regress tests for index
> relation.
> > I am not sure the WARNING is ok.
>
> This is not OK based on the rules introduced by Noah at aac2c9b4fde8.
> check_lock_if_inplace_updateable_rel() expects a lock to be taken.
> Note that elog() are used when reports should never be user-facing,
> for states that should not be reachable.
> --
> Michael
>

Here's a patch that

Attached is the patch, along with the regression test output prior to the
change to stat_utils.c.

Other pg_dump work has been left out of v39 to focus on this.

Attachment Content-Type Size
regression.diffs application/octet-stream 623 bytes
v39-0001-Lock-table-first-when-setting-index-relation-sta.patch text/x-patch 4.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2025-01-20 21:33:40 Re: XMLDocument (SQL/XML X030)
Previous Message Tom Lane 2025-01-20 21:16:35 Re: [PATCH] Add roman support for to_number function