citusdata / citusdata/citus

COPY FROM WHERE in pg12 isn't straight forward to support

Open
#2,878 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
12.8k
Forks
794
Avg merge
2d 14h
Merged PRs (30d)
31

Description

As is, our copy implementation ignores the `WHERE`

https://github.com/postgres/postgres/commit/31f3817402da736b29014ace470cf70aeb126ac5#diff-2593bfcd8f00a702b24d894bc081f314R863

This mangling of the expression occurs in code we bypass, preferring our own `CheckCopyPermissions` which doesn't have parseState

CopyState is an opaque pointer for us, so we can't assign `copyState->whereClause`

Actual filtering happens here: https://github.com/postgres/postgres/blob/31f3817402da736b29014ace470cf70aeb126ac5/src/backend/commands/copy.c#L2728

Bail out is to check for `copyStatement->whereClause` & throw an error

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.