Hi,
I have an issue that COPY from a FIFO, which has no writers, could not be
canceled, because COPY invokes AllocateFile() -> fopen() -> blocking open().
```
[postgres@s1 ~]$ mkfifo /tmp/test0
[postgres@s1 ~]$ /usr/local/pgsql/bin/psql test
psql (11devel)
Type "help" for help.
test=# create table test(t text);
CREATE TABLE
test=# copy test from '/tmp/test0';
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
...
```
Should we nonblocking open FIFO files?
And a following question if we nonblocking open them, say there is a
FIFO file, no one will write into it, and a utility calls `COPY FROM`
it, should we just return `COPY 0` or wait writers? If we wait, then
users have to interrupt or write an EOF into the FIFO after a timeout,
I see some utilities do that, gptransfer for instance, just seems not
right.
My plan is to write a new function which nonblocking opens FIFOs just
for COPY, and not waits writers, what do you think?
--
Adam Lee