Environment: Apache AGE 1.8.0, PostgreSQL 18.1, image
Reproduction
CREATE (n {id: 1})
WITH n AS alias0
MATCH (alias0)
RETURN alias0
Observed error:
ERROR: variable 'alias0' already exists
The same error occurs after a second boundary:
CREATE (n {id: 1})
WITH n AS alias0
WITH alias0
MATCH (alias0)
RETURN alias0
The two renamed-alias queries both produced the existing-variable error. The
control query below succeeded and returned the created vertex:
CREATE (n {id: 4})
WITH n
MATCH (n)
RETURN n
Therefore this is not a generic prohibition on reusing an already-bound
pattern variable. The failure is specific to the entity projection alias.
Environment: Apache AGE
1.8.0, PostgreSQL18.1, imageReproduction
Observed error:
The same error occurs after a second boundary:
The two renamed-alias queries both produced the existing-variable error. The
control query below succeeded and returned the created vertex:
Therefore this is not a generic prohibition on reusing an already-bound
pattern variable. The failure is specific to the entity projection alias.