pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Avoid unhelpful internal error for incorrect recursive-WITH quer
7+ messages / 1 participants
[nested] [flat]

* pgsql: Avoid unhelpful internal error for incorrect recursive-WITH quer
@ 2024-07-14 17:50 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2024-07-14 17:50 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid unhelpful internal error for incorrect recursive-WITH queries.

checkWellFormedRecursion would issue "missing recursive reference"
if a WITH RECURSIVE query contained a single self-reference but
that self-reference was inside a top-level WITH, ORDER BY, LIMIT,
etc, rather than inside the second arm of the UNION as expected.
We already intended to throw more-on-point errors for such cases,
but those error checks must be done before examining the UNION arm
in order to have the desired results.  So this patch need only
move some code (and improve the comments).

Per bug #18536 from Alexander Lakhin.  Back-patch to all supported
branches.

Discussion: https://postgr.es/m/18536-0a342ec07901203e@postgresql.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f96c2c72788cab3005c8bc6b4934b4928b34a529

Modified Files
--------------
src/backend/parser/parse_cte.c     | 53 ++++++++++++++++++++++++--------------
src/test/regress/expected/with.out | 40 ++++++++++++++++++++++++++++
src/test/regress/sql/with.sql      | 29 +++++++++++++++++++++
3 files changed, 102 insertions(+), 20 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Avoid unhelpful internal error for incorrect recursive-WITH quer
@ 2024-07-14 17:50 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2024-07-14 17:50 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid unhelpful internal error for incorrect recursive-WITH queries.

checkWellFormedRecursion would issue "missing recursive reference"
if a WITH RECURSIVE query contained a single self-reference but
that self-reference was inside a top-level WITH, ORDER BY, LIMIT,
etc, rather than inside the second arm of the UNION as expected.
We already intended to throw more-on-point errors for such cases,
but those error checks must be done before examining the UNION arm
in order to have the desired results.  So this patch need only
move some code (and improve the comments).

Per bug #18536 from Alexander Lakhin.  Back-patch to all supported
branches.

Discussion: https://postgr.es/m/18536-0a342ec07901203e@postgresql.org

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/cf588e10f664be37a0804e9a8662facd0e163800

Modified Files
--------------
src/backend/parser/parse_cte.c     | 53 ++++++++++++++++++++++++--------------
src/test/regress/expected/with.out | 40 ++++++++++++++++++++++++++++
src/test/regress/sql/with.sql      | 29 +++++++++++++++++++++
3 files changed, 102 insertions(+), 20 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Avoid unhelpful internal error for incorrect recursive-WITH quer
@ 2024-07-14 17:50 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2024-07-14 17:50 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid unhelpful internal error for incorrect recursive-WITH queries.

checkWellFormedRecursion would issue "missing recursive reference"
if a WITH RECURSIVE query contained a single self-reference but
that self-reference was inside a top-level WITH, ORDER BY, LIMIT,
etc, rather than inside the second arm of the UNION as expected.
We already intended to throw more-on-point errors for such cases,
but those error checks must be done before examining the UNION arm
in order to have the desired results.  So this patch need only
move some code (and improve the comments).

Per bug #18536 from Alexander Lakhin.  Back-patch to all supported
branches.

Discussion: https://postgr.es/m/18536-0a342ec07901203e@postgresql.org

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/8fc4876147fb62825cd27712d25f90a4eebf44fb

Modified Files
--------------
src/backend/parser/parse_cte.c     | 53 ++++++++++++++++++++++++--------------
src/test/regress/expected/with.out | 40 ++++++++++++++++++++++++++++
src/test/regress/sql/with.sql      | 29 +++++++++++++++++++++
3 files changed, 102 insertions(+), 20 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Avoid unhelpful internal error for incorrect recursive-WITH quer
@ 2024-07-14 17:50 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2024-07-14 17:50 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid unhelpful internal error for incorrect recursive-WITH queries.

checkWellFormedRecursion would issue "missing recursive reference"
if a WITH RECURSIVE query contained a single self-reference but
that self-reference was inside a top-level WITH, ORDER BY, LIMIT,
etc, rather than inside the second arm of the UNION as expected.
We already intended to throw more-on-point errors for such cases,
but those error checks must be done before examining the UNION arm
in order to have the desired results.  So this patch need only
move some code (and improve the comments).

Per bug #18536 from Alexander Lakhin.  Back-patch to all supported
branches.

Discussion: https://postgr.es/m/18536-0a342ec07901203e@postgresql.org

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/e7f9f44e3bd95404f4221fab29cd295805ff410d

Modified Files
--------------
src/backend/parser/parse_cte.c     | 53 ++++++++++++++++++++++++--------------
src/test/regress/expected/with.out | 40 ++++++++++++++++++++++++++++
src/test/regress/sql/with.sql      | 29 +++++++++++++++++++++
3 files changed, 102 insertions(+), 20 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Avoid unhelpful internal error for incorrect recursive-WITH quer
@ 2024-07-14 17:50 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2024-07-14 17:50 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid unhelpful internal error for incorrect recursive-WITH queries.

checkWellFormedRecursion would issue "missing recursive reference"
if a WITH RECURSIVE query contained a single self-reference but
that self-reference was inside a top-level WITH, ORDER BY, LIMIT,
etc, rather than inside the second arm of the UNION as expected.
We already intended to throw more-on-point errors for such cases,
but those error checks must be done before examining the UNION arm
in order to have the desired results.  So this patch need only
move some code (and improve the comments).

Per bug #18536 from Alexander Lakhin.  Back-patch to all supported
branches.

Discussion: https://postgr.es/m/18536-0a342ec07901203e@postgresql.org

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/02b4f5e1f26b610fb2f6f4698810907547b68f12

Modified Files
--------------
src/backend/parser/parse_cte.c     | 53 ++++++++++++++++++++++++--------------
src/test/regress/expected/with.out | 40 ++++++++++++++++++++++++++++
src/test/regress/sql/with.sql      | 29 +++++++++++++++++++++
3 files changed, 102 insertions(+), 20 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Avoid unhelpful internal error for incorrect recursive-WITH quer
@ 2024-07-14 17:50 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2024-07-14 17:50 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid unhelpful internal error for incorrect recursive-WITH queries.

checkWellFormedRecursion would issue "missing recursive reference"
if a WITH RECURSIVE query contained a single self-reference but
that self-reference was inside a top-level WITH, ORDER BY, LIMIT,
etc, rather than inside the second arm of the UNION as expected.
We already intended to throw more-on-point errors for such cases,
but those error checks must be done before examining the UNION arm
in order to have the desired results.  So this patch need only
move some code (and improve the comments).

Per bug #18536 from Alexander Lakhin.  Back-patch to all supported
branches.

Discussion: https://postgr.es/m/18536-0a342ec07901203e@postgresql.org

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/b020a866a22b40138161c70351da375f2d2bd24f

Modified Files
--------------
src/backend/parser/parse_cte.c     | 53 ++++++++++++++++++++++++--------------
src/test/regress/expected/with.out | 40 ++++++++++++++++++++++++++++
src/test/regress/sql/with.sql      | 29 +++++++++++++++++++++
3 files changed, 102 insertions(+), 20 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Avoid unhelpful internal error for incorrect recursive-WITH quer
@ 2024-07-14 17:50 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2024-07-14 17:50 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid unhelpful internal error for incorrect recursive-WITH queries.

checkWellFormedRecursion would issue "missing recursive reference"
if a WITH RECURSIVE query contained a single self-reference but
that self-reference was inside a top-level WITH, ORDER BY, LIMIT,
etc, rather than inside the second arm of the UNION as expected.
We already intended to throw more-on-point errors for such cases,
but those error checks must be done before examining the UNION arm
in order to have the desired results.  So this patch need only
move some code (and improve the comments).

Per bug #18536 from Alexander Lakhin.  Back-patch to all supported
branches.

Discussion: https://postgr.es/m/18536-0a342ec07901203e@postgresql.org

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/236b225ed452ae54bf3bb778b926495c4f1aa388

Modified Files
--------------
src/backend/parser/parse_cte.c     | 53 ++++++++++++++++++++++++--------------
src/test/regress/expected/with.out | 40 ++++++++++++++++++++++++++++
src/test/regress/sql/with.sql      | 29 +++++++++++++++++++++
3 files changed, 102 insertions(+), 20 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2024-07-14 17:50 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-07-14 17:50 pgsql: Avoid unhelpful internal error for incorrect recursive-WITH quer Tom Lane <tgl@sss.pgh.pa.us>
2024-07-14 17:50 pgsql: Avoid unhelpful internal error for incorrect recursive-WITH quer Tom Lane <tgl@sss.pgh.pa.us>
2024-07-14 17:50 pgsql: Avoid unhelpful internal error for incorrect recursive-WITH quer Tom Lane <tgl@sss.pgh.pa.us>
2024-07-14 17:50 pgsql: Avoid unhelpful internal error for incorrect recursive-WITH quer Tom Lane <tgl@sss.pgh.pa.us>
2024-07-14 17:50 pgsql: Avoid unhelpful internal error for incorrect recursive-WITH quer Tom Lane <tgl@sss.pgh.pa.us>
2024-07-14 17:50 pgsql: Avoid unhelpful internal error for incorrect recursive-WITH quer Tom Lane <tgl@sss.pgh.pa.us>
2024-07-14 17:50 pgsql: Avoid unhelpful internal error for incorrect recursive-WITH quer Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox