IITDBGroup / gprom

GProM is a middleware that adds support for provenance to database backends.
http://www.cs.iit.edu/%7edbgroup/research/gprom.php
Apache License 2.0
9 stars 5 forks source link

Postgres backend - common table expression as join input is put into parentheses #36

Closed lordpretzel closed 6 years ago

lordpretzel commented 6 years ago

Postgres does not support putting parentheses around a FROM item and its alias like this:

FROM ((SELECT * FROM "r") AS "f0")

GProM's SQL code generator for Postgres was generating this from for CTEs, e.g.,

WITH "sub" AS (SELECT "id" FROM "student") 
SELECT "x.id" AS "id" FROM "sub" "x" JOIN "sub" "y" ON ("x.id" = "y.id");