Thread: psql -f switch and "COPY ... FROM STDIN"

psql -f switch and "COPY ... FROM STDIN"

From
PG Doc comments form
Date:
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/12/app-psql.html
Description:

Hi, first of all thanks for the great postgres database and its psql
utility.
Today I had some trouble using "COPY ... FROM STDIN" with CSV data piped
into the psql command, which had the "COPY" sql statement in a separate
file, referenced by the -f switch. In the end, I found out that the -f
switch leads to psql ignoring all stdin - all you get is the output "COPY
0". I think it would be worth documenting this behavior of the -f / --file
switch on the psql documentation page.
Thanks + best regards,
Carsten