Seems a bug, because is impossible to call pg_read_file
or pg_read_binary_file
without the length before the missing_ok flag... It is possible? I try lengths NULL and -1, but not works.
No clues at documentation, https://www.postgresql.org/docs/current/functions-admin.html
Notes
- the length (file size in bytes) is unpredictable, sometimes big big files.
- I need portable calls: for example
pg_read_file(f,0,922337203,missing_ok)
is not a solution. - (edited after @LaurenzAlbe comment) As a constant/default length I try also 9223372036854775807, and same problem, an error.
In this case "ERROR: requested length too large".