citusdata / citusdata/citus_docs

CTE behavior: Citus vs pg

Open
#664 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
CSS
Stars
58
Forks
60
PR merge metrics
No merged PRs in 30d

Description

## Communication goals (e.g. detailed howto vs orientation)

Alert people in case they rely on pg semantics for their CTEs.

### Good locations for content in docs structure

Add a CTE section to https://docs.citusdata.com/en/v7.3/develop/reference_sql.html

## How does this work? (devs)

As pointed out in https://github.com/citusdata/citus/issues/2153:

- We execute CTEs one-by-one, in order of appearance
- CTEs can see the result of other modifying CTEs
- Each CTE may work on different snapshots (read committed semantics)

We can address the third point by using repeatable mode as mentioned in https://github.com/citusdata/citus/issues/1804. A challenge is that repeatable read needs to be set at the start of a transaction block and the CTE might appear mid-transaction block.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.