apache / apache/age

write/read rescan is rejected inside one Cypher query

Open
#2,526 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
C
Stars
4.8k
Forks
523
Avg merge
1d 2h
Merged PRs (30d)
9

Description

- Docker image `apache/age:release_PG18_1.8.0

**Reproduction**

```sql
LOAD 'age';
SET search_path = ag_catalog, public;
SELECT ag_catalog.create_graph('age_issue_case2');

SELECT *
FROM ag_catalog.cypher('age_issue_case2', $$
CREATE (a {id: 1})-[:e]->(b {id: 2})
$$) AS (v agtype);

SELECT *
FROM ag_catalog.cypher('age_issue_case2', $$
MERGE ({id: 28})
MERGE p0 = (:l0 {k0: false, id: 29})
WITH tan(toFloat(length(p0))) AS alias0,
range(6, 14) + [0] AS alias1,
p0 AS alias2
WHERE true
MATCH p1 = (n0) -[*1..1]-()
RETURN collect(toString(n0.id)) AS alias3
SKIP 0 LIMIT 9
$$) AS (alias3 agtype);
```

**Expected**

The valid Cypher query executes and returns the matching path result.

**Actual**

```text
cypher merge clause cannot be rescanned
HINT: its unsafe to use joins in a query with a Cypher MERGE clause
```

The corresponding `CREATE` variant reports `cypher create clause cannot be
rescanned` when the later graph read finds a matching path.

Contributor guide

Open the contributing guide

Research direction

Start by running the supplied SQL reproduction against Docker image apache/age:release_PG18_1.8.0, then compare the MERGE and CREATE cases with their expected graph-read results. Done means the valid write/read query executes and returns the matching path instead of reporting that the clause cannot be rescanned.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, postgresql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.