MCPcopy Create free account
hub / github.com/apache/cloudberry / pg_file_write

Function pg_file_write

contrib/adminpack/adminpack.c:133–146  ·  view source on GitHub ↗

------------------------------------ * pg_file_write - old version * * The superuser() check here must be kept as the library might be upgraded * without the extension being upgraded, meaning that in pre-1.1 installations * these functions could be called by any user. */

Source from the content-addressed store, hash-verified

131 * these functions could be called by any user.
132 */
133Datum
134pg_file_write(PG_FUNCTION_ARGS)
135{
136 text *file = PG_GETARG_TEXT_PP(0);
137 text *data = PG_GETARG_TEXT_PP(1);
138 bool replace = PG_GETARG_BOOL(2);
139 int64 count = 0;
140
141 requireSuperuser();
142
143 count = pg_file_write_internal(file, data, replace);
144
145 PG_RETURN_INT64(count);
146}
147
148/* ------------------------------------
149 * pg_file_write_v1_1 - Version 1.1

Callers

nothing calls this directly

Calls 2

requireSuperuserFunction · 0.70
pg_file_write_internalFunction · 0.70

Tested by

no test coverage detected