postgresql/src/backend/utils/adt
Tom Lane 283129e325 Support pg_read_[binary_]file (filename, missing_ok).
There wasn't an especially nice way to read all of a file while
passing missing_ok = true.  Add an additional overloaded variant
to support that use-case.

While here, refactor the C code to avoid a rats-nest of PG_NARGS
checks, instead handling the argument collection in the outer
wrapper functions.  It's a bit longer this way, but far more
straightforward.

(Upon looking at the code coverage report for genfile.c, I was
impelled to also add a test case for pg_stat_file() -- tgl)

Kyotaro Horiguchi

Discussion: https://postgr.es/m/20220607.160520.1984541900138970018.horikyota.ntt@gmail.com
2022-07-29 15:38:49 -04:00
..
.gitignore
acl.c Replace many MemSet calls with struct initialization 2022-07-16 08:50:49 +02:00
amutils.c
array_expanded.c
array_selfuncs.c
array_typanalyze.c Invent qsort_interruptible(). 2022-07-12 16:30:36 -04:00
array_userfuncs.c
arrayfuncs.c Replace many MemSet calls with struct initialization 2022-07-16 08:50:49 +02:00
arraysubs.c
arrayutils.c Add construct_array_builtin, deconstruct_array_builtin 2022-07-01 11:23:15 +02:00
ascii.c
bool.c
cash.c
char.c
cryptohashfuncs.c
date.c Specialize tuplesort routines for different kinds of abbreviated keys 2022-04-02 15:22:25 +07:00
datetime.c Replace many MemSet calls with struct initialization 2022-07-16 08:50:49 +02:00
datum.c
dbsize.c Change internal RelFileNode references to RelFileNumber or RelFileLocator. 2022-07-06 11:39:09 -04:00
domains.c
encode.c
enum.c
expandeddatum.c
expandedrecord.c
float.c Remove support for Visual Studio 2013 2022-07-14 11:22:49 +09:00
format_type.c SQL JSON functions 2022-03-30 16:30:37 -04:00
formatting.c Remove configure probe for wctype.h. 2022-07-23 16:54:00 +12:00
genfile.c Support pg_read_[binary_]file (filename, missing_ok). 2022-07-29 15:38:49 -04:00
geo_ops.c Fix various typos and spelling mistakes in code comments 2022-04-11 20:49:41 +12:00
geo_selfuncs.c
geo_spgist.c
hbafuncs.c Fix path reference when parsing pg_ident.conf for pg_ident_file_mappings 2022-07-26 15:57:31 +09:00
inet_cidr_ntop.c
inet_net_pton.c
int8.c Teach planner and executor about monotonic window funcs 2022-04-08 10:34:36 +12:00
int.c
json.c Add construct_array_builtin, deconstruct_array_builtin 2022-07-01 11:23:15 +02:00
jsonb_gin.c Add construct_array_builtin, deconstruct_array_builtin 2022-07-01 11:23:15 +02:00
jsonb_op.c Add construct_array_builtin, deconstruct_array_builtin 2022-07-01 11:23:15 +02:00
jsonb_util.c Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00
jsonb.c Add construct_array_builtin, deconstruct_array_builtin 2022-07-01 11:23:15 +02:00
jsonbsubs.c
jsonfuncs.c Add construct_array_builtin, deconstruct_array_builtin 2022-07-01 11:23:15 +02:00
jsonpath_exec.c Tweak detail and hint messages to be consistent with project policy 2022-07-20 09:50:12 +09:00
jsonpath_gram.y Tweak detail and hint messages to be consistent with project policy 2022-07-20 09:50:12 +09:00
jsonpath_scan.l Indent C code in flex and bison files 2022-05-13 07:17:29 +02:00
jsonpath.c Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00
levenshtein.c
like_match.c
like_support.c
like.c Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00
lockfuncs.c Replace many MemSet calls with struct initialization 2022-07-16 08:50:49 +02:00
mac8.c
mac.c Specialize tuplesort routines for different kinds of abbreviated keys 2022-04-02 15:22:25 +07:00
Makefile Refactor code related to pg_hba_file_rules() into new file 2022-03-24 12:42:30 +09:00
mcxtfuncs.c
misc.c Fix pg_tablespace_location() with in-place tablespaces 2022-03-17 11:25:02 +09:00
multirangetypes_selfuncs.c
multirangetypes.c Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00
name.c Add construct_array_builtin, deconstruct_array_builtin 2022-07-01 11:23:15 +02:00
network_gist.c
network_selfuncs.c
network_spgist.c
network.c Specialize tuplesort routines for different kinds of abbreviated keys 2022-04-02 15:22:25 +07:00
numeric.c Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00
numutils.c
oid.c
oracle_compat.c Avoid ERRCODE_INTERNAL_ERROR in oracle_compat.c functions. 2022-05-26 12:25:10 -04:00
orderedsetaggs.c Add construct_array_builtin, deconstruct_array_builtin 2022-07-01 11:23:15 +02:00
partitionfuncs.c Replace many MemSet calls with struct initialization 2022-07-16 08:50:49 +02:00
pg_locale.c Remove support for Visual Studio 2013 2022-07-14 11:22:49 +09:00
pg_lsn.c
pg_upgrade_support.c Change internal RelFileNode references to RelFileNumber or RelFileLocator. 2022-07-06 11:39:09 -04:00
pgstatfuncs.c Replace many MemSet calls with struct initialization 2022-07-16 08:50:49 +02:00
pseudotypes.c
quote.c
rangetypes_gist.c
rangetypes_selfuncs.c
rangetypes_spgist.c Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00
rangetypes_typanalyze.c Invent qsort_interruptible(). 2022-07-12 16:30:36 -04:00
rangetypes.c Change some internal error messages to elogs 2022-03-30 17:53:54 +02:00
regexp.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
regproc.c
ri_triggers.c Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00
rowtypes.c
ruleutils.c Close old gap in dependency checks for functions returning composite. 2022-07-22 12:46:42 -04:00
selfuncs.c Fix omissions in support for the "regcollation" type. 2022-07-17 17:43:28 -04:00
tid.c
timestamp.c Replace many MemSet calls with struct initialization 2022-07-16 08:50:49 +02:00
trigfuncs.c
tsginidx.c
tsgistidx.c Change some unnecessary MemSet calls 2022-07-01 00:16:38 +02:00
tsquery_cleanup.c
tsquery_gist.c
tsquery_op.c
tsquery_rewrite.c
tsquery_util.c
tsquery.c Fix various typos and spelling mistakes in code comments 2022-04-11 20:49:41 +12:00
tsrank.c
tsvector_op.c Add construct_array_builtin, deconstruct_array_builtin 2022-07-01 11:23:15 +02:00
tsvector_parser.c
tsvector.c
uuid.c Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00
varbit.c
varchar.c Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00
varlena.c Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00
version.c
windowfuncs.c Teach planner and executor about monotonic window funcs 2022-04-08 10:34:36 +12:00
xid8funcs.c Fix visibility check when XID is committed in CLOG but not in procarray. 2022-06-27 08:21:08 +03:00
xid.c
xml.c Add construct_array_builtin, deconstruct_array_builtin 2022-07-01 11:23:15 +02:00