union all bug?
От
Joe Conway
Тема
union all bug?
Дата
Msg-id
449572FE.6000408@joeconway.com
Список
Дерево обсуждения
union all bug? Joe Conway <mail@joeconway.com>
Re: union all bug? Tom Lane <tgl@sss.pgh.pa.us>
Re: union all bug? Joe Conway <mail@joeconway.com>
Re: union all bug? "Gurjeet Singh" <singh.gurjeet@gmail.com>
Re: union all bug? Tom Lane <tgl@sss.pgh.pa.us>
I was trying to work around limitations with "partitioning" of tables using constraint exclusion, when I ran across this little oddity: -- works test=# select * from (select time from url_access_2006_06_07 order by 1 limit 2) as ss1; time --------------------- 2006-06-07 15:07:41 2006-06-07 15:07:41 (2 rows) -- works test=# select time from url_access_2006_06_08 order by 1 limit 2; time --------------------- 2006-06-08 15:07:41 2006-06-08 15:07:41 (2 rows) -- huh ?!? test=# select * from (select time from url_access_2006_06_07 order by 1 limit 2) as ss1 union all select time from url_access_2006_06_08 order by 1 limit 2; time --------------------- 2006-06-07 15:07:41 2006-06-07 15:07:41 (2 rows) -- works test=# select * from (select time from url_access_2006_06_07 order by 1 limit 2) as ss1 union all select * from (select time from url_access_2006_06_08 order by 1 limit 2) as ss2; time --------------------- 2006-06-07 15:07:41 2006-06-07 15:07:41 2006-06-08 15:07:41 2006-06-08 15:07:41 (4 rows) I get an error if I try to eliminate the first FROM clause subselect: test=# select time from url_access_2006_06_07 order by 1 limit 2 union all select * from (select time from url_access_2006_06_08 order by 1 limit 2) as ss2; ERROR: syntax error at or near "all" at character 65 LINE 1: ...om url_access_2006_06_07 order by 1 limit 2 union all select... So I'm wondering whether the second FROM clause subselect is really required, but not getting enforced as it should? Joe
В списке pgsql-hackers по дате отправления