| From: | surya poondla <suryapoondla4(at)gmail(dot)com> |
|---|---|
| To: | Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> |
| Cc: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
| Subject: | Re: Reject unsupported COPY FROM targets before analyzing WHERE clause |
| Date: | 2026-11-03 00:33:01 |
| Message-ID: | CAOVWO5ppE+m19UFm33qbNG4NuqeSBJ-8CDzokL4mZzdMRrPqQA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi Chao,
I tested v2 on current master (51ae21aa313). The code change looks fine to
me.
One more argument for it, on master the file is opened, or the program is
run, before the relkind check fires. For example:
create sequence s;
copy s from program 'touch /tmp/marker';
ERROR: cannot copy to sequence "s"
On master /tmp/marker gets created; with v2 it doesn't. And copy s from
'/nonexistent/file' fails with "could not open file" on master, but "cannot
copy to sequence" with v2. Might be worth a line in the commit message.
The copy2.sql change needs to be dropped, though. Since Tom's 3045a25ba81,
which went in after v2, psql skips the in-line data when COPY FROM STDIN
fails early. With test1 and . removed, psql now eats everything up to the
next ., i.e. the CREATE FUNCTION, CREATE TRIGGER and the next COPY, and
copy2 fails. If you keep those two lines, the expected output doesn't
change.
Apart from that I checked sequences, views and matviews (error before
reading any input), plain/partitioned tables the WHERE clause error (still
reported first).
+1 with the test being removed.
Regards,
Surya Poondla
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Chao Li | 2026-11-03 01:03:53 | Re: [PATCH] pgcrypto: Fix sha-crypt rounds= values that do not fit in int (BUG #19743) |
| Previous Message | Tender Wang | 2026-11-03 00:30:13 | Re: Remove unused arguments from split_selfjoin_quals() |