READABLE from COPY does not recieve close event
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 8.7k
- Forks
- 374
- Avg merge
- 11d 16h
- Merged PRs (30d)
- 1
Description
I am using a postgres client to run COPY on the server to stdout into a readable stream. I am using pipeline and noticing that sometimes pipeline hangs indefinetly due to the readabel stream never getting the 'close' event. I provided sample code below. I'm trying to read the output of copy to a local file.
await pipeline(
await sourceSql`COPY (${sourceSql.unsafe(
'select * from test where id = ' +
id
)}) to stdout WITH (FORMAT CSV, NULL "NULL", HEADER)`.readable();,
createWriteStream(
`${os.homedir()}/cms/${testName}`
)
);
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Use the reported PostgreSQL COPY-to-stdout call and its .readable() entry point with the pipeline and createWriteStream example; first reproduce whether the readable stream emits close. Done means the pipeline completes and the COPY output is written to the local file without hanging.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs, postgresql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100