Re: Pgstattuple on Sequences: Seeking Community Feedback on Potential Patch
Nathan Bossart <nathandbossart@gmail.com>
From: Nathan Bossart <nathandbossart@gmail.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Ayush Vatsa <ayushvatsa1810@gmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>, michael@paquier.xyz
Date: 2024-08-26T18:14:28Z
Lists: pgsql-hackers
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
Commits
-
Fix contrib/pageinspect's test for sequences.
- ef46a73f6941 13.17 landed
- e0277d90acf6 12.21 landed
- a63aef5e496c 15.9 landed
- 9b3c3c0fc206 17.0 landed
- 70d1c664f437 18.0 landed
- 0970889e352c 14.14 landed
- 0938a4ecda33 16.5 landed
-
Reintroduce support for sequences in pgstattuple and pageinspect.
- e03042a7003d 15.9 landed
- dd5670fa549e 12.21 landed
- ca902529cc0f 13.17 landed
- 8a94af8a2d0f 14.14 landed
- 6ea7f04b7366 17.0 landed
- 2bd4c06bba8c 16.5 landed
- 05036a3155c1 18.0 landed
-
Only allow heap in a number of contrib modules.
- 4b82664156c2 12.0 cited