PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <sys/file.h>
#include <sys/stat.h>
#include <unistd.h>
#include "catalog/pg_authid.h"
#include "catalog/pg_type.h"
#include "funcapi.h"
#include "miscadmin.h"
#include "postmaster/syslogger.h"
#include "storage/fd.h"
#include "utils/acl.h"
#include "utils/builtins.h"
#include "utils/datetime.h"
Go to the source code of this file.
Variables | |
PG_MODULE_MAGIC | |
|
static |
Definition at line 71 of file adminpack.c.
References arg, canonicalize_path(), DataDir, ereport, errcode(), errmsg(), ERROR, filename, GetUserId(), has_privs_of_role(), is_absolute_path, path_is_prefix_of_path(), path_is_relative_and_below_cwd(), and text_to_cstring().
Referenced by pg_file_rename_internal(), pg_file_sync(), pg_file_unlink(), pg_file_unlink_v1_1(), and pg_file_write_internal().
Datum pg_file_rename | ( | PG_FUNCTION_ARGS | ) |
Definition at line 239 of file adminpack.c.
References PG_ARGISNULL, pg_file_rename_internal(), PG_GETARG_TEXT_PP, PG_RETURN_BOOL, PG_RETURN_NULL, and requireSuperuser().
Definition at line 303 of file adminpack.c.
References convert_and_check_filename(), ereport, errcode(), errcode_for_file_access(), errmsg(), ERROR, and WARNING.
Referenced by pg_file_rename(), and pg_file_rename_v1_1().
Datum pg_file_rename_v1_1 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 274 of file adminpack.c.
References PG_ARGISNULL, pg_file_rename_internal(), PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and PG_RETURN_NULL.
Datum pg_file_sync | ( | PG_FUNCTION_ARGS | ) |
Definition at line 214 of file adminpack.c.
References convert_and_check_filename(), ereport, errcode_for_file_access(), errmsg(), ERROR, filename, fsync_fname_ext(), PG_GETARG_TEXT_PP, PG_RETURN_VOID, S_ISDIR, stat::st_mode, and stat.
Datum pg_file_unlink | ( | PG_FUNCTION_ARGS | ) |
Definition at line 396 of file adminpack.c.
References convert_and_check_filename(), ereport, errcode_for_file_access(), errmsg(), ERROR, filename, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, requireSuperuser(), and WARNING.
Datum pg_file_unlink_v1_1 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 436 of file adminpack.c.
References convert_and_check_filename(), ereport, errcode_for_file_access(), errmsg(), ERROR, filename, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and WARNING.
Datum pg_file_write | ( | PG_FUNCTION_ARGS | ) |
Definition at line 128 of file adminpack.c.
References data, pg_file_write_internal(), PG_GETARG_BOOL, PG_GETARG_TEXT_PP, PG_RETURN_INT64, and requireSuperuser().
Definition at line 170 of file adminpack.c.
References AllocateFile(), convert_and_check_filename(), data, ereport, errcode(), errcode_for_file_access(), errmsg(), ERROR, filename, FreeFile(), stat, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Referenced by pg_file_write(), and pg_file_write_v1_1().
Datum pg_file_write_v1_1 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 152 of file adminpack.c.
References data, pg_file_write_internal(), PG_GETARG_BOOL, PG_GETARG_TEXT_PP, and PG_RETURN_INT64.
PG_FUNCTION_INFO_V1 | ( | pg_file_rename | ) |
PG_FUNCTION_INFO_V1 | ( | pg_file_rename_v1_1 | ) |
PG_FUNCTION_INFO_V1 | ( | pg_file_sync | ) |
PG_FUNCTION_INFO_V1 | ( | pg_file_unlink | ) |
PG_FUNCTION_INFO_V1 | ( | pg_file_unlink_v1_1 | ) |
PG_FUNCTION_INFO_V1 | ( | pg_file_write | ) |
PG_FUNCTION_INFO_V1 | ( | pg_file_write_v1_1 | ) |
PG_FUNCTION_INFO_V1 | ( | pg_logdir_ls | ) |
PG_FUNCTION_INFO_V1 | ( | pg_logdir_ls_v1_1 | ) |
Datum pg_logdir_ls | ( | PG_FUNCTION_ARGS | ) |
Definition at line 471 of file adminpack.c.
References ereport, errcode(), errmsg(), ERROR, pg_logdir_ls_internal(), and superuser().
|
static |
Definition at line 497 of file adminpack.c.
References AllocateDir(), ReturnSetInfo::allowedModes, BuildTupleFromCStrings(), CreateTemplateTupleDesc(), DecodeDateTime(), ReturnSetInfo::econtext, ExprContext::ecxt_per_query_memory, ereport, errcode(), errmsg(), ERROR, FreeDir(), if(), IsA, Log_directory, Log_filename, MAXDATEFIELDS, MAXDATELEN, MemoryContextSwitchTo(), ParseDateTime(), psprintf(), ReadDir(), FunctionCallInfoBaseData::resultinfo, ReturnSetInfo::returnMode, ReturnSetInfo::setDesc, ReturnSetInfo::setResult, SFRM_Materialize, SFRM_Materialize_Random, TupleDescGetAttInMetadata(), TupleDescInitEntry(), tuplestore_begin_heap(), tuplestore_puttuple(), values, and work_mem.
Referenced by pg_logdir_ls(), and pg_logdir_ls_v1_1().
Datum pg_logdir_ls_v1_1 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 491 of file adminpack.c.
References pg_logdir_ls_internal().
|
static |
Definition at line 110 of file adminpack.c.
References ereport, errcode(), errmsg(), ERROR, and superuser().
Referenced by pg_file_rename(), pg_file_unlink(), and pg_file_write().
PG_MODULE_MAGIC |
Definition at line 43 of file adminpack.c.