Hi Chao,

I tested the v2 patch on PostgreSQL 20devel.
Before applying the patch, I reproduced the reported behavior with:

DROP SEQUENCE IF EXISTS s;
CREATE SEQUENCE s;

COPY s FROM stdin;

PostgreSQL waited for input with:

Enter data to be copied...

After providing input, it reported:

ERROR: cannot copy to sequence "s"

After applying the v2 patch and rebuilding PostgreSQL, I ran the same
test again:

COPY s FROM stdin;

This time PostgreSQL immediately reported:

ERROR: cannot copy to sequence "s"

and did not wait for input.

I also tested:

COPY s FROM stdin WHERE tableoid IS NULL;

and it continued to report:

ERROR: system columns are not supported in COPY FROM WHERE conditions
DETAIL: Column "tableoid" is a system column.

So the v2 patch successfully fixes the delayed error reporting by
rejecting the unsupported target before waiting for input. The
existing WHERE-clause validation behavior remains unchanged.

Regards,
Solai


Reply via email to