pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathandbossart@gmail.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Ayush Vatsa <ayushvatsa1810@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Cc: michael@paquier.xyz
Subject: Re: Pgstattuple on Sequences: Seeking Community Feedback on Potential Patch
Date: Mon, 26 Aug 2024 13:14:28 -0500
Message-ID: <ZszGBMK1D4hCsRnD@nathan> (raw)
In-Reply-To: <CA+TgmoYm0X=KuHry1A6prNzf3pUmAcXYgQEr25kCY8jSMJaVjg@mail.gmail.com>
References: <CACX+KaP3i+i9tdPLjF5JCHVv93xobEdcd_eB+638VDvZ3i=cQA@mail.gmail.com>
	<Zsy6w_yW2QKYSo_m@nathan>
	<CA+TgmoYm0X=KuHry1A6prNzf3pUmAcXYgQEr25kCY8jSMJaVjg@mail.gmail.com>

On Mon, Aug 26, 2024 at 01:35:52PM -0400, Robert Haas wrote:
> On Mon, Aug 26, 2024 at 1:26 PM Nathan Bossart <nathandbossart@gmail.com> wrote:
>> While it is apparently pretty uncommon to use pgstattuple on sequences,
>> this is arguably a bug that should be fixed and back-patched.
> 
> I don't understand what would make it a bug.
> 
>> IMHO it would be good to establish some level of consistency here.
> 
> Sure, consistency is good, all other things being equal, but just
> saying "well this used to work one way and now it works another way"
> isn't enough to say that there is a bug, or that something should be
> changed.

The reason I think it's arguably a bug is because it used to work fine and
then started ERROR-ing after commit 4b82664.  I'm fine with saying that we
don't think it's useful and intentionally deprecating it, but AFAICT no
such determination has been made.  I see no discussion about this on the
thread for commit 4b82664, and the only caller of pgstat_heap()
intentionally calls into the affected function for sequences (and has since
pgstattuple was introduced 18 years ago):

	if (RELKIND_HAS_TABLE_AM(rel->rd_rel->relkind) ||
		rel->rd_rel->relkind == RELKIND_SEQUENCE)
	{
		return pgstat_heap(rel, fcinfo);
	}

-- 
nathan





view thread (29+ messages)  latest in thread

Message-ID: <ZszGBMK1D4hCsRnD@nathan>
Permalink:  ../ZszGBMK1D4hCsRnD@nathan/
Also on:    postgresql.org/message-id/ZszGBMK1D4hCsRnD@nathan

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: nathandbossart@gmail.com, robertmhaas@gmail.com, ayushvatsa1810@gmail.com, michael@paquier.xyz
  Subject: Re: Pgstattuple on Sequences: Seeking Community Feedback on Potential Patch
  In-Reply-To: <ZszGBMK1D4hCsRnD@nathan>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox