Re: [PATCH] Allow multiple recursive self-references - Mailing list pgsql-hackers

From Denis Hirn
Subject Re: [PATCH] Allow multiple recursive self-references
Date
Msg-id B8715F3D-81D1-4033-A195-413EE5CC5F05@uni-tuebingen.de
Whole thread Raw
In response to Re: [PATCH] Allow multiple recursive self-references  (Denis Hirn <denis.hirn@uni-tuebingen.de>)
Responses Re: [PATCH] Allow multiple recursive self-references  (Denis Hirn <denis.hirn@uni-tuebingen.de>)
List pgsql-hackers
Based on Toms feedback, and due to the fact that SQL:2021 forbids
non-linear recursion, version 2 of the patch allows only linear
recursion. Therefore, later SQL committee decisions on non-linear
recursion should not be problematic.

> [LIN] PostgreSQL does not allow multiple references to the recursive
> common table, even if the recursion is LINEAR. Plenty of examples
> of such queries are found in the documentation of established RDBMSs,
> among these IBM Db2 and MS SQL Server:
>
> (example "Two tables used for recursion using recursive common
> table expressions")

See the gist at [1] below for SQL code that features multiple (yet linear)
recursive references. A patched PostgreSQL runs this query as expected.

Best wishes,
--Denis and Torsten



Attachment

pgsql-hackers by date:

Previous
From: Sait Talha Nisanci
Date:
Subject: Re: Crash in record_type_typmod_compare
Next
From: David Steele
Date:
Subject: Re: invalid data in file backup_label problem on windows