Reducing the maintenance overhead of test_oat_hooks

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Reducing the maintenance overhead of test_oat_hooks
Date: 2022-07-30 22:08:48
Message-ID: 843818.1659218928@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I've been annoyed several times lately by having to update
the list of node types embodied in test_oat_hooks.c's
nodetag_to_string(). I got around to looking at that more
closely, and realized that it is only used for utility
statements, which (a) are a very small subset of the node
types that that function knows about, and (b) we already
have a mechanism to get string identifiers for, and (c)
those identifiers are already standard parts of our user API,
unlike the strings exposed by nodetag_to_string(). I do not
think that test_oat_hooks.c has any business imposing
an extra maintenance burden on us all, so I propose
nuking nodetag_to_string() from orbit, as attached.

(Incidentally, this improves test_oat_hooks's own
reported code coverage from 14.0% to 76.1%, because
so much of that switch is dead code.)

regards, tom lane

Attachment Content-Type Size
remove-nodetag_to_string.patch text/x-diff 48.4 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2022-07-30 23:08:01 Re: standby recovery fails (tablespace related) (tentative patch and discussion)
Previous Message Tom Lane 2022-07-30 21:32:57 Re: add test: pg_rowlocks extension