pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedMissed TidRangePath in the print_path switch
2+ messages / 2 participants
[nested] [flat]
* Missed TidRangePath in the print_path switch
@ 2023-09-28 05:07 Andrey Lepikhov <a.lepikhov@postgrespro.ru>
0 siblings, 1 reply; 2+ messages in thread
From: Andrey Lepikhov @ 2023-09-28 05:07 UTC (permalink / raw)
To: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>; David Rowley <dgrowleyml@gmail.com>
Hi,
The TidRangePath node was introduced three years ago. However, path
printing machinery still does not support it. It isn't enjoyable to add
this string of code each time. I suggest adding it now.
Also, I propose not printing "???path" in the default case but throwing
a warning - see the patch in the attachment. It can help to avoid such
slip-ups next time.
It generally makes sense to generate such long switches automatically,
likewise nodeToString.
--
regards,
Andrey Lepikhov
Postgres Professional
diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c
index 9bdc70c702..b0ed69d2f8 100644
--- a/src/backend/optimizer/path/allpaths.c
+++ b/src/backend/optimizer/path/allpaths.c
@@ -4470,6 +4470,9 @@ print_path(PlannerInfo *root, Path *path, int indent)
case T_TidPath:
ptype = "TidScan";
break;
+ case T_TidRangePath:
+ ptype = "TidRangePath";
+ break;
case T_SubqueryScanPath:
ptype = "SubqueryScan";
break;
@@ -4578,7 +4581,8 @@ print_path(PlannerInfo *root, Path *path, int indent)
subpath = ((LimitPath *) path)->subpath;
break;
default:
- ptype = "???Path";
+ elog(WARNING, "could not print unrecognized node type: %d",
+ (int) nodeTag(path));
break;
}
Attachments:
[text/plain] tidrangepath.patch (750B, ../../379082d6-1b6a-4cd6-9ecf-7157d8c08635@postgrespro.ru/2-tidrangepath.patch)
download | inline diff:
diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c
index 9bdc70c702..b0ed69d2f8 100644
--- a/src/backend/optimizer/path/allpaths.c
+++ b/src/backend/optimizer/path/allpaths.c
@@ -4470,6 +4470,9 @@ print_path(PlannerInfo *root, Path *path, int indent)
case T_TidPath:
ptype = "TidScan";
break;
+ case T_TidRangePath:
+ ptype = "TidRangePath";
+ break;
case T_SubqueryScanPath:
ptype = "SubqueryScan";
break;
@@ -4578,7 +4581,8 @@ print_path(PlannerInfo *root, Path *path, int indent)
subpath = ((LimitPath *) path)->subpath;
break;
default:
- ptype = "???Path";
+ elog(WARNING, "could not print unrecognized node type: %d",
+ (int) nodeTag(path));
break;
}
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Missed TidRangePath in the print_path switch
@ 2023-09-28 10:33 David Rowley <dgrowleyml@gmail.com>
parent: Andrey Lepikhov <a.lepikhov@postgrespro.ru>
0 siblings, 0 replies; 2+ messages in thread
From: David Rowley @ 2023-09-28 10:33 UTC (permalink / raw)
To: Andrey Lepikhov <a.lepikhov@postgrespro.ru>; +Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
On Thu, 28 Sept 2023 at 18:07, Andrey Lepikhov
<a.lepikhov@postgrespro.ru> wrote:
> The TidRangePath node was introduced three years ago. However, path
> printing machinery still does not support it. It isn't enjoyable to add
> this string of code each time. I suggest adding it now.
> Also, I propose not printing "???path" in the default case but throwing
> a warning - see the patch in the attachment. It can help to avoid such
> slip-ups next time.
> It generally makes sense to generate such long switches automatically,
> likewise nodeToString.
Thanks for the report and patch.
I'll push the fix shortly. I'll leave off the WARNING thing for now.
Perhaps an Assert would draw more attention to the correct people. We
can debate that later as a master only change.
David
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2023-09-28 10:33 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-09-28 05:07 Missed TidRangePath in the print_path switch Andrey Lepikhov <a.lepikhov@postgrespro.ru>
2023-09-28 10:33 ` David Rowley <dgrowleyml@gmail.com>
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