pgsql: Fix poorly written regression test

From: David Rowley <drowley(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix poorly written regression test
Date: 2025-02-18 11:42:40
Message-ID: E1tkLzs-007mfI-2Z@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix poorly written regression test

bd10ec529 added code to allow redundant functionally dependent GROUP BY
columns to be removed using unique indexes and NOT NULL constraints as
proofs of functional dependency. In that commit, I (David) added a test
to ensure that when there are multiple indexes available to remove columns
that we pick the index that allows us to remove the most columns. This
test was faulty as it assumed the t3 table's primary key index was valid
to use as functional dependency proof, but that's not the case since
that's defined as deferrable.

Here we adjust the tests added by that commit to use the t2 table instead.
That's defined with a non-deferrable primary key.

Author: songjinzhou <tsinghualucky912(at)foxmail(dot)com>
Author: David Rowley <dgrowleyml(at)gmail(dot)com>
Reviewed-by: Japin Li <japinli(at)hotmail(dot)com>
Discussion: https://postgr.es/m/tencent_CD414C79D39668455DF80D35143B87634C08@qq.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/593509202f669dbc4a9db33bb3aca2bd68f7ab5c

Modified Files
--------------
src/test/regress/expected/aggregates.out | 50 ++++++++++++++++----------------
src/test/regress/sql/aggregates.sql | 26 ++++++++---------
2 files changed, 38 insertions(+), 38 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Daniel Gustafsson 2025-02-18 12:24:15 pgsql: Add PGErrorVerbosity to typedefs.list
Previous Message Amit Kapila 2025-02-18 06:59:44 pgsql: Raise a WARNING for max_slot_wal_keep_size in pg_createsubscribe