Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 78b674b

Browse files
committed
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.
1 parent 1945096 commit 78b674b

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/test/regress/expected/interval.out

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,3 +212,12 @@ SELECT '' AS ten, INTERVAL_TBL.*;
212212
| @ 5 mons 12 hours
213213
(10 rows)
214214

215+
-- test avg(interval), which is somewhat fragile since people have been
216+
-- known to change the allowed input syntax for type interval without
217+
-- updating pg_aggregate.agginitval
218+
select avg(f1) from interval_tbl;
219+
avg
220+
-------------------------------------------------
221+
@ 4 years 1 mon 10 days 4 hours 18 mins 23 secs
222+
(1 row)
223+

src/test/regress/sql/interval.sql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,9 @@ SELECT '' AS fortyfive, r1.*, r2.*
6060
SET DATESTYLE = 'postgres';
6161

6262
SELECT '' AS ten, INTERVAL_TBL.*;
63+
64+
-- test avg(interval), which is somewhat fragile since people have been
65+
-- known to change the allowed input syntax for type interval without
66+
-- updating pg_aggregate.agginitval
67+
68+
select avg(f1) from interval_tbl;

0 commit comments

Comments
 (0)