public inbox for [email protected]  
help / color / mirror / Atom feed
Cleanup explain_memoize function after test
3+ messages / 3 participants
[nested] [flat]

* Cleanup explain_memoize function after test
@ 2026-04-22 06:49 Kirill Reshke <[email protected]>
  2026-04-22 09:24 ` Re: Cleanup explain_memoize function after test Chao Li <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Kirill Reshke @ 2026-04-22 06:49 UTC (permalink / raw)
  To: PostgreSQL Hackers <[email protected]>

Hi!

I was doing some hacking today, when I noticed that the memoize
regression test does not clean up the explain_memoize function after
its end. I checked other regression tests and they tend to do it. So,
I am not sure if there is a rule about `you should drop all objects
that you create in regression test`, but if there is such a rule, PFA.



-- 
Best regards,
Kirill Reshke


Attachments:

  [application/octet-stream] v1-0001-Cleanup-explain_memoize-after-resgression-test.patch (721B, 2-v1-0001-Cleanup-explain_memoize-after-resgression-test.patch)
  download | inline diff:
From eb777d061f23699e1f9837c928636989906481f8 Mon Sep 17 00:00:00 2001
From: reshke <[email protected]>
Date: Wed, 22 Apr 2026 06:46:25 +0000
Subject: [PATCH v1] Cleanup explain_memoize after resgression test

---
 src/test/regress/sql/memoize.sql | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/test/regress/sql/memoize.sql b/src/test/regress/sql/memoize.sql
index e39bbb65391..4774d20c624 100644
--- a/src/test/regress/sql/memoize.sql
+++ b/src/test/regress/sql/memoize.sql
@@ -272,4 +272,6 @@ SELECT * FROM tab_anti t1 WHERE t1.a IN
  (SELECT a FROM tab_anti t2 WHERE t2.b IN
   (SELECT t1.b FROM tab_anti t3 WHERE t2.a > 1 OFFSET 0));
 
+DROP FUNCTION explain_memoize;
+
 DROP TABLE tab_anti;
-- 
2.43.0



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Cleanup explain_memoize function after test
  2026-04-22 06:49 Cleanup explain_memoize function after test Kirill Reshke <[email protected]>
@ 2026-04-22 09:24 ` Chao Li <[email protected]>
  2026-04-22 17:32   ` Re: Cleanup explain_memoize function after test Bertrand Drouvot <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Chao Li @ 2026-04-22 09:24 UTC (permalink / raw)
  To: Kirill Reshke <[email protected]>; +Cc: PostgreSQL Hackers <[email protected]>



> On Apr 22, 2026, at 14:49, Kirill Reshke <[email protected]> wrote:
> 
> Hi!
> 
> I was doing some hacking today, when I noticed that the memoize
> regression test does not clean up the explain_memoize function after
> its end. I checked other regression tests and they tend to do it. So,
> I am not sure if there is a rule about `you should drop all objects
> that you create in regression test`, but if there is such a rule, PFA.
> 
> 
> 
> -- 
> Best regards,
> Kirill Reshke
> <v1-0001-Cleanup-explain_memoize-after-resgression-test.patch>

Good catch.

You also need to update the corresponding out file, otherwise the test will fail. I have helped update the out file in v2, now “make check” passes with v2 applied.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/






Attachments:

  [application/octet-stream] v2-0001-Cleanup-explain_memoize-after-resgression-test.patch (1.2K, 2-v2-0001-Cleanup-explain_memoize-after-resgression-test.patch)
  download | inline diff:
From 695443e50e522453f11c442fef6f025e29a0a2e3 Mon Sep 17 00:00:00 2001
From: reshke <[email protected]>
Date: Wed, 22 Apr 2026 06:46:25 +0000
Subject: [PATCH v2] Cleanup explain_memoize after resgression test

---
 src/test/regress/expected/memoize.out | 1 +
 src/test/regress/sql/memoize.sql      | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/src/test/regress/expected/memoize.out b/src/test/regress/expected/memoize.out
index 218972dfab8..199ef15920a 100644
--- a/src/test/regress/expected/memoize.out
+++ b/src/test/regress/expected/memoize.out
@@ -561,4 +561,5 @@ SELECT * FROM tab_anti t1 WHERE t1.a IN
                      ->  Seq Scan on tab_anti t3
 (10 rows)
 
+DROP FUNCTION explain_memoize;
 DROP TABLE tab_anti;
diff --git a/src/test/regress/sql/memoize.sql b/src/test/regress/sql/memoize.sql
index e39bbb65391..4774d20c624 100644
--- a/src/test/regress/sql/memoize.sql
+++ b/src/test/regress/sql/memoize.sql
@@ -272,4 +272,6 @@ SELECT * FROM tab_anti t1 WHERE t1.a IN
  (SELECT a FROM tab_anti t2 WHERE t2.b IN
   (SELECT t1.b FROM tab_anti t3 WHERE t2.a > 1 OFFSET 0));
 
+DROP FUNCTION explain_memoize;
+
 DROP TABLE tab_anti;
-- 
2.50.1 (Apple Git-155)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Cleanup explain_memoize function after test
  2026-04-22 06:49 Cleanup explain_memoize function after test Kirill Reshke <[email protected]>
  2026-04-22 09:24 ` Re: Cleanup explain_memoize function after test Chao Li <[email protected]>
@ 2026-04-22 17:32   ` Bertrand Drouvot <[email protected]>
  0 siblings, 0 replies; 3+ messages in thread

From: Bertrand Drouvot @ 2026-04-22 17:32 UTC (permalink / raw)
  To: Chao Li <[email protected]>; +Cc: Kirill Reshke <[email protected]>; PostgreSQL Hackers <[email protected]>

Hi,

On Wed, Apr 22, 2026 at 05:24:33PM +0800, Chao Li wrote:
> 
> 
> > On Apr 22, 2026, at 14:49, Kirill Reshke <[email protected]> wrote:
> > 
> > Hi!
> > 
> > I was doing some hacking today, when I noticed that the memoize
> > regression test does not clean up the explain_memoize function after
> > its end. I checked other regression tests and they tend to do it. So,
> > I am not sure if there is a rule about `you should drop all objects
> > that you create in regression test`, but if there is such a rule, PFA.
> > 
> > 
> > 
> > -- 
> > Best regards,
> > Kirill Reshke
> > <v1-0001-Cleanup-explain_memoize-after-resgression-test.patch>
> 
> Good catch.
> 
> You also need to update the corresponding out file, otherwise the test will fail. I have helped update the out file in v2, now “make check” passes with v2 applied.


I'm not sure fixing "only" this single missing clean up makes sense. I think,
that the main purpose of those would be to be able to run "make installcheck EXTRA_REGRESS_OPTS="--use-existing""
multiple times on the same running instance without any errors. If that's the
case, then from what I can see after a quick test, the task would be way larger
that this patch.

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com





^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2026-04-22 17:32 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-04-22 06:49 Cleanup explain_memoize function after test Kirill Reshke <[email protected]>
2026-04-22 09:24 ` Chao Li <[email protected]>
2026-04-22 17:32   ` Bertrand Drouvot <[email protected]>

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