From: Tom Lane Date: Fri, 18 May 2001 16:02:01 +0000 (+0000) Subject: Add regression test to catch future breakage of avg(interval). This X-Git-Tag: REL7_2_BETA1~1235 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=78b674ba35d35836b7ff6eac9e22d92ab5e3f2bd;p=postgresql Add regression test to catch future breakage of avg(interval). This aggregate seems uniquely fragile, because it's the only one with an agginitval that's at all likely to change in format. --- diff --git a/src/test/regress/expected/interval.out b/src/test/regress/expected/interval.out index 8a4eb27590..ed16ada224 100644 --- a/src/test/regress/expected/interval.out +++ b/src/test/regress/expected/interval.out @@ -212,3 +212,12 @@ SELECT '' AS ten, INTERVAL_TBL.*; | @ 5 mons 12 hours (10 rows) +-- test avg(interval), which is somewhat fragile since people have been +-- known to change the allowed input syntax for type interval without +-- updating pg_aggregate.agginitval +select avg(f1) from interval_tbl; + avg +------------------------------------------------- + @ 4 years 1 mon 10 days 4 hours 18 mins 23 secs +(1 row) + diff --git a/src/test/regress/sql/interval.sql b/src/test/regress/sql/interval.sql index 945eb08d60..aa14cd3b09 100644 --- a/src/test/regress/sql/interval.sql +++ b/src/test/regress/sql/interval.sql @@ -60,3 +60,9 @@ SELECT '' AS fortyfive, r1.*, r2.* SET DATESTYLE = 'postgres'; SELECT '' AS ten, INTERVAL_TBL.*; + +-- test avg(interval), which is somewhat fragile since people have been +-- known to change the allowed input syntax for type interval without +-- updating pg_aggregate.agginitval + +select avg(f1) from interval_tbl;