Skip to content

Commit 7d5b403

Browse files
committed
Small improvement for plpgsql regression test.
Use DISCARD PLANS instead of a reconnect to force reconstruction of a cached plan; this corresponds more nearly to what people might actually do in practice.
1 parent cfb758b commit 7d5b403

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/pl/plpgsql/src/expected/plpgsql_record.out

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,9 +424,11 @@ select sillyaddone(42);
424424
alter table mutable drop column f1;
425425
alter table mutable add column f1 float8;
426426
-- currently, this fails due to cached plan for "r.f1 + 1" expression
427+
-- (but we can't actually show that, because a CLOBBER_CACHE_ALWAYS build
428+
-- will succeed)
427429
-- select sillyaddone(42);
428-
\c -
429-
-- but it's OK after a reconnect
430+
-- but it's OK if we force plan rebuilding
431+
discard plans;
430432
select sillyaddone(42);
431433
sillyaddone
432434
-------------

src/pl/plpgsql/src/sql/plpgsql_record.sql

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,12 @@ alter table mutable drop column f1;
274274
alter table mutable add column f1 float8;
275275

276276
-- currently, this fails due to cached plan for "r.f1 + 1" expression
277+
-- (but we can't actually show that, because a CLOBBER_CACHE_ALWAYS build
278+
-- will succeed)
277279
-- select sillyaddone(42);
278-
\c -
279-
-- but it's OK after a reconnect
280+
281+
-- but it's OK if we force plan rebuilding
282+
discard plans;
280283
select sillyaddone(42);
281284

282285
alter table mutable drop column f1;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy