Re: pipe_read_line for reading arbitrary strings
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Daniel Gustafsson <daniel@yesql.se>
Cc: Peter Eisentraut <peter@eisentraut.org>, Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-03-06T10:46:29Z
Lists: pgsql-hackers
On 2024-Mar-06, Daniel Gustafsson wrote: > Good catch, that's an incorrect copy/paste, it should use ERRCODE_NO_DATA. I'm > not convinced that a function to read from a pipe should consider not reading > anything successful by default, output is sort expected here. We could add a > flag parameter to use for signalling that no data is fine though as per the > attached (as of yet untested) diff? I think adding dead code is not a great plan, particularly if it's hairy enough that we need to very carefully dissect what happens in error cases. IMO if and when somebody has a need for an empty return string being acceptable, they can add it then. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
Commits
-
Fix errorhandling for reading from a pipe
- be41a9b03807 17.0 landed
-
Refactor pipe_read_line to return the full line
- 5c7038d70bb9 17.0 landed
-
Add -c/--restore-target-wal to pg_rewind
- a7e8ece41cf7 13.0 cited
-
Here is a patch that fixes the pipes used in find_other_exec() when
- 5b2f4afffe69 8.0.0 cited