BUG #19542: Boolean syntax in GRAPH_TABLE
Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.
You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:
docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t248736psql -h localhost -U postgresBuilt from patchset v2 (message #2), July 28, 2026 at 11:30 PM.
Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:
git clone --branch t248736_2 https://github.com/hackorum-dev/postgres.gitIn a checkout you already have, add the fork once:
git remote add hackorum https://github.com/hackorum-dev/postgres.gitthen, for this patchset and every later one:
git fetch hackorum t248736_2 && git checkout t248736_2Patchset v2 (message #2) is on t248736_2
The following bug has been logged on the website:
Bug reference: 19542
Logged by: Hervé Lefebvre
Email address: h.lefebvre.69@gmail.com
PostgreSQL version: 19beta1
Operating system: Linux
Description:
In MATCH clause you cannot use "WHERE boolean" Syntax. aka :
select * from GRAPH_TABLE (trajet MATCH ( a IS quai where
a.nom_station='Place des Fêtes' )-[t IS dessert where t.correspondance ]->(b
IS quai) columns (a.nom_station as station1, a.num_ligne as ligne1,
b.nom_station as station2, b.num_ligne as ligne2, T.correspondance as
correspondance));
ERROR: unrecognized node type: 63
You have to add " = true" (ugly) :
select * from GRAPH_TABLE (trajet MATCH ( a IS quai where
a.nom_station='Place des Fêtes' )-[t IS dessert where t.correspondance=true
]->(b IS quai) columns (a.nom_station as station1, a.num_ligne as ligne1,
b.nom_station as station2, b.num_ligne as ligne2, T.correspondance as
correspondance));
station1 | ligne1 | station2 | ligne2 | correspondance
-----------------+--------+-----------------+--------+----------------
Place des Fêtes | 7bis | Place des Fêtes | 11 | t
Place des Fêtes | 11 | Place des Fêtes | 7bis | t
(2 rows)
Thanks for reporting.
The crash comes from replace_property_refs()
(src/backend/rewrite/rewriteGraphTable.c) which rewrites the
GraphPropertyRef nodes.
It calls expression_tree_mutator() directly on the top level node instead
of calling it's mutator (replace_property_refs_mutator()) which treats
GraphPropertyRef as a leaf & just copies it unchanged.
```
case T_GraphLabelRef:
case T_GraphPropertyRef:
case T_MergeSupportFunc:
return copyObject(node);
```
The fix is to call the mutator directly at the entry point.
Thanks,
Vaibhave.
On Fri, Jul 3, 2026 at 7:53 PM PG Bug reporting form <noreply@postgresql.org>
wrote:
Show quoted text
The following bug has been logged on the website:
Bug reference: 19542
Logged by: Hervé Lefebvre
Email address: h.lefebvre.69@gmail.com
PostgreSQL version: 19beta1
Operating system: Linux
Description:In MATCH clause you cannot use "WHERE boolean" Syntax. aka :
select * from GRAPH_TABLE (trajet MATCH ( a IS quai where
a.nom_station='Place des Fêtes' )-[t IS dessert where t.correspondance
]->(b
IS quai) columns (a.nom_station as station1, a.num_ligne as ligne1,
b.nom_station as station2, b.num_ligne as ligne2, T.correspondance as
correspondance));
ERROR: unrecognized node type: 63You have to add " = true" (ugly) :
select * from GRAPH_TABLE (trajet MATCH ( a IS quai where
a.nom_station='Place des Fêtes' )-[t IS dessert where t.correspondance=true
]->(b IS quai) columns (a.nom_station as station1, a.num_ligne as ligne1,
b.nom_station as station2, b.num_ligne as ligne2, T.correspondance as
correspondance));
station1 | ligne1 | station2 | ligne2 | correspondance
-----------------+--------+-----------------+--------+----------------
Place des Fêtes | 7bis | Place des Fêtes | 11 | t
Place des Fêtes | 11 | Place des Fêtes | 7bis | t
(2 rows)
On 05.07.26 10:20, vaibhave postgres wrote:
Thanks for reporting.
The crash comes from replace_property_refs() (src/backend/rewrite/
rewriteGraphTable.c) which rewrites the GraphPropertyRef nodes.It calls expression_tree_mutator() directly on the top level node
instead of calling it's mutator (replace_property_refs_mutator()) which
treats GraphPropertyRef as a leaf & just copies it unchanged.```
case T_GraphLabelRef:
case T_GraphPropertyRef:
case T_MergeSupportFunc:return copyObject(node);
```
The fix is to call the mutator directly at the entry point.
Thanks, this has also been discovered in [0]/messages/by-id/20260630173053.51.noahmisch@microsoft.com, and the fix there is the same.
[0]: /messages/by-id/20260630173053.51.noahmisch@microsoft.com
/messages/by-id/20260630173053.51.noahmisch@microsoft.com