36 #include "utils/fmgrprotos.h"
56 bool have_style =
false;
57 bool have_order =
false;
80 char *tok = (
char *)
lfirst(l);
149 void *subextra = NULL;
163 myextra = (
int *) subextra;
165 newDateStyle = myextra[0];
167 newDateOrder = myextra[1];
196 switch (newDateStyle)
199 strcpy(result,
"ISO");
202 strcpy(result,
"SQL");
205 strcpy(result,
"German");
208 strcpy(result,
"Postgres");
211 switch (newDateOrder)
214 strcat(result,
", YMD");
217 strcat(result,
", DMY");
220 strcat(result,
", MDY");
233 myextra[0] = newDateStyle;
234 myextra[1] = newDateOrder;
235 *extra = (
void *) myextra;
246 int *myextra = (
int *) extra;
274 const char *valueptr = *
newval;
279 while (isspace((
unsigned char) *valueptr))
281 if (*valueptr++ !=
'\'')
285 endptr = strchr(
val,
'\'');
286 if (!endptr || endptr[1] !=
'\0')
329 hours = strtod(*
newval, &endptr);
330 if (endptr != *
newval && *endptr ==
'\0')
372 *((
pg_tz **) *extra) = new_tz;
445 *((
pg_tz **) *extra) = new_tz;
552 GUC_check_errmsg(
"cannot set transaction read-write mode inside a read-only transaction");
559 GUC_check_errmsg(
"transaction read-write mode must be set before any query");
586 int newXactIsoLevel = *
newval;
594 GUC_check_errmsg(
"SET TRANSACTION ISOLATION LEVEL must be called before any query");
601 GUC_check_errmsg(
"SET TRANSACTION ISOLATION LEVEL must not be called in a subtransaction");
631 GUC_check_errmsg(
"SET TRANSACTION [NOT] DEFERRABLE cannot be called within a subtransaction");
637 GUC_check_errmsg(
"SET TRANSACTION [NOT] DEFERRABLE must be called before any query");
669 if (*((
int *) extra))
671 *((
int *) extra) = 0;
677 return "unavailable";
689 const char *canonical_name;
763 if (strcmp(*
newval, canonical_name) != 0 &&
764 strcmp(*
newval,
"UNICODE") != 0)
848 (
errcode(ERRCODE_UNDEFINED_OBJECT),
857 roleid = roleform->oid;
873 (
errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
874 errmsg(
"permission will be denied to set session authorization \"%s\"",
890 *extra = (
void *) myextra;
925 if (strcmp(*
newval,
"none") == 0)
956 (
errcode(ERRCODE_UNDEFINED_OBJECT),
965 roleid = roleform->oid;
981 (
errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
982 errmsg(
"permission will be denied to set role \"%s\"",
999 *extra = (
void *) myextra;
1145 static char buf[12];
1157 static char buf[12];
1169 static char buf[12];
1212 #ifndef USE_PREFETCH
1215 GUC_check_errdetail(
"\"%s\" must be set to 0 on platforms that lack support for issuing read-ahead advice.",
1216 "effective_io_concurrency");
1226 #ifndef USE_PREFETCH
1229 GUC_check_errdetail(
"\"%s\" must be set to 0 on platforms that lack support for issuing read-ahead advice.",
1230 "maintenance_io_concurrency");
bool member_can_set_role(Oid member, Oid role)
bool InitializingParallelWorker
const char * show_unix_socket_permissions(void)
void assign_application_name(const char *newval, void *extra)
bool check_bonjour(bool *newval, void **extra, GucSource source)
bool check_maintenance_io_concurrency(int *newval, void **extra, GucSource source)
void assign_session_authorization(const char *newval, void *extra)
bool check_transaction_deferrable(bool *newval, void **extra, GucSource source)
bool check_canonical_path(char **newval, void **extra, GucSource source)
const char * show_timezone(void)
bool check_transaction_isolation(int *newval, void **extra, GucSource source)
bool check_default_with_oids(bool *newval, void **extra, GucSource source)
void assign_timezone_abbreviations(const char *newval, void *extra)
bool check_effective_io_concurrency(int *newval, void **extra, GucSource source)
bool check_application_name(char **newval, void **extra, GucSource source)
void assign_timezone(const char *newval, void *extra)
bool check_role(char **newval, void **extra, GucSource source)
bool check_cluster_name(char **newval, void **extra, GucSource source)
const char * show_log_timezone(void)
bool check_session_authorization(char **newval, void **extra, GucSource source)
bool check_transaction_read_only(bool *newval, void **extra, GucSource source)
void assign_maintenance_io_concurrency(int newval, void *extra)
bool check_timezone_abbreviations(char **newval, void **extra, GucSource source)
void assign_client_encoding(const char *newval, void *extra)
void assign_role(const char *newval, void *extra)
bool check_timezone(char **newval, void **extra, GucSource source)
const char * show_random_seed(void)
bool check_ssl(bool *newval, void **extra, GucSource source)
void assign_datestyle(const char *newval, void *extra)
void assign_random_seed(double newval, void *extra)
bool check_log_timezone(char **newval, void **extra, GucSource source)
bool check_random_seed(double *newval, void **extra, GucSource source)
const char * show_role(void)
bool check_datestyle(char **newval, void **extra, GucSource source)
bool check_client_encoding(char **newval, void **extra, GucSource source)
const char * show_log_file_mode(void)
const char * show_data_directory_mode(void)
void assign_log_timezone(const char *newval, void *extra)
void InstallTimeZoneAbbrevs(TimeZoneAbbrevTable *tbl)
Datum interval_in(PG_FUNCTION_ARGS)
void pgstat_report_appname(const char *appname)
int maintenance_io_concurrency
#define Assert(condition)
#define OidIsValid(objectId)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
int pg_valid_client_encoding(const char *name)
#define MCXT_ALLOC_NO_OOM
Datum Float8GetDatum(float8 X)
#define DirectFunctionCall1(func, arg1)
#define DirectFunctionCall3(func, arg1, arg2, arg3)
void GUC_check_errcode(int sqlerrcode)
void * guc_malloc(int elevel, size_t size)
const char * GetConfigOptionResetString(const char *name)
char * guc_strdup(int elevel, const char *src)
#define GUC_check_errdetail
#define GUC_check_errhint
#define HeapTupleIsValid(tuple)
#define IsParallelWorker()
void list_free(List *list)
int SetClientEncoding(int encoding)
int PrepareClientEncoding(int encoding)
const char * GetDatabaseEncodingName(void)
char * pstrdup(const char *in)
void pfree(void *pointer)
#define AmStartupProcess()
#define USE_POSTGRES_DATES
void SetSessionAuthorization(Oid userid, bool is_superuser)
Oid GetSessionUserId(void)
void SetCurrentRoleId(Oid roleid, bool is_superuser)
Oid GetAuthenticatedUserId(void)
Oid GetCurrentRoleId(void)
FormData_pg_authid * Form_pg_authid
static bool is_superuser(Archive *fout)
static rewind_source * source
#define pg_encoding_to_char
bool pg_tz_acceptable(pg_tz *tz)
pg_tz * pg_tzset_offset(long gmtoffset)
const char * pg_get_timezone_name(pg_tz *tz)
PGDLLIMPORT pg_tz * session_timezone
pg_tz * pg_tzset(const char *tzname)
PGDLLIMPORT pg_tz * log_timezone
int pg_strcasecmp(const char *s1, const char *s2)
void canonicalize_path(char *path)
int pg_strncasecmp(const char *s1, const char *s2, size_t n)
static Datum PointerGetDatum(const void *X)
static Datum ObjectIdGetDatum(Oid X)
static Datum CStringGetDatum(const char *X)
static Datum Int32GetDatum(int32 X)
int Unix_socket_permissions
Datum setseed(PG_FUNCTION_ARGS)
char * pg_clean_ascii(const char *str, int alloc_flags)
bool superuser_arg(Oid roleid)
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
TimeZoneAbbrevTable * load_tzoffsets(const char *filename)
static Interval * DatumGetIntervalP(Datum X)
bool SplitIdentifierString(char *rawstring, char separator, List **namelist)
bool IsTransactionState(void)
bool IsSubTransaction(void)
#define XACT_SERIALIZABLE
bool RecoveryInProgress(void)
void XLogPrefetchReconfigure(void)