ERROR: could not devise a query plan for the given query (UNIONS and LATERAL)

Поиск
Список
Период
Сортировка
От Elvis Pranskevichus
Тема ERROR: could not devise a query plan for the given query (UNIONS and LATERAL)
Дата
Msg-id 5981018.zdth1YWmNy@hammer.magicstack.net
обсуждение исходный текст
Ответы Re: ERROR: could not devise a query plan for the given query (UNIONS and LATERAL)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
Hi,

The following (admittedly bizzare) query causes the error in the subject 
on all recent versions of Postgres:

SELECT
        "q2"."v"
    FROM
        LATERAL
        (SELECT
                "q11"."v"
            FROM
                (
                    (SELECT 2::bigint AS "v") UNION ALL
                    (SELECT 3::bigint AS "v")
                ) AS "q11"
        ) AS "q1"
        CROSS JOIN LATERAL
        (
            (SELECT
                "q3"."v"
             FROM
                (
                    (SELECT 4::bigint AS "v") UNION ALL
                    (SELECT 5::bigint AS "v")
                ) AS "q3"
            )
            UNION ALL
            (SELECT "q1"."v")
        ) AS "q2"
    ORDER BY
        "q2"."v"; 


Interestingly, removing UNION from either "q3" or "q11", as well as 
removing the ::bigint casts makes it work.


                            Elvis




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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [BUGS] BUG #14898: pg_upgrade documentation is misleading
Следующее
От: Tom Lane
Дата:
Сообщение: Re: ERROR: could not devise a query plan for the given query (UNIONS and LATERAL)