Thread: pgsql: Fix poorly written regression test

pgsql: Fix poorly written regression test

From
David Rowley
Date:
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@foxmail.com>
Author: David Rowley <dgrowleyml@gmail.com>
Reviewed-by: Japin Li <japinli@hotmail.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(-)