* Over time, this has also become the preferred place for widely known
* resource-limitation stuff, such as work_mem and check_stack_depth().
*
- * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/miscadmin.h,v 1.194 2007/04/16 18:29:56 alvherre Exp $
+ * $PostgreSQL: pgsql/src/include/miscadmin.h,v 1.201 2008/02/20 22:46:24 tgl Exp $
*
* NOTES
* some of the information in this file should be moved to other files.
#ifndef MISCADMIN_H
#define MISCADMIN_H
+#include "pgtime.h" /* for pg_time_t */
-#define PG_VERSIONSTR "postgres (PostgreSQL) " PG_VERSION "\n"
+
+#define PG_BACKEND_VERSIONSTR "postgres (PostgreSQL) " PG_VERSION "\n"
/*****************************************************************************
/* in globals.c */
/* these are marked volatile because they are set by signal handlers: */
-extern DLLIMPORT volatile bool InterruptPending;
+extern PGDLLIMPORT volatile bool InterruptPending;
extern volatile bool QueryCancelPending;
extern volatile bool ProcDiePending;
/* these are marked volatile because they are examined by signal handlers: */
extern volatile bool ImmediateInterruptOK;
-extern DLLIMPORT volatile uint32 InterruptHoldoffCount;
-extern DLLIMPORT volatile uint32 CritSectionCount;
+extern PGDLLIMPORT volatile uint32 InterruptHoldoffCount;
+extern PGDLLIMPORT volatile uint32 CritSectionCount;
/* in tcop/postgres.c */
extern void ProcessInterrupts(void);
extern bool ExitOnAnyError;
-extern DLLIMPORT char *DataDir;
+extern PGDLLIMPORT char *DataDir;
-extern DLLIMPORT int NBuffers;
+extern PGDLLIMPORT int NBuffers;
extern int MaxBackends;
extern int MaxConnections;
-extern DLLIMPORT int MyProcPid;
-extern DLLIMPORT struct Port *MyProcPort;
+extern PGDLLIMPORT int MyProcPid;
+extern PGDLLIMPORT pg_time_t MyStartTime;
+extern PGDLLIMPORT struct Port *MyProcPort;
extern long MyCancelKey;
extern char OutputFileName[];
-extern DLLIMPORT char my_exec_path[];
+extern PGDLLIMPORT char my_exec_path[];
extern char pkglib_path[];
#ifdef EXEC_BACKEND
*
* extern BackendId MyBackendId;
*/
-extern DLLIMPORT Oid MyDatabaseId;
+extern PGDLLIMPORT Oid MyDatabaseId;
-extern DLLIMPORT Oid MyDatabaseTableSpace;
+extern PGDLLIMPORT Oid MyDatabaseTableSpace;
/*
* Date/Time Configuration
extern bool enableFsync;
extern bool allowSystemTableMods;
-extern DLLIMPORT int work_mem;
-extern DLLIMPORT int maintenance_work_mem;
+extern PGDLLIMPORT int work_mem;
+extern PGDLLIMPORT int maintenance_work_mem;
extern int VacuumCostPageHit;
extern int VacuumCostPageMiss;
extern char *GetUserNameFromId(Oid roleid);
extern Oid GetUserId(void);
-extern void SetUserId(Oid userid);
extern Oid GetOuterUserId(void);
extern Oid GetSessionUserId(void);
+extern void GetUserIdAndContext(Oid *userid, bool *sec_def_context);
+extern void SetUserIdAndContext(Oid userid, bool sec_def_context);
+extern bool InSecurityDefinerContext(void);
extern void InitializeSessionUserId(const char *rolename);
extern void InitializeSessionUserIdStandalone(void);
-extern void AtAbort_UserId(void);
extern void SetSessionAuthorization(Oid userid, bool is_superuser);
extern Oid GetCurrentRoleId(void);
extern void SetCurrentRoleId(Oid roleid, bool is_superuser);