ERROR: ORDER/GROUP BY expression not found in targetlist

Поиск
Список
Период
Сортировка
От Rajkumar Raghuwanshi
Тема ERROR: ORDER/GROUP BY expression not found in targetlist
Дата
Msg-id CAKcux6=1_Ye9kx8YLBPmJs_xE72PPc6vNi5q2AOHowMaCWjJ2w@mail.gmail.com
обсуждение исходный текст
Ответы Re: ERROR: ORDER/GROUP BY expression not found in targetlist  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi,

Below test case is failing with ERROR:  ORDER/GROUP BY expression not found in targetlist. this issue is reproducible from PGv10.

postgres=# CREATE TABLE test(c1 int, c2 text, c3 text);
CREATE TABLE
postgres=# INSERT INTO test SELECT i % 10, i % 250, to_char(i % 4, 'FM0000000') FROM GENERATE_SERIES(1,100000,1)i;
INSERT 0 100000
postgres=# ANALYZE test;
ANALYZE
postgres=# EXPLAIN (verbose) SELECT c1, generate_series(1,1), count(*) FROM test GROUP BY 1 HAVING count(*) > 1;
                                  QUERY PLAN                                  
-------------------------------------------------------------------------------
 ProjectSet  (cost=2291.00..2306.15 rows=3000 width=16)
   Output: c1, generate_series(1, 1), (count(*))
   ->  HashAggregate  (cost=2291.00..2291.12 rows=3 width=12)
         Output: c1, count(*)
         Group Key: test.c1
         Filter: (count(*) > 1)
         ->  Seq Scan on public.test  (cost=0.00..1541.00 rows=100000 width=4)
               Output: c1, c2, c3
(8 rows)

postgres=# SET min_parallel_table_scan_size=0;
SET
postgres=# EXPLAIN (verbose) SELECT c1, generate_series(1,1), count(*) FROM test GROUP BY 1 HAVING count(*) > 1;
ERROR:  ORDER/GROUP BY expression not found in targetlist

Thanks & Regards,
Rajkumar Raghuwanshi
QMG, EnterpriseDB Corporation

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: ToDo: show size of partitioned table
Следующее
От: Arseny Sher
Дата:
Сообщение: Re: Possible bug in logical replication.