[PATCH] Improve error message for graph variable references in subqueries within GRAPH_TABLE - Mailing list pgsql-hackers

From SATYANARAYANA NARLAPURAM
Subject [PATCH] Improve error message for graph variable references in subqueries within GRAPH_TABLE
Date
Msg-id CAHg+QDfUwNPcxWk_WJWPvVhrGAeeDQrD6CMTuFcSd1ybELie9Q@mail.gmail.com
Whole thread
List pgsql-hackers
Hi Hackers,

When a subquery inside GRAPH_TABLE COLUMNS or MATCH WHERE references a
graph pattern variable, the error was a confusing "missing FROM-clause
entry for table".  Fix by walking the parentParseState chain in
transformGraphTablePropertyRef() to detect the graph variable and report
a clear "cannot be used in a subquery" error instead.


Based on the below comment and code in  transformRangeGraphTable I am assuming we don't support
subqueries for now.

  /*
* If we support subqueries within GRAPH_TABLE, those need to be
* propagated to the queries resulting from rewriting graph table RTE. We
* don't do that right now, hence prohibit it for now.
*/
if (pstate->p_hasSubLinks)
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("subqueries within GRAPH_TABLE reference are not supported")));
pstate->p_hasSubLinks = saved_hasSublinks;

Attached a patch to address this which also includes a test.

Thanks,
Satya


Attachment

pgsql-hackers by date:

Previous
From: Álvaro Herrera
Date:
Subject: Re: [PATCH] Compressed TOAST data corruption with REPACK CONCURRENTLY
Next
From: Antonin Houska
Date:
Subject: Re: [PATCH] Compressed TOAST data corruption with REPACK CONCURRENTLY