| From: | Kirill Reshke <reshkekirill(at)gmail(dot)com> |
|---|---|
| To: | Sugamoto Shinya <shinya34892(at)gmail(dot)com> |
| Cc: | Nathan Bossart <nathandbossart(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: [PATCH] Add error hints for invalid COPY options |
| Date: | 2025-11-27 17:55:45 |
| Message-ID: | CALdSSPhJy2HOMzVV9XT68thgn7hMFhk3JLC2cVvv3OmE_a_2fA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi
On Thu, 27 Nov 2025 at 20:38, Sugamoto Shinya <shinya34892(at)gmail(dot)com> wrote:
>
>
>
> Regarding the option `convert_selectively`, what do you think about this?
> Still it seems to me that this option is accessible from SQL interfaces. But for now
> I just removed the comment changes from my v2 patch and would like to discuss
> this with you here or in another thread.
>
> Regards,
>
It is worse than that - user can lose his data by using
convert_selectively from SQL:
```
db1=# COPY conv_test FROM STDIN (
FORMAT csv,
convert_selectively (a)
);
Enter data to be copied followed by a newline.
End with a backslash and a period on a line by itself, or an EOF signal.
>> 2,2,dsd
>> \.
COPY 1
db1=# table conv_test
db1-# ;
a | b | c
---+---+---
2 | |
(1 row)
```
So, this option should be rejected when manually specified. Looks like
we can do ereport() directly in parser, when reading option name
--
Best regards,
Kirill Reshke
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Kirill Reshke | 2025-11-27 17:59:37 | Re: [PATCH] Add error hints for invalid COPY options |
| Previous Message | Dean Rasheed | 2025-11-27 17:55:03 | Re: Second RewriteQuery complains about first RewriteQuery in edge case |