From: | Kris Jurka <books(at)ejurka(dot)com> |
---|---|
To: | pgsql-bugs(at)postgresql(dot)org |
Subject: | multiple SRFs in SELECT clause. |
Date: | 2006-11-27 10:58:33 |
Message-ID: | Pine.BSO.4.64.0611270549540.13818@leary2.csoft.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
I'm getting some odd results when running two generate_series calls in a
SELECT. When the two calls return the same number of rows you get that
many rows out:
# SELECT generate_series(1,3), generate_series(1,3);
generate_series | generate_series
-----------------+-----------------
1 | 1
2 | 2
3 | 3
(3 rows)
When the row counts differ you get the least common multiple number of
rows.
# SELECT generate_series(1,4), generate_series(1,2);
generate_series | generate_series
-----------------+-----------------
1 | 1
2 | 2
3 | 1
4 | 2
(4 rows)
I was personally expecting a cross join between them that would be
equivalent to
# SELECT * FROM generate_series(1,4) a, generate_series(1,2) b;
a | b
---+---
1 | 1
1 | 2
2 | 1
2 | 2
3 | 1
3 | 2
4 | 1
4 | 2
(8 rows)
Tested on 8.1.3 and CVS HEAD.
Kris Jurka
From | Date | Subject | |
---|---|---|---|
Next Message | Jeremy Haile | 2006-11-27 14:21:07 | fsync and semctl errors with 8.1.5/win32 |
Previous Message | Thomas H. | 2006-11-27 06:32:41 | Re: 8.2rc1: vacuum full fills up disk space |