eaiovnaovbqoebvqoeavibavo PKBiZny!77internal/port.hnu[/*------------------------------------------------------------------------- * * port.h * Header for src/port/ compatibility functions. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/port.h * *------------------------------------------------------------------------- */ #ifndef PG_PORT_H #define PG_PORT_H #include #include #include /* socket has a different definition on WIN32 */ #ifndef WIN32 typedef int pgsocket; #define PGINVALID_SOCKET (-1) #else typedef SOCKET pgsocket; #define PGINVALID_SOCKET INVALID_SOCKET #endif /* non-blocking */ extern bool pg_set_noblock(pgsocket sock); extern bool pg_set_block(pgsocket sock); /* Portable path handling for Unix/Win32 (in path.c) */ extern bool has_drive_prefix(const char *filename); extern char *first_dir_separator(const char *filename); extern char *last_dir_separator(const char *filename); extern char *first_path_var_separator(const char *pathlist); extern void join_path_components(char *ret_path, const char *head, const char *tail); extern void canonicalize_path(char *path); extern void make_native_path(char *path); extern bool path_contains_parent_reference(const char *path); extern bool path_is_relative_and_below_cwd(const char *path); extern bool path_is_prefix_of_path(const char *path1, const char *path2); extern const char *get_progname(const char *argv0); extern void get_share_path(const char *my_exec_path, char *ret_path); extern void get_etc_path(const char *my_exec_path, char *ret_path); extern void get_include_path(const char *my_exec_path, char *ret_path); extern void get_pkginclude_path(const char *my_exec_path, char *ret_path); extern void get_includeserver_path(const char *my_exec_path, char *ret_path); extern void get_lib_path(const char *my_exec_path, char *ret_path); extern void get_pkglib_path(const char *my_exec_path, char *ret_path); extern void get_locale_path(const char *my_exec_path, char *ret_path); extern void get_doc_path(const char *my_exec_path, char *ret_path); extern void get_html_path(const char *my_exec_path, char *ret_path); extern void get_man_path(const char *my_exec_path, char *ret_path); extern bool get_home_path(char *ret_path); extern void get_parent_directory(char *path); /* port/dirmod.c */ extern char **pgfnames(const char *path); extern void pgfnames_cleanup(char **filenames); /* * is_absolute_path * * By making this a macro we avoid needing to include path.c in libpq. */ #ifndef WIN32 #define IS_DIR_SEP(ch) ((ch) == '/') #define is_absolute_path(filename) \ ( \ IS_DIR_SEP((filename)[0]) \ ) #else #define IS_DIR_SEP(ch) ((ch) == '/' || (ch) == '\\') /* See path_is_relative_and_below_cwd() for how we handle 'E:abc'. */ #define is_absolute_path(filename) \ ( \ IS_DIR_SEP((filename)[0]) || \ (isalpha((unsigned char) ((filename)[0])) && (filename)[1] == ':' && \ IS_DIR_SEP((filename)[2])) \ ) #endif /* Portable locale initialization (in exec.c) */ extern void set_pglocale_pgservice(const char *argv0, const char *app); /* Portable way to find binaries (in exec.c) */ extern int find_my_exec(const char *argv0, char *retpath); extern int find_other_exec(const char *argv0, const char *target, const char *versionstr, char *retpath); /* Windows security token manipulation (in exec.c) */ #ifdef WIN32 extern BOOL AddUserToTokenDacl(HANDLE hToken); #endif #if defined(WIN32) || defined(__CYGWIN__) #define EXE ".exe" #else #define EXE "" #endif #if defined(WIN32) && !defined(__CYGWIN__) #define DEVNULL "nul" #else #define DEVNULL "/dev/null" #endif /* * Win32 needs double quotes at the beginning and end of system() * strings. If not, it gets confused with multiple quoted strings. * It also requires double-quotes around the executable name and * any files used for redirection. Other args can use single-quotes. * * Generated using Win32 "CMD /?": * * 1. If all of the following conditions are met, then quote characters * on the command line are preserved: * * - no /S switch * - exactly two quote characters * - no special characters between the two quote characters, where special * is one of: &<>()@^| * - there are one or more whitespace characters between the two quote * characters * - the string between the two quote characters is the name of an * executable file. * * 2. Otherwise, old behavior is to see if the first character is a quote * character and if so, strip the leading character and remove the last * quote character on the command line, preserving any text after the last * quote character. */ #if defined(WIN32) && !defined(__CYGWIN__) #define SYSTEMQUOTE "\"" #else #define SYSTEMQUOTE "" #endif /* Portable delay handling */ extern void pg_usleep(long microsec); /* Portable SQL-like case-independent comparisons and conversions */ extern int pg_strcasecmp(const char *s1, const char *s2); extern int pg_strncasecmp(const char *s1, const char *s2, size_t n); extern unsigned char pg_toupper(unsigned char ch); extern unsigned char pg_tolower(unsigned char ch); extern unsigned char pg_ascii_toupper(unsigned char ch); extern unsigned char pg_ascii_tolower(unsigned char ch); #ifdef USE_REPL_SNPRINTF /* * Versions of libintl >= 0.13 try to replace printf() and friends with * macros to their own versions that understand the %$ format. We do the * same, so disable their macros, if they exist. */ #ifdef vsnprintf #undef vsnprintf #endif #ifdef snprintf #undef snprintf #endif #ifdef sprintf #undef sprintf #endif #ifdef vfprintf #undef vfprintf #endif #ifdef fprintf #undef fprintf #endif #ifdef printf #undef printf #endif extern int pg_vsnprintf(char *str, size_t count, const char *fmt, va_list args); extern int pg_snprintf(char *str, size_t count, const char *fmt,...) /* This extension allows gcc to check the format string */ __attribute__((format(PG_PRINTF_ATTRIBUTE, 3, 4))); extern int pg_sprintf(char *str, const char *fmt,...) /* This extension allows gcc to check the format string */ __attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 3))); extern int pg_vfprintf(FILE *stream, const char *fmt, va_list args); extern int pg_fprintf(FILE *stream, const char *fmt,...) /* This extension allows gcc to check the format string */ __attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 3))); extern int pg_printf(const char *fmt,...) /* This extension allows gcc to check the format string */ __attribute__((format(PG_PRINTF_ATTRIBUTE, 1, 2))); /* * The GCC-specific code below prevents the __attribute__(... 'printf') * above from being replaced, and this is required because gcc doesn't * know anything about pg_printf. */ #ifdef __GNUC__ #define vsnprintf(...) pg_vsnprintf(__VA_ARGS__) #define snprintf(...) pg_snprintf(__VA_ARGS__) #define sprintf(...) pg_sprintf(__VA_ARGS__) #define vfprintf(...) pg_vfprintf(__VA_ARGS__) #define fprintf(...) pg_fprintf(__VA_ARGS__) #define printf(...) pg_printf(__VA_ARGS__) #else #define vsnprintf pg_vsnprintf #define snprintf pg_snprintf #define sprintf pg_sprintf #define vfprintf pg_vfprintf #define fprintf pg_fprintf #define printf pg_printf #endif #endif /* USE_REPL_SNPRINTF */ #if defined(WIN32) /* * Versions of libintl >= 0.18? try to replace setlocale() with a macro * to their own versions. Remove the macro, if it exists, because it * ends up calling the wrong version when the backend and libintl use * different versions of msvcrt. */ #if defined(setlocale) #undef setlocale #endif /* * Define our own wrapper macro around setlocale() to work around bugs in * Windows' native setlocale() function. */ extern char *pgwin32_setlocale(int category, const char *locale); #define setlocale(a,b) pgwin32_setlocale(a,b) #endif /* WIN32 */ /* Portable prompt handling */ extern char *simple_prompt(const char *prompt, int maxlen, bool echo); #ifdef WIN32 #define PG_SIGNAL_COUNT 32 #define kill(pid,sig) pgkill(pid,sig) extern int pgkill(int pid, int sig); #endif extern int pclose_check(FILE *stream); /* Global variable holding time zone information. */ #ifndef __CYGWIN__ #define TIMEZONE_GLOBAL timezone #define TZNAME_GLOBAL tzname #else #define TIMEZONE_GLOBAL _timezone #define TZNAME_GLOBAL _tzname #endif #if defined(WIN32) || defined(__CYGWIN__) /* * Win32 doesn't have reliable rename/unlink during concurrent access. */ extern int pgrename(const char *from, const char *to); extern int pgunlink(const char *path); /* Include this first so later includes don't see these defines */ #ifdef WIN32_ONLY_COMPILER #include #endif #define rename(from, to) pgrename(from, to) #define unlink(path) pgunlink(path) #endif /* defined(WIN32) || defined(__CYGWIN__) */ /* * Win32 also doesn't have symlinks, but we can emulate them with * junction points on newer Win32 versions. * * Cygwin has its own symlinks which work on Win95/98/ME where * junction points don't, so use those instead. We have no way of * knowing what type of system Cygwin binaries will be run on. * Note: Some CYGWIN includes might #define WIN32. */ #if defined(WIN32) && !defined(__CYGWIN__) extern int pgsymlink(const char *oldpath, const char *newpath); extern int pgreadlink(const char *path, char *buf, size_t size); extern bool pgwin32_is_junction(char *path); #define symlink(oldpath, newpath) pgsymlink(oldpath, newpath) #define readlink(path, buf, size) pgreadlink(path, buf, size) #endif extern bool rmtree(const char *path, bool rmtopdir); /* * stat() is not guaranteed to set the st_size field on win32, so we * redefine it to our own implementation that is. * * We must pull in sys/stat.h here so the system header definition * goes in first, and we redefine that, and not the other way around. * * Some frontends don't need the size from stat, so if UNSAFE_STAT_OK * is defined we don't bother with this. */ #if defined(WIN32) && !defined(__CYGWIN__) && !defined(UNSAFE_STAT_OK) #include extern int pgwin32_safestat(const char *path, struct stat * buf); #define stat(a,b) pgwin32_safestat(a,b) #endif #if defined(WIN32) && !defined(__CYGWIN__) /* * open() and fopen() replacements to allow deletion of open files and * passing of other special options. */ #define O_DIRECT 0x80000000 extern int pgwin32_open(const char *, int,...); extern FILE *pgwin32_fopen(const char *, const char *); #ifndef FRONTEND #define open(a,b,c) pgwin32_open(a,b,c) #define fopen(a,b) pgwin32_fopen(a,b) #endif #ifndef popen #define popen(a,b) _popen(a,b) #endif #ifndef pclose #define pclose(a) _pclose(a) #endif /* New versions of MingW have gettimeofday, old mingw and msvc don't */ #ifndef HAVE_GETTIMEOFDAY /* Last parameter not used */ extern int gettimeofday(struct timeval * tp, struct timezone * tzp); #endif #else /* !WIN32 */ /* * Win32 requires a special close for sockets and pipes, while on Unix * close() does them all. */ #define closesocket close #endif /* WIN32 */ /* * On Windows, setvbuf() does not support _IOLBF mode, and interprets that * as _IOFBF. To add insult to injury, setvbuf(file, NULL, _IOFBF, 0) * crashes outright if "parameter validation" is enabled. Therefore, in * places where we'd like to select line-buffered mode, we fall back to * unbuffered mode instead on Windows. Always use PG_IOLBF not _IOLBF * directly in order to implement this behavior. */ #ifndef WIN32 #define PG_IOLBF _IOLBF #else #define PG_IOLBF _IONBF #endif /* * Default "extern" declarations or macro substitutes for library routines. * When necessary, these routines are provided by files in src/port/. */ #ifndef HAVE_CRYPT extern char *crypt(const char *key, const char *setting); #endif /* WIN32 handled in port/win32.h */ #ifndef WIN32 #define pgoff_t off_t #ifdef __NetBSD__ extern int fseeko(FILE *stream, off_t offset, int whence); extern off_t ftello(FILE *stream); #endif #endif extern double pg_erand48(unsigned short xseed[3]); extern long pg_lrand48(void); extern void pg_srand48(long seed); #ifndef HAVE_FLS extern int fls(int mask); #endif #ifndef HAVE_FSEEKO #define fseeko(a, b, c) fseek(a, b, c) #define ftello(a) ftell(a) #endif #ifndef HAVE_GETOPT extern int getopt(int nargc, char *const * nargv, const char *ostr); #endif #if !defined(HAVE_GETPEEREID) && !defined(WIN32) extern int getpeereid(int sock, uid_t *uid, gid_t *gid); #endif #ifndef HAVE_ISINF extern int isinf(double x); #endif #ifndef HAVE_MKDTEMP extern char *mkdtemp(char *path); #endif #ifndef HAVE_RINT extern double rint(double x); #endif #ifndef HAVE_INET_ATON #include #include extern int inet_aton(const char *cp, struct in_addr * addr); #endif #if !HAVE_DECL_STRLCAT extern size_t strlcat(char *dst, const char *src, size_t siz); #endif #if !HAVE_DECL_STRLCPY extern size_t strlcpy(char *dst, const char *src, size_t siz); #endif #if !defined(HAVE_RANDOM) && !defined(__BORLANDC__) extern long random(void); #endif #ifndef HAVE_UNSETENV extern void unsetenv(const char *name); #endif #ifndef HAVE_SRANDOM extern void srandom(unsigned int seed); #endif /* thread.h */ extern char *pqStrerror(int errnum, char *strerrbuf, size_t buflen); #if !defined(WIN32) || defined(__CYGWIN__) extern int pqGetpwuid(uid_t uid, struct passwd * resultbuf, char *buffer, size_t buflen, struct passwd ** result); #endif extern int pqGethostbyname(const char *name, struct hostent * resultbuf, char *buffer, size_t buflen, struct hostent ** result, int *herrno); extern void pg_qsort(void *base, size_t nel, size_t elsize, int (*cmp) (const void *, const void *)); #define qsort(a,b,c,d) pg_qsort(a,b,c,d) typedef int (*qsort_arg_comparator) (const void *a, const void *b, void *arg); extern void qsort_arg(void *base, size_t nel, size_t elsize, qsort_arg_comparator cmp, void *arg); /* port/chklocale.c */ extern int pg_get_encoding_from_locale(const char *ctype, bool write_message); /* port/inet_net_ntop.c */ extern char *inet_net_ntop(int af, const void *src, int bits, char *dst, size_t size); /* port/pgcheckdir.c */ extern int pg_check_dir(const char *dir); /* port/pgmkdirp.c */ extern int pg_mkdir_p(char *path, int omode); #endif /* PG_PORT_H */ PKBiZ3Ainternal/pqexpbuffer.hnu[/*------------------------------------------------------------------------- * * pqexpbuffer.h * Declarations/definitions for "PQExpBuffer" functions. * * PQExpBuffer provides an indefinitely-extensible string data type. * It can be used to buffer either ordinary C strings (null-terminated text) * or arbitrary binary data. All storage is allocated with malloc(). * * This module is essentially the same as the backend's StringInfo data type, * but it is intended for use in frontend libpq and client applications. * Thus, it does not rely on palloc() nor elog(). * * It does rely on vsnprintf(); if configure finds that libc doesn't provide * a usable vsnprintf(), then a copy of our own implementation of it will * be linked into libpq. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/interfaces/libpq/pqexpbuffer.h * *------------------------------------------------------------------------- */ #ifndef PQEXPBUFFER_H #define PQEXPBUFFER_H /*------------------------- * PQExpBufferData holds information about an extensible string. * data is the current buffer for the string (allocated with malloc). * len is the current string length. There is guaranteed to be * a terminating '\0' at data[len], although this is not very * useful when the string holds binary data rather than text. * maxlen is the allocated size in bytes of 'data', i.e. the maximum * string size (including the terminating '\0' char) that we can * currently store in 'data' without having to reallocate * more space. We must always have maxlen > len. * * An exception occurs if we failed to allocate enough memory for the string * buffer. In that case data points to a statically allocated empty string, * and len = maxlen = 0. *------------------------- */ typedef struct PQExpBufferData { char *data; size_t len; size_t maxlen; } PQExpBufferData; typedef PQExpBufferData *PQExpBuffer; /*------------------------ * Test for a broken (out of memory) PQExpBuffer. * When a buffer is "broken", all operations except resetting or deleting it * are no-ops. *------------------------ */ #define PQExpBufferBroken(str) \ ((str) == NULL || (str)->maxlen == 0) /*------------------------ * Same, but for use when using a static or local PQExpBufferData struct. * For that, a null-pointer test is useless and may draw compiler warnings. *------------------------ */ #define PQExpBufferDataBroken(buf) \ ((buf).maxlen == 0) /*------------------------ * Initial size of the data buffer in a PQExpBuffer. * NB: this must be large enough to hold error messages that might * be returned by PQrequestCancel(). *------------------------ */ #define INITIAL_EXPBUFFER_SIZE 256 /*------------------------ * There are two ways to create a PQExpBuffer object initially: * * PQExpBuffer stringptr = createPQExpBuffer(); * Both the PQExpBufferData and the data buffer are malloc'd. * * PQExpBufferData string; * initPQExpBuffer(&string); * The data buffer is malloc'd but the PQExpBufferData is presupplied. * This is appropriate if the PQExpBufferData is a field of another * struct. *------------------------- */ /*------------------------ * createPQExpBuffer * Create an empty 'PQExpBufferData' & return a pointer to it. */ extern PQExpBuffer createPQExpBuffer(void); /*------------------------ * initPQExpBuffer * Initialize a PQExpBufferData struct (with previously undefined contents) * to describe an empty string. */ extern void initPQExpBuffer(PQExpBuffer str); /*------------------------ * To destroy a PQExpBuffer, use either: * * destroyPQExpBuffer(str); * free()s both the data buffer and the PQExpBufferData. * This is the inverse of createPQExpBuffer(). * * termPQExpBuffer(str) * free()s the data buffer but not the PQExpBufferData itself. * This is the inverse of initPQExpBuffer(). * * NOTE: some routines build up a string using PQExpBuffer, and then * release the PQExpBufferData but return the data string itself to their * caller. At that point the data string looks like a plain malloc'd * string. */ extern void destroyPQExpBuffer(PQExpBuffer str); extern void termPQExpBuffer(PQExpBuffer str); /*------------------------ * resetPQExpBuffer * Reset a PQExpBuffer to empty * * Note: if possible, a "broken" PQExpBuffer is returned to normal. */ extern void resetPQExpBuffer(PQExpBuffer str); /*------------------------ * enlargePQExpBuffer * Make sure there is enough space for 'needed' more bytes in the buffer * ('needed' does not include the terminating null). * * Returns 1 if OK, 0 if failed to enlarge buffer. (In the latter case * the buffer is left in "broken" state.) */ extern int enlargePQExpBuffer(PQExpBuffer str, size_t needed); /*------------------------ * printfPQExpBuffer * Format text data under the control of fmt (an sprintf-like format string) * and insert it into str. More space is allocated to str if necessary. * This is a convenience routine that does the same thing as * resetPQExpBuffer() followed by appendPQExpBuffer(). */ extern void printfPQExpBuffer(PQExpBuffer str, const char *fmt,...) /* This extension allows gcc to check the format string */ __attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 3))); /*------------------------ * appendPQExpBuffer * Format text data under the control of fmt (an sprintf-like format string) * and append it to whatever is already in str. More space is allocated * to str if necessary. This is sort of like a combination of sprintf and * strcat. */ extern void appendPQExpBuffer(PQExpBuffer str, const char *fmt,...) /* This extension allows gcc to check the format string */ __attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 3))); /*------------------------ * appendPQExpBufferStr * Append the given string to a PQExpBuffer, allocating more space * if necessary. */ extern void appendPQExpBufferStr(PQExpBuffer str, const char *data); /*------------------------ * appendPQExpBufferChar * Append a single byte to str. * Like appendPQExpBuffer(str, "%c", ch) but much faster. */ extern void appendPQExpBufferChar(PQExpBuffer str, char ch); /*------------------------ * appendBinaryPQExpBuffer * Append arbitrary binary data to a PQExpBuffer, allocating more space * if necessary. */ extern void appendBinaryPQExpBuffer(PQExpBuffer str, const char *data, size_t datalen); #endif /* PQEXPBUFFER_H */ PKBiZAeAe internal/c.hnu[/*------------------------------------------------------------------------- * * c.h * Fundamental C definitions. This is included by every .c file in * PostgreSQL (via either postgres.h or postgres_fe.h, as appropriate). * * Note that the definitions here are not intended to be exposed to clients * of the frontend interface libraries --- so we don't worry much about * polluting the namespace with lots of stuff... * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/c.h * *------------------------------------------------------------------------- */ /* *---------------------------------------------------------------- * TABLE OF CONTENTS * * When adding stuff to this file, please try to put stuff * into the relevant section, or add new sections as appropriate. * * section description * ------- ------------------------------------------------ * 0) pg_config.h and standard system headers * 1) hacks to cope with non-ANSI C compilers * 2) bool, true, false, TRUE, FALSE, NULL * 3) standard system types * 4) IsValid macros for system types * 5) offsetof, lengthof, endof, alignment * 6) widely useful macros * 7) random stuff * 8) system-specific hacks * * NOTE: since this file is included by both frontend and backend modules, it's * almost certainly wrong to put an "extern" declaration here. typedefs and * macros are the kind of thing that might go here. * *---------------------------------------------------------------- */ #ifndef C_H #define C_H /* * We have to include stdlib.h here because it defines many of these macros * on some platforms, and we only want our definitions used if stdlib.h doesn't * have its own. The same goes for stddef and stdarg if present. */ #include "pg_config.h" #include "pg_config_manual.h" /* must be after pg_config.h */ #if !defined(WIN32) && !defined(__CYGWIN__) /* win32 will include further * down */ #include "pg_config_os.h" /* must be before any system header files */ #endif #include "postgres_ext.h" #if _MSC_VER >= 1400 || defined(HAVE_CRTDEFS_H) #define errcode __msvc_errcode #include #undef errcode #endif #include #include #include #include #include #ifdef HAVE_STRINGS_H #include #endif #ifdef HAVE_STDINT_H #include #endif #include #include #if defined(WIN32) || defined(__CYGWIN__) #include /* ensure O_BINARY is available */ #endif #if defined(WIN32) || defined(__CYGWIN__) /* We have to redefine some system functions after they are included above. */ #include "pg_config_os.h" #endif /* Must be before gettext() games below */ #include #define _(x) gettext(x) #ifdef ENABLE_NLS #include #else #define gettext(x) (x) #define dgettext(d,x) (x) #define ngettext(s,p,n) ((n) == 1 ? (s) : (p)) #define dngettext(d,s,p,n) ((n) == 1 ? (s) : (p)) #endif /* * Use this to mark string constants as needing translation at some later * time, rather than immediately. This is useful for cases where you need * access to the original string and translated string, and for cases where * immediate translation is not possible, like when initializing global * variables. * http://www.gnu.org/software/autoconf/manual/gettext/Special-cases.html */ #define gettext_noop(x) (x) /* ---------------------------------------------------------------- * Section 1: hacks to cope with non-ANSI C compilers * * type prefixes (const, signed, volatile, inline) are handled in pg_config.h. * ---------------------------------------------------------------- */ /* * Hints to the compiler about the likelihood of a branch. Both likely() and * unlikely() return the boolean value of the contained expression. * * These should only be used sparingly, in very hot code paths. It's very easy * to mis-estimate likelihoods. */ #if __GNUC__ >= 3 #define likely(x) __builtin_expect((x) != 0, 1) #define unlikely(x) __builtin_expect((x) != 0, 0) #else #define likely(x) ((x) != 0) #define unlikely(x) ((x) != 0) #endif /* * CppAsString * Convert the argument to a string, using the C preprocessor. * CppConcat * Concatenate two arguments together, using the C preprocessor. * * Note: the standard Autoconf macro AC_C_STRINGIZE actually only checks * whether #identifier works, but if we have that we likely have ## too. */ #if defined(HAVE_STRINGIZE) #define CppAsString(identifier) #identifier #define CppConcat(x, y) x##y #else /* !HAVE_STRINGIZE */ #define CppAsString(identifier) "identifier" /* * CppIdentity -- On Reiser based cpp's this is used to concatenate * two tokens. That is * CppIdentity(A)B ==> AB * We renamed it to _private_CppIdentity because it should not * be referenced outside this file. On other cpp's it * produces A B. */ #define _priv_CppIdentity(x)x #define CppConcat(x, y) _priv_CppIdentity(x)y #endif /* !HAVE_STRINGIZE */ /* * dummyret is used to set return values in macros that use ?: to make * assignments. gcc wants these to be void, other compilers like char */ #ifdef __GNUC__ /* GNU cc */ #define dummyret void #else #define dummyret char #endif #ifndef __GNUC__ #define __attribute__(_arg_) #endif /* ---------------------------------------------------------------- * Section 2: bool, true, false, TRUE, FALSE, NULL * ---------------------------------------------------------------- */ /* * bool * Boolean value, either true or false. * * XXX for C++ compilers, we assume the compiler has a compatible * built-in definition of bool. */ #ifndef __cplusplus #ifndef bool typedef char bool; #endif #ifndef true #define true ((bool) 1) #endif #ifndef false #define false ((bool) 0) #endif #endif /* not C++ */ typedef bool *BoolPtr; #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif /* * NULL * Null pointer. */ #ifndef NULL #define NULL ((void *) 0) #endif /* ---------------------------------------------------------------- * Section 3: standard system types * ---------------------------------------------------------------- */ /* * stdint.h limits aren't guaranteed to be present and aren't guaranteed to * have compatible types with our fixed width types. So just define our own. */ #define PG_INT8_MIN (-0x7F-1) #define PG_INT8_MAX (0x7F) #define PG_UINT8_MAX (0xFF) #define PG_INT16_MIN (-0x7FFF-1) #define PG_INT16_MAX (0x7FFF) #define PG_UINT16_MAX (0xFFFF) #define PG_INT32_MIN (-0x7FFFFFFF-1) #define PG_INT32_MAX (0x7FFFFFFF) #define PG_UINT32_MAX (0xFFFFFFFFU) #define PG_INT64_MIN (-INT64CONST(0x7FFFFFFFFFFFFFFF) - 1) #define PG_INT64_MAX INT64CONST(0x7FFFFFFFFFFFFFFF) #define PG_UINT64_MAX UINT64CONST(0xFFFFFFFFFFFFFFFF) /* * Pointer * Variable holding address of any memory resident object. * * XXX Pointer arithmetic is done with this, so it can't be void * * under "true" ANSI compilers. */ typedef char *Pointer; /* * intN * Signed integer, EXACTLY N BITS IN SIZE, * used for numerical computations and the * frontend/backend protocol. */ #ifndef HAVE_INT8 typedef signed char int8; /* == 8 bits */ typedef signed short int16; /* == 16 bits */ typedef signed int int32; /* == 32 bits */ #endif /* not HAVE_INT8 */ /* * uintN * Unsigned integer, EXACTLY N BITS IN SIZE, * used for numerical computations and the * frontend/backend protocol. */ #ifndef HAVE_UINT8 typedef unsigned char uint8; /* == 8 bits */ typedef unsigned short uint16; /* == 16 bits */ typedef unsigned int uint32; /* == 32 bits */ #endif /* not HAVE_UINT8 */ /* * bitsN * Unit of bitwise operation, AT LEAST N BITS IN SIZE. */ typedef uint8 bits8; /* >= 8 bits */ typedef uint16 bits16; /* >= 16 bits */ typedef uint32 bits32; /* >= 32 bits */ /* * 64-bit integers */ #ifdef HAVE_LONG_INT_64 /* Plain "long int" fits, use it */ #ifndef HAVE_INT64 typedef long int int64; #endif #ifndef HAVE_UINT64 typedef unsigned long int uint64; #endif #define INT64CONST(x) (x##L) #define UINT64CONST(x) (x##UL) #elif defined(HAVE_LONG_LONG_INT_64) /* We have working support for "long long int", use that */ #ifndef HAVE_INT64 typedef long long int int64; #endif #ifndef HAVE_UINT64 typedef unsigned long long int uint64; #endif #define INT64CONST(x) (x##LL) #define UINT64CONST(x) (x##ULL) #else /* neither HAVE_LONG_INT_64 nor HAVE_LONG_LONG_INT_64 */ #error must have a working 64-bit integer datatype #endif /* Max value of size_t might be missing if we don't have stdint.h */ #ifndef SIZE_MAX #if SIZEOF_SIZE_T == 8 #define SIZE_MAX UINT64CONST(0xFFFFFFFFFFFFFFFF) #else #define SIZE_MAX (0xFFFFFFFFU) #endif #endif /* Select timestamp representation (float8 or int64) */ #ifdef USE_INTEGER_DATETIMES #define HAVE_INT64_TIMESTAMP #endif /* sig_atomic_t is required by ANSI C, but may be missing on old platforms */ #ifndef HAVE_SIG_ATOMIC_T typedef int sig_atomic_t; #endif /* * Size * Size of any memory resident object, as returned by sizeof. */ typedef size_t Size; /* * Index * Index into any memory resident array. * * Note: * Indices are non negative. */ typedef unsigned int Index; /* * Offset * Offset into any memory resident array. * * Note: * This differs from an Index in that an Index is always * non negative, whereas Offset may be negative. */ typedef signed int Offset; /* * Common Postgres datatype names (as used in the catalogs) */ typedef int16 int2; typedef int32 int4; typedef float float4; typedef double float8; /* * Oid, RegProcedure, TransactionId, SubTransactionId, MultiXactId, * CommandId */ /* typedef Oid is in postgres_ext.h */ /* * regproc is the type name used in the include/catalog headers, but * RegProcedure is the preferred name in C code. */ typedef Oid regproc; typedef regproc RegProcedure; typedef uint32 TransactionId; typedef uint32 LocalTransactionId; typedef uint32 SubTransactionId; #define InvalidSubTransactionId ((SubTransactionId) 0) #define TopSubTransactionId ((SubTransactionId) 1) /* MultiXactId must be equivalent to TransactionId, to fit in t_xmax */ typedef TransactionId MultiXactId; typedef uint32 MultiXactOffset; typedef uint32 CommandId; #define FirstCommandId ((CommandId) 0) /* * Array indexing support */ #define MAXDIM 6 typedef struct { int indx[MAXDIM]; } IntArray; /* ---------------- * Variable-length datatypes all share the 'struct varlena' header. * * NOTE: for TOASTable types, this is an oversimplification, since the value * may be compressed or moved out-of-line. However datatype-specific routines * are mostly content to deal with de-TOASTed values only, and of course * client-side routines should never see a TOASTed value. But even in a * de-TOASTed value, beware of touching vl_len_ directly, as its representation * is no longer convenient. It's recommended that code always use the VARDATA, * VARSIZE, and SET_VARSIZE macros instead of relying on direct mentions of * the struct fields. See postgres.h for details of the TOASTed form. * ---------------- */ struct varlena { char vl_len_[4]; /* Do not touch this field directly! */ char vl_dat[1]; }; #define VARHDRSZ ((int32) sizeof(int32)) /* * These widely-used datatypes are just a varlena header and the data bytes. * There is no terminating null or anything like that --- the data length is * always VARSIZE(ptr) - VARHDRSZ. */ typedef struct varlena bytea; typedef struct varlena text; typedef struct varlena BpChar; /* blank-padded char, ie SQL char(n) */ typedef struct varlena VarChar; /* var-length char, ie SQL varchar(n) */ /* * Specialized array types. These are physically laid out just the same * as regular arrays (so that the regular array subscripting code works * with them). They exist as distinct types mostly for historical reasons: * they have nonstandard I/O behavior which we don't want to change for fear * of breaking applications that look at the system catalogs. There is also * an implementation issue for oidvector: it's part of the primary key for * pg_proc, and we can't use the normal btree array support routines for that * without circularity. */ typedef struct { int32 vl_len_; /* these fields must match ArrayType! */ int ndim; /* always 1 for int2vector */ int32 dataoffset; /* always 0 for int2vector */ Oid elemtype; int dim1; int lbound1; int2 values[1]; /* VARIABLE LENGTH ARRAY */ } int2vector; /* VARIABLE LENGTH STRUCT */ typedef struct { int32 vl_len_; /* these fields must match ArrayType! */ int ndim; /* always 1 for oidvector */ int32 dataoffset; /* always 0 for oidvector */ Oid elemtype; int dim1; int lbound1; Oid values[1]; /* VARIABLE LENGTH ARRAY */ } oidvector; /* VARIABLE LENGTH STRUCT */ /* * Representation of a Name: effectively just a C string, but null-padded to * exactly NAMEDATALEN bytes. The use of a struct is historical. */ typedef struct nameData { char data[NAMEDATALEN]; } NameData; typedef NameData *Name; #define NameStr(name) ((name).data) /* * Support macros for escaping strings. escape_backslash should be TRUE * if generating a non-standard-conforming string. Prefixing a string * with ESCAPE_STRING_SYNTAX guarantees it is non-standard-conforming. * Beware of multiple evaluation of the "ch" argument! */ #define SQL_STR_DOUBLE(ch, escape_backslash) \ ((ch) == '\'' || ((ch) == '\\' && (escape_backslash))) #define ESCAPE_STRING_SYNTAX 'E' /* ---------------------------------------------------------------- * Section 4: IsValid macros for system types * ---------------------------------------------------------------- */ /* * BoolIsValid * True iff bool is valid. */ #define BoolIsValid(boolean) ((boolean) == false || (boolean) == true) /* * PointerIsValid * True iff pointer is valid. */ #define PointerIsValid(pointer) ((const void*)(pointer) != NULL) /* * PointerIsAligned * True iff pointer is properly aligned to point to the given type. */ #define PointerIsAligned(pointer, type) \ (((intptr_t)(pointer) % (sizeof (type))) == 0) #define OidIsValid(objectId) ((bool) ((objectId) != InvalidOid)) #define RegProcedureIsValid(p) OidIsValid(p) /* ---------------------------------------------------------------- * Section 5: offsetof, lengthof, endof, alignment * ---------------------------------------------------------------- */ /* * offsetof * Offset of a structure/union field within that structure/union. * * XXX This is supposed to be part of stddef.h, but isn't on * some systems (like SunOS 4). */ #ifndef offsetof #define offsetof(type, field) ((long) &((type *)0)->field) #endif /* offsetof */ /* * lengthof * Number of elements in an array. */ #define lengthof(array) (sizeof (array) / sizeof ((array)[0])) /* * endof * Address of the element one past the last in an array. */ #define endof(array) (&(array)[lengthof(array)]) /* ---------------- * Alignment macros: align a length or address appropriately for a given type. * The fooALIGN() macros round up to a multiple of the required alignment, * while the fooALIGN_DOWN() macros round down. The latter are more useful * for problems like "how many X-sized structures will fit in a page?". * * NOTE: TYPEALIGN[_DOWN] will not work if ALIGNVAL is not a power of 2. * That case seems extremely unlikely to be needed in practice, however. * ---------------- */ #define TYPEALIGN(ALIGNVAL,LEN) \ (((intptr_t) (LEN) + ((ALIGNVAL) - 1)) & ~((intptr_t) ((ALIGNVAL) - 1))) #define SHORTALIGN(LEN) TYPEALIGN(ALIGNOF_SHORT, (LEN)) #define INTALIGN(LEN) TYPEALIGN(ALIGNOF_INT, (LEN)) #define LONGALIGN(LEN) TYPEALIGN(ALIGNOF_LONG, (LEN)) #define DOUBLEALIGN(LEN) TYPEALIGN(ALIGNOF_DOUBLE, (LEN)) #define MAXALIGN(LEN) TYPEALIGN(MAXIMUM_ALIGNOF, (LEN)) /* MAXALIGN covers only built-in types, not buffers */ #define BUFFERALIGN(LEN) TYPEALIGN(ALIGNOF_BUFFER, (LEN)) #define TYPEALIGN_DOWN(ALIGNVAL,LEN) \ (((intptr_t) (LEN)) & ~((intptr_t) ((ALIGNVAL) - 1))) #define SHORTALIGN_DOWN(LEN) TYPEALIGN_DOWN(ALIGNOF_SHORT, (LEN)) #define INTALIGN_DOWN(LEN) TYPEALIGN_DOWN(ALIGNOF_INT, (LEN)) #define LONGALIGN_DOWN(LEN) TYPEALIGN_DOWN(ALIGNOF_LONG, (LEN)) #define DOUBLEALIGN_DOWN(LEN) TYPEALIGN_DOWN(ALIGNOF_DOUBLE, (LEN)) #define MAXALIGN_DOWN(LEN) TYPEALIGN_DOWN(MAXIMUM_ALIGNOF, (LEN)) /* ---------------------------------------------------------------- * Section 6: widely useful macros * ---------------------------------------------------------------- */ /* * Max * Return the maximum of two numbers. */ #define Max(x, y) ((x) > (y) ? (x) : (y)) /* * Min * Return the minimum of two numbers. */ #define Min(x, y) ((x) < (y) ? (x) : (y)) /* * Abs * Return the absolute value of the argument. */ #define Abs(x) ((x) >= 0 ? (x) : -(x)) /* * StrNCpy * Like standard library function strncpy(), except that result string * is guaranteed to be null-terminated --- that is, at most N-1 bytes * of the source string will be kept. * Also, the macro returns no result (too hard to do that without * evaluating the arguments multiple times, which seems worse). * * BTW: when you need to copy a non-null-terminated string (like a text * datum) and add a null, do not do it with StrNCpy(..., len+1). That * might seem to work, but it fetches one byte more than there is in the * text object. One fine day you'll have a SIGSEGV because there isn't * another byte before the end of memory. Don't laugh, we've had real * live bug reports from real live users over exactly this mistake. * Do it honestly with "memcpy(dst,src,len); dst[len] = '\0';", instead. */ #define StrNCpy(dst,src,len) \ do \ { \ char * _dst = (dst); \ Size _len = (len); \ \ if (_len > 0) \ { \ strncpy(_dst, (src), _len); \ _dst[_len-1] = '\0'; \ } \ } while (0) /* Get a bit mask of the bits set in non-long aligned addresses */ #define LONG_ALIGN_MASK (sizeof(long) - 1) /* * MemSet * Exactly the same as standard library function memset(), but considerably * faster for zeroing small word-aligned structures (such as parsetree nodes). * This has to be a macro because the main point is to avoid function-call * overhead. However, we have also found that the loop is faster than * native libc memset() on some platforms, even those with assembler * memset() functions. More research needs to be done, perhaps with * MEMSET_LOOP_LIMIT tests in configure. */ #define MemSet(start, val, len) \ do \ { \ /* must be void* because we don't know if it is integer aligned yet */ \ void *_vstart = (void *) (start); \ int _val = (val); \ Size _len = (len); \ \ if ((((intptr_t) _vstart) & LONG_ALIGN_MASK) == 0 && \ (_len & LONG_ALIGN_MASK) == 0 && \ _val == 0 && \ _len <= MEMSET_LOOP_LIMIT && \ /* \ * If MEMSET_LOOP_LIMIT == 0, optimizer should find \ * the whole "if" false at compile time. \ */ \ MEMSET_LOOP_LIMIT != 0) \ { \ long *_start = (long *) _vstart; \ long *_stop = (long *) ((char *) _start + _len); \ while (_start < _stop) \ *_start++ = 0; \ } \ else \ memset(_vstart, _val, _len); \ } while (0) /* * MemSetAligned is the same as MemSet except it omits the test to see if * "start" is word-aligned. This is okay to use if the caller knows a-priori * that the pointer is suitably aligned (typically, because he just got it * from palloc(), which always delivers a max-aligned pointer). */ #define MemSetAligned(start, val, len) \ do \ { \ long *_start = (long *) (start); \ int _val = (val); \ Size _len = (len); \ \ if ((_len & LONG_ALIGN_MASK) == 0 && \ _val == 0 && \ _len <= MEMSET_LOOP_LIMIT && \ MEMSET_LOOP_LIMIT != 0) \ { \ long *_stop = (long *) ((char *) _start + _len); \ while (_start < _stop) \ *_start++ = 0; \ } \ else \ memset(_start, _val, _len); \ } while (0) /* * MemSetTest/MemSetLoop are a variant version that allow all the tests in * MemSet to be done at compile time in cases where "val" and "len" are * constants *and* we know the "start" pointer must be word-aligned. * If MemSetTest succeeds, then it is okay to use MemSetLoop, otherwise use * MemSetAligned. Beware of multiple evaluations of the arguments when using * this approach. */ #define MemSetTest(val, len) \ ( ((len) & LONG_ALIGN_MASK) == 0 && \ (len) <= MEMSET_LOOP_LIMIT && \ MEMSET_LOOP_LIMIT != 0 && \ (val) == 0 ) #define MemSetLoop(start, val, len) \ do \ { \ long * _start = (long *) (start); \ long * _stop = (long *) ((char *) _start + (Size) (len)); \ \ while (_start < _stop) \ *_start++ = 0; \ } while (0) /* ---------------------------------------------------------------- * Section 7: random stuff * ---------------------------------------------------------------- */ /* msb for char */ #define HIGHBIT (0x80) #define IS_HIGHBIT_SET(ch) ((unsigned char)(ch) & HIGHBIT) #define STATUS_OK (0) #define STATUS_ERROR (-1) #define STATUS_EOF (-2) #define STATUS_FOUND (1) #define STATUS_WAITING (2) /* * Append PG_USED_FOR_ASSERTS_ONLY to definitions of variables that are only * used in assert-enabled builds, to avoid compiler warnings about unused * variables in assert-disabled builds. */ #ifdef USE_ASSERT_CHECKING #define PG_USED_FOR_ASSERTS_ONLY #else #define PG_USED_FOR_ASSERTS_ONLY __attribute__((unused)) #endif /* gettext domain name mangling */ /* * To better support parallel installations of major PostgreSQL * versions as well as parallel installations of major library soname * versions, we mangle the gettext domain name by appending those * version numbers. The coding rule ought to be that whereever the * domain name is mentioned as a literal, it must be wrapped into * PG_TEXTDOMAIN(). The macros below do not work on non-literals; but * that is somewhat intentional because it avoids having to worry * about multiple states of premangling and postmangling as the values * are being passed around. * * Make sure this matches the installation rules in nls-global.mk. */ /* need a second indirection because we want to stringize the macro value, not the name */ #define CppAsString2(x) CppAsString(x) #ifdef SO_MAJOR_VERSION #define PG_TEXTDOMAIN(domain) (domain CppAsString2(SO_MAJOR_VERSION) "-" PG_MAJORVERSION) #else #define PG_TEXTDOMAIN(domain) (domain "-" PG_MAJORVERSION) #endif /* ---------------------------------------------------------------- * Section 8: system-specific hacks * * This should be limited to things that absolutely have to be * included in every source file. The port-specific header file * is usually a better place for this sort of thing. * ---------------------------------------------------------------- */ /* * NOTE: this is also used for opening text files. * WIN32 treats Control-Z as EOF in files opened in text mode. * Therefore, we open files in binary mode on Win32 so we can read * literal control-Z. The other affect is that we see CRLF, but * that is OK because we can already handle those cleanly. */ #if defined(WIN32) || defined(__CYGWIN__) #define PG_BINARY O_BINARY #define PG_BINARY_A "ab" #define PG_BINARY_R "rb" #define PG_BINARY_W "wb" #else #define PG_BINARY 0 #define PG_BINARY_A "a" #define PG_BINARY_R "r" #define PG_BINARY_W "w" #endif /* * Provide prototypes for routines not present in a particular machine's * standard C library. */ #if !HAVE_DECL_SNPRINTF extern int snprintf(char *str, size_t count, const char *fmt,...) /* This extension allows gcc to check the format string */ __attribute__((format(PG_PRINTF_ATTRIBUTE, 3, 4))); #endif #if !HAVE_DECL_VSNPRINTF extern int vsnprintf(char *str, size_t count, const char *fmt, va_list args); #endif #if !defined(HAVE_MEMMOVE) && !defined(memmove) #define memmove(d, s, c) bcopy(s, d, c) #endif /* no special DLL markers on most ports */ #ifndef PGDLLIMPORT #define PGDLLIMPORT #endif #ifndef PGDLLEXPORT #define PGDLLEXPORT #endif /* * The following is used as the arg list for signal handlers. Any ports * that take something other than an int argument should override this in * their pg_config_os.h file. Note that variable names are required * because it is used in both the prototypes as well as the definitions. * Note also the long name. We expect that this won't collide with * other names causing compiler warnings. */ #ifndef SIGNAL_ARGS #define SIGNAL_ARGS int postgres_signal_arg #endif /* * When there is no sigsetjmp, its functionality is provided by plain * setjmp. Incidentally, nothing provides setjmp's functionality in * that case. */ #ifndef HAVE_SIGSETJMP #define sigjmp_buf jmp_buf #define sigsetjmp(x,y) setjmp(x) #define siglongjmp longjmp #endif #if defined(HAVE_FDATASYNC) && !HAVE_DECL_FDATASYNC extern int fdatasync(int fildes); #endif /* If strtoq() exists, rename it to the more standard strtoll() */ #if defined(HAVE_LONG_LONG_INT_64) && !defined(HAVE_STRTOLL) && defined(HAVE_STRTOQ) #define strtoll strtoq #define HAVE_STRTOLL 1 #endif /* If strtouq() exists, rename it to the more standard strtoull() */ #if defined(HAVE_LONG_LONG_INT_64) && !defined(HAVE_STRTOULL) && defined(HAVE_STRTOUQ) #define strtoull strtouq #define HAVE_STRTOULL 1 #endif /* * We assume if we have these two functions, we have their friends too, and * can use the wide-character functions. */ #if defined(HAVE_WCSTOMBS) && defined(HAVE_TOWLOWER) #define USE_WIDE_UPPER_LOWER #endif /* EXEC_BACKEND defines */ #ifdef EXEC_BACKEND #define NON_EXEC_STATIC #else #define NON_EXEC_STATIC static #endif /* /port compatibility functions */ #include "port.h" #endif /* C_H */ PKBiZiJyinternal/postgres_fe.hnu[/*------------------------------------------------------------------------- * * postgres_fe.h * Primary include file for PostgreSQL client-side .c files * * This should be the first file included by PostgreSQL client libraries and * application programs --- but not by backend modules, which should include * postgres.h. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1995, Regents of the University of California * * src/include/postgres_fe.h * *------------------------------------------------------------------------- */ #ifndef POSTGRES_FE_H #define POSTGRES_FE_H #ifndef FRONTEND #define FRONTEND 1 #endif #include "c.h" #endif /* POSTGRES_FE_H */ PKBiZW1ZZinternal/libpq-int.hnu[/*------------------------------------------------------------------------- * * libpq-int.h * This file contains internal definitions meant to be used only by * the frontend libpq library, not by applications that call it. * * An application can include this file if it wants to bypass the * official API defined by libpq-fe.h, but code that does so is much * more likely to break across PostgreSQL releases than code that uses * only the official API. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/interfaces/libpq/libpq-int.h * *------------------------------------------------------------------------- */ #ifndef LIBPQ_INT_H #define LIBPQ_INT_H /* We assume libpq-fe.h has already been included. */ #include "postgres_fe.h" #include "libpq-events.h" #include #include #ifndef WIN32 #include #endif #ifdef ENABLE_THREAD_SAFETY #ifdef WIN32 #include "pthread-win32.h" #else #include #endif #include #endif /* include stuff common to fe and be */ #include "getaddrinfo.h" #include "libpq/pqcomm.h" /* include stuff found in fe only */ #include "pqexpbuffer.h" #ifdef ENABLE_GSS #if defined(HAVE_GSSAPI_H) #include #else #include #endif #endif #ifdef ENABLE_SSPI #define SECURITY_WIN32 #if defined(WIN32) && !defined(WIN32_ONLY_COMPILER) #include #endif #include #undef SECURITY_WIN32 #ifndef ENABLE_GSS /* * Define a fake structure compatible with GSSAPI on Unix. */ typedef struct { void *value; int length; } gss_buffer_desc; #endif #endif /* ENABLE_SSPI */ #ifdef USE_SSL #include #include #if (OPENSSL_VERSION_NUMBER >= 0x00907000L) && !defined(OPENSSL_NO_ENGINE) #define USE_SSL_ENGINE #endif #endif /* USE_SSL */ /* * POSTGRES backend dependent Constants. */ #define CMDSTATUS_LEN 64 /* should match COMPLETION_TAG_BUFSIZE */ /* * PGresult and the subsidiary types PGresAttDesc, PGresAttValue * represent the result of a query (or more precisely, of a single SQL * command --- a query string given to PQexec can contain multiple commands). * Note we assume that a single command can return at most one tuple group, * hence there is no need for multiple descriptor sets. */ /* Subsidiary-storage management structure for PGresult. * See space management routines in fe-exec.c for details. * Note that space[k] refers to the k'th byte starting from the physical * head of the block --- it's a union, not a struct! */ typedef union pgresult_data PGresult_data; union pgresult_data { PGresult_data *next; /* link to next block, or NULL */ char space[1]; /* dummy for accessing block as bytes */ }; /* Data about a single parameter of a prepared statement */ typedef struct pgresParamDesc { Oid typid; /* type id */ } PGresParamDesc; /* * Data for a single attribute of a single tuple * * We use char* for Attribute values. * * The value pointer always points to a null-terminated area; we add a * null (zero) byte after whatever the backend sends us. This is only * particularly useful for text values ... with a binary value, the * value might have embedded nulls, so the application can't use C string * operators on it. But we add a null anyway for consistency. * Note that the value itself does not contain a length word. * * A NULL attribute is a special case in two ways: its len field is NULL_LEN * and its value field points to null_field in the owning PGresult. All the * NULL attributes in a query result point to the same place (there's no need * to store a null string separately for each one). */ #define NULL_LEN (-1) /* pg_result len for NULL value */ typedef struct pgresAttValue { int len; /* length in bytes of the value */ char *value; /* actual value, plus terminating zero byte */ } PGresAttValue; /* Typedef for message-field list entries */ typedef struct pgMessageField { struct pgMessageField *next; /* list link */ char code; /* field code */ char contents[1]; /* field value (VARIABLE LENGTH) */ } PGMessageField; /* Fields needed for notice handling */ typedef struct { PQnoticeReceiver noticeRec; /* notice message receiver */ void *noticeRecArg; PQnoticeProcessor noticeProc; /* notice message processor */ void *noticeProcArg; } PGNoticeHooks; typedef struct PGEvent { PGEventProc proc; /* the function to call on events */ char *name; /* used only for error messages */ void *passThrough; /* pointer supplied at registration time */ void *data; /* optional state (instance) data */ bool resultInitialized; /* T if RESULTCREATE/COPY succeeded */ } PGEvent; struct pg_result { int ntups; int numAttributes; PGresAttDesc *attDescs; PGresAttValue **tuples; /* each PGresTuple is an array of * PGresAttValue's */ int tupArrSize; /* allocated size of tuples array */ int numParameters; PGresParamDesc *paramDescs; ExecStatusType resultStatus; char cmdStatus[CMDSTATUS_LEN]; /* cmd status from the query */ int binary; /* binary tuple values if binary == 1, * otherwise text */ /* * These fields are copied from the originating PGconn, so that operations * on the PGresult don't have to reference the PGconn. */ PGNoticeHooks noticeHooks; PGEvent *events; int nEvents; int client_encoding; /* encoding id */ /* * Error information (all NULL if not an error result). errMsg is the * "overall" error message returned by PQresultErrorMessage. If we have * per-field info then it is stored in a linked list. */ char *errMsg; /* error message, or NULL if no error */ PGMessageField *errFields; /* message broken into fields */ /* All NULL attributes in the query result point to this null string */ char null_field[1]; /* * Space management information. Note that attDescs and error stuff, if * not null, point into allocated blocks. But tuples points to a * separately malloc'd block, so that we can realloc it. */ PGresult_data *curBlock; /* most recently allocated block */ int curOffset; /* start offset of free space in block */ int spaceLeft; /* number of free bytes remaining in block */ }; /* PGAsyncStatusType defines the state of the query-execution state machine */ typedef enum { PGASYNC_IDLE, /* nothing's happening, dude */ PGASYNC_BUSY, /* query in progress */ PGASYNC_READY, /* result ready for PQgetResult */ PGASYNC_COPY_IN, /* Copy In data transfer in progress */ PGASYNC_COPY_OUT, /* Copy Out data transfer in progress */ PGASYNC_COPY_BOTH /* Copy In/Out data transfer in progress */ } PGAsyncStatusType; /* PGQueryClass tracks which query protocol we are now executing */ typedef enum { PGQUERY_SIMPLE, /* simple Query protocol (PQexec) */ PGQUERY_EXTENDED, /* full Extended protocol (PQexecParams) */ PGQUERY_PREPARE, /* Parse only (PQprepare) */ PGQUERY_DESCRIBE /* Describe Statement or Portal */ } PGQueryClass; /* PGSetenvStatusType defines the state of the PQSetenv state machine */ /* (this is used only for 2.0-protocol connections) */ typedef enum { SETENV_STATE_CLIENT_ENCODING_SEND, /* About to send an Environment Option */ SETENV_STATE_CLIENT_ENCODING_WAIT, /* Waiting for above send to complete */ SETENV_STATE_OPTION_SEND, /* About to send an Environment Option */ SETENV_STATE_OPTION_WAIT, /* Waiting for above send to complete */ SETENV_STATE_QUERY1_SEND, /* About to send a status query */ SETENV_STATE_QUERY1_WAIT, /* Waiting for query to complete */ SETENV_STATE_QUERY2_SEND, /* About to send a status query */ SETENV_STATE_QUERY2_WAIT, /* Waiting for query to complete */ SETENV_STATE_IDLE } PGSetenvStatusType; /* Typedef for the EnvironmentOptions[] array */ typedef struct PQEnvironmentOption { const char *envName, /* name of an environment variable */ *pgName; /* name of corresponding SET variable */ } PQEnvironmentOption; /* Typedef for parameter-status list entries */ typedef struct pgParameterStatus { struct pgParameterStatus *next; /* list link */ char *name; /* parameter name */ char *value; /* parameter value */ /* Note: name and value are stored in same malloc block as struct is */ } pgParameterStatus; /* large-object-access data ... allocated only if large-object code is used. */ typedef struct pgLobjfuncs { Oid fn_lo_open; /* OID of backend function lo_open */ Oid fn_lo_close; /* OID of backend function lo_close */ Oid fn_lo_creat; /* OID of backend function lo_creat */ Oid fn_lo_create; /* OID of backend function lo_create */ Oid fn_lo_unlink; /* OID of backend function lo_unlink */ Oid fn_lo_lseek; /* OID of backend function lo_lseek */ Oid fn_lo_tell; /* OID of backend function lo_tell */ Oid fn_lo_truncate; /* OID of backend function lo_truncate */ Oid fn_lo_read; /* OID of backend function LOread */ Oid fn_lo_write; /* OID of backend function LOwrite */ } PGlobjfuncs; /* PGdataValue represents a data field value being passed to a row processor. * It could be either text or binary data; text data is not zero-terminated. * A SQL NULL is represented by len < 0; then value is still valid but there * are no data bytes there. */ typedef struct pgDataValue { int len; /* data length in bytes, or <0 if NULL */ const char *value; /* data value, without zero-termination */ } PGdataValue; /* * PGconn stores all the state data associated with a single connection * to a backend. */ struct pg_conn { /* Saved values of connection options */ char *pghost; /* the machine on which the server is running */ char *pghostaddr; /* the numeric IP address of the machine on * which the server is running. Takes * precedence over above. */ char *pgport; /* the server's communication port */ char *pgunixsocket; /* the Unix-domain socket that the server is * listening on; if NULL, uses a default * constructed from pgport */ char *pgtty; /* tty on which the backend messages is * displayed (OBSOLETE, NOT USED) */ char *connect_timeout; /* connection timeout (numeric string) */ char *client_encoding_initial; /* encoding to use */ char *pgoptions; /* options to start the backend with */ char *appname; /* application name */ char *fbappname; /* fallback application name */ char *dbName; /* database name */ char *replication; /* connect as the replication standby? */ char *pguser; /* Postgres username and password, if any */ char *pgpass; char *keepalives; /* use TCP keepalives? */ char *keepalives_idle; /* time between TCP keepalives */ char *keepalives_interval; /* time between TCP keepalive * retransmits */ char *keepalives_count; /* maximum number of TCP keepalive * retransmits */ char *sslmode; /* SSL mode (require,prefer,allow,disable) */ char *sslcompression; /* SSL compression (0 or 1) */ char *sslkey; /* client key filename */ char *sslcert; /* client certificate filename */ char *sslrootcert; /* root certificate filename */ char *sslcrl; /* certificate revocation list filename */ char *requirepeer; /* required peer credentials for local sockets */ #if defined(KRB5) || defined(ENABLE_GSS) || defined(ENABLE_SSPI) char *krbsrvname; /* Kerberos service name */ #endif /* Optional file to write trace info to */ FILE *Pfdebug; /* Callback procedures for notice message processing */ PGNoticeHooks noticeHooks; /* Event procs registered via PQregisterEventProc */ PGEvent *events; /* expandable array of event data */ int nEvents; /* number of active events */ int eventArraySize; /* allocated array size */ /* Status indicators */ ConnStatusType status; PGAsyncStatusType asyncStatus; PGTransactionStatusType xactStatus; /* never changes to ACTIVE */ PGQueryClass queryclass; char *last_query; /* last SQL command, or NULL if unknown */ char last_sqlstate[6]; /* last reported SQLSTATE */ bool options_valid; /* true if OK to attempt connection */ bool nonblocking; /* whether this connection is using nonblock * sending semantics */ bool singleRowMode; /* return current query result row-by-row? */ char copy_is_binary; /* 1 = copy binary, 0 = copy text */ int copy_already_done; /* # bytes already returned in COPY * OUT */ PGnotify *notifyHead; /* oldest unreported Notify msg */ PGnotify *notifyTail; /* newest unreported Notify msg */ /* Connection data */ /* See PQconnectPoll() for how we use 'int' and not 'pgsocket'. */ int sock; /* Unix FD for socket, -1 if not connected */ SockAddr laddr; /* Local address */ SockAddr raddr; /* Remote address */ ProtocolVersion pversion; /* FE/BE protocol version in use */ int sversion; /* server version, e.g. 70401 for 7.4.1 */ bool auth_req_received; /* true if any type of auth req * received */ bool password_needed; /* true if server demanded a password */ bool dot_pgpass_used; /* true if used .pgpass */ bool sigpipe_so; /* have we masked SIGPIPE via SO_NOSIGPIPE? */ bool sigpipe_flag; /* can we mask SIGPIPE via MSG_NOSIGNAL? */ /* Transient state needed while establishing connection */ bool try_next_addr; /* time to advance to next address? */ bool is_new_addr; /* need to (re)initialize for new address? */ struct addrinfo *addrlist; /* list of possible backend addresses */ struct addrinfo *addr_cur; /* the one currently being tried */ int addrlist_family; /* needed to know how to free addrlist */ PGSetenvStatusType setenv_state; /* for 2.0 protocol only */ const PQEnvironmentOption *next_eo; bool send_appname; /* okay to send application_name? */ /* Miscellaneous stuff */ int be_pid; /* PID of backend --- needed for cancels */ int be_key; /* key of backend --- needed for cancels */ char md5Salt[4]; /* password salt received from backend */ pgParameterStatus *pstatus; /* ParameterStatus data */ int client_encoding; /* encoding id */ bool std_strings; /* standard_conforming_strings */ PGVerbosity verbosity; /* error/notice message verbosity */ PGlobjfuncs *lobjfuncs; /* private state for large-object access fns */ /* Buffer for data received from backend and not yet processed */ char *inBuffer; /* currently allocated buffer */ int inBufSize; /* allocated size of buffer */ int inStart; /* offset to first unconsumed data in buffer */ int inCursor; /* next byte to tentatively consume */ int inEnd; /* offset to first position after avail data */ /* Buffer for data not yet sent to backend */ char *outBuffer; /* currently allocated buffer */ int outBufSize; /* allocated size of buffer */ int outCount; /* number of chars waiting in buffer */ /* State for constructing messages in outBuffer */ int outMsgStart; /* offset to msg start (length word); if -1, * msg has no length word */ int outMsgEnd; /* offset to msg end (so far) */ /* Row processor interface workspace */ PGdataValue *rowBuf; /* array for passing values to rowProcessor */ int rowBufLen; /* number of entries allocated in rowBuf */ /* Status for asynchronous result construction */ PGresult *result; /* result being constructed */ PGresult *next_result; /* next result (used in single-row mode) */ /* Assorted state for SSL, GSS, etc */ #ifdef USE_SSL bool allow_ssl_try; /* Allowed to try SSL negotiation */ bool wait_ssl_try; /* Delay SSL negotiation until after * attempting normal connection */ SSL *ssl; /* SSL status, if have SSL connection */ X509 *peer; /* X509 cert of server */ #ifdef USE_SSL_ENGINE ENGINE *engine; /* SSL engine, if any */ #else void *engine; /* dummy field to keep struct the same if * OpenSSL version changes */ #endif #endif /* USE_SSL */ #ifdef ENABLE_GSS gss_ctx_id_t gctx; /* GSS context */ gss_name_t gtarg_nam; /* GSS target name */ gss_buffer_desc ginbuf; /* GSS input token */ gss_buffer_desc goutbuf; /* GSS output token */ #endif #ifdef ENABLE_SSPI #ifndef ENABLE_GSS gss_buffer_desc ginbuf; /* GSS input token */ #else char *gsslib; /* What GSS librart to use ("gssapi" or * "sspi") */ #endif CredHandle *sspicred; /* SSPI credentials handle */ CtxtHandle *sspictx; /* SSPI context */ char *sspitarget; /* SSPI target name */ int usesspi; /* Indicate if SSPI is in use on the * connection */ #endif /* Buffer for current error message */ PQExpBufferData errorMessage; /* expansible string */ /* Buffer for receiving various parts of messages */ PQExpBufferData workBuffer; /* expansible string */ }; /* PGcancel stores all data necessary to cancel a connection. A copy of this * data is required to safely cancel a connection running on a different * thread. */ struct pg_cancel { SockAddr raddr; /* Remote address */ int be_pid; /* PID of backend --- needed for cancels */ int be_key; /* key of backend --- needed for cancels */ }; /* String descriptions of the ExecStatusTypes. * direct use of this array is deprecated; call PQresStatus() instead. */ extern char *const pgresStatus[]; /* ---------------- * Internal functions of libpq * Functions declared here need to be visible across files of libpq, * but are not intended to be called by applications. We use the * convention "pqXXX" for internal functions, vs. the "PQxxx" names * used for application-visible routines. * ---------------- */ /* === in fe-connect.c === */ extern void pqDropConnection(PGconn *conn, bool flushInput); extern int pqPacketSend(PGconn *conn, char pack_type, const void *buf, size_t buf_len); extern bool pqGetHomeDirectory(char *buf, int bufsize); #ifdef ENABLE_THREAD_SAFETY extern pgthreadlock_t pg_g_threadlock; #define PGTHREAD_ERROR(msg) \ do { \ fprintf(stderr, "%s\n", msg); \ abort(); \ } while (0) #define pglock_thread() pg_g_threadlock(true) #define pgunlock_thread() pg_g_threadlock(false) #else #define pglock_thread() ((void) 0) #define pgunlock_thread() ((void) 0) #endif /* === in fe-exec.c === */ extern void pqSetResultError(PGresult *res, const char *msg); extern void pqCatenateResultError(PGresult *res, const char *msg); extern void *pqResultAlloc(PGresult *res, size_t nBytes, bool isBinary); extern char *pqResultStrdup(PGresult *res, const char *str); extern void pqClearAsyncResult(PGconn *conn); extern void pqSaveErrorResult(PGconn *conn); extern PGresult *pqPrepareAsyncResult(PGconn *conn); extern void pqInternalNotice(const PGNoticeHooks *hooks, const char *fmt,...) /* This lets gcc check the format string for consistency. */ __attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 3))); extern void pqSaveMessageField(PGresult *res, char code, const char *value); extern void pqSaveParameterStatus(PGconn *conn, const char *name, const char *value); extern int pqRowProcessor(PGconn *conn, const char **errmsgp); extern void pqHandleSendFailure(PGconn *conn); /* === in fe-protocol2.c === */ extern PostgresPollingStatusType pqSetenvPoll(PGconn *conn); extern char *pqBuildStartupPacket2(PGconn *conn, int *packetlen, const PQEnvironmentOption *options); extern void pqParseInput2(PGconn *conn); extern int pqGetCopyData2(PGconn *conn, char **buffer, int async); extern int pqGetline2(PGconn *conn, char *s, int maxlen); extern int pqGetlineAsync2(PGconn *conn, char *buffer, int bufsize); extern int pqEndcopy2(PGconn *conn); extern PGresult *pqFunctionCall2(PGconn *conn, Oid fnid, int *result_buf, int *actual_result_len, int result_is_int, const PQArgBlock *args, int nargs); /* === in fe-protocol3.c === */ extern char *pqBuildStartupPacket3(PGconn *conn, int *packetlen, const PQEnvironmentOption *options); extern void pqParseInput3(PGconn *conn); extern int pqGetErrorNotice3(PGconn *conn, bool isError); extern int pqGetCopyData3(PGconn *conn, char **buffer, int async); extern int pqGetline3(PGconn *conn, char *s, int maxlen); extern int pqGetlineAsync3(PGconn *conn, char *buffer, int bufsize); extern int pqEndcopy3(PGconn *conn); extern PGresult *pqFunctionCall3(PGconn *conn, Oid fnid, int *result_buf, int *actual_result_len, int result_is_int, const PQArgBlock *args, int nargs); /* === in fe-misc.c === */ /* * "Get" and "Put" routines return 0 if successful, EOF if not. Note that for * Get, EOF merely means the buffer is exhausted, not that there is * necessarily any error. */ extern int pqCheckOutBufferSpace(size_t bytes_needed, PGconn *conn); extern int pqCheckInBufferSpace(size_t bytes_needed, PGconn *conn); extern int pqGetc(char *result, PGconn *conn); extern int pqPutc(char c, PGconn *conn); extern int pqGets(PQExpBuffer buf, PGconn *conn); extern int pqGets_append(PQExpBuffer buf, PGconn *conn); extern int pqPuts(const char *s, PGconn *conn); extern int pqGetnchar(char *s, size_t len, PGconn *conn); extern int pqSkipnchar(size_t len, PGconn *conn); extern int pqPutnchar(const char *s, size_t len, PGconn *conn); extern int pqGetInt(int *result, size_t bytes, PGconn *conn); extern int pqPutInt(int value, size_t bytes, PGconn *conn); extern int pqPutMsgStart(char msg_type, bool force_len, PGconn *conn); extern int pqPutMsgEnd(PGconn *conn); extern int pqReadData(PGconn *conn); extern int pqFlush(PGconn *conn); extern int pqWait(int forRead, int forWrite, PGconn *conn); extern int pqWaitTimed(int forRead, int forWrite, PGconn *conn, time_t finish_time); extern int pqReadReady(PGconn *conn); extern int pqWriteReady(PGconn *conn); /* === in fe-secure.c === */ extern int pqsecure_initialize(PGconn *); extern void pqsecure_destroy(void); extern PostgresPollingStatusType pqsecure_open_client(PGconn *); extern void pqsecure_close(PGconn *); extern ssize_t pqsecure_read(PGconn *, void *ptr, size_t len); extern ssize_t pqsecure_write(PGconn *, const void *ptr, size_t len); #if defined(ENABLE_THREAD_SAFETY) && !defined(WIN32) extern int pq_block_sigpipe(sigset_t *osigset, bool *sigpipe_pending); extern void pq_reset_sigpipe(sigset_t *osigset, bool sigpipe_pending, bool got_epipe); #endif /* * this is so that we can check if a connection is non-blocking internally * without the overhead of a function call */ #define pqIsnonblocking(conn) ((conn)->nonblocking) #ifdef ENABLE_NLS extern char * libpq_gettext(const char *msgid) __attribute__((format_arg(1))); #else #define libpq_gettext(x) (x) #endif /* * These macros are needed to let error-handling code be portable between * Unix and Windows. (ugh) */ #ifdef WIN32 #define SOCK_ERRNO (WSAGetLastError()) #define SOCK_STRERROR winsock_strerror #define SOCK_ERRNO_SET(e) WSASetLastError(e) #else #define SOCK_ERRNO errno #define SOCK_STRERROR pqStrerror #define SOCK_ERRNO_SET(e) (errno = (e)) #endif #endif /* LIBPQ_INT_H */ PKBiZoointernal/libpq/pqcomm.hnu[/*------------------------------------------------------------------------- * * pqcomm.h * Definitions common to frontends and backends. * * NOTE: for historical reasons, this does not correspond to pqcomm.c. * pqcomm.c's routines are declared in libpq.h. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/libpq/pqcomm.h * *------------------------------------------------------------------------- */ #ifndef PQCOMM_H #define PQCOMM_H #include #include #ifdef HAVE_SYS_UN_H #include #endif #include #ifdef HAVE_STRUCT_SOCKADDR_STORAGE #ifndef HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY #ifdef HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY #define ss_family __ss_family #else #error struct sockaddr_storage does not provide an ss_family member #endif #endif #ifdef HAVE_STRUCT_SOCKADDR_STORAGE___SS_LEN #define ss_len __ss_len #define HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN 1 #endif #else /* !HAVE_STRUCT_SOCKADDR_STORAGE */ /* Define a struct sockaddr_storage if we don't have one. */ struct sockaddr_storage { union { struct sockaddr sa; /* get the system-dependent fields */ int64 ss_align; /* ensures struct is properly aligned */ char ss_pad[128]; /* ensures struct has desired size */ } ss_stuff; }; #define ss_family ss_stuff.sa.sa_family /* It should have an ss_len field if sockaddr has sa_len. */ #ifdef HAVE_STRUCT_SOCKADDR_SA_LEN #define ss_len ss_stuff.sa.sa_len #define HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN 1 #endif #endif /* HAVE_STRUCT_SOCKADDR_STORAGE */ typedef struct { struct sockaddr_storage addr; ACCEPT_TYPE_ARG3 salen; } SockAddr; /* Configure the UNIX socket location for the well known port. */ #define UNIXSOCK_PATH(path, port, sockdir) \ snprintf(path, sizeof(path), "%s/.s.PGSQL.%d", \ ((sockdir) && *(sockdir) != '\0') ? (sockdir) : \ DEFAULT_PGSOCKET_DIR, \ (port)) /* * The maximum workable length of a socket path is what will fit into * struct sockaddr_un. This is usually only 100 or so bytes :-(. * * For consistency, always pass a MAXPGPATH-sized buffer to UNIXSOCK_PATH(), * then complain if the resulting string is >= UNIXSOCK_PATH_BUFLEN bytes. * (Because the standard API for getaddrinfo doesn't allow it to complain in * a useful way when the socket pathname is too long, we have to test for * this explicitly, instead of just letting the subroutine return an error.) */ #define UNIXSOCK_PATH_BUFLEN sizeof(((struct sockaddr_un *) NULL)->sun_path) /* * These manipulate the frontend/backend protocol version number. * * The major number should be incremented for incompatible changes. The minor * number should be incremented for compatible changes (eg. additional * functionality). * * If a backend supports version m.n of the protocol it must actually support * versions m.[0..n]. Backend support for version m-1 can be dropped after a * `reasonable' length of time. * * A frontend isn't required to support anything other than the current * version. */ #define PG_PROTOCOL_MAJOR(v) ((v) >> 16) #define PG_PROTOCOL_MINOR(v) ((v) & 0x0000ffff) #define PG_PROTOCOL(m,n) (((m) << 16) | (n)) /* The earliest and latest frontend/backend protocol version supported. */ #define PG_PROTOCOL_EARLIEST PG_PROTOCOL(1,0) #define PG_PROTOCOL_LATEST PG_PROTOCOL(3,0) typedef uint32 ProtocolVersion; /* FE/BE protocol version number */ typedef ProtocolVersion MsgType; /* * Packet lengths are 4 bytes in network byte order. * * The initial length is omitted from the packet layouts appearing below. */ typedef uint32 PacketLen; /* * Old-style startup packet layout with fixed-width fields. This is used in * protocol 1.0 and 2.0, but not in later versions. Note that the fields * in this layout are '\0' terminated only if there is room. */ #define SM_DATABASE 64 #define SM_USER 32 /* We append database name if db_user_namespace true. */ #define SM_DATABASE_USER (SM_DATABASE+SM_USER+1) /* +1 for @ */ #define SM_OPTIONS 64 #define SM_UNUSED 64 #define SM_TTY 64 typedef struct StartupPacket { ProtocolVersion protoVersion; /* Protocol version */ char database[SM_DATABASE]; /* Database name */ /* Db_user_namespace appends dbname */ char user[SM_USER]; /* User name */ char options[SM_OPTIONS]; /* Optional additional args */ char unused[SM_UNUSED]; /* Unused */ char tty[SM_TTY]; /* Tty for debug output */ } StartupPacket; extern bool Db_user_namespace; /* * In protocol 3.0 and later, the startup packet length is not fixed, but * we set an arbitrary limit on it anyway. This is just to prevent simple * denial-of-service attacks via sending enough data to run the server * out of memory. */ #define MAX_STARTUP_PACKET_LENGTH 10000 /* These are the authentication request codes sent by the backend. */ #define AUTH_REQ_OK 0 /* User is authenticated */ #define AUTH_REQ_KRB4 1 /* Kerberos V4. Not supported any more. */ #define AUTH_REQ_KRB5 2 /* Kerberos V5 */ #define AUTH_REQ_PASSWORD 3 /* Password */ #define AUTH_REQ_CRYPT 4 /* crypt password. Not supported any more. */ #define AUTH_REQ_MD5 5 /* md5 password */ #define AUTH_REQ_SCM_CREDS 6 /* transfer SCM credentials */ #define AUTH_REQ_GSS 7 /* GSSAPI without wrap() */ #define AUTH_REQ_GSS_CONT 8 /* Continue GSS exchanges */ #define AUTH_REQ_SSPI 9 /* SSPI negotiate without wrap() */ #define AUTH_REQ_SASL 10 /* SASL authentication. Not supported before * libpq version 10. */ typedef uint32 AuthRequest; /* * A client can also send a cancel-current-operation request to the postmaster. * This is uglier than sending it directly to the client's backend, but it * avoids depending on out-of-band communication facilities. * * The cancel request code must not match any protocol version number * we're ever likely to use. This random choice should do. */ #define CANCEL_REQUEST_CODE PG_PROTOCOL(1234,5678) typedef struct CancelRequestPacket { /* Note that each field is stored in network byte order! */ MsgType cancelRequestCode; /* code to identify a cancel request */ uint32 backendPID; /* PID of client's backend */ uint32 cancelAuthCode; /* secret key to authorize cancel */ } CancelRequestPacket; /* * A client can also start by sending a SSL negotiation request, to get a * secure channel. */ #define NEGOTIATE_SSL_CODE PG_PROTOCOL(1234,5679) #endif /* PQCOMM_H */ PKBiZ1\informix/esql/decimal.hnu[/* src/interfaces/ecpg/include/decimal.h */ #ifndef _ECPG_DECIMAL_H #define _ECPG_DECIMAL_H #include /* source created by ecpg which defines this */ #ifndef _ECPGLIB_H typedef decimal dec_t; #endif /* ndef _ECPGLIB_H */ #endif /* ndef _ECPG_DECIMAL_H */ PKBiZBFinformix/esql/sqltypes.hnu[#ifndef ECPG_SQLTYPES_H #define ECPG_SQLTYPES_H #include #define CCHARTYPE ECPGt_char #define CSHORTTYPE ECPGt_short #define CINTTYPE ECPGt_int #define CLONGTYPE ECPGt_long #define CFLOATTYPE ECPGt_float #define CDOUBLETYPE ECPGt_double #define CDECIMALTYPE ECPGt_decimal #define CFIXCHARTYPE 108 #define CSTRINGTYPE ECPGt_char #define CDATETYPE ECPGt_date #define CMONEYTYPE 111 #define CDTIMETYPE ECPGt_timestamp #define CLOCATORTYPE 113 #define CVCHARTYPE ECPGt_varchar #define CINVTYPE 115 #define CFILETYPE 116 #define CINT8TYPE ECPGt_long_long #define CCOLLTYPE 118 #define CLVCHARTYPE 119 #define CFIXBINTYPE 120 #define CVARBINTYPE 121 #define CBOOLTYPE ECPGt_bool #define CROWTYPE 123 #define CLVCHARPTRTYPE 124 #define CTYPEMAX 25 /* * Values used in sqlda->sqlvar[i]->sqltype */ #define SQLCHAR ECPGt_char #define SQLSMINT ECPGt_short #define SQLINT ECPGt_int #define SQLFLOAT ECPGt_double #define SQLSMFLOAT ECPGt_float #define SQLDECIMAL ECPGt_decimal #define SQLSERIAL ECPGt_int #define SQLDATE ECPGt_date #define SQLDTIME ECPGt_timestamp #define SQLTEXT ECPGt_char #define SQLVCHAR ECPGt_char #define SQLINTERVAL ECPGt_interval #define SQLNCHAR ECPGt_char #define SQLNVCHAR ECPGt_char #ifdef HAVE_LONG_LONG_INT_64 #define SQLINT8 ECPGt_long_long #define SQLSERIAL8 ECPGt_long_long #else #define SQLINT8 ECPGt_long #define SQLSERIAL8 ECPGt_long #endif #endif /* ndef ECPG_SQLTYPES_H */ PKBiZ|DDinformix/esql/datetime.hnu[/* src/interfaces/ecpg/include/datetime.h */ #ifndef _ECPG_DATETIME_H #define _ECPG_DATETIME_H #include /* source created by ecpg which defines these symbols */ #ifndef _ECPGLIB_H typedef timestamp dtime_t; typedef interval intrvl_t; #endif /* ndef _ECPGLIB_H */ #endif /* ndef _ECPG_DATETIME_H */ PKBiZ'Kserver/pgtar.hnu[/*------------------------------------------------------------------------- * * pgtar.h * Functions for manipulating tarfile datastructures (src/port/tar.c) * * * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/pgtar.h * *------------------------------------------------------------------------- */ extern void tarCreateHeader(char *h, const char *filename, const char *linktarget, pgoff_t size, mode_t mode, uid_t uid, gid_t gid, time_t mtime, bool bogus); extern uint64 read_tar_number(const char *s, int len); extern int tarChecksum(char *header); PKBiZny!77 server/port.hnu[/*------------------------------------------------------------------------- * * port.h * Header for src/port/ compatibility functions. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/port.h * *------------------------------------------------------------------------- */ #ifndef PG_PORT_H #define PG_PORT_H #include #include #include /* socket has a different definition on WIN32 */ #ifndef WIN32 typedef int pgsocket; #define PGINVALID_SOCKET (-1) #else typedef SOCKET pgsocket; #define PGINVALID_SOCKET INVALID_SOCKET #endif /* non-blocking */ extern bool pg_set_noblock(pgsocket sock); extern bool pg_set_block(pgsocket sock); /* Portable path handling for Unix/Win32 (in path.c) */ extern bool has_drive_prefix(const char *filename); extern char *first_dir_separator(const char *filename); extern char *last_dir_separator(const char *filename); extern char *first_path_var_separator(const char *pathlist); extern void join_path_components(char *ret_path, const char *head, const char *tail); extern void canonicalize_path(char *path); extern void make_native_path(char *path); extern bool path_contains_parent_reference(const char *path); extern bool path_is_relative_and_below_cwd(const char *path); extern bool path_is_prefix_of_path(const char *path1, const char *path2); extern const char *get_progname(const char *argv0); extern void get_share_path(const char *my_exec_path, char *ret_path); extern void get_etc_path(const char *my_exec_path, char *ret_path); extern void get_include_path(const char *my_exec_path, char *ret_path); extern void get_pkginclude_path(const char *my_exec_path, char *ret_path); extern void get_includeserver_path(const char *my_exec_path, char *ret_path); extern void get_lib_path(const char *my_exec_path, char *ret_path); extern void get_pkglib_path(const char *my_exec_path, char *ret_path); extern void get_locale_path(const char *my_exec_path, char *ret_path); extern void get_doc_path(const char *my_exec_path, char *ret_path); extern void get_html_path(const char *my_exec_path, char *ret_path); extern void get_man_path(const char *my_exec_path, char *ret_path); extern bool get_home_path(char *ret_path); extern void get_parent_directory(char *path); /* port/dirmod.c */ extern char **pgfnames(const char *path); extern void pgfnames_cleanup(char **filenames); /* * is_absolute_path * * By making this a macro we avoid needing to include path.c in libpq. */ #ifndef WIN32 #define IS_DIR_SEP(ch) ((ch) == '/') #define is_absolute_path(filename) \ ( \ IS_DIR_SEP((filename)[0]) \ ) #else #define IS_DIR_SEP(ch) ((ch) == '/' || (ch) == '\\') /* See path_is_relative_and_below_cwd() for how we handle 'E:abc'. */ #define is_absolute_path(filename) \ ( \ IS_DIR_SEP((filename)[0]) || \ (isalpha((unsigned char) ((filename)[0])) && (filename)[1] == ':' && \ IS_DIR_SEP((filename)[2])) \ ) #endif /* Portable locale initialization (in exec.c) */ extern void set_pglocale_pgservice(const char *argv0, const char *app); /* Portable way to find binaries (in exec.c) */ extern int find_my_exec(const char *argv0, char *retpath); extern int find_other_exec(const char *argv0, const char *target, const char *versionstr, char *retpath); /* Windows security token manipulation (in exec.c) */ #ifdef WIN32 extern BOOL AddUserToTokenDacl(HANDLE hToken); #endif #if defined(WIN32) || defined(__CYGWIN__) #define EXE ".exe" #else #define EXE "" #endif #if defined(WIN32) && !defined(__CYGWIN__) #define DEVNULL "nul" #else #define DEVNULL "/dev/null" #endif /* * Win32 needs double quotes at the beginning and end of system() * strings. If not, it gets confused with multiple quoted strings. * It also requires double-quotes around the executable name and * any files used for redirection. Other args can use single-quotes. * * Generated using Win32 "CMD /?": * * 1. If all of the following conditions are met, then quote characters * on the command line are preserved: * * - no /S switch * - exactly two quote characters * - no special characters between the two quote characters, where special * is one of: &<>()@^| * - there are one or more whitespace characters between the two quote * characters * - the string between the two quote characters is the name of an * executable file. * * 2. Otherwise, old behavior is to see if the first character is a quote * character and if so, strip the leading character and remove the last * quote character on the command line, preserving any text after the last * quote character. */ #if defined(WIN32) && !defined(__CYGWIN__) #define SYSTEMQUOTE "\"" #else #define SYSTEMQUOTE "" #endif /* Portable delay handling */ extern void pg_usleep(long microsec); /* Portable SQL-like case-independent comparisons and conversions */ extern int pg_strcasecmp(const char *s1, const char *s2); extern int pg_strncasecmp(const char *s1, const char *s2, size_t n); extern unsigned char pg_toupper(unsigned char ch); extern unsigned char pg_tolower(unsigned char ch); extern unsigned char pg_ascii_toupper(unsigned char ch); extern unsigned char pg_ascii_tolower(unsigned char ch); #ifdef USE_REPL_SNPRINTF /* * Versions of libintl >= 0.13 try to replace printf() and friends with * macros to their own versions that understand the %$ format. We do the * same, so disable their macros, if they exist. */ #ifdef vsnprintf #undef vsnprintf #endif #ifdef snprintf #undef snprintf #endif #ifdef sprintf #undef sprintf #endif #ifdef vfprintf #undef vfprintf #endif #ifdef fprintf #undef fprintf #endif #ifdef printf #undef printf #endif extern int pg_vsnprintf(char *str, size_t count, const char *fmt, va_list args); extern int pg_snprintf(char *str, size_t count, const char *fmt,...) /* This extension allows gcc to check the format string */ __attribute__((format(PG_PRINTF_ATTRIBUTE, 3, 4))); extern int pg_sprintf(char *str, const char *fmt,...) /* This extension allows gcc to check the format string */ __attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 3))); extern int pg_vfprintf(FILE *stream, const char *fmt, va_list args); extern int pg_fprintf(FILE *stream, const char *fmt,...) /* This extension allows gcc to check the format string */ __attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 3))); extern int pg_printf(const char *fmt,...) /* This extension allows gcc to check the format string */ __attribute__((format(PG_PRINTF_ATTRIBUTE, 1, 2))); /* * The GCC-specific code below prevents the __attribute__(... 'printf') * above from being replaced, and this is required because gcc doesn't * know anything about pg_printf. */ #ifdef __GNUC__ #define vsnprintf(...) pg_vsnprintf(__VA_ARGS__) #define snprintf(...) pg_snprintf(__VA_ARGS__) #define sprintf(...) pg_sprintf(__VA_ARGS__) #define vfprintf(...) pg_vfprintf(__VA_ARGS__) #define fprintf(...) pg_fprintf(__VA_ARGS__) #define printf(...) pg_printf(__VA_ARGS__) #else #define vsnprintf pg_vsnprintf #define snprintf pg_snprintf #define sprintf pg_sprintf #define vfprintf pg_vfprintf #define fprintf pg_fprintf #define printf pg_printf #endif #endif /* USE_REPL_SNPRINTF */ #if defined(WIN32) /* * Versions of libintl >= 0.18? try to replace setlocale() with a macro * to their own versions. Remove the macro, if it exists, because it * ends up calling the wrong version when the backend and libintl use * different versions of msvcrt. */ #if defined(setlocale) #undef setlocale #endif /* * Define our own wrapper macro around setlocale() to work around bugs in * Windows' native setlocale() function. */ extern char *pgwin32_setlocale(int category, const char *locale); #define setlocale(a,b) pgwin32_setlocale(a,b) #endif /* WIN32 */ /* Portable prompt handling */ extern char *simple_prompt(const char *prompt, int maxlen, bool echo); #ifdef WIN32 #define PG_SIGNAL_COUNT 32 #define kill(pid,sig) pgkill(pid,sig) extern int pgkill(int pid, int sig); #endif extern int pclose_check(FILE *stream); /* Global variable holding time zone information. */ #ifndef __CYGWIN__ #define TIMEZONE_GLOBAL timezone #define TZNAME_GLOBAL tzname #else #define TIMEZONE_GLOBAL _timezone #define TZNAME_GLOBAL _tzname #endif #if defined(WIN32) || defined(__CYGWIN__) /* * Win32 doesn't have reliable rename/unlink during concurrent access. */ extern int pgrename(const char *from, const char *to); extern int pgunlink(const char *path); /* Include this first so later includes don't see these defines */ #ifdef WIN32_ONLY_COMPILER #include #endif #define rename(from, to) pgrename(from, to) #define unlink(path) pgunlink(path) #endif /* defined(WIN32) || defined(__CYGWIN__) */ /* * Win32 also doesn't have symlinks, but we can emulate them with * junction points on newer Win32 versions. * * Cygwin has its own symlinks which work on Win95/98/ME where * junction points don't, so use those instead. We have no way of * knowing what type of system Cygwin binaries will be run on. * Note: Some CYGWIN includes might #define WIN32. */ #if defined(WIN32) && !defined(__CYGWIN__) extern int pgsymlink(const char *oldpath, const char *newpath); extern int pgreadlink(const char *path, char *buf, size_t size); extern bool pgwin32_is_junction(char *path); #define symlink(oldpath, newpath) pgsymlink(oldpath, newpath) #define readlink(path, buf, size) pgreadlink(path, buf, size) #endif extern bool rmtree(const char *path, bool rmtopdir); /* * stat() is not guaranteed to set the st_size field on win32, so we * redefine it to our own implementation that is. * * We must pull in sys/stat.h here so the system header definition * goes in first, and we redefine that, and not the other way around. * * Some frontends don't need the size from stat, so if UNSAFE_STAT_OK * is defined we don't bother with this. */ #if defined(WIN32) && !defined(__CYGWIN__) && !defined(UNSAFE_STAT_OK) #include extern int pgwin32_safestat(const char *path, struct stat * buf); #define stat(a,b) pgwin32_safestat(a,b) #endif #if defined(WIN32) && !defined(__CYGWIN__) /* * open() and fopen() replacements to allow deletion of open files and * passing of other special options. */ #define O_DIRECT 0x80000000 extern int pgwin32_open(const char *, int,...); extern FILE *pgwin32_fopen(const char *, const char *); #ifndef FRONTEND #define open(a,b,c) pgwin32_open(a,b,c) #define fopen(a,b) pgwin32_fopen(a,b) #endif #ifndef popen #define popen(a,b) _popen(a,b) #endif #ifndef pclose #define pclose(a) _pclose(a) #endif /* New versions of MingW have gettimeofday, old mingw and msvc don't */ #ifndef HAVE_GETTIMEOFDAY /* Last parameter not used */ extern int gettimeofday(struct timeval * tp, struct timezone * tzp); #endif #else /* !WIN32 */ /* * Win32 requires a special close for sockets and pipes, while on Unix * close() does them all. */ #define closesocket close #endif /* WIN32 */ /* * On Windows, setvbuf() does not support _IOLBF mode, and interprets that * as _IOFBF. To add insult to injury, setvbuf(file, NULL, _IOFBF, 0) * crashes outright if "parameter validation" is enabled. Therefore, in * places where we'd like to select line-buffered mode, we fall back to * unbuffered mode instead on Windows. Always use PG_IOLBF not _IOLBF * directly in order to implement this behavior. */ #ifndef WIN32 #define PG_IOLBF _IOLBF #else #define PG_IOLBF _IONBF #endif /* * Default "extern" declarations or macro substitutes for library routines. * When necessary, these routines are provided by files in src/port/. */ #ifndef HAVE_CRYPT extern char *crypt(const char *key, const char *setting); #endif /* WIN32 handled in port/win32.h */ #ifndef WIN32 #define pgoff_t off_t #ifdef __NetBSD__ extern int fseeko(FILE *stream, off_t offset, int whence); extern off_t ftello(FILE *stream); #endif #endif extern double pg_erand48(unsigned short xseed[3]); extern long pg_lrand48(void); extern void pg_srand48(long seed); #ifndef HAVE_FLS extern int fls(int mask); #endif #ifndef HAVE_FSEEKO #define fseeko(a, b, c) fseek(a, b, c) #define ftello(a) ftell(a) #endif #ifndef HAVE_GETOPT extern int getopt(int nargc, char *const * nargv, const char *ostr); #endif #if !defined(HAVE_GETPEEREID) && !defined(WIN32) extern int getpeereid(int sock, uid_t *uid, gid_t *gid); #endif #ifndef HAVE_ISINF extern int isinf(double x); #endif #ifndef HAVE_MKDTEMP extern char *mkdtemp(char *path); #endif #ifndef HAVE_RINT extern double rint(double x); #endif #ifndef HAVE_INET_ATON #include #include extern int inet_aton(const char *cp, struct in_addr * addr); #endif #if !HAVE_DECL_STRLCAT extern size_t strlcat(char *dst, const char *src, size_t siz); #endif #if !HAVE_DECL_STRLCPY extern size_t strlcpy(char *dst, const char *src, size_t siz); #endif #if !defined(HAVE_RANDOM) && !defined(__BORLANDC__) extern long random(void); #endif #ifndef HAVE_UNSETENV extern void unsetenv(const char *name); #endif #ifndef HAVE_SRANDOM extern void srandom(unsigned int seed); #endif /* thread.h */ extern char *pqStrerror(int errnum, char *strerrbuf, size_t buflen); #if !defined(WIN32) || defined(__CYGWIN__) extern int pqGetpwuid(uid_t uid, struct passwd * resultbuf, char *buffer, size_t buflen, struct passwd ** result); #endif extern int pqGethostbyname(const char *name, struct hostent * resultbuf, char *buffer, size_t buflen, struct hostent ** result, int *herrno); extern void pg_qsort(void *base, size_t nel, size_t elsize, int (*cmp) (const void *, const void *)); #define qsort(a,b,c,d) pg_qsort(a,b,c,d) typedef int (*qsort_arg_comparator) (const void *a, const void *b, void *arg); extern void qsort_arg(void *base, size_t nel, size_t elsize, qsort_arg_comparator cmp, void *arg); /* port/chklocale.c */ extern int pg_get_encoding_from_locale(const char *ctype, bool write_message); /* port/inet_net_ntop.c */ extern char *inet_net_ntop(int af, const void *src, int bits, char *dst, size_t size); /* port/pgcheckdir.c */ extern int pg_check_dir(const char *dir); /* port/pgmkdirp.c */ extern int pg_mkdir_p(char *path, int omode); #endif /* PG_PORT_H */ PKBiZViP server/regex/regcustom.hnu[/* * Copyright (c) 1998, 1999 Henry Spencer. All rights reserved. * * Development of this software was funded, in part, by Cray Research Inc., * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics * Corporation, none of whom are responsible for the results. The author * thanks all of them. * * Redistribution and use in source and binary forms -- with or without * modification -- are permitted for any purpose, provided that * redistributions in source form retain this entire copyright notice and * indicate the origin and nature of any modifications. * * I'd appreciate being given credit for this package in the documentation * of software which uses it, but that is not a requirement. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * src/include/regex/regcustom.h */ /* headers if any */ #include "postgres.h" #include #include /* * towlower() and friends should be in , but some pre-C99 systems * declare them in . */ #ifdef HAVE_WCHAR_H #include #endif #ifdef HAVE_WCTYPE_H #include #endif #include "mb/pg_wchar.h" /* overrides for regguts.h definitions, if any */ #define FUNCPTR(name, args) (*name) args #define MALLOC(n) malloc(n) #define FREE(p) free(VS(p)) #define REALLOC(p,n) realloc(VS(p),n) #define assert(x) Assert(x) /* internal character type and related */ typedef pg_wchar chr; /* the type itself */ typedef unsigned uchr; /* unsigned type that will hold a chr */ typedef int celt; /* type to hold chr, or NOCELT */ #define NOCELT (-1) /* celt value which is not valid chr */ #define CHR(c) ((unsigned char) (c)) /* turn char literal into chr literal */ #define DIGITVAL(c) ((c)-'0') /* turn chr digit into its value */ #define CHRBITS 32 /* bits in a chr; must not use sizeof */ #define CHR_MIN 0x00000000 /* smallest and largest chr; the value */ #define CHR_MAX 0x7ffffffe /* CHR_MAX-CHR_MIN+1 must fit in an int, and * CHR_MAX+1 must fit in both chr and celt */ /* * Check if a chr value is in range. Ideally we'd just write this as * ((c) >= CHR_MIN && (c) <= CHR_MAX) * However, if chr is unsigned and CHR_MIN is zero, the first part of that * is a no-op, and certain overly-nannyish compilers give warnings about it. * So we leave that out here. If you want to make chr signed and/or CHR_MIN * not zero, redefine this macro as above. Callers should assume that the * macro may multiply evaluate its argument, even though it does not today. */ #define CHR_IS_IN_RANGE(c) ((c) <= CHR_MAX) /* functions operating on chr */ #define iscalnum(x) pg_wc_isalnum(x) #define iscalpha(x) pg_wc_isalpha(x) #define iscdigit(x) pg_wc_isdigit(x) #define iscspace(x) pg_wc_isspace(x) /* and pick up the standard header */ #include "regex.h" PKBiZ{ ??server/regex/regguts.hnu[/* * Internal interface definitions, etc., for the reg package * * Copyright (c) 1998, 1999 Henry Spencer. All rights reserved. * * Development of this software was funded, in part, by Cray Research Inc., * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics * Corporation, none of whom are responsible for the results. The author * thanks all of them. * * Redistribution and use in source and binary forms -- with or without * modification -- are permitted for any purpose, provided that * redistributions in source form retain this entire copyright notice and * indicate the origin and nature of any modifications. * * I'd appreciate being given credit for this package in the documentation * of software which uses it, but that is not a requirement. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * src/include/regex/regguts.h */ /* * Environmental customization. It should not (I hope) be necessary to * alter the file you are now reading -- regcustom.h should handle it all, * given care here and elsewhere. */ #include "regcustom.h" /* * Things that regcustom.h might override. */ /* assertions */ #ifndef assert #ifndef REG_DEBUG #define NDEBUG /* no assertions */ #endif #include #endif /* voids */ #ifndef DISCARD #define DISCARD void /* for throwing values away */ #endif #ifndef VS #define VS(x) ((void *)(x)) /* cast something to generic ptr */ #endif /* function-pointer declarator */ #ifndef FUNCPTR #define FUNCPTR(name, args) (*(name)) args #endif /* memory allocation */ #ifndef MALLOC #define MALLOC(n) malloc(n) #endif #ifndef REALLOC #define REALLOC(p, n) realloc(VS(p), n) #endif #ifndef FREE #define FREE(p) free(VS(p)) #endif /* want size of a char in bits, and max value in bounded quantifiers */ #ifndef CHAR_BIT #include #endif #ifndef _POSIX2_RE_DUP_MAX #define _POSIX2_RE_DUP_MAX 255 /* normally from */ #endif /* * misc */ #define NOTREACHED 0 #define xxx 1 #define DUPMAX _POSIX2_RE_DUP_MAX #define INFINITY (DUPMAX+1) #define REMAGIC 0xfed7 /* magic number for main struct */ /* * debugging facilities */ #ifdef REG_DEBUG /* FDEBUG does finite-state tracing */ #define FDEBUG(arglist) { if (v->eflags®_FTRACE) printf arglist; } /* MDEBUG does higher-level tracing */ #define MDEBUG(arglist) { if (v->eflags®_MTRACE) printf arglist; } #else #define FDEBUG(arglist) {} #define MDEBUG(arglist) {} #endif /* * bitmap manipulation */ #define UBITS (CHAR_BIT * sizeof(unsigned)) #define BSET(uv, sn) ((uv)[(sn)/UBITS] |= (unsigned)1 << ((sn)%UBITS)) #define ISBSET(uv, sn) ((uv)[(sn)/UBITS] & ((unsigned)1 << ((sn)%UBITS))) /* * We dissect a chr into byts for colormap table indexing. Here we define * a byt, which will be the same as a byte on most machines... The exact * size of a byt is not critical, but about 8 bits is good, and extraction * of 8-bit chunks is sometimes especially fast. */ #ifndef BYTBITS #define BYTBITS 8 /* bits in a byt */ #endif #define BYTTAB (1<flags & FREECOL) union tree *block; /* block of solid color, if any */ }; /* * The color map itself * * Much of the data in the colormap struct is only used at compile time. * However, the bulk of the space usage is in the "tree" structure, so it's * not clear that there's much point in converting the rest to a more compact * form when compilation is finished. */ struct colormap { int magic; #define CMMAGIC 0x876 struct vars *v; /* for compile error reporting */ size_t ncds; /* allocated length of colordescs array */ size_t max; /* highest color number currently in use */ color free; /* beginning of free chain (if non-0) */ struct colordesc *cd; /* pointer to array of colordescs */ #define CDEND(cm) (&(cm)->cd[(cm)->max + 1]) /* If we need up to NINLINECDS, we store them here to save a malloc */ #define NINLINECDS ((size_t)10) struct colordesc cdspace[NINLINECDS]; union tree tree[NBYTS]; /* tree top, plus lower-level fill blocks */ }; /* optimization magic to do fast chr->color mapping */ #define B0(c) ((c) & BYTMASK) #define B1(c) (((c)>>BYTBITS) & BYTMASK) #define B2(c) (((c)>>(2*BYTBITS)) & BYTMASK) #define B3(c) (((c)>>(3*BYTBITS)) & BYTMASK) #if NBYTS == 1 #define GETCOLOR(cm, c) ((cm)->tree->tcolor[B0(c)]) #endif /* beware, for NBYTS>1, GETCOLOR() is unsafe -- 2nd arg used repeatedly */ #if NBYTS == 2 #define GETCOLOR(cm, c) ((cm)->tree->tptr[B1(c)]->tcolor[B0(c)]) #endif #if NBYTS == 4 #define GETCOLOR(cm, c) ((cm)->tree->tptr[B3(c)]->tptr[B2(c)]->tptr[B1(c)]->tcolor[B0(c)]) #endif /* * Interface definitions for locale-interface functions in regc_locale.c. */ /* * Representation of a set of characters. chrs[] represents individual * code points, ranges[] represents ranges in the form min..max inclusive. * * Note that in cvecs gotten from newcvec() and intended to be freed by * freecvec(), both arrays of chrs are after the end of the struct, not * separately malloc'd; so chrspace and rangespace are effectively immutable. */ struct cvec { int nchrs; /* number of chrs */ int chrspace; /* number of chrs allocated in chrs[] */ chr *chrs; /* pointer to vector of chrs */ int nranges; /* number of ranges (chr pairs) */ int rangespace; /* number of ranges allocated in ranges[] */ chr *ranges; /* pointer to vector of chr pairs */ }; /* * definitions for NFA internal representation * * Having a "from" pointer within each arc may seem redundant, but it * saves a lot of hassle. */ struct state; struct arc { int type; /* 0 if free, else an NFA arc type code */ color co; struct state *from; /* where it's from (and contained within) */ struct state *to; /* where it's to */ struct arc *outchain; /* link in *from's outs chain or free chain */ struct arc *outchainRev; /* back-link in *from's outs chain */ #define freechain outchain /* we do not maintain "freechainRev" */ struct arc *inchain; /* link in *to's ins chain */ struct arc *inchainRev; /* back-link in *to's ins chain */ struct arc *colorchain; /* link in color's arc chain */ struct arc *colorchainRev; /* back-link in color's arc chain */ }; struct arcbatch { /* for bulk allocation of arcs */ struct arcbatch *next; #define ABSIZE 10 struct arc a[ABSIZE]; }; struct state { int no; #define FREESTATE (-1) char flag; /* marks special states */ int nins; /* number of inarcs */ struct arc *ins; /* chain of inarcs */ int nouts; /* number of outarcs */ struct arc *outs; /* chain of outarcs */ struct arc *free; /* chain of free arcs */ struct state *tmp; /* temporary for traversal algorithms */ struct state *next; /* chain for traversing all */ struct state *prev; /* back chain */ struct arcbatch oas; /* first arcbatch, avoid malloc in easy case */ int noas; /* number of arcs used in first arcbatch */ }; struct nfa { struct state *pre; /* pre-initial state */ struct state *init; /* initial state */ struct state *final; /* final state */ struct state *post; /* post-final state */ int nstates; /* for numbering states */ struct state *states; /* state-chain header */ struct state *slast; /* tail of the chain */ struct state *free; /* free list */ struct colormap *cm; /* the color map */ color bos[2]; /* colors, if any, assigned to BOS and BOL */ color eos[2]; /* colors, if any, assigned to EOS and EOL */ struct vars *v; /* simplifies compile error reporting */ struct nfa *parent; /* parent NFA, if any */ }; /* * definitions for compacted NFA * * The main space savings in a compacted NFA is from making the arcs as small * as possible. We store only the transition color and next-state number for * each arc. The list of out arcs for each state is an array beginning at * cnfa.states[statenumber], and terminated by a dummy carc struct with * co == COLORLESS. * * The non-dummy carc structs are of two types: plain arcs and LACON arcs. * Plain arcs just store the transition color number as "co". LACON arcs * store the lookahead constraint number plus cnfa.ncolors as "co". LACON * arcs can be distinguished from plain by testing for co >= cnfa.ncolors. */ struct carc { color co; /* COLORLESS is list terminator */ int to; /* next-state number */ }; struct cnfa { int nstates; /* number of states */ int ncolors; /* number of colors (max color in use + 1) */ int flags; #define HASLACONS 01 /* uses lookahead constraints */ int pre; /* setup state number */ int post; /* teardown state number */ color bos[2]; /* colors, if any, assigned to BOS and BOL */ color eos[2]; /* colors, if any, assigned to EOS and EOL */ char *stflags; /* vector of per-state flags bytes */ #define CNFA_NOPROGRESS 01 /* flag bit for a no-progress state */ struct carc **states; /* vector of pointers to outarc lists */ /* states[n] are pointers into a single malloc'd array of arcs */ struct carc *arcs; /* the area for the lists */ }; #define ZAPCNFA(cnfa) ((cnfa).nstates = 0) #define NULLCNFA(cnfa) ((cnfa).nstates == 0) /* * This symbol limits the transient heap space used by the regex compiler, * and thereby also the maximum complexity of NFAs that we'll deal with. * Currently we only count NFA states and arcs against this; the other * transient data is generally not large enough to notice compared to those. * Note that we do not charge anything for the final output data structures * (the compacted NFA and the colormap). */ #ifndef REG_MAX_COMPILE_SPACE #define REG_MAX_COMPILE_SPACE \ (100000 * sizeof(struct state) + 100000 * sizeof(struct arcbatch)) #endif /* * subexpression tree * * "op" is one of: * '=' plain regex without interesting substructure (implemented as DFA) * 'b' back-reference (has no substructure either) * '(' capture node: captures the match of its single child * '.' concatenation: matches a match for left, then a match for right * '|' alternation: matches a match for left or a match for right * '*' iteration: matches some number of matches of its single child * * Note: the right child of an alternation must be another alternation or * NULL; hence, an N-way branch requires N alternation nodes, not N-1 as you * might expect. This could stand to be changed. Actually I'd rather see * a single alternation node with N children, but that will take revising * the representation of struct subre. * * Note: when a backref is directly quantified, we stick the min/max counts * into the backref rather than plastering an iteration node on top. This is * for efficiency: there is no need to search for possible division points. */ struct subre { char op; /* see type codes above */ char flags; #define LONGER 01 /* prefers longer match */ #define SHORTER 02 /* prefers shorter match */ #define MIXED 04 /* mixed preference below */ #define CAP 010 /* capturing parens below */ #define BACKR 020 /* back reference below */ #define INUSE 0100 /* in use in final tree */ #define LOCAL 03 /* bits which may not propagate up */ #define LMIX(f) ((f)<<2) /* LONGER -> MIXED */ #define SMIX(f) ((f)<<1) /* SHORTER -> MIXED */ #define UP(f) (((f)&~LOCAL) | (LMIX(f) & SMIX(f) & MIXED)) #define MESSY(f) ((f)&(MIXED|CAP|BACKR)) #define PREF(f) ((f)&LOCAL) #define PREF2(f1, f2) ((PREF(f1) != 0) ? PREF(f1) : PREF(f2)) #define COMBINE(f1, f2) (UP((f1)|(f2)) | PREF2(f1, f2)) short id; /* ID of subre (1..ntree-1) */ int subno; /* subexpression number (for 'b' and '(') */ short min; /* min repetitions for iteration or backref */ short max; /* max repetitions for iteration or backref */ struct subre *left; /* left child, if any (also freelist chain) */ struct subre *right; /* right child, if any */ struct state *begin; /* outarcs from here... */ struct state *end; /* ...ending in inarcs here */ struct cnfa cnfa; /* compacted NFA, if any */ struct subre *chain; /* for bookkeeping and error cleanup */ }; /* * table of function pointers for generic manipulation functions * A regex_t's re_fns points to one of these. */ struct fns { void FUNCPTR(free, (regex_t *)); int FUNCPTR(cancel_requested, (void)); int FUNCPTR(stack_too_deep, (void)); }; #define CANCEL_REQUESTED(re) \ ((*((struct fns *) (re)->re_fns)->cancel_requested) ()) #define STACK_TOO_DEEP(re) \ ((*((struct fns *) (re)->re_fns)->stack_too_deep) ()) /* * the insides of a regex_t, hidden behind a void * */ struct guts { int magic; #define GUTSMAGIC 0xfed9 int cflags; /* copy of compile flags */ long info; /* copy of re_info */ size_t nsub; /* copy of re_nsub */ struct subre *tree; struct cnfa search; /* for fast preliminary search */ int ntree; /* number of subre's, plus one */ struct colormap cmap; int FUNCPTR(compare, (const chr *, const chr *, size_t)); struct subre *lacons; /* lookahead-constraint vector */ int nlacons; /* size of lacons */ }; PKBiZЃ44server/regex/regerrs.hnu[/* * src/include/regex/regerrs.h */ { REG_OKAY, "REG_OKAY", "no errors detected" }, { REG_NOMATCH, "REG_NOMATCH", "failed to match" }, { REG_BADPAT, "REG_BADPAT", "invalid regexp (reg version 0.8)" }, { REG_ECOLLATE, "REG_ECOLLATE", "invalid collating element" }, { REG_ECTYPE, "REG_ECTYPE", "invalid character class" }, { REG_EESCAPE, "REG_EESCAPE", "invalid escape \\ sequence" }, { REG_ESUBREG, "REG_ESUBREG", "invalid backreference number" }, { REG_EBRACK, "REG_EBRACK", "brackets [] not balanced" }, { REG_EPAREN, "REG_EPAREN", "parentheses () not balanced" }, { REG_EBRACE, "REG_EBRACE", "braces {} not balanced" }, { REG_BADBR, "REG_BADBR", "invalid repetition count(s)" }, { REG_ERANGE, "REG_ERANGE", "invalid character range" }, { REG_ESPACE, "REG_ESPACE", "out of memory" }, { REG_BADRPT, "REG_BADRPT", "quantifier operand invalid" }, { REG_ASSERT, "REG_ASSERT", "\"cannot happen\" -- you found a bug" }, { REG_INVARG, "REG_INVARG", "invalid argument to regex function" }, { REG_MIXED, "REG_MIXED", "character widths of regex and string differ" }, { REG_BADOPT, "REG_BADOPT", "invalid embedded option" }, { REG_ETOOBIG, "REG_ETOOBIG", "regular expression is too complex" }, { REG_ECOLORS, "REG_ECOLORS", "too many colors" }, { REG_CANCEL, "REG_CANCEL", "operation cancelled" }, PKBiZ//server/regex/regex.hnu[#ifndef _REGEX_H_ #define _REGEX_H_ /* never again */ /* * regular expressions * * Copyright (c) 1998, 1999 Henry Spencer. All rights reserved. * * Development of this software was funded, in part, by Cray Research Inc., * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics * Corporation, none of whom are responsible for the results. The author * thanks all of them. * * Redistribution and use in source and binary forms -- with or without * modification -- are permitted for any purpose, provided that * redistributions in source form retain this entire copyright notice and * indicate the origin and nature of any modifications. * * I'd appreciate being given credit for this package in the documentation * of software which uses it, but that is not a requirement. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * src/include/regex/regex.h */ /* * Add your own defines, if needed, here. */ #include "mb/pg_wchar.h" /* * interface types etc. */ /* * regoff_t has to be large enough to hold either off_t or ssize_t, * and must be signed; it's only a guess that long is suitable. */ typedef long regoff_t; /* * other interface types */ /* the biggie, a compiled RE (or rather, a front end to same) */ typedef struct { int re_magic; /* magic number */ size_t re_nsub; /* number of subexpressions */ long re_info; /* information about RE */ #define REG_UBACKREF 000001 #define REG_ULOOKAHEAD 000002 #define REG_UBOUNDS 000004 #define REG_UBRACES 000010 #define REG_UBSALNUM 000020 #define REG_UPBOTCH 000040 #define REG_UBBS 000100 #define REG_UNONPOSIX 000200 #define REG_UUNSPEC 000400 #define REG_UUNPORT 001000 #define REG_ULOCALE 002000 #define REG_UEMPTYMATCH 004000 #define REG_UIMPOSSIBLE 010000 #define REG_USHORTEST 020000 int re_csize; /* sizeof(character) */ char *re_endp; /* backward compatibility kludge */ Oid re_collation; /* Collation that defines LC_CTYPE behavior */ /* the rest is opaque pointers to hidden innards */ char *re_guts; /* `char *' is more portable than `void *' */ char *re_fns; } regex_t; /* result reporting (may acquire more fields later) */ typedef struct { regoff_t rm_so; /* start of substring */ regoff_t rm_eo; /* end of substring */ } regmatch_t; /* supplementary control and reporting */ typedef struct { regmatch_t rm_extend; /* see REG_EXPECT */ } rm_detail_t; /* * regex compilation flags */ #define REG_BASIC 000000 /* BREs (convenience) */ #define REG_EXTENDED 000001 /* EREs */ #define REG_ADVF 000002 /* advanced features in EREs */ #define REG_ADVANCED 000003 /* AREs (which are also EREs) */ #define REG_QUOTE 000004 /* no special characters, none */ #define REG_NOSPEC REG_QUOTE /* historical synonym */ #define REG_ICASE 000010 /* ignore case */ #define REG_NOSUB 000020 /* don't care about subexpressions */ #define REG_EXPANDED 000040 /* expanded format, white space & comments */ #define REG_NLSTOP 000100 /* \n doesn't match . or [^ ] */ #define REG_NLANCH 000200 /* ^ matches after \n, $ before */ #define REG_NEWLINE 000300 /* newlines are line terminators */ #define REG_PEND 000400 /* ugh -- backward-compatibility hack */ #define REG_EXPECT 001000 /* report details on partial/limited matches */ #define REG_BOSONLY 002000 /* temporary kludge for BOS-only matches */ #define REG_DUMP 004000 /* none of your business :-) */ #define REG_FAKE 010000 /* none of your business :-) */ #define REG_PROGRESS 020000 /* none of your business :-) */ /* * regex execution flags */ #define REG_NOTBOL 0001 /* BOS is not BOL */ #define REG_NOTEOL 0002 /* EOS is not EOL */ #define REG_STARTEND 0004 /* backward compatibility kludge */ #define REG_FTRACE 0010 /* none of your business */ #define REG_MTRACE 0020 /* none of your business */ #define REG_SMALL 0040 /* none of your business */ /* * error reporting * Be careful if modifying the list of error codes -- the table used by * regerror() is generated automatically from this file! */ #define REG_OKAY 0 /* no errors detected */ #define REG_NOMATCH 1 /* failed to match */ #define REG_BADPAT 2 /* invalid regexp */ #define REG_ECOLLATE 3 /* invalid collating element */ #define REG_ECTYPE 4 /* invalid character class */ #define REG_EESCAPE 5 /* invalid escape \ sequence */ #define REG_ESUBREG 6 /* invalid backreference number */ #define REG_EBRACK 7 /* brackets [] not balanced */ #define REG_EPAREN 8 /* parentheses () not balanced */ #define REG_EBRACE 9 /* braces {} not balanced */ #define REG_BADBR 10 /* invalid repetition count(s) */ #define REG_ERANGE 11 /* invalid character range */ #define REG_ESPACE 12 /* out of memory */ #define REG_BADRPT 13 /* quantifier operand invalid */ #define REG_ASSERT 15 /* "can't happen" -- you found a bug */ #define REG_INVARG 16 /* invalid argument to regex function */ #define REG_MIXED 17 /* character widths of regex and string differ */ #define REG_BADOPT 18 /* invalid embedded option */ #define REG_ETOOBIG 19 /* regular expression is too complex */ #define REG_ECOLORS 20 /* too many colors */ #define REG_CANCEL 21 /* operation cancelled */ /* two specials for debugging and testing */ #define REG_ATOI 101 /* convert error-code name to number */ #define REG_ITOA 102 /* convert error-code number to name */ /* non-error result codes for pg_regprefix */ #define REG_PREFIX (-1) /* identified a common prefix */ #define REG_EXACT (-2) /* identified an exact match */ /* * the prototypes for exported functions */ extern int pg_regcomp(regex_t *, const pg_wchar *, size_t, int, Oid); extern int pg_regexec(regex_t *, const pg_wchar *, size_t, size_t, rm_detail_t *, size_t, regmatch_t[], int); extern int pg_regprefix(regex_t *, pg_wchar **, size_t *); extern void pg_regfree(regex_t *); extern size_t pg_regerror(int, const regex_t *, char *, size_t); extern void pg_set_regex_collation(Oid collation); #endif /* _REGEX_H_ */ PKBiZTUcCcCserver/mb/pg_wchar.hnu[/*------------------------------------------------------------------------- * * pg_wchar.h * multibyte-character support * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/mb/pg_wchar.h * * NOTES * This is used both by the backend and by libpq, but should not be * included by libpq client programs. In particular, a libpq client * should not assume that the encoding IDs used by the version of libpq * it's linked to match up with the IDs declared here. * *------------------------------------------------------------------------- */ #ifndef PG_WCHAR_H #define PG_WCHAR_H /* * The pg_wchar type */ typedef unsigned int pg_wchar; /* * various definitions for EUC */ #define SS2 0x8e /* single shift 2 (JIS0201) */ #define SS3 0x8f /* single shift 3 (JIS0212) */ /* * SJIS validation macros */ #define ISSJISHEAD(c) (((c) >= 0x81 && (c) <= 0x9f) || ((c) >= 0xe0 && (c) <= 0xfc)) #define ISSJISTAIL(c) (((c) >= 0x40 && (c) <= 0x7e) || ((c) >= 0x80 && (c) <= 0xfc)) /* * Leading byte types or leading prefix byte for MULE internal code. * See http://www.xemacs.org for more details. (there is a doc titled * "XEmacs Internals Manual", "MULE Character Sets and Encodings" * section.) */ /* * Is a leading byte for "official" single byte encodings? */ #define IS_LC1(c) ((unsigned char)(c) >= 0x81 && (unsigned char)(c) <= 0x8d) /* * Is a prefix byte for "private" single byte encodings? */ #define LCPRV1_A 0x9a #define LCPRV1_B 0x9b #define IS_LCPRV1(c) ((unsigned char)(c) == LCPRV1_A || (unsigned char)(c) == LCPRV1_B) #define IS_LCPRV1_A_RANGE(c) \ ((unsigned char)(c) >= 0xa0 && (unsigned char)(c) <= 0xdf) #define IS_LCPRV1_B_RANGE(c) \ ((unsigned char)(c) >= 0xe0 && (unsigned char)(c) <= 0xef) /* * Is a leading byte for "official" multibyte encodings? */ #define IS_LC2(c) ((unsigned char)(c) >= 0x90 && (unsigned char)(c) <= 0x99) /* * Is a prefix byte for "private" multibyte encodings? */ #define LCPRV2_A 0x9c #define LCPRV2_B 0x9d #define IS_LCPRV2(c) ((unsigned char)(c) == LCPRV2_A || (unsigned char)(c) == LCPRV2_B) #define IS_LCPRV2_A_RANGE(c) \ ((unsigned char)(c) >= 0xf0 && (unsigned char)(c) <= 0xf4) #define IS_LCPRV2_B_RANGE(c) \ ((unsigned char)(c) >= 0xf5 && (unsigned char)(c) <= 0xfe) /*---------------------------------------------------- * leading characters *---------------------------------------------------- */ /* * Official single byte encodings (0x81-0x8e) */ #define LC_ISO8859_1 0x81 /* ISO8859 Latin 1 */ #define LC_ISO8859_2 0x82 /* ISO8859 Latin 2 */ #define LC_ISO8859_3 0x83 /* ISO8859 Latin 3 */ #define LC_ISO8859_4 0x84 /* ISO8859 Latin 4 */ #define LC_TIS620 0x85 /* Thai (not supported yet) */ #define LC_ISO8859_7 0x86 /* Greek (not supported yet) */ #define LC_ISO8859_6 0x87 /* Arabic (not supported yet) */ #define LC_ISO8859_8 0x88 /* Hebrew (not supported yet) */ #define LC_JISX0201K 0x89 /* Japanese 1 byte kana */ #define LC_JISX0201R 0x8a /* Japanese 1 byte Roman */ /* Note that 0x8b seems to be unused as of Emacs 20.7. * However, there might be a chance that 0x8b could be used * in later version of Emacs. */ #define LC_KOI8_R 0x8b /* Cyrillic KOI8-R */ #define LC_KOI8_U 0x8b /* Cyrillic KOI8-U */ #define LC_ISO8859_5 0x8c /* ISO8859 Cyrillic */ #define LC_ISO8859_9 0x8d /* ISO8859 Latin 5 (not supported yet) */ /* #define FREE 0x8e free (unused) */ /* * Unused */ #define CONTROL_1 0x8f /* control characters (unused) */ /* * Official multibyte byte encodings (0x90-0x99) * 0x9a-0x9d are free. 0x9e and 0x9f are reserved. */ #define LC_JISX0208_1978 0x90 /* Japanese Kanji, old JIS (not supported) */ /* #define FREE 0x90 free (unused) */ #define LC_GB2312_80 0x91 /* Chinese */ #define LC_JISX0208 0x92 /* Japanese Kanji (JIS X 0208) */ #define LC_KS5601 0x93 /* Korean */ #define LC_JISX0212 0x94 /* Japanese Kanji (JIS X 0212) */ #define LC_CNS11643_1 0x95 /* CNS 11643-1992 Plane 1 */ #define LC_CNS11643_2 0x96 /* CNS 11643-1992 Plane 2 */ /* #define FREE 0x97 free (unused) */ #define LC_BIG5_1 0x98 /* Plane 1 Chinese traditional (not supported) */ #define LC_BIG5_2 0x99 /* Plane 1 Chinese traditional (not supported) */ /* * Private single byte encodings (0xa0-0xef) */ #define LC_SISHENG 0xa0/* Chinese SiSheng characters for * PinYin/ZhuYin (not supported) */ #define LC_IPA 0xa1/* IPA (International Phonetic Association) * (not supported) */ #define LC_VISCII_LOWER 0xa2/* Vietnamese VISCII1.1 lower-case (not * supported) */ #define LC_VISCII_UPPER 0xa3/* Vietnamese VISCII1.1 upper-case (not * supported) */ #define LC_ARABIC_DIGIT 0xa4 /* Arabic digit (not supported) */ #define LC_ARABIC_1_COLUMN 0xa5 /* Arabic 1-column (not supported) */ #define LC_ASCII_RIGHT_TO_LEFT 0xa6 /* ASCII (left half of ISO8859-1) with * right-to-left direction (not * supported) */ #define LC_LAO 0xa7/* Lao characters (ISO10646 0E80..0EDF) (not * supported) */ #define LC_ARABIC_2_COLUMN 0xa8 /* Arabic 1-column (not supported) */ /* * Private multibyte encodings (0xf0-0xff) */ #define LC_INDIAN_1_COLUMN 0xf0/* Indian charset for 1-column width glypps * (not supported) */ #define LC_TIBETAN_1_COLUMN 0xf1 /* Tibetan 1 column glyph (not supported) */ #define LC_ETHIOPIC 0xf5 /* Ethiopic characters (not supported) */ #define LC_CNS11643_3 0xf6 /* CNS 11643-1992 Plane 3 */ #define LC_CNS11643_4 0xf7 /* CNS 11643-1992 Plane 4 */ #define LC_CNS11643_5 0xf8 /* CNS 11643-1992 Plane 5 */ #define LC_CNS11643_6 0xf9 /* CNS 11643-1992 Plane 6 */ #define LC_CNS11643_7 0xfa /* CNS 11643-1992 Plane 7 */ #define LC_INDIAN_2_COLUMN 0xfb/* Indian charset for 2-column width glypps * (not supported) */ #define LC_TIBETAN 0xfc /* Tibetan (not supported) */ /* #define FREE 0xfd free (unused) */ /* #define FREE 0xfe free (unused) */ /* #define FREE 0xff free (unused) */ /* * PostgreSQL encoding identifiers * * WARNING: the order of this enum must be same as order of entries * in the pg_enc2name_tbl[] array (in mb/encnames.c), and * in the pg_wchar_table[] array (in mb/wchar.c)! * * If you add some encoding don't forget to check * PG_ENCODING_BE_LAST macro. * * PG_SQL_ASCII is default encoding and must be = 0. * * XXX We must avoid renumbering any backend encoding until libpq's major * version number is increased beyond 5; it turns out that the backend * encoding IDs are effectively part of libpq's ABI as far as 8.2 initdb and * psql are concerned. */ typedef enum pg_enc { PG_SQL_ASCII = 0, /* SQL/ASCII */ PG_EUC_JP, /* EUC for Japanese */ PG_EUC_CN, /* EUC for Chinese */ PG_EUC_KR, /* EUC for Korean */ PG_EUC_TW, /* EUC for Taiwan */ PG_EUC_JIS_2004, /* EUC-JIS-2004 */ PG_UTF8, /* Unicode UTF8 */ PG_MULE_INTERNAL, /* Mule internal code */ PG_LATIN1, /* ISO-8859-1 Latin 1 */ PG_LATIN2, /* ISO-8859-2 Latin 2 */ PG_LATIN3, /* ISO-8859-3 Latin 3 */ PG_LATIN4, /* ISO-8859-4 Latin 4 */ PG_LATIN5, /* ISO-8859-9 Latin 5 */ PG_LATIN6, /* ISO-8859-10 Latin6 */ PG_LATIN7, /* ISO-8859-13 Latin7 */ PG_LATIN8, /* ISO-8859-14 Latin8 */ PG_LATIN9, /* ISO-8859-15 Latin9 */ PG_LATIN10, /* ISO-8859-16 Latin10 */ PG_WIN1256, /* windows-1256 */ PG_WIN1258, /* Windows-1258 */ PG_WIN866, /* (MS-DOS CP866) */ PG_WIN874, /* windows-874 */ PG_KOI8R, /* KOI8-R */ PG_WIN1251, /* windows-1251 */ PG_WIN1252, /* windows-1252 */ PG_ISO_8859_5, /* ISO-8859-5 */ PG_ISO_8859_6, /* ISO-8859-6 */ PG_ISO_8859_7, /* ISO-8859-7 */ PG_ISO_8859_8, /* ISO-8859-8 */ PG_WIN1250, /* windows-1250 */ PG_WIN1253, /* windows-1253 */ PG_WIN1254, /* windows-1254 */ PG_WIN1255, /* windows-1255 */ PG_WIN1257, /* windows-1257 */ PG_KOI8U, /* KOI8-U */ /* PG_ENCODING_BE_LAST points to the above entry */ /* followings are for client encoding only */ PG_SJIS, /* Shift JIS (Winindows-932) */ PG_BIG5, /* Big5 (Windows-950) */ PG_GBK, /* GBK (Windows-936) */ PG_UHC, /* UHC (Windows-949) */ PG_GB18030, /* GB18030 */ PG_JOHAB, /* EUC for Korean JOHAB */ PG_SHIFT_JIS_2004, /* Shift-JIS-2004 */ _PG_LAST_ENCODING_ /* mark only */ } pg_enc; #define PG_ENCODING_BE_LAST PG_KOI8U /* * Please use these tests before access to pg_encconv_tbl[] * or to other places... */ #define PG_VALID_BE_ENCODING(_enc) \ ((_enc) >= 0 && (_enc) <= PG_ENCODING_BE_LAST) #define PG_ENCODING_IS_CLIENT_ONLY(_enc) \ ((_enc) > PG_ENCODING_BE_LAST && (_enc) < _PG_LAST_ENCODING_) #define PG_VALID_ENCODING(_enc) \ ((_enc) >= 0 && (_enc) < _PG_LAST_ENCODING_) /* On FE are possible all encodings */ #define PG_VALID_FE_ENCODING(_enc) PG_VALID_ENCODING(_enc) /* * Encoding names with all aliases */ typedef struct pg_encname { char *name; pg_enc encoding; } pg_encname; extern pg_encname pg_encname_tbl[]; extern unsigned int pg_encname_tbl_sz; /* * Careful: * * if (PG_VALID_ENCODING(encoding)) * pg_enc2name_tbl[ encoding ]; */ typedef struct pg_enc2name { char *name; pg_enc encoding; #ifdef WIN32 unsigned codepage; /* codepage for WIN32 */ #endif } pg_enc2name; extern pg_enc2name pg_enc2name_tbl[]; /* * Encoding names for gettext */ typedef struct pg_enc2gettext { pg_enc encoding; const char *name; } pg_enc2gettext; extern pg_enc2gettext pg_enc2gettext_tbl[]; /* * pg_wchar stuff */ typedef int (*mb2wchar_with_len_converter) (const unsigned char *from, pg_wchar *to, int len); typedef int (*wchar2mb_with_len_converter) (const pg_wchar *from, unsigned char *to, int len); typedef int (*mblen_converter) (const unsigned char *mbstr); typedef int (*mbdisplaylen_converter) (const unsigned char *mbstr); typedef bool (*mbcharacter_incrementer) (unsigned char *mbstr, int len); typedef int (*mbverifier) (const unsigned char *mbstr, int len); typedef struct { mb2wchar_with_len_converter mb2wchar_with_len; /* convert a multibyte * string to a wchar */ wchar2mb_with_len_converter wchar2mb_with_len; /* convert a wchar * string to a multibyte */ mblen_converter mblen; /* get byte length of a char */ mbdisplaylen_converter dsplen; /* get display width of a char */ mbverifier mbverify; /* verify multibyte sequence */ int maxmblen; /* max bytes for a char in this encoding */ } pg_wchar_tbl; extern pg_wchar_tbl pg_wchar_table[]; /* * UTF-8 to local code conversion map * Note that we limit the max length of UTF-8 to 4 bytes, * which is UCS-4 00010000-001FFFFF range. */ typedef struct { uint32 utf; /* UTF-8 */ uint32 code; /* local code */ } pg_utf_to_local; /* * local code to UTF-8 conversion map */ typedef struct { uint32 code; /* local code */ uint32 utf; /* UTF-8 */ } pg_local_to_utf; /* * UTF-8 to local code conversion map(combined characters) */ typedef struct { uint32 utf1; /* UTF-8 code 1 */ uint32 utf2; /* UTF-8 code 2 */ uint32 code; /* local code */ } pg_utf_to_local_combined; /* * local code to UTF-8 conversion map(combined characters) */ typedef struct { uint32 code; /* local code */ uint32 utf1; /* UTF-8 code 1 */ uint32 utf2; /* UTF-8 code 2 */ } pg_local_to_utf_combined; /* * Support macro for encoding conversion functions to validate their * arguments. (This could be made more compact if we included fmgr.h * here, but we don't want to do that because this header file is also * used by frontends.) */ #define CHECK_ENCODING_CONVERSION_ARGS(srcencoding,destencoding) \ check_encoding_conversion_args(PG_GETARG_INT32(0), \ PG_GETARG_INT32(1), \ PG_GETARG_INT32(4), \ (srcencoding), \ (destencoding)) /* * These functions are considered part of libpq's exported API and * are also declared in libpq-fe.h. */ extern int pg_char_to_encoding(const char *name); extern const char *pg_encoding_to_char(int encoding); extern int pg_valid_server_encoding_id(int encoding); /* * Remaining functions are not considered part of libpq's API, though many * of them do exist inside libpq. */ extern pg_encname *pg_char_to_encname_struct(const char *name); extern int pg_mb2wchar(const char *from, pg_wchar *to); extern int pg_mb2wchar_with_len(const char *from, pg_wchar *to, int len); extern int pg_encoding_mb2wchar_with_len(int encoding, const char *from, pg_wchar *to, int len); extern int pg_wchar2mb(const pg_wchar *from, char *to); extern int pg_wchar2mb_with_len(const pg_wchar *from, char *to, int len); extern int pg_encoding_wchar2mb_with_len(int encoding, const pg_wchar *from, char *to, int len); extern int pg_char_and_wchar_strcmp(const char *s1, const pg_wchar *s2); extern int pg_wchar_strncmp(const pg_wchar *s1, const pg_wchar *s2, size_t n); extern int pg_char_and_wchar_strncmp(const char *s1, const pg_wchar *s2, size_t n); extern size_t pg_wchar_strlen(const pg_wchar *wstr); extern int pg_mblen(const char *mbstr); extern int pg_dsplen(const char *mbstr); extern int pg_encoding_mblen(int encoding, const char *mbstr); extern int pg_encoding_dsplen(int encoding, const char *mbstr); extern int pg_encoding_verifymb(int encoding, const char *mbstr, int len); extern int pg_mule_mblen(const unsigned char *mbstr); extern int pg_mic_mblen(const unsigned char *mbstr); extern int pg_mbstrlen(const char *mbstr); extern int pg_mbstrlen_with_len(const char *mbstr, int len); extern int pg_mbcliplen(const char *mbstr, int len, int limit); extern int pg_encoding_mbcliplen(int encoding, const char *mbstr, int len, int limit); extern int pg_mbcharcliplen(const char *mbstr, int len, int imit); extern int pg_encoding_max_length(int encoding); extern int pg_database_encoding_max_length(void); extern mbcharacter_incrementer pg_database_encoding_character_incrementer(void); extern int PrepareClientEncoding(int encoding); extern int SetClientEncoding(int encoding); extern void InitializeClientEncoding(void); extern int pg_get_client_encoding(void); extern const char *pg_get_client_encoding_name(void); extern void SetDatabaseEncoding(int encoding); extern int GetDatabaseEncoding(void); extern const char *GetDatabaseEncodingName(void); extern int GetPlatformEncoding(void); extern void pg_bind_textdomain_codeset(const char *domainname); extern int pg_valid_client_encoding(const char *name); extern int pg_valid_server_encoding(const char *name); extern unsigned char *unicode_to_utf8(pg_wchar c, unsigned char *utf8string); extern pg_wchar utf8_to_unicode(const unsigned char *c); extern int pg_utf_mblen(const unsigned char *); extern unsigned char *pg_do_encoding_conversion(unsigned char *src, int len, int src_encoding, int dest_encoding); extern char *pg_client_to_server(const char *s, int len); extern char *pg_server_to_client(const char *s, int len); extern char *pg_any_to_server(const char *s, int len, int encoding); extern char *pg_server_to_any(const char *s, int len, int encoding); extern unsigned short BIG5toCNS(unsigned short big5, unsigned char *lc); extern unsigned short CNStoBIG5(unsigned short cns, unsigned char lc); extern void LocalToUtf(const unsigned char *iso, unsigned char *utf, const pg_local_to_utf *map, const pg_local_to_utf_combined *cmap, int size1, int size2, int encoding, int len); extern void UtfToLocal(const unsigned char *utf, unsigned char *iso, const pg_utf_to_local *map, const pg_utf_to_local_combined *cmap, int size1, int size2, int encoding, int len); extern bool pg_verifymbstr(const char *mbstr, int len, bool noError); extern bool pg_verify_mbstr(int encoding, const char *mbstr, int len, bool noError); extern int pg_verify_mbstr_len(int encoding, const char *mbstr, int len, bool noError); extern void check_encoding_conversion_args(int src_encoding, int dest_encoding, int len, int expected_src_encoding, int expected_dest_encoding); extern void report_invalid_encoding(int encoding, const char *mbstr, int len); extern void report_untranslatable_char(int src_encoding, int dest_encoding, const char *mbstr, int len); extern void pg_ascii2mic(const unsigned char *l, unsigned char *p, int len); extern void pg_mic2ascii(const unsigned char *mic, unsigned char *p, int len); extern void latin2mic(const unsigned char *l, unsigned char *p, int len, int lc, int encoding); extern void mic2latin(const unsigned char *mic, unsigned char *p, int len, int lc, int encoding); extern void latin2mic_with_table(const unsigned char *l, unsigned char *p, int len, int lc, int encoding, const unsigned char *tab); extern void mic2latin_with_table(const unsigned char *mic, unsigned char *p, int len, int lc, int encoding, const unsigned char *tab); extern bool pg_utf8_islegal(const unsigned char *source, int length); #ifdef WIN32 extern WCHAR *pgwin32_toUTF16(const char *str, int len, int *utf16len); #endif #endif /* PG_WCHAR_H */ PKBiZ],Iserver/tcop/utility.hnu[/*------------------------------------------------------------------------- * * utility.h * prototypes for utility.c. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/tcop/utility.h * *------------------------------------------------------------------------- */ #ifndef UTILITY_H #define UTILITY_H #include "tcop/tcopprot.h" /* Hook for plugins to get control in ProcessUtility() */ typedef void (*ProcessUtility_hook_type) (Node *parsetree, const char *queryString, ParamListInfo params, bool isTopLevel, DestReceiver *dest, char *completionTag); extern PGDLLIMPORT ProcessUtility_hook_type ProcessUtility_hook; extern void ProcessUtility(Node *parsetree, const char *queryString, ParamListInfo params, bool isTopLevel, DestReceiver *dest, char *completionTag); extern void standard_ProcessUtility(Node *parsetree, const char *queryString, ParamListInfo params, bool isTopLevel, DestReceiver *dest, char *completionTag); extern bool UtilityReturnsTuples(Node *parsetree); extern TupleDesc UtilityTupleDescriptor(Node *parsetree); extern Query *UtilityContainsQuery(Node *parsetree); extern const char *CreateCommandTag(Node *parsetree); extern LogStmtLevel GetCommandLogLevel(Node *parsetree); extern bool CommandIsReadOnly(Node *parsetree); #endif /* UTILITY_H */ PKBiZ--server/tcop/dest.hnu[/*------------------------------------------------------------------------- * * dest.h * support for communication destinations * * Whenever the backend executes a query that returns tuples, the results * have to go someplace. For example: * * - stdout is the destination only when we are running a * standalone backend (no postmaster) and are returning results * back to an interactive user. * * - a remote process is the destination when we are * running a backend with a frontend and the frontend executes * PQexec() or PQfn(). In this case, the results are sent * to the frontend via the functions in backend/libpq. * * - DestNone is the destination when the system executes * a query internally. The results are discarded. * * dest.c defines three functions that implement destination management: * * BeginCommand: initialize the destination at start of command. * CreateDestReceiver: return a pointer to a struct of destination-specific * receiver functions. * EndCommand: clean up the destination at end of command. * * BeginCommand/EndCommand are executed once per received SQL query. * * CreateDestReceiver returns a receiver object appropriate to the specified * destination. The executor, as well as utility statements that can return * tuples, are passed the resulting DestReceiver* pointer. Each executor run * or utility execution calls the receiver's rStartup method, then the * receiveSlot method (zero or more times), then the rShutdown method. * The same receiver object may be re-used multiple times; eventually it is * destroyed by calling its rDestroy method. * * In some cases, receiver objects require additional parameters that must * be passed to them after calling CreateDestReceiver. Since the set of * parameters varies for different receiver types, this is not handled by * this module, but by direct calls from the calling code to receiver type * specific functions. * * The DestReceiver object returned by CreateDestReceiver may be a statically * allocated object (for destination types that require no local state), * in which case rDestroy is a no-op. Alternatively it can be a palloc'd * object that has DestReceiver as its first field and contains additional * fields (see printtup.c for an example). These additional fields are then * accessible to the DestReceiver functions by casting the DestReceiver* * pointer passed to them. The palloc'd object is pfree'd by the rDestroy * method. Note that the caller of CreateDestReceiver should take care to * do so in a memory context that is long-lived enough for the receiver * object not to disappear while still needed. * * Special provision: None_Receiver is a permanently available receiver * object for the DestNone destination. This avoids useless creation/destroy * calls in portal and cursor manipulations. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/tcop/dest.h * *------------------------------------------------------------------------- */ #ifndef DEST_H #define DEST_H #include "executor/tuptable.h" /* buffer size to use for command completion tags */ #define COMPLETION_TAG_BUFSIZE 64 /* ---------------- * CommandDest is a simplistic means of identifying the desired * destination. Someday this will probably need to be improved. * * Note: only the values DestNone, DestDebug, DestRemote are legal for the * global variable whereToSendOutput. The other values may be used * as the destination for individual commands. * ---------------- */ typedef enum { DestNone, /* results are discarded */ DestDebug, /* results go to debugging output */ DestRemote, /* results sent to frontend process */ DestRemoteExecute, /* sent to frontend, in Execute command */ DestSPI, /* results sent to SPI manager */ DestTuplestore, /* results sent to Tuplestore */ DestIntoRel, /* results sent to relation (SELECT INTO) */ DestCopyOut, /* results sent to COPY TO code */ DestSQLFunction /* results sent to SQL-language func mgr */ } CommandDest; /* ---------------- * DestReceiver is a base type for destination-specific local state. * In the simplest cases, there is no state info, just the function * pointers that the executor must call. * * Note: the receiveSlot routine must be passed a slot containing a TupleDesc * identical to the one given to the rStartup routine. * ---------------- */ typedef struct _DestReceiver DestReceiver; struct _DestReceiver { /* Called for each tuple to be output: */ void (*receiveSlot) (TupleTableSlot *slot, DestReceiver *self); /* Per-executor-run initialization and shutdown: */ void (*rStartup) (DestReceiver *self, int operation, TupleDesc typeinfo); void (*rShutdown) (DestReceiver *self); /* Destroy the receiver object itself (if dynamically allocated) */ void (*rDestroy) (DestReceiver *self); /* CommandDest code for this receiver */ CommandDest mydest; /* Private fields might appear beyond this point... */ }; extern DestReceiver *None_Receiver; /* permanent receiver for DestNone */ /* The primary destination management functions */ extern void BeginCommand(const char *commandTag, CommandDest dest); extern DestReceiver *CreateDestReceiver(CommandDest dest); extern void EndCommand(const char *commandTag, CommandDest dest); /* Additional functions that go with destination management, more or less. */ extern void NullCommand(CommandDest dest); extern void ReadyForQuery(CommandDest dest); #endif /* DEST_H */ PKBiZS+h h server/tcop/tcopprot.hnu[/*------------------------------------------------------------------------- * * tcopprot.h * prototypes for postgres.c. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/tcop/tcopprot.h * * OLD COMMENTS * This file was created so that other c files could get the two * function prototypes without having to include tcop.h which single * handedly includes the whole f*cking tree -- mer 5 Nov. 1991 * *------------------------------------------------------------------------- */ #ifndef TCOPPROT_H #define TCOPPROT_H #include "executor/execdesc.h" #include "nodes/parsenodes.h" #include "storage/procsignal.h" #include "utils/guc.h" /* Required daylight between max_stack_depth and the kernel limit, in bytes */ #define STACK_DEPTH_SLOP (512 * 1024L) extern CommandDest whereToSendOutput; extern PGDLLIMPORT const char *debug_query_string; extern int max_stack_depth; extern int PostAuthDelay; /* GUC-configurable parameters */ typedef enum { LOGSTMT_NONE, /* log no statements */ LOGSTMT_DDL, /* log data definition statements */ LOGSTMT_MOD, /* log modification statements, plus DDL */ LOGSTMT_ALL /* log all statements */ } LogStmtLevel; extern int log_statement; /* Flags for restrict_nonsystem_relation_kind value */ #define RESTRICT_RELKIND_VIEW 0x01 #define RESTRICT_RELKIND_FOREIGN_TABLE 0x02 extern PGDLLIMPORT int restrict_nonsystem_relation_kind; extern List *pg_parse_query(const char *query_string); extern List *pg_analyze_and_rewrite(Node *parsetree, const char *query_string, Oid *paramTypes, int numParams); extern List *pg_analyze_and_rewrite_params(Node *parsetree, const char *query_string, ParserSetupHook parserSetup, void *parserSetupArg); extern PlannedStmt *pg_plan_query(Query *querytree, int cursorOptions, ParamListInfo boundParams); extern List *pg_plan_queries(List *querytrees, int cursorOptions, ParamListInfo boundParams); extern bool check_max_stack_depth(int *newval, void **extra, GucSource source); extern void assign_max_stack_depth(int newval, void *extra); extern bool check_restrict_nonsystem_relation_kind(char **newval, void **extra, GucSource source); extern void assign_restrict_nonsystem_relation_kind(const char *newval, void *extra); extern void die(SIGNAL_ARGS); extern void quickdie(SIGNAL_ARGS); extern void StatementCancelHandler(SIGNAL_ARGS); extern void FloatExceptionHandler(SIGNAL_ARGS); extern void RecoveryConflictInterrupt(ProcSignalReason reason); /* called from SIGUSR1 * handler */ extern void prepare_for_client_read(void); extern void client_read_ended(void); extern void process_postgres_switches(int argc, char *argv[], GucContext ctx, const char **dbname); extern int PostgresMain(int argc, char *argv[], const char *dbname, const char *username); extern long get_stack_depth_rlimit(void); extern void ResetUsage(void); extern void ShowUsage(const char *title); extern int check_log_duration(char *msec_str, bool was_logged); extern void set_debug_options(int debug_flag, GucContext context, GucSource source); extern bool set_plan_disabling_options(const char *arg, GucContext context, GucSource source); extern const char *get_stats_option_name(const char *arg); #endif /* TCOPPROT_H */ PKBiZbG%%server/tcop/tcopdebug.hnu[/*------------------------------------------------------------------------- * * tcopdebug.h * #defines governing debugging behaviour in the traffic cop * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/tcop/tcopdebug.h * *------------------------------------------------------------------------- */ #ifndef TCOPDEBUG_H #define TCOPDEBUG_H /* ---------------------------------------------------------------- * debugging defines. * * If you want certain debugging behaviour, then #define * the variable to 1, else #undef it. -cim 10/26/89 * ---------------------------------------------------------------- */ /* ---------------- * TCOP_SHOWSTATS controls whether or not buffer and * access method statistics are shown for each query. -cim 2/9/89 * ---------------- */ #undef TCOP_SHOWSTATS /* ---------------- * TCOP_DONTUSENEWLINE controls the default setting of * the UseNewLine variable in postgres.c * ---------------- */ #undef TCOP_DONTUSENEWLINE /* ---------------------------------------------------------------- * #defines controlled by above definitions * ---------------------------------------------------------------- */ #endif /* TCOPDEBUG_H */ PKBiZTk00server/tcop/fastpath.hnu[/*------------------------------------------------------------------------- * * fastpath.h * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/tcop/fastpath.h * *------------------------------------------------------------------------- */ #ifndef FASTPATH_H #define FASTPATH_H #include "lib/stringinfo.h" extern int GetOldFunctionMessage(StringInfo buf); extern void HandleFunctionRequest(StringInfo msgBuf); #endif /* FASTPATH_H */ PKBiZYserver/tcop/pquery.hnu[/*------------------------------------------------------------------------- * * pquery.h * prototypes for pquery.c. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/tcop/pquery.h * *------------------------------------------------------------------------- */ #ifndef PQUERY_H #define PQUERY_H #include "nodes/parsenodes.h" #include "utils/portal.h" extern PGDLLIMPORT Portal ActivePortal; extern PortalStrategy ChoosePortalStrategy(List *stmts); extern List *FetchPortalTargetList(Portal portal); extern List *FetchStatementTargetList(Node *stmt); extern void PortalStart(Portal portal, ParamListInfo params, int eflags, Snapshot snapshot); extern void PortalSetResultFormat(Portal portal, int nFormats, int16 *formats); extern bool PortalRun(Portal portal, long count, bool isTopLevel, DestReceiver *dest, DestReceiver *altdest, char *completionTag); extern long PortalRunFetch(Portal portal, FetchDirection fdirection, long count, DestReceiver *dest); #endif /* PQUERY_H */ PKBiZN..server/rewrite/prs2lock.hnu[/*------------------------------------------------------------------------- * * prs2lock.h * data structures for POSTGRES Rule System II (rewrite rules only) * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/rewrite/prs2lock.h * *------------------------------------------------------------------------- */ #ifndef PRS2LOCK_H #define PRS2LOCK_H #include "access/attnum.h" #include "nodes/pg_list.h" /* * RewriteRule - * holds a info for a rewrite rule * */ typedef struct RewriteRule { Oid ruleId; CmdType event; AttrNumber attrno; Node *qual; List *actions; char enabled; bool isInstead; } RewriteRule; /* * RuleLock - * all rules that apply to a particular relation. Even though we only * have the rewrite rule system left and these are not really "locks", * the name is kept for historical reasons. */ typedef struct RuleLock { int numLocks; RewriteRule **rules; } RuleLock; #endif /* REWRITE_H */ PKBiZ.qserver/rewrite/rewriteSupport.hnu[/*------------------------------------------------------------------------- * * rewriteSupport.h * * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/rewrite/rewriteSupport.h * *------------------------------------------------------------------------- */ #ifndef REWRITESUPPORT_H #define REWRITESUPPORT_H /* The ON SELECT rule of a view is always named this: */ #define ViewSelectRuleName "_RETURN" extern bool IsDefinedRewriteRule(Oid owningRel, const char *ruleName); extern void SetRelationRuleStatus(Oid relationId, bool relHasRules, bool relIsBecomingView); extern Oid get_rewrite_oid(Oid relid, const char *rulename, bool missing_ok); extern Oid get_rewrite_oid_without_relid(const char *rulename, Oid *relid, bool missing_ok); #endif /* REWRITESUPPORT_H */ PKBiZXNwwserver/rewrite/rewriteDefine.hnu[/*------------------------------------------------------------------------- * * rewriteDefine.h * * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/rewrite/rewriteDefine.h * *------------------------------------------------------------------------- */ #ifndef REWRITEDEFINE_H #define REWRITEDEFINE_H #include "nodes/parsenodes.h" #include "utils/relcache.h" #define RULE_FIRES_ON_ORIGIN 'O' #define RULE_FIRES_ALWAYS 'A' #define RULE_FIRES_ON_REPLICA 'R' #define RULE_DISABLED 'D' extern void DefineRule(RuleStmt *stmt, const char *queryString); extern void DefineQueryRewrite(char *rulename, Oid event_relid, Node *event_qual, CmdType event_type, bool is_instead, bool replace, List *action); extern void RenameRewriteRule(Oid owningRel, const char *oldName, const char *newName); extern void setRuleCheckAsUser(Node *node, Oid userid); extern void EnableDisableRule(Relation rel, const char *rulename, char fires_when); #endif /* REWRITEDEFINE_H */ PKBiZserver/rewrite/rewriteRemove.hnu[/*------------------------------------------------------------------------- * * rewriteRemove.h * * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/rewrite/rewriteRemove.h * *------------------------------------------------------------------------- */ #ifndef REWRITEREMOVE_H #define REWRITEREMOVE_H #include "nodes/parsenodes.h" extern void RemoveRewriteRuleById(Oid ruleOid); #endif /* REWRITEREMOVE_H */ PKBiZdserver/rewrite/rewriteHandler.hnu[/*------------------------------------------------------------------------- * * rewriteHandler.h * External interface to query rewriter. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/rewrite/rewriteHandler.h * *------------------------------------------------------------------------- */ #ifndef REWRITEHANDLER_H #define REWRITEHANDLER_H #include "utils/relcache.h" #include "nodes/parsenodes.h" extern List *QueryRewrite(Query *parsetree); extern void AcquireRewriteLocks(Query *parsetree, bool forExecute, bool forUpdatePushedDown); extern Node *build_column_default(Relation rel, int attrno); #endif /* REWRITEHANDLER_H */ PKBiZ+i server/rewrite/rewriteManip.hnu[/*------------------------------------------------------------------------- * * rewriteManip.h * Querytree manipulation subroutines for query rewriter. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/rewrite/rewriteManip.h * *------------------------------------------------------------------------- */ #ifndef REWRITEMANIP_H #define REWRITEMANIP_H #include "nodes/parsenodes.h" typedef struct replace_rte_variables_context replace_rte_variables_context; typedef Node *(*replace_rte_variables_callback) (Var *var, replace_rte_variables_context *context); struct replace_rte_variables_context { replace_rte_variables_callback callback; /* callback function */ void *callback_arg; /* context data for callback function */ int target_varno; /* RTE index to search for */ int sublevels_up; /* (current) nesting depth */ bool inserted_sublink; /* have we inserted a SubLink? */ }; extern void OffsetVarNodes(Node *node, int offset, int sublevels_up); extern void ChangeVarNodes(Node *node, int old_varno, int new_varno, int sublevels_up); extern void IncrementVarSublevelsUp(Node *node, int delta_sublevels_up, int min_sublevels_up); extern void IncrementVarSublevelsUp_rtable(List *rtable, int delta_sublevels_up, int min_sublevels_up); extern bool rangeTableEntry_used(Node *node, int rt_index, int sublevels_up); extern bool attribute_used(Node *node, int rt_index, int attno, int sublevels_up); extern Query *getInsertSelectQuery(Query *parsetree, Query ***subquery_ptr); extern void AddQual(Query *parsetree, Node *qual); extern void AddInvertedQual(Query *parsetree, Node *qual); extern bool contain_aggs_of_level(Node *node, int levelsup); extern int locate_agg_of_level(Node *node, int levelsup); extern int locate_windowfunc(Node *node); extern bool checkExprHasAggs(Node *node); extern bool checkExprHasWindowFuncs(Node *node); extern bool checkExprHasSubLink(Node *node); extern Node *replace_rte_variables(Node *node, int target_varno, int sublevels_up, replace_rte_variables_callback callback, void *callback_arg, bool *outer_hasSubLinks); extern Node *replace_rte_variables_mutator(Node *node, replace_rte_variables_context *context); extern Node *map_variable_attnos(Node *node, int target_varno, int sublevels_up, const AttrNumber *attno_map, int map_length, bool *found_whole_row); extern Node *ResolveNew(Node *node, int target_varno, int sublevels_up, RangeTblEntry *target_rte, List *targetlist, int event, int update_varno, bool *outer_hasSubLinks); #endif /* REWRITEMANIP_H */ PKBiZserver/catalog/pg_index.hnu[/*------------------------------------------------------------------------- * * pg_index.h * definition of the system "index" relation (pg_index) * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_index.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * *------------------------------------------------------------------------- */ #ifndef PG_INDEX_H #define PG_INDEX_H #include "catalog/genbki.h" /* ---------------- * pg_index definition. cpp turns this into * typedef struct FormData_pg_index. * ---------------- */ #define IndexRelationId 2610 CATALOG(pg_index,2610) BKI_WITHOUT_OIDS BKI_SCHEMA_MACRO { Oid indexrelid; /* OID of the index */ Oid indrelid; /* OID of the relation it indexes */ int2 indnatts; /* number of columns in index */ bool indisunique; /* is this a unique index? */ bool indisprimary; /* is this index for primary key? */ bool indisexclusion; /* is this index for exclusion constraint? */ bool indimmediate; /* is uniqueness enforced immediately? */ bool indisclustered; /* is this the index last clustered by? */ bool indisvalid; /* is this index valid for use by queries? */ bool indcheckxmin; /* must we wait for xmin to be old? */ bool indisready; /* is this index ready for inserts? */ /* variable-length fields start here, but we allow direct access to indkey */ int2vector indkey; /* column numbers of indexed cols, or 0 */ #ifdef CATALOG_VARLEN oidvector indcollation; /* collation identifiers */ oidvector indclass; /* opclass identifiers */ int2vector indoption; /* per-column flags (AM-specific meanings) */ pg_node_tree indexprs; /* expression trees for index attributes that * are not simple column references; one for * each zero entry in indkey[] */ pg_node_tree indpred; /* expression tree for predicate, if a partial * index; else NULL */ #endif } FormData_pg_index; /* ---------------- * Form_pg_index corresponds to a pointer to a tuple with * the format of pg_index relation. * ---------------- */ typedef FormData_pg_index *Form_pg_index; /* ---------------- * compiler constants for pg_index * ---------------- */ #define Natts_pg_index 17 #define Anum_pg_index_indexrelid 1 #define Anum_pg_index_indrelid 2 #define Anum_pg_index_indnatts 3 #define Anum_pg_index_indisunique 4 #define Anum_pg_index_indisprimary 5 #define Anum_pg_index_indisexclusion 6 #define Anum_pg_index_indimmediate 7 #define Anum_pg_index_indisclustered 8 #define Anum_pg_index_indisvalid 9 #define Anum_pg_index_indcheckxmin 10 #define Anum_pg_index_indisready 11 #define Anum_pg_index_indkey 12 #define Anum_pg_index_indcollation 13 #define Anum_pg_index_indclass 14 #define Anum_pg_index_indoption 15 #define Anum_pg_index_indexprs 16 #define Anum_pg_index_indpred 17 /* * Index AMs that support ordered scans must support these two indoption * bits. Otherwise, the content of the per-column indoption fields is * open for future definition. */ #define INDOPTION_DESC 0x0001 /* values are in reverse order */ #define INDOPTION_NULLS_FIRST 0x0002 /* NULLs are first instead of last */ /* * Use of these macros is recommended over direct examination of the state * flag columns where possible; this allows source code compatibility with * the less ugly representation used after 9.2. */ #define IndexIsValid(indexForm) ((indexForm)->indisvalid && (indexForm)->indisready) #define IndexIsReady(indexForm) ((indexForm)->indisready) #define IndexIsLive(indexForm) ((indexForm)->indisready || !(indexForm)->indisvalid) #endif /* PG_INDEX_H */ PKBiZ~~server/catalog/pg_operator.hnu[/*------------------------------------------------------------------------- * * pg_operator.h * definition of the system "operator" relation (pg_operator) * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_operator.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * * XXX do NOT break up DATA() statements into multiple lines! * the scripts are not as smart as you might think... * *------------------------------------------------------------------------- */ #ifndef PG_OPERATOR_H #define PG_OPERATOR_H #include "catalog/genbki.h" #include "nodes/pg_list.h" /* ---------------- * pg_operator definition. cpp turns this into * typedef struct FormData_pg_operator * ---------------- */ #define OperatorRelationId 2617 CATALOG(pg_operator,2617) { NameData oprname; /* name of operator */ Oid oprnamespace; /* OID of namespace containing this oper */ Oid oprowner; /* operator owner */ char oprkind; /* 'l', 'r', or 'b' */ bool oprcanmerge; /* can be used in merge join? */ bool oprcanhash; /* can be used in hash join? */ Oid oprleft; /* left arg type, or 0 if 'l' oprkind */ Oid oprright; /* right arg type, or 0 if 'r' oprkind */ Oid oprresult; /* result datatype */ Oid oprcom; /* OID of commutator oper, or 0 if none */ Oid oprnegate; /* OID of negator oper, or 0 if none */ regproc oprcode; /* OID of underlying function */ regproc oprrest; /* OID of restriction estimator, or 0 */ regproc oprjoin; /* OID of join estimator, or 0 */ } FormData_pg_operator; /* ---------------- * Form_pg_operator corresponds to a pointer to a tuple with * the format of pg_operator relation. * ---------------- */ typedef FormData_pg_operator *Form_pg_operator; /* ---------------- * compiler constants for pg_operator * ---------------- */ #define Natts_pg_operator 14 #define Anum_pg_operator_oprname 1 #define Anum_pg_operator_oprnamespace 2 #define Anum_pg_operator_oprowner 3 #define Anum_pg_operator_oprkind 4 #define Anum_pg_operator_oprcanmerge 5 #define Anum_pg_operator_oprcanhash 6 #define Anum_pg_operator_oprleft 7 #define Anum_pg_operator_oprright 8 #define Anum_pg_operator_oprresult 9 #define Anum_pg_operator_oprcom 10 #define Anum_pg_operator_oprnegate 11 #define Anum_pg_operator_oprcode 12 #define Anum_pg_operator_oprrest 13 #define Anum_pg_operator_oprjoin 14 /* ---------------- * initial contents of pg_operator * ---------------- */ /* * Note: every entry in pg_operator.h is expected to have a DESCR() comment. * If the operator is a deprecated equivalent of some other entry, be sure * to comment it as such so that initdb doesn't think it's a preferred name * for the underlying function. */ DATA(insert OID = 15 ( "=" PGNSP PGUID b t t 23 20 16 416 36 int48eq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 36 ( "<>" PGNSP PGUID b f f 23 20 16 417 15 int48ne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 37 ( "<" PGNSP PGUID b f f 23 20 16 419 82 int48lt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 76 ( ">" PGNSP PGUID b f f 23 20 16 418 80 int48gt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 80 ( "<=" PGNSP PGUID b f f 23 20 16 430 76 int48le scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 82 ( ">=" PGNSP PGUID b f f 23 20 16 420 37 int48ge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 58 ( "<" PGNSP PGUID b f f 16 16 16 59 1695 boollt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 59 ( ">" PGNSP PGUID b f f 16 16 16 58 1694 boolgt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 85 ( "<>" PGNSP PGUID b f f 16 16 16 85 91 boolne neqsel neqjoinsel )); DESCR("not equal"); #define BooleanNotEqualOperator 85 DATA(insert OID = 91 ( "=" PGNSP PGUID b t t 16 16 16 91 85 booleq eqsel eqjoinsel )); DESCR("equal"); #define BooleanEqualOperator 91 DATA(insert OID = 1694 ( "<=" PGNSP PGUID b f f 16 16 16 1695 59 boolle scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 1695 ( ">=" PGNSP PGUID b f f 16 16 16 1694 58 boolge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 92 ( "=" PGNSP PGUID b t t 18 18 16 92 630 chareq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 93 ( "=" PGNSP PGUID b t t 19 19 16 93 643 nameeq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 94 ( "=" PGNSP PGUID b t t 21 21 16 94 519 int2eq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 95 ( "<" PGNSP PGUID b f f 21 21 16 520 524 int2lt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 96 ( "=" PGNSP PGUID b t t 23 23 16 96 518 int4eq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 97 ( "<" PGNSP PGUID b f f 23 23 16 521 525 int4lt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 98 ( "=" PGNSP PGUID b t t 25 25 16 98 531 texteq eqsel eqjoinsel )); DESCR("equal"); #define TextEqualOperator 98 DATA(insert OID = 349 ( "||" PGNSP PGUID b f f 2277 2283 2277 0 0 array_append - - )); DESCR("append element onto end of array"); DATA(insert OID = 374 ( "||" PGNSP PGUID b f f 2283 2277 2277 0 0 array_prepend - - )); DESCR("prepend element onto front of array"); DATA(insert OID = 375 ( "||" PGNSP PGUID b f f 2277 2277 2277 0 0 array_cat - - )); DESCR("concatenate"); DATA(insert OID = 352 ( "=" PGNSP PGUID b f t 28 28 16 352 0 xideq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 353 ( "=" PGNSP PGUID b f f 28 23 16 0 0 xideqint4 eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 388 ( "!" PGNSP PGUID r f f 20 0 1700 0 0 numeric_fac - - )); DESCR("factorial"); DATA(insert OID = 389 ( "!!" PGNSP PGUID l f f 0 20 1700 0 0 numeric_fac - - )); DESCR("deprecated, use ! instead"); DATA(insert OID = 385 ( "=" PGNSP PGUID b f t 29 29 16 385 0 cideq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 386 ( "=" PGNSP PGUID b f t 22 22 16 386 0 int2vectoreq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 387 ( "=" PGNSP PGUID b t f 27 27 16 387 402 tideq eqsel eqjoinsel )); DESCR("equal"); #define TIDEqualOperator 387 DATA(insert OID = 402 ( "<>" PGNSP PGUID b f f 27 27 16 402 387 tidne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 2799 ( "<" PGNSP PGUID b f f 27 27 16 2800 2802 tidlt scalarltsel scalarltjoinsel )); DESCR("less than"); #define TIDLessOperator 2799 DATA(insert OID = 2800 ( ">" PGNSP PGUID b f f 27 27 16 2799 2801 tidgt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 2801 ( "<=" PGNSP PGUID b f f 27 27 16 2802 2800 tidle scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 2802 ( ">=" PGNSP PGUID b f f 27 27 16 2801 2799 tidge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 410 ( "=" PGNSP PGUID b t t 20 20 16 410 411 int8eq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 411 ( "<>" PGNSP PGUID b f f 20 20 16 411 410 int8ne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 412 ( "<" PGNSP PGUID b f f 20 20 16 413 415 int8lt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 413 ( ">" PGNSP PGUID b f f 20 20 16 412 414 int8gt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 414 ( "<=" PGNSP PGUID b f f 20 20 16 415 413 int8le scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 415 ( ">=" PGNSP PGUID b f f 20 20 16 414 412 int8ge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 416 ( "=" PGNSP PGUID b t t 20 23 16 15 417 int84eq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 417 ( "<>" PGNSP PGUID b f f 20 23 16 36 416 int84ne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 418 ( "<" PGNSP PGUID b f f 20 23 16 76 430 int84lt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 419 ( ">" PGNSP PGUID b f f 20 23 16 37 420 int84gt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 420 ( "<=" PGNSP PGUID b f f 20 23 16 82 419 int84le scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 430 ( ">=" PGNSP PGUID b f f 20 23 16 80 418 int84ge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 439 ( "%" PGNSP PGUID b f f 20 20 20 0 0 int8mod - - )); DESCR("modulus"); DATA(insert OID = 473 ( "@" PGNSP PGUID l f f 0 20 20 0 0 int8abs - - )); DESCR("absolute value"); DATA(insert OID = 484 ( "-" PGNSP PGUID l f f 0 20 20 0 0 int8um - - )); DESCR("negate"); DATA(insert OID = 485 ( "<<" PGNSP PGUID b f f 604 604 16 0 0 poly_left positionsel positionjoinsel )); DESCR("is left of"); DATA(insert OID = 486 ( "&<" PGNSP PGUID b f f 604 604 16 0 0 poly_overleft positionsel positionjoinsel )); DESCR("overlaps or is left of"); DATA(insert OID = 487 ( "&>" PGNSP PGUID b f f 604 604 16 0 0 poly_overright positionsel positionjoinsel )); DESCR("overlaps or is right of"); DATA(insert OID = 488 ( ">>" PGNSP PGUID b f f 604 604 16 0 0 poly_right positionsel positionjoinsel )); DESCR("is right of"); DATA(insert OID = 489 ( "<@" PGNSP PGUID b f f 604 604 16 490 0 poly_contained contsel contjoinsel )); DESCR("is contained by"); DATA(insert OID = 490 ( "@>" PGNSP PGUID b f f 604 604 16 489 0 poly_contain contsel contjoinsel )); DESCR("contains"); DATA(insert OID = 491 ( "~=" PGNSP PGUID b f f 604 604 16 491 0 poly_same eqsel eqjoinsel )); DESCR("same as"); DATA(insert OID = 492 ( "&&" PGNSP PGUID b f f 604 604 16 492 0 poly_overlap areasel areajoinsel )); DESCR("overlaps"); DATA(insert OID = 493 ( "<<" PGNSP PGUID b f f 603 603 16 0 0 box_left positionsel positionjoinsel )); DESCR("is left of"); DATA(insert OID = 494 ( "&<" PGNSP PGUID b f f 603 603 16 0 0 box_overleft positionsel positionjoinsel )); DESCR("overlaps or is left of"); DATA(insert OID = 495 ( "&>" PGNSP PGUID b f f 603 603 16 0 0 box_overright positionsel positionjoinsel )); DESCR("overlaps or is right of"); DATA(insert OID = 496 ( ">>" PGNSP PGUID b f f 603 603 16 0 0 box_right positionsel positionjoinsel )); DESCR("is right of"); DATA(insert OID = 497 ( "<@" PGNSP PGUID b f f 603 603 16 498 0 box_contained contsel contjoinsel )); DESCR("is contained by"); DATA(insert OID = 498 ( "@>" PGNSP PGUID b f f 603 603 16 497 0 box_contain contsel contjoinsel )); DESCR("contains"); DATA(insert OID = 499 ( "~=" PGNSP PGUID b f f 603 603 16 499 0 box_same eqsel eqjoinsel )); DESCR("same as"); DATA(insert OID = 500 ( "&&" PGNSP PGUID b f f 603 603 16 500 0 box_overlap areasel areajoinsel )); DESCR("overlaps"); DATA(insert OID = 501 ( ">=" PGNSP PGUID b f f 603 603 16 505 504 box_ge areasel areajoinsel )); DESCR("greater than or equal by area"); DATA(insert OID = 502 ( ">" PGNSP PGUID b f f 603 603 16 504 505 box_gt areasel areajoinsel )); DESCR("greater than by area"); DATA(insert OID = 503 ( "=" PGNSP PGUID b f f 603 603 16 503 0 box_eq eqsel eqjoinsel )); DESCR("equal by area"); DATA(insert OID = 504 ( "<" PGNSP PGUID b f f 603 603 16 502 501 box_lt areasel areajoinsel )); DESCR("less than by area"); DATA(insert OID = 505 ( "<=" PGNSP PGUID b f f 603 603 16 501 502 box_le areasel areajoinsel )); DESCR("less than or equal by area"); DATA(insert OID = 506 ( ">^" PGNSP PGUID b f f 600 600 16 0 0 point_above positionsel positionjoinsel )); DESCR("is above"); DATA(insert OID = 507 ( "<<" PGNSP PGUID b f f 600 600 16 0 0 point_left positionsel positionjoinsel )); DESCR("is left of"); DATA(insert OID = 508 ( ">>" PGNSP PGUID b f f 600 600 16 0 0 point_right positionsel positionjoinsel )); DESCR("is right of"); DATA(insert OID = 509 ( "<^" PGNSP PGUID b f f 600 600 16 0 0 point_below positionsel positionjoinsel )); DESCR("is below"); DATA(insert OID = 510 ( "~=" PGNSP PGUID b f f 600 600 16 510 713 point_eq eqsel eqjoinsel )); DESCR("same as"); DATA(insert OID = 511 ( "<@" PGNSP PGUID b f f 600 603 16 433 0 on_pb contsel contjoinsel )); DESCR("point inside box"); DATA(insert OID = 433 ( "@>" PGNSP PGUID b f f 603 600 16 511 0 box_contain_pt contsel contjoinsel )); DESCR("contains"); DATA(insert OID = 512 ( "<@" PGNSP PGUID b f f 600 602 16 755 0 on_ppath - - )); DESCR("point within closed path, or point on open path"); DATA(insert OID = 513 ( "@@" PGNSP PGUID l f f 0 603 600 0 0 box_center - - )); DESCR("center of"); DATA(insert OID = 514 ( "*" PGNSP PGUID b f f 23 23 23 514 0 int4mul - - )); DESCR("multiply"); DATA(insert OID = 517 ( "<->" PGNSP PGUID b f f 600 600 701 517 0 point_distance - - )); DESCR("distance between"); DATA(insert OID = 518 ( "<>" PGNSP PGUID b f f 23 23 16 518 96 int4ne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 519 ( "<>" PGNSP PGUID b f f 21 21 16 519 94 int2ne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 520 ( ">" PGNSP PGUID b f f 21 21 16 95 522 int2gt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 521 ( ">" PGNSP PGUID b f f 23 23 16 97 523 int4gt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 522 ( "<=" PGNSP PGUID b f f 21 21 16 524 520 int2le scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 523 ( "<=" PGNSP PGUID b f f 23 23 16 525 521 int4le scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 524 ( ">=" PGNSP PGUID b f f 21 21 16 522 95 int2ge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 525 ( ">=" PGNSP PGUID b f f 23 23 16 523 97 int4ge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 526 ( "*" PGNSP PGUID b f f 21 21 21 526 0 int2mul - - )); DESCR("multiply"); DATA(insert OID = 527 ( "/" PGNSP PGUID b f f 21 21 21 0 0 int2div - - )); DESCR("divide"); DATA(insert OID = 528 ( "/" PGNSP PGUID b f f 23 23 23 0 0 int4div - - )); DESCR("divide"); DATA(insert OID = 529 ( "%" PGNSP PGUID b f f 21 21 21 0 0 int2mod - - )); DESCR("modulus"); DATA(insert OID = 530 ( "%" PGNSP PGUID b f f 23 23 23 0 0 int4mod - - )); DESCR("modulus"); DATA(insert OID = 531 ( "<>" PGNSP PGUID b f f 25 25 16 531 98 textne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 532 ( "=" PGNSP PGUID b t t 21 23 16 533 538 int24eq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 533 ( "=" PGNSP PGUID b t t 23 21 16 532 539 int42eq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 534 ( "<" PGNSP PGUID b f f 21 23 16 537 542 int24lt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 535 ( "<" PGNSP PGUID b f f 23 21 16 536 543 int42lt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 536 ( ">" PGNSP PGUID b f f 21 23 16 535 540 int24gt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 537 ( ">" PGNSP PGUID b f f 23 21 16 534 541 int42gt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 538 ( "<>" PGNSP PGUID b f f 21 23 16 539 532 int24ne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 539 ( "<>" PGNSP PGUID b f f 23 21 16 538 533 int42ne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 540 ( "<=" PGNSP PGUID b f f 21 23 16 543 536 int24le scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 541 ( "<=" PGNSP PGUID b f f 23 21 16 542 537 int42le scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 542 ( ">=" PGNSP PGUID b f f 21 23 16 541 534 int24ge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 543 ( ">=" PGNSP PGUID b f f 23 21 16 540 535 int42ge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 544 ( "*" PGNSP PGUID b f f 21 23 23 545 0 int24mul - - )); DESCR("multiply"); DATA(insert OID = 545 ( "*" PGNSP PGUID b f f 23 21 23 544 0 int42mul - - )); DESCR("multiply"); DATA(insert OID = 546 ( "/" PGNSP PGUID b f f 21 23 23 0 0 int24div - - )); DESCR("divide"); DATA(insert OID = 547 ( "/" PGNSP PGUID b f f 23 21 23 0 0 int42div - - )); DESCR("divide"); DATA(insert OID = 550 ( "+" PGNSP PGUID b f f 21 21 21 550 0 int2pl - - )); DESCR("add"); DATA(insert OID = 551 ( "+" PGNSP PGUID b f f 23 23 23 551 0 int4pl - - )); DESCR("add"); DATA(insert OID = 552 ( "+" PGNSP PGUID b f f 21 23 23 553 0 int24pl - - )); DESCR("add"); DATA(insert OID = 553 ( "+" PGNSP PGUID b f f 23 21 23 552 0 int42pl - - )); DESCR("add"); DATA(insert OID = 554 ( "-" PGNSP PGUID b f f 21 21 21 0 0 int2mi - - )); DESCR("subtract"); DATA(insert OID = 555 ( "-" PGNSP PGUID b f f 23 23 23 0 0 int4mi - - )); DESCR("subtract"); DATA(insert OID = 556 ( "-" PGNSP PGUID b f f 21 23 23 0 0 int24mi - - )); DESCR("subtract"); DATA(insert OID = 557 ( "-" PGNSP PGUID b f f 23 21 23 0 0 int42mi - - )); DESCR("subtract"); DATA(insert OID = 558 ( "-" PGNSP PGUID l f f 0 23 23 0 0 int4um - - )); DESCR("negate"); DATA(insert OID = 559 ( "-" PGNSP PGUID l f f 0 21 21 0 0 int2um - - )); DESCR("negate"); DATA(insert OID = 560 ( "=" PGNSP PGUID b t t 702 702 16 560 561 abstimeeq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 561 ( "<>" PGNSP PGUID b f f 702 702 16 561 560 abstimene neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 562 ( "<" PGNSP PGUID b f f 702 702 16 563 565 abstimelt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 563 ( ">" PGNSP PGUID b f f 702 702 16 562 564 abstimegt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 564 ( "<=" PGNSP PGUID b f f 702 702 16 565 563 abstimele scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 565 ( ">=" PGNSP PGUID b f f 702 702 16 564 562 abstimege scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 566 ( "=" PGNSP PGUID b t t 703 703 16 566 567 reltimeeq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 567 ( "<>" PGNSP PGUID b f f 703 703 16 567 566 reltimene neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 568 ( "<" PGNSP PGUID b f f 703 703 16 569 571 reltimelt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 569 ( ">" PGNSP PGUID b f f 703 703 16 568 570 reltimegt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 570 ( "<=" PGNSP PGUID b f f 703 703 16 571 569 reltimele scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 571 ( ">=" PGNSP PGUID b f f 703 703 16 570 568 reltimege scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 572 ( "~=" PGNSP PGUID b f f 704 704 16 572 0 tintervalsame eqsel eqjoinsel )); DESCR("same as"); DATA(insert OID = 573 ( "<<" PGNSP PGUID b f f 704 704 16 0 0 tintervalct - - )); DESCR("contains"); DATA(insert OID = 574 ( "&&" PGNSP PGUID b f f 704 704 16 574 0 tintervalov - - )); DESCR("overlaps"); DATA(insert OID = 575 ( "#=" PGNSP PGUID b f f 704 703 16 0 576 tintervalleneq - - )); DESCR("equal by length"); DATA(insert OID = 576 ( "#<>" PGNSP PGUID b f f 704 703 16 0 575 tintervallenne - - )); DESCR("not equal by length"); DATA(insert OID = 577 ( "#<" PGNSP PGUID b f f 704 703 16 0 580 tintervallenlt - - )); DESCR("less than by length"); DATA(insert OID = 578 ( "#>" PGNSP PGUID b f f 704 703 16 0 579 tintervallengt - - )); DESCR("greater than by length"); DATA(insert OID = 579 ( "#<=" PGNSP PGUID b f f 704 703 16 0 578 tintervallenle - - )); DESCR("less than or equal by length"); DATA(insert OID = 580 ( "#>=" PGNSP PGUID b f f 704 703 16 0 577 tintervallenge - - )); DESCR("greater than or equal by length"); DATA(insert OID = 581 ( "+" PGNSP PGUID b f f 702 703 702 0 0 timepl - - )); DESCR("add"); DATA(insert OID = 582 ( "-" PGNSP PGUID b f f 702 703 702 0 0 timemi - - )); DESCR("subtract"); DATA(insert OID = 583 ( "" PGNSP PGUID b f f 702 704 16 0 0 intinterval - - )); DESCR("is contained by"); DATA(insert OID = 584 ( "-" PGNSP PGUID l f f 0 700 700 0 0 float4um - - )); DESCR("negate"); DATA(insert OID = 585 ( "-" PGNSP PGUID l f f 0 701 701 0 0 float8um - - )); DESCR("negate"); DATA(insert OID = 586 ( "+" PGNSP PGUID b f f 700 700 700 586 0 float4pl - - )); DESCR("add"); DATA(insert OID = 587 ( "-" PGNSP PGUID b f f 700 700 700 0 0 float4mi - - )); DESCR("subtract"); DATA(insert OID = 588 ( "/" PGNSP PGUID b f f 700 700 700 0 0 float4div - - )); DESCR("divide"); DATA(insert OID = 589 ( "*" PGNSP PGUID b f f 700 700 700 589 0 float4mul - - )); DESCR("multiply"); DATA(insert OID = 590 ( "@" PGNSP PGUID l f f 0 700 700 0 0 float4abs - - )); DESCR("absolute value"); DATA(insert OID = 591 ( "+" PGNSP PGUID b f f 701 701 701 591 0 float8pl - - )); DESCR("add"); DATA(insert OID = 592 ( "-" PGNSP PGUID b f f 701 701 701 0 0 float8mi - - )); DESCR("subtract"); DATA(insert OID = 593 ( "/" PGNSP PGUID b f f 701 701 701 0 0 float8div - - )); DESCR("divide"); DATA(insert OID = 594 ( "*" PGNSP PGUID b f f 701 701 701 594 0 float8mul - - )); DESCR("multiply"); DATA(insert OID = 595 ( "@" PGNSP PGUID l f f 0 701 701 0 0 float8abs - - )); DESCR("absolute value"); DATA(insert OID = 596 ( "|/" PGNSP PGUID l f f 0 701 701 0 0 dsqrt - - )); DESCR("square root"); DATA(insert OID = 597 ( "||/" PGNSP PGUID l f f 0 701 701 0 0 dcbrt - - )); DESCR("cube root"); DATA(insert OID = 1284 ( "|" PGNSP PGUID l f f 0 704 702 0 0 tintervalstart - - )); DESCR("start of interval"); DATA(insert OID = 606 ( "<#>" PGNSP PGUID b f f 702 702 704 0 0 mktinterval - - )); DESCR("convert to tinterval"); DATA(insert OID = 607 ( "=" PGNSP PGUID b t t 26 26 16 607 608 oideq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 608 ( "<>" PGNSP PGUID b f f 26 26 16 608 607 oidne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 609 ( "<" PGNSP PGUID b f f 26 26 16 610 612 oidlt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 610 ( ">" PGNSP PGUID b f f 26 26 16 609 611 oidgt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 611 ( "<=" PGNSP PGUID b f f 26 26 16 612 610 oidle scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 612 ( ">=" PGNSP PGUID b f f 26 26 16 611 609 oidge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 644 ( "<>" PGNSP PGUID b f f 30 30 16 644 649 oidvectorne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 645 ( "<" PGNSP PGUID b f f 30 30 16 646 648 oidvectorlt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 646 ( ">" PGNSP PGUID b f f 30 30 16 645 647 oidvectorgt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 647 ( "<=" PGNSP PGUID b f f 30 30 16 648 646 oidvectorle scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 648 ( ">=" PGNSP PGUID b f f 30 30 16 647 645 oidvectorge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 649 ( "=" PGNSP PGUID b t t 30 30 16 649 644 oidvectoreq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 613 ( "<->" PGNSP PGUID b f f 600 628 701 0 0 dist_pl - - )); DESCR("distance between"); DATA(insert OID = 614 ( "<->" PGNSP PGUID b f f 600 601 701 0 0 dist_ps - - )); DESCR("distance between"); DATA(insert OID = 615 ( "<->" PGNSP PGUID b f f 600 603 701 0 0 dist_pb - - )); DESCR("distance between"); DATA(insert OID = 616 ( "<->" PGNSP PGUID b f f 601 628 701 0 0 dist_sl - - )); DESCR("distance between"); DATA(insert OID = 617 ( "<->" PGNSP PGUID b f f 601 603 701 0 0 dist_sb - - )); DESCR("distance between"); DATA(insert OID = 618 ( "<->" PGNSP PGUID b f f 600 602 701 0 0 dist_ppath - - )); DESCR("distance between"); DATA(insert OID = 620 ( "=" PGNSP PGUID b t t 700 700 16 620 621 float4eq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 621 ( "<>" PGNSP PGUID b f f 700 700 16 621 620 float4ne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 622 ( "<" PGNSP PGUID b f f 700 700 16 623 625 float4lt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 623 ( ">" PGNSP PGUID b f f 700 700 16 622 624 float4gt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 624 ( "<=" PGNSP PGUID b f f 700 700 16 625 623 float4le scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 625 ( ">=" PGNSP PGUID b f f 700 700 16 624 622 float4ge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 630 ( "<>" PGNSP PGUID b f f 18 18 16 630 92 charne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 631 ( "<" PGNSP PGUID b f f 18 18 16 633 634 charlt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 632 ( "<=" PGNSP PGUID b f f 18 18 16 634 633 charle scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 633 ( ">" PGNSP PGUID b f f 18 18 16 631 632 chargt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 634 ( ">=" PGNSP PGUID b f f 18 18 16 632 631 charge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 639 ( "~" PGNSP PGUID b f f 19 25 16 0 640 nameregexeq regexeqsel regexeqjoinsel )); DESCR("matches regular expression, case-sensitive"); #define OID_NAME_REGEXEQ_OP 639 DATA(insert OID = 640 ( "!~" PGNSP PGUID b f f 19 25 16 0 639 nameregexne regexnesel regexnejoinsel )); DESCR("does not match regular expression, case-sensitive"); DATA(insert OID = 641 ( "~" PGNSP PGUID b f f 25 25 16 0 642 textregexeq regexeqsel regexeqjoinsel )); DESCR("matches regular expression, case-sensitive"); #define OID_TEXT_REGEXEQ_OP 641 DATA(insert OID = 642 ( "!~" PGNSP PGUID b f f 25 25 16 0 641 textregexne regexnesel regexnejoinsel )); DESCR("does not match regular expression, case-sensitive"); DATA(insert OID = 643 ( "<>" PGNSP PGUID b f f 19 19 16 643 93 namene neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 654 ( "||" PGNSP PGUID b f f 25 25 25 0 0 textcat - - )); DESCR("concatenate"); DATA(insert OID = 660 ( "<" PGNSP PGUID b f f 19 19 16 662 663 namelt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 661 ( "<=" PGNSP PGUID b f f 19 19 16 663 662 namele scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 662 ( ">" PGNSP PGUID b f f 19 19 16 660 661 namegt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 663 ( ">=" PGNSP PGUID b f f 19 19 16 661 660 namege scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 664 ( "<" PGNSP PGUID b f f 25 25 16 666 667 text_lt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 665 ( "<=" PGNSP PGUID b f f 25 25 16 667 666 text_le scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 666 ( ">" PGNSP PGUID b f f 25 25 16 664 665 text_gt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 667 ( ">=" PGNSP PGUID b f f 25 25 16 665 664 text_ge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 670 ( "=" PGNSP PGUID b t t 701 701 16 670 671 float8eq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 671 ( "<>" PGNSP PGUID b f f 701 701 16 671 670 float8ne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 672 ( "<" PGNSP PGUID b f f 701 701 16 674 675 float8lt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 673 ( "<=" PGNSP PGUID b f f 701 701 16 675 674 float8le scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 674 ( ">" PGNSP PGUID b f f 701 701 16 672 673 float8gt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 675 ( ">=" PGNSP PGUID b f f 701 701 16 673 672 float8ge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 682 ( "@" PGNSP PGUID l f f 0 21 21 0 0 int2abs - - )); DESCR("absolute value"); DATA(insert OID = 684 ( "+" PGNSP PGUID b f f 20 20 20 684 0 int8pl - - )); DESCR("add"); DATA(insert OID = 685 ( "-" PGNSP PGUID b f f 20 20 20 0 0 int8mi - - )); DESCR("subtract"); DATA(insert OID = 686 ( "*" PGNSP PGUID b f f 20 20 20 686 0 int8mul - - )); DESCR("multiply"); DATA(insert OID = 687 ( "/" PGNSP PGUID b f f 20 20 20 0 0 int8div - - )); DESCR("divide"); DATA(insert OID = 688 ( "+" PGNSP PGUID b f f 20 23 20 692 0 int84pl - - )); DESCR("add"); DATA(insert OID = 689 ( "-" PGNSP PGUID b f f 20 23 20 0 0 int84mi - - )); DESCR("subtract"); DATA(insert OID = 690 ( "*" PGNSP PGUID b f f 20 23 20 694 0 int84mul - - )); DESCR("multiply"); DATA(insert OID = 691 ( "/" PGNSP PGUID b f f 20 23 20 0 0 int84div - - )); DESCR("divide"); DATA(insert OID = 692 ( "+" PGNSP PGUID b f f 23 20 20 688 0 int48pl - - )); DESCR("add"); DATA(insert OID = 693 ( "-" PGNSP PGUID b f f 23 20 20 0 0 int48mi - - )); DESCR("subtract"); DATA(insert OID = 694 ( "*" PGNSP PGUID b f f 23 20 20 690 0 int48mul - - )); DESCR("multiply"); DATA(insert OID = 695 ( "/" PGNSP PGUID b f f 23 20 20 0 0 int48div - - )); DESCR("divide"); DATA(insert OID = 818 ( "+" PGNSP PGUID b f f 20 21 20 822 0 int82pl - - )); DESCR("add"); DATA(insert OID = 819 ( "-" PGNSP PGUID b f f 20 21 20 0 0 int82mi - - )); DESCR("subtract"); DATA(insert OID = 820 ( "*" PGNSP PGUID b f f 20 21 20 824 0 int82mul - - )); DESCR("multiply"); DATA(insert OID = 821 ( "/" PGNSP PGUID b f f 20 21 20 0 0 int82div - - )); DESCR("divide"); DATA(insert OID = 822 ( "+" PGNSP PGUID b f f 21 20 20 818 0 int28pl - - )); DESCR("add"); DATA(insert OID = 823 ( "-" PGNSP PGUID b f f 21 20 20 0 0 int28mi - - )); DESCR("subtract"); DATA(insert OID = 824 ( "*" PGNSP PGUID b f f 21 20 20 820 0 int28mul - - )); DESCR("multiply"); DATA(insert OID = 825 ( "/" PGNSP PGUID b f f 21 20 20 0 0 int28div - - )); DESCR("divide"); DATA(insert OID = 706 ( "<->" PGNSP PGUID b f f 603 603 701 706 0 box_distance - - )); DESCR("distance between"); DATA(insert OID = 707 ( "<->" PGNSP PGUID b f f 602 602 701 707 0 path_distance - - )); DESCR("distance between"); DATA(insert OID = 708 ( "<->" PGNSP PGUID b f f 628 628 701 708 0 line_distance - - )); DESCR("distance between"); DATA(insert OID = 709 ( "<->" PGNSP PGUID b f f 601 601 701 709 0 lseg_distance - - )); DESCR("distance between"); DATA(insert OID = 712 ( "<->" PGNSP PGUID b f f 604 604 701 712 0 poly_distance - - )); DESCR("distance between"); DATA(insert OID = 713 ( "<>" PGNSP PGUID b f f 600 600 16 713 510 point_ne neqsel neqjoinsel )); DESCR("not equal"); /* add translation/rotation/scaling operators for geometric types. - thomas 97/05/10 */ DATA(insert OID = 731 ( "+" PGNSP PGUID b f f 600 600 600 731 0 point_add - - )); DESCR("add points (translate)"); DATA(insert OID = 732 ( "-" PGNSP PGUID b f f 600 600 600 0 0 point_sub - - )); DESCR("subtract points (translate)"); DATA(insert OID = 733 ( "*" PGNSP PGUID b f f 600 600 600 733 0 point_mul - - )); DESCR("multiply points (scale/rotate)"); DATA(insert OID = 734 ( "/" PGNSP PGUID b f f 600 600 600 0 0 point_div - - )); DESCR("divide points (scale/rotate)"); DATA(insert OID = 735 ( "+" PGNSP PGUID b f f 602 602 602 735 0 path_add - - )); DESCR("concatenate"); DATA(insert OID = 736 ( "+" PGNSP PGUID b f f 602 600 602 0 0 path_add_pt - - )); DESCR("add (translate path)"); DATA(insert OID = 737 ( "-" PGNSP PGUID b f f 602 600 602 0 0 path_sub_pt - - )); DESCR("subtract (translate path)"); DATA(insert OID = 738 ( "*" PGNSP PGUID b f f 602 600 602 0 0 path_mul_pt - - )); DESCR("multiply (rotate/scale path)"); DATA(insert OID = 739 ( "/" PGNSP PGUID b f f 602 600 602 0 0 path_div_pt - - )); DESCR("divide (rotate/scale path)"); DATA(insert OID = 755 ( "@>" PGNSP PGUID b f f 602 600 16 512 0 path_contain_pt - - )); DESCR("contains"); DATA(insert OID = 756 ( "<@" PGNSP PGUID b f f 600 604 16 757 0 pt_contained_poly contsel contjoinsel )); DESCR("is contained by"); DATA(insert OID = 757 ( "@>" PGNSP PGUID b f f 604 600 16 756 0 poly_contain_pt contsel contjoinsel )); DESCR("contains"); DATA(insert OID = 758 ( "<@" PGNSP PGUID b f f 600 718 16 759 0 pt_contained_circle contsel contjoinsel )); DESCR("is contained by"); DATA(insert OID = 759 ( "@>" PGNSP PGUID b f f 718 600 16 758 0 circle_contain_pt contsel contjoinsel )); DESCR("contains"); DATA(insert OID = 773 ( "@" PGNSP PGUID l f f 0 23 23 0 0 int4abs - - )); DESCR("absolute value"); /* additional operators for geometric types - thomas 1997-07-09 */ DATA(insert OID = 792 ( "=" PGNSP PGUID b f f 602 602 16 792 0 path_n_eq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 793 ( "<" PGNSP PGUID b f f 602 602 16 794 0 path_n_lt - - )); DESCR("less than"); DATA(insert OID = 794 ( ">" PGNSP PGUID b f f 602 602 16 793 0 path_n_gt - - )); DESCR("greater than"); DATA(insert OID = 795 ( "<=" PGNSP PGUID b f f 602 602 16 796 0 path_n_le - - )); DESCR("less than or equal"); DATA(insert OID = 796 ( ">=" PGNSP PGUID b f f 602 602 16 795 0 path_n_ge - - )); DESCR("greater than or equal"); DATA(insert OID = 797 ( "#" PGNSP PGUID l f f 0 602 23 0 0 path_npoints - - )); DESCR("number of points"); DATA(insert OID = 798 ( "?#" PGNSP PGUID b f f 602 602 16 0 0 path_inter - - )); DESCR("intersect"); DATA(insert OID = 799 ( "@-@" PGNSP PGUID l f f 0 602 701 0 0 path_length - - )); DESCR("sum of path segment lengths"); DATA(insert OID = 800 ( ">^" PGNSP PGUID b f f 603 603 16 0 0 box_above_eq positionsel positionjoinsel )); DESCR("is above (allows touching)"); DATA(insert OID = 801 ( "<^" PGNSP PGUID b f f 603 603 16 0 0 box_below_eq positionsel positionjoinsel )); DESCR("is below (allows touching)"); DATA(insert OID = 802 ( "?#" PGNSP PGUID b f f 603 603 16 0 0 box_overlap areasel areajoinsel )); DESCR("deprecated, use && instead"); DATA(insert OID = 803 ( "#" PGNSP PGUID b f f 603 603 603 0 0 box_intersect - - )); DESCR("box intersection"); DATA(insert OID = 804 ( "+" PGNSP PGUID b f f 603 600 603 0 0 box_add - - )); DESCR("add point to box (translate)"); DATA(insert OID = 805 ( "-" PGNSP PGUID b f f 603 600 603 0 0 box_sub - - )); DESCR("subtract point from box (translate)"); DATA(insert OID = 806 ( "*" PGNSP PGUID b f f 603 600 603 0 0 box_mul - - )); DESCR("multiply box by point (scale)"); DATA(insert OID = 807 ( "/" PGNSP PGUID b f f 603 600 603 0 0 box_div - - )); DESCR("divide box by point (scale)"); DATA(insert OID = 808 ( "?-" PGNSP PGUID b f f 600 600 16 808 0 point_horiz - - )); DESCR("horizontally aligned"); DATA(insert OID = 809 ( "?|" PGNSP PGUID b f f 600 600 16 809 0 point_vert - - )); DESCR("vertically aligned"); DATA(insert OID = 811 ( "=" PGNSP PGUID b t f 704 704 16 811 812 tintervaleq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 812 ( "<>" PGNSP PGUID b f f 704 704 16 812 811 tintervalne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 813 ( "<" PGNSP PGUID b f f 704 704 16 814 816 tintervallt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 814 ( ">" PGNSP PGUID b f f 704 704 16 813 815 tintervalgt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 815 ( "<=" PGNSP PGUID b f f 704 704 16 816 814 tintervalle scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 816 ( ">=" PGNSP PGUID b f f 704 704 16 815 813 tintervalge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 843 ( "*" PGNSP PGUID b f f 790 700 790 845 0 cash_mul_flt4 - - )); DESCR("multiply"); DATA(insert OID = 844 ( "/" PGNSP PGUID b f f 790 700 790 0 0 cash_div_flt4 - - )); DESCR("divide"); DATA(insert OID = 845 ( "*" PGNSP PGUID b f f 700 790 790 843 0 flt4_mul_cash - - )); DESCR("multiply"); DATA(insert OID = 900 ( "=" PGNSP PGUID b t f 790 790 16 900 901 cash_eq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 901 ( "<>" PGNSP PGUID b f f 790 790 16 901 900 cash_ne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 902 ( "<" PGNSP PGUID b f f 790 790 16 903 905 cash_lt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 903 ( ">" PGNSP PGUID b f f 790 790 16 902 904 cash_gt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 904 ( "<=" PGNSP PGUID b f f 790 790 16 905 903 cash_le scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 905 ( ">=" PGNSP PGUID b f f 790 790 16 904 902 cash_ge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 906 ( "+" PGNSP PGUID b f f 790 790 790 906 0 cash_pl - - )); DESCR("add"); DATA(insert OID = 907 ( "-" PGNSP PGUID b f f 790 790 790 0 0 cash_mi - - )); DESCR("subtract"); DATA(insert OID = 908 ( "*" PGNSP PGUID b f f 790 701 790 916 0 cash_mul_flt8 - - )); DESCR("multiply"); DATA(insert OID = 909 ( "/" PGNSP PGUID b f f 790 701 790 0 0 cash_div_flt8 - - )); DESCR("divide"); DATA(insert OID = 912 ( "*" PGNSP PGUID b f f 790 23 790 917 0 cash_mul_int4 - - )); DESCR("multiply"); DATA(insert OID = 913 ( "/" PGNSP PGUID b f f 790 23 790 0 0 cash_div_int4 - - )); DESCR("divide"); DATA(insert OID = 914 ( "*" PGNSP PGUID b f f 790 21 790 918 0 cash_mul_int2 - - )); DESCR("multiply"); DATA(insert OID = 915 ( "/" PGNSP PGUID b f f 790 21 790 0 0 cash_div_int2 - - )); DESCR("divide"); DATA(insert OID = 916 ( "*" PGNSP PGUID b f f 701 790 790 908 0 flt8_mul_cash - - )); DESCR("multiply"); DATA(insert OID = 917 ( "*" PGNSP PGUID b f f 23 790 790 912 0 int4_mul_cash - - )); DESCR("multiply"); DATA(insert OID = 918 ( "*" PGNSP PGUID b f f 21 790 790 914 0 int2_mul_cash - - )); DESCR("multiply"); DATA(insert OID = 3825 ( "/" PGNSP PGUID b f f 790 790 701 0 0 cash_div_cash - - )); DESCR("divide"); DATA(insert OID = 965 ( "^" PGNSP PGUID b f f 701 701 701 0 0 dpow - - )); DESCR("exponentiation"); DATA(insert OID = 966 ( "+" PGNSP PGUID b f f 1034 1033 1034 0 0 aclinsert - - )); DESCR("add/update ACL item"); DATA(insert OID = 967 ( "-" PGNSP PGUID b f f 1034 1033 1034 0 0 aclremove - - )); DESCR("remove ACL item"); DATA(insert OID = 968 ( "@>" PGNSP PGUID b f f 1034 1033 16 0 0 aclcontains - - )); DESCR("contains"); DATA(insert OID = 974 ( "=" PGNSP PGUID b f t 1033 1033 16 974 0 aclitemeq eqsel eqjoinsel )); DESCR("equal"); /* additional geometric operators - thomas 1997-07-09 */ DATA(insert OID = 969 ( "@@" PGNSP PGUID l f f 0 601 600 0 0 lseg_center - - )); DESCR("center of"); DATA(insert OID = 970 ( "@@" PGNSP PGUID l f f 0 602 600 0 0 path_center - - )); DESCR("center of"); DATA(insert OID = 971 ( "@@" PGNSP PGUID l f f 0 604 600 0 0 poly_center - - )); DESCR("center of"); DATA(insert OID = 1054 ( "=" PGNSP PGUID b t t 1042 1042 16 1054 1057 bpchareq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 1055 ( "~" PGNSP PGUID b f f 1042 25 16 0 1056 bpcharregexeq regexeqsel regexeqjoinsel )); DESCR("matches regular expression, case-sensitive"); #define OID_BPCHAR_REGEXEQ_OP 1055 DATA(insert OID = 1056 ( "!~" PGNSP PGUID b f f 1042 25 16 0 1055 bpcharregexne regexnesel regexnejoinsel )); DESCR("does not match regular expression, case-sensitive"); DATA(insert OID = 1057 ( "<>" PGNSP PGUID b f f 1042 1042 16 1057 1054 bpcharne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 1058 ( "<" PGNSP PGUID b f f 1042 1042 16 1060 1061 bpcharlt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 1059 ( "<=" PGNSP PGUID b f f 1042 1042 16 1061 1060 bpcharle scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 1060 ( ">" PGNSP PGUID b f f 1042 1042 16 1058 1059 bpchargt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 1061 ( ">=" PGNSP PGUID b f f 1042 1042 16 1059 1058 bpcharge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); /* generic array comparison operators */ DATA(insert OID = 1070 ( "=" PGNSP PGUID b t t 2277 2277 16 1070 1071 array_eq eqsel eqjoinsel )); DESCR("equal"); #define ARRAY_EQ_OP 1070 DATA(insert OID = 1071 ( "<>" PGNSP PGUID b f f 2277 2277 16 1071 1070 array_ne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 1072 ( "<" PGNSP PGUID b f f 2277 2277 16 1073 1075 array_lt scalarltsel scalarltjoinsel )); DESCR("less than"); #define ARRAY_LT_OP 1072 DATA(insert OID = 1073 ( ">" PGNSP PGUID b f f 2277 2277 16 1072 1074 array_gt scalargtsel scalargtjoinsel )); DESCR("greater than"); #define ARRAY_GT_OP 1073 DATA(insert OID = 1074 ( "<=" PGNSP PGUID b f f 2277 2277 16 1075 1073 array_le scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 1075 ( ">=" PGNSP PGUID b f f 2277 2277 16 1074 1072 array_ge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); /* date operators */ DATA(insert OID = 1076 ( "+" PGNSP PGUID b f f 1082 1186 1114 2551 0 date_pl_interval - - )); DESCR("add"); DATA(insert OID = 1077 ( "-" PGNSP PGUID b f f 1082 1186 1114 0 0 date_mi_interval - - )); DESCR("subtract"); DATA(insert OID = 1093 ( "=" PGNSP PGUID b t t 1082 1082 16 1093 1094 date_eq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 1094 ( "<>" PGNSP PGUID b f f 1082 1082 16 1094 1093 date_ne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 1095 ( "<" PGNSP PGUID b f f 1082 1082 16 1097 1098 date_lt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 1096 ( "<=" PGNSP PGUID b f f 1082 1082 16 1098 1097 date_le scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 1097 ( ">" PGNSP PGUID b f f 1082 1082 16 1095 1096 date_gt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 1098 ( ">=" PGNSP PGUID b f f 1082 1082 16 1096 1095 date_ge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 1099 ( "-" PGNSP PGUID b f f 1082 1082 23 0 0 date_mi - - )); DESCR("subtract"); DATA(insert OID = 1100 ( "+" PGNSP PGUID b f f 1082 23 1082 2555 0 date_pli - - )); DESCR("add"); DATA(insert OID = 1101 ( "-" PGNSP PGUID b f f 1082 23 1082 0 0 date_mii - - )); DESCR("subtract"); /* time operators */ DATA(insert OID = 1108 ( "=" PGNSP PGUID b t t 1083 1083 16 1108 1109 time_eq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 1109 ( "<>" PGNSP PGUID b f f 1083 1083 16 1109 1108 time_ne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 1110 ( "<" PGNSP PGUID b f f 1083 1083 16 1112 1113 time_lt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 1111 ( "<=" PGNSP PGUID b f f 1083 1083 16 1113 1112 time_le scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 1112 ( ">" PGNSP PGUID b f f 1083 1083 16 1110 1111 time_gt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 1113 ( ">=" PGNSP PGUID b f f 1083 1083 16 1111 1110 time_ge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); /* timetz operators */ DATA(insert OID = 1550 ( "=" PGNSP PGUID b t t 1266 1266 16 1550 1551 timetz_eq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 1551 ( "<>" PGNSP PGUID b f f 1266 1266 16 1551 1550 timetz_ne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 1552 ( "<" PGNSP PGUID b f f 1266 1266 16 1554 1555 timetz_lt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 1553 ( "<=" PGNSP PGUID b f f 1266 1266 16 1555 1554 timetz_le scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 1554 ( ">" PGNSP PGUID b f f 1266 1266 16 1552 1553 timetz_gt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 1555 ( ">=" PGNSP PGUID b f f 1266 1266 16 1553 1552 timetz_ge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); /* float48 operators */ DATA(insert OID = 1116 ( "+" PGNSP PGUID b f f 700 701 701 1126 0 float48pl - - )); DESCR("add"); DATA(insert OID = 1117 ( "-" PGNSP PGUID b f f 700 701 701 0 0 float48mi - - )); DESCR("subtract"); DATA(insert OID = 1118 ( "/" PGNSP PGUID b f f 700 701 701 0 0 float48div - - )); DESCR("divide"); DATA(insert OID = 1119 ( "*" PGNSP PGUID b f f 700 701 701 1129 0 float48mul - - )); DESCR("multiply"); DATA(insert OID = 1120 ( "=" PGNSP PGUID b t t 700 701 16 1130 1121 float48eq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 1121 ( "<>" PGNSP PGUID b f f 700 701 16 1131 1120 float48ne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 1122 ( "<" PGNSP PGUID b f f 700 701 16 1133 1125 float48lt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 1123 ( ">" PGNSP PGUID b f f 700 701 16 1132 1124 float48gt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 1124 ( "<=" PGNSP PGUID b f f 700 701 16 1135 1123 float48le scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 1125 ( ">=" PGNSP PGUID b f f 700 701 16 1134 1122 float48ge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); /* float84 operators */ DATA(insert OID = 1126 ( "+" PGNSP PGUID b f f 701 700 701 1116 0 float84pl - - )); DESCR("add"); DATA(insert OID = 1127 ( "-" PGNSP PGUID b f f 701 700 701 0 0 float84mi - - )); DESCR("subtract"); DATA(insert OID = 1128 ( "/" PGNSP PGUID b f f 701 700 701 0 0 float84div - - )); DESCR("divide"); DATA(insert OID = 1129 ( "*" PGNSP PGUID b f f 701 700 701 1119 0 float84mul - - )); DESCR("multiply"); DATA(insert OID = 1130 ( "=" PGNSP PGUID b t t 701 700 16 1120 1131 float84eq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 1131 ( "<>" PGNSP PGUID b f f 701 700 16 1121 1130 float84ne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 1132 ( "<" PGNSP PGUID b f f 701 700 16 1123 1135 float84lt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 1133 ( ">" PGNSP PGUID b f f 701 700 16 1122 1134 float84gt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 1134 ( "<=" PGNSP PGUID b f f 701 700 16 1125 1133 float84le scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 1135 ( ">=" PGNSP PGUID b f f 701 700 16 1124 1132 float84ge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); /* LIKE hacks by Keith Parks. */ DATA(insert OID = 1207 ( "~~" PGNSP PGUID b f f 19 25 16 0 1208 namelike likesel likejoinsel )); DESCR("matches LIKE expression"); #define OID_NAME_LIKE_OP 1207 DATA(insert OID = 1208 ( "!~~" PGNSP PGUID b f f 19 25 16 0 1207 namenlike nlikesel nlikejoinsel )); DESCR("does not match LIKE expression"); DATA(insert OID = 1209 ( "~~" PGNSP PGUID b f f 25 25 16 0 1210 textlike likesel likejoinsel )); DESCR("matches LIKE expression"); #define OID_TEXT_LIKE_OP 1209 DATA(insert OID = 1210 ( "!~~" PGNSP PGUID b f f 25 25 16 0 1209 textnlike nlikesel nlikejoinsel )); DESCR("does not match LIKE expression"); DATA(insert OID = 1211 ( "~~" PGNSP PGUID b f f 1042 25 16 0 1212 bpcharlike likesel likejoinsel )); DESCR("matches LIKE expression"); #define OID_BPCHAR_LIKE_OP 1211 DATA(insert OID = 1212 ( "!~~" PGNSP PGUID b f f 1042 25 16 0 1211 bpcharnlike nlikesel nlikejoinsel )); DESCR("does not match LIKE expression"); /* case-insensitive regex hacks */ DATA(insert OID = 1226 ( "~*" PGNSP PGUID b f f 19 25 16 0 1227 nameicregexeq icregexeqsel icregexeqjoinsel )); DESCR("matches regular expression, case-insensitive"); #define OID_NAME_ICREGEXEQ_OP 1226 DATA(insert OID = 1227 ( "!~*" PGNSP PGUID b f f 19 25 16 0 1226 nameicregexne icregexnesel icregexnejoinsel )); DESCR("does not match regular expression, case-insensitive"); DATA(insert OID = 1228 ( "~*" PGNSP PGUID b f f 25 25 16 0 1229 texticregexeq icregexeqsel icregexeqjoinsel )); DESCR("matches regular expression, case-insensitive"); #define OID_TEXT_ICREGEXEQ_OP 1228 DATA(insert OID = 1229 ( "!~*" PGNSP PGUID b f f 25 25 16 0 1228 texticregexne icregexnesel icregexnejoinsel )); DESCR("does not match regular expression, case-insensitive"); DATA(insert OID = 1234 ( "~*" PGNSP PGUID b f f 1042 25 16 0 1235 bpcharicregexeq icregexeqsel icregexeqjoinsel )); DESCR("matches regular expression, case-insensitive"); #define OID_BPCHAR_ICREGEXEQ_OP 1234 DATA(insert OID = 1235 ( "!~*" PGNSP PGUID b f f 1042 25 16 0 1234 bpcharicregexne icregexnesel icregexnejoinsel )); DESCR("does not match regular expression, case-insensitive"); /* timestamptz operators */ DATA(insert OID = 1320 ( "=" PGNSP PGUID b t t 1184 1184 16 1320 1321 timestamptz_eq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 1321 ( "<>" PGNSP PGUID b f f 1184 1184 16 1321 1320 timestamptz_ne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 1322 ( "<" PGNSP PGUID b f f 1184 1184 16 1324 1325 timestamptz_lt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 1323 ( "<=" PGNSP PGUID b f f 1184 1184 16 1325 1324 timestamptz_le scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 1324 ( ">" PGNSP PGUID b f f 1184 1184 16 1322 1323 timestamptz_gt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 1325 ( ">=" PGNSP PGUID b f f 1184 1184 16 1323 1322 timestamptz_ge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 1327 ( "+" PGNSP PGUID b f f 1184 1186 1184 2554 0 timestamptz_pl_interval - - )); DESCR("add"); DATA(insert OID = 1328 ( "-" PGNSP PGUID b f f 1184 1184 1186 0 0 timestamptz_mi - - )); DESCR("subtract"); DATA(insert OID = 1329 ( "-" PGNSP PGUID b f f 1184 1186 1184 0 0 timestamptz_mi_interval - - )); DESCR("subtract"); /* interval operators */ DATA(insert OID = 1330 ( "=" PGNSP PGUID b t t 1186 1186 16 1330 1331 interval_eq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 1331 ( "<>" PGNSP PGUID b f f 1186 1186 16 1331 1330 interval_ne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 1332 ( "<" PGNSP PGUID b f f 1186 1186 16 1334 1335 interval_lt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 1333 ( "<=" PGNSP PGUID b f f 1186 1186 16 1335 1334 interval_le scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 1334 ( ">" PGNSP PGUID b f f 1186 1186 16 1332 1333 interval_gt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 1335 ( ">=" PGNSP PGUID b f f 1186 1186 16 1333 1332 interval_ge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 1336 ( "-" PGNSP PGUID l f f 0 1186 1186 0 0 interval_um - - )); DESCR("negate"); DATA(insert OID = 1337 ( "+" PGNSP PGUID b f f 1186 1186 1186 1337 0 interval_pl - - )); DESCR("add"); DATA(insert OID = 1338 ( "-" PGNSP PGUID b f f 1186 1186 1186 0 0 interval_mi - - )); DESCR("subtract"); DATA(insert OID = 1360 ( "+" PGNSP PGUID b f f 1082 1083 1114 1363 0 datetime_pl - - )); DESCR("convert date and time to timestamp"); DATA(insert OID = 1361 ( "+" PGNSP PGUID b f f 1082 1266 1184 1366 0 datetimetz_pl - - )); DESCR("convert date and time with time zone to timestamp with time zone"); DATA(insert OID = 1363 ( "+" PGNSP PGUID b f f 1083 1082 1114 1360 0 timedate_pl - - )); DESCR("convert time and date to timestamp"); DATA(insert OID = 1366 ( "+" PGNSP PGUID b f f 1266 1082 1184 1361 0 timetzdate_pl - - )); DESCR("convert time with time zone and date to timestamp with time zone"); DATA(insert OID = 1399 ( "-" PGNSP PGUID b f f 1083 1083 1186 0 0 time_mi_time - - )); DESCR("subtract"); /* additional geometric operators - thomas 97/04/18 */ DATA(insert OID = 1420 ( "@@" PGNSP PGUID l f f 0 718 600 0 0 circle_center - - )); DESCR("center of"); DATA(insert OID = 1500 ( "=" PGNSP PGUID b f f 718 718 16 1500 1501 circle_eq eqsel eqjoinsel )); DESCR("equal by area"); DATA(insert OID = 1501 ( "<>" PGNSP PGUID b f f 718 718 16 1501 1500 circle_ne neqsel neqjoinsel )); DESCR("not equal by area"); DATA(insert OID = 1502 ( "<" PGNSP PGUID b f f 718 718 16 1503 1505 circle_lt areasel areajoinsel )); DESCR("less than by area"); DATA(insert OID = 1503 ( ">" PGNSP PGUID b f f 718 718 16 1502 1504 circle_gt areasel areajoinsel )); DESCR("greater than by area"); DATA(insert OID = 1504 ( "<=" PGNSP PGUID b f f 718 718 16 1505 1503 circle_le areasel areajoinsel )); DESCR("less than or equal by area"); DATA(insert OID = 1505 ( ">=" PGNSP PGUID b f f 718 718 16 1504 1502 circle_ge areasel areajoinsel )); DESCR("greater than or equal by area"); DATA(insert OID = 1506 ( "<<" PGNSP PGUID b f f 718 718 16 0 0 circle_left positionsel positionjoinsel )); DESCR("is left of"); DATA(insert OID = 1507 ( "&<" PGNSP PGUID b f f 718 718 16 0 0 circle_overleft positionsel positionjoinsel )); DESCR("overlaps or is left of"); DATA(insert OID = 1508 ( "&>" PGNSP PGUID b f f 718 718 16 0 0 circle_overright positionsel positionjoinsel )); DESCR("overlaps or is right of"); DATA(insert OID = 1509 ( ">>" PGNSP PGUID b f f 718 718 16 0 0 circle_right positionsel positionjoinsel )); DESCR("is right of"); DATA(insert OID = 1510 ( "<@" PGNSP PGUID b f f 718 718 16 1511 0 circle_contained contsel contjoinsel )); DESCR("is contained by"); DATA(insert OID = 1511 ( "@>" PGNSP PGUID b f f 718 718 16 1510 0 circle_contain contsel contjoinsel )); DESCR("contains"); DATA(insert OID = 1512 ( "~=" PGNSP PGUID b f f 718 718 16 1512 0 circle_same eqsel eqjoinsel )); DESCR("same as"); DATA(insert OID = 1513 ( "&&" PGNSP PGUID b f f 718 718 16 1513 0 circle_overlap areasel areajoinsel )); DESCR("overlaps"); DATA(insert OID = 1514 ( "|>>" PGNSP PGUID b f f 718 718 16 0 0 circle_above positionsel positionjoinsel )); DESCR("is above"); DATA(insert OID = 1515 ( "<<|" PGNSP PGUID b f f 718 718 16 0 0 circle_below positionsel positionjoinsel )); DESCR("is below"); DATA(insert OID = 1516 ( "+" PGNSP PGUID b f f 718 600 718 0 0 circle_add_pt - - )); DESCR("add"); DATA(insert OID = 1517 ( "-" PGNSP PGUID b f f 718 600 718 0 0 circle_sub_pt - - )); DESCR("subtract"); DATA(insert OID = 1518 ( "*" PGNSP PGUID b f f 718 600 718 0 0 circle_mul_pt - - )); DESCR("multiply"); DATA(insert OID = 1519 ( "/" PGNSP PGUID b f f 718 600 718 0 0 circle_div_pt - - )); DESCR("divide"); DATA(insert OID = 1520 ( "<->" PGNSP PGUID b f f 718 718 701 1520 0 circle_distance - - )); DESCR("distance between"); DATA(insert OID = 1521 ( "#" PGNSP PGUID l f f 0 604 23 0 0 poly_npoints - - )); DESCR("number of points"); DATA(insert OID = 1522 ( "<->" PGNSP PGUID b f f 600 718 701 0 0 dist_pc - - )); DESCR("distance between"); DATA(insert OID = 1523 ( "<->" PGNSP PGUID b f f 718 604 701 0 0 dist_cpoly - - )); DESCR("distance between"); /* additional geometric operators - thomas 1997-07-09 */ DATA(insert OID = 1524 ( "<->" PGNSP PGUID b f f 628 603 701 0 0 dist_lb - - )); DESCR("distance between"); DATA(insert OID = 1525 ( "?#" PGNSP PGUID b f f 601 601 16 1525 0 lseg_intersect - - )); DESCR("intersect"); DATA(insert OID = 1526 ( "?||" PGNSP PGUID b f f 601 601 16 1526 0 lseg_parallel - - )); DESCR("parallel"); DATA(insert OID = 1527 ( "?-|" PGNSP PGUID b f f 601 601 16 1527 0 lseg_perp - - )); DESCR("perpendicular"); DATA(insert OID = 1528 ( "?-" PGNSP PGUID l f f 0 601 16 0 0 lseg_horizontal - - )); DESCR("horizontal"); DATA(insert OID = 1529 ( "?|" PGNSP PGUID l f f 0 601 16 0 0 lseg_vertical - - )); DESCR("vertical"); DATA(insert OID = 1535 ( "=" PGNSP PGUID b f f 601 601 16 1535 1586 lseg_eq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 1536 ( "#" PGNSP PGUID b f f 601 601 600 1536 0 lseg_interpt - - )); DESCR("intersection point"); DATA(insert OID = 1537 ( "?#" PGNSP PGUID b f f 601 628 16 0 0 inter_sl - - )); DESCR("intersect"); DATA(insert OID = 1538 ( "?#" PGNSP PGUID b f f 601 603 16 0 0 inter_sb - - )); DESCR("intersect"); DATA(insert OID = 1539 ( "?#" PGNSP PGUID b f f 628 603 16 0 0 inter_lb - - )); DESCR("intersect"); DATA(insert OID = 1546 ( "<@" PGNSP PGUID b f f 600 628 16 0 0 on_pl - - )); DESCR("point on line"); DATA(insert OID = 1547 ( "<@" PGNSP PGUID b f f 600 601 16 0 0 on_ps - - )); DESCR("is contained by"); DATA(insert OID = 1548 ( "<@" PGNSP PGUID b f f 601 628 16 0 0 on_sl - - )); DESCR("lseg on line"); DATA(insert OID = 1549 ( "<@" PGNSP PGUID b f f 601 603 16 0 0 on_sb - - )); DESCR("is contained by"); DATA(insert OID = 1557 ( "##" PGNSP PGUID b f f 600 628 600 0 0 close_pl - - )); DESCR("closest point to A on B"); DATA(insert OID = 1558 ( "##" PGNSP PGUID b f f 600 601 600 0 0 close_ps - - )); DESCR("closest point to A on B"); DATA(insert OID = 1559 ( "##" PGNSP PGUID b f f 600 603 600 0 0 close_pb - - )); DESCR("closest point to A on B"); DATA(insert OID = 1566 ( "##" PGNSP PGUID b f f 601 628 600 0 0 close_sl - - )); DESCR("closest point to A on B"); DATA(insert OID = 1567 ( "##" PGNSP PGUID b f f 601 603 600 0 0 close_sb - - )); DESCR("closest point to A on B"); DATA(insert OID = 1568 ( "##" PGNSP PGUID b f f 628 603 600 0 0 close_lb - - )); DESCR("closest point to A on B"); DATA(insert OID = 1577 ( "##" PGNSP PGUID b f f 628 601 600 0 0 close_ls - - )); DESCR("closest point to A on B"); DATA(insert OID = 1578 ( "##" PGNSP PGUID b f f 601 601 600 0 0 close_lseg - - )); DESCR("closest point to A on B"); DATA(insert OID = 1583 ( "*" PGNSP PGUID b f f 1186 701 1186 1584 0 interval_mul - - )); DESCR("multiply"); DATA(insert OID = 1584 ( "*" PGNSP PGUID b f f 701 1186 1186 1583 0 mul_d_interval - - )); DESCR("multiply"); DATA(insert OID = 1585 ( "/" PGNSP PGUID b f f 1186 701 1186 0 0 interval_div - - )); DESCR("divide"); DATA(insert OID = 1586 ( "<>" PGNSP PGUID b f f 601 601 16 1586 1535 lseg_ne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 1587 ( "<" PGNSP PGUID b f f 601 601 16 1589 1590 lseg_lt - - )); DESCR("less than by length"); DATA(insert OID = 1588 ( "<=" PGNSP PGUID b f f 601 601 16 1590 1589 lseg_le - - )); DESCR("less than or equal by length"); DATA(insert OID = 1589 ( ">" PGNSP PGUID b f f 601 601 16 1587 1588 lseg_gt - - )); DESCR("greater than by length"); DATA(insert OID = 1590 ( ">=" PGNSP PGUID b f f 601 601 16 1588 1587 lseg_ge - - )); DESCR("greater than or equal by length"); DATA(insert OID = 1591 ( "@-@" PGNSP PGUID l f f 0 601 701 0 0 lseg_length - - )); DESCR("distance between endpoints"); DATA(insert OID = 1611 ( "?#" PGNSP PGUID b f f 628 628 16 1611 0 line_intersect - - )); DESCR("intersect"); DATA(insert OID = 1612 ( "?||" PGNSP PGUID b f f 628 628 16 1612 0 line_parallel - - )); DESCR("parallel"); DATA(insert OID = 1613 ( "?-|" PGNSP PGUID b f f 628 628 16 1613 0 line_perp - - )); DESCR("perpendicular"); DATA(insert OID = 1614 ( "?-" PGNSP PGUID l f f 0 628 16 0 0 line_horizontal - - )); DESCR("horizontal"); DATA(insert OID = 1615 ( "?|" PGNSP PGUID l f f 0 628 16 0 0 line_vertical - - )); DESCR("vertical"); DATA(insert OID = 1616 ( "=" PGNSP PGUID b f f 628 628 16 1616 0 line_eq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 1617 ( "#" PGNSP PGUID b f f 628 628 600 1617 0 line_interpt - - )); DESCR("intersection point"); /* MAC type */ DATA(insert OID = 1220 ( "=" PGNSP PGUID b t t 829 829 16 1220 1221 macaddr_eq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 1221 ( "<>" PGNSP PGUID b f f 829 829 16 1221 1220 macaddr_ne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 1222 ( "<" PGNSP PGUID b f f 829 829 16 1224 1225 macaddr_lt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 1223 ( "<=" PGNSP PGUID b f f 829 829 16 1225 1224 macaddr_le scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 1224 ( ">" PGNSP PGUID b f f 829 829 16 1222 1223 macaddr_gt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 1225 ( ">=" PGNSP PGUID b f f 829 829 16 1223 1222 macaddr_ge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 3147 ( "~" PGNSP PGUID l f f 0 829 829 0 0 macaddr_not - - )); DESCR("bitwise not"); DATA(insert OID = 3148 ( "&" PGNSP PGUID b f f 829 829 829 0 0 macaddr_and - - )); DESCR("bitwise and"); DATA(insert OID = 3149 ( "|" PGNSP PGUID b f f 829 829 829 0 0 macaddr_or - - )); DESCR("bitwise or"); /* INET type (these also support CIDR via implicit cast) */ DATA(insert OID = 1201 ( "=" PGNSP PGUID b t t 869 869 16 1201 1202 network_eq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 1202 ( "<>" PGNSP PGUID b f f 869 869 16 1202 1201 network_ne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 1203 ( "<" PGNSP PGUID b f f 869 869 16 1205 1206 network_lt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 1204 ( "<=" PGNSP PGUID b f f 869 869 16 1206 1205 network_le scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 1205 ( ">" PGNSP PGUID b f f 869 869 16 1203 1204 network_gt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 1206 ( ">=" PGNSP PGUID b f f 869 869 16 1204 1203 network_ge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 931 ( "<<" PGNSP PGUID b f f 869 869 16 933 0 network_sub - - )); DESCR("is subnet"); #define OID_INET_SUB_OP 931 DATA(insert OID = 932 ( "<<=" PGNSP PGUID b f f 869 869 16 934 0 network_subeq - - )); DESCR("is subnet or equal"); #define OID_INET_SUBEQ_OP 932 DATA(insert OID = 933 ( ">>" PGNSP PGUID b f f 869 869 16 931 0 network_sup - - )); DESCR("is supernet"); #define OID_INET_SUP_OP 933 DATA(insert OID = 934 ( ">>=" PGNSP PGUID b f f 869 869 16 932 0 network_supeq - - )); DESCR("is supernet or equal"); #define OID_INET_SUPEQ_OP 934 DATA(insert OID = 2634 ( "~" PGNSP PGUID l f f 0 869 869 0 0 inetnot - - )); DESCR("bitwise not"); DATA(insert OID = 2635 ( "&" PGNSP PGUID b f f 869 869 869 0 0 inetand - - )); DESCR("bitwise and"); DATA(insert OID = 2636 ( "|" PGNSP PGUID b f f 869 869 869 0 0 inetor - - )); DESCR("bitwise or"); DATA(insert OID = 2637 ( "+" PGNSP PGUID b f f 869 20 869 2638 0 inetpl - - )); DESCR("add"); DATA(insert OID = 2638 ( "+" PGNSP PGUID b f f 20 869 869 2637 0 int8pl_inet - - )); DESCR("add"); DATA(insert OID = 2639 ( "-" PGNSP PGUID b f f 869 20 869 0 0 inetmi_int8 - - )); DESCR("subtract"); DATA(insert OID = 2640 ( "-" PGNSP PGUID b f f 869 869 20 0 0 inetmi - - )); DESCR("subtract"); /* case-insensitive LIKE hacks */ DATA(insert OID = 1625 ( "~~*" PGNSP PGUID b f f 19 25 16 0 1626 nameiclike iclikesel iclikejoinsel )); DESCR("matches LIKE expression, case-insensitive"); #define OID_NAME_ICLIKE_OP 1625 DATA(insert OID = 1626 ( "!~~*" PGNSP PGUID b f f 19 25 16 0 1625 nameicnlike icnlikesel icnlikejoinsel )); DESCR("does not match LIKE expression, case-insensitive"); DATA(insert OID = 1627 ( "~~*" PGNSP PGUID b f f 25 25 16 0 1628 texticlike iclikesel iclikejoinsel )); DESCR("matches LIKE expression, case-insensitive"); #define OID_TEXT_ICLIKE_OP 1627 DATA(insert OID = 1628 ( "!~~*" PGNSP PGUID b f f 25 25 16 0 1627 texticnlike icnlikesel icnlikejoinsel )); DESCR("does not match LIKE expression, case-insensitive"); DATA(insert OID = 1629 ( "~~*" PGNSP PGUID b f f 1042 25 16 0 1630 bpchariclike iclikesel iclikejoinsel )); DESCR("matches LIKE expression, case-insensitive"); #define OID_BPCHAR_ICLIKE_OP 1629 DATA(insert OID = 1630 ( "!~~*" PGNSP PGUID b f f 1042 25 16 0 1629 bpcharicnlike icnlikesel icnlikejoinsel )); DESCR("does not match LIKE expression, case-insensitive"); /* NUMERIC type - OID's 1700-1799 */ DATA(insert OID = 1751 ( "-" PGNSP PGUID l f f 0 1700 1700 0 0 numeric_uminus - - )); DESCR("negate"); DATA(insert OID = 1752 ( "=" PGNSP PGUID b t t 1700 1700 16 1752 1753 numeric_eq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 1753 ( "<>" PGNSP PGUID b f f 1700 1700 16 1753 1752 numeric_ne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 1754 ( "<" PGNSP PGUID b f f 1700 1700 16 1756 1757 numeric_lt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 1755 ( "<=" PGNSP PGUID b f f 1700 1700 16 1757 1756 numeric_le scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 1756 ( ">" PGNSP PGUID b f f 1700 1700 16 1754 1755 numeric_gt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 1757 ( ">=" PGNSP PGUID b f f 1700 1700 16 1755 1754 numeric_ge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 1758 ( "+" PGNSP PGUID b f f 1700 1700 1700 1758 0 numeric_add - - )); DESCR("add"); DATA(insert OID = 1759 ( "-" PGNSP PGUID b f f 1700 1700 1700 0 0 numeric_sub - - )); DESCR("subtract"); DATA(insert OID = 1760 ( "*" PGNSP PGUID b f f 1700 1700 1700 1760 0 numeric_mul - - )); DESCR("multiply"); DATA(insert OID = 1761 ( "/" PGNSP PGUID b f f 1700 1700 1700 0 0 numeric_div - - )); DESCR("divide"); DATA(insert OID = 1762 ( "%" PGNSP PGUID b f f 1700 1700 1700 0 0 numeric_mod - - )); DESCR("modulus"); DATA(insert OID = 1038 ( "^" PGNSP PGUID b f f 1700 1700 1700 0 0 numeric_power - - )); DESCR("exponentiation"); DATA(insert OID = 1763 ( "@" PGNSP PGUID l f f 0 1700 1700 0 0 numeric_abs - - )); DESCR("absolute value"); DATA(insert OID = 1784 ( "=" PGNSP PGUID b t f 1560 1560 16 1784 1785 biteq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 1785 ( "<>" PGNSP PGUID b f f 1560 1560 16 1785 1784 bitne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 1786 ( "<" PGNSP PGUID b f f 1560 1560 16 1787 1789 bitlt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 1787 ( ">" PGNSP PGUID b f f 1560 1560 16 1786 1788 bitgt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 1788 ( "<=" PGNSP PGUID b f f 1560 1560 16 1789 1787 bitle scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 1789 ( ">=" PGNSP PGUID b f f 1560 1560 16 1788 1786 bitge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 1791 ( "&" PGNSP PGUID b f f 1560 1560 1560 1791 0 bitand - - )); DESCR("bitwise and"); DATA(insert OID = 1792 ( "|" PGNSP PGUID b f f 1560 1560 1560 1792 0 bitor - - )); DESCR("bitwise or"); DATA(insert OID = 1793 ( "#" PGNSP PGUID b f f 1560 1560 1560 1793 0 bitxor - - )); DESCR("bitwise exclusive or"); DATA(insert OID = 1794 ( "~" PGNSP PGUID l f f 0 1560 1560 0 0 bitnot - - )); DESCR("bitwise not"); DATA(insert OID = 1795 ( "<<" PGNSP PGUID b f f 1560 23 1560 0 0 bitshiftleft - - )); DESCR("bitwise shift left"); DATA(insert OID = 1796 ( ">>" PGNSP PGUID b f f 1560 23 1560 0 0 bitshiftright - - )); DESCR("bitwise shift right"); DATA(insert OID = 1797 ( "||" PGNSP PGUID b f f 1562 1562 1562 0 0 bitcat - - )); DESCR("concatenate"); DATA(insert OID = 1800 ( "+" PGNSP PGUID b f f 1083 1186 1083 1849 0 time_pl_interval - - )); DESCR("add"); DATA(insert OID = 1801 ( "-" PGNSP PGUID b f f 1083 1186 1083 0 0 time_mi_interval - - )); DESCR("subtract"); DATA(insert OID = 1802 ( "+" PGNSP PGUID b f f 1266 1186 1266 2552 0 timetz_pl_interval - - )); DESCR("add"); DATA(insert OID = 1803 ( "-" PGNSP PGUID b f f 1266 1186 1266 0 0 timetz_mi_interval - - )); DESCR("subtract"); DATA(insert OID = 1804 ( "=" PGNSP PGUID b t f 1562 1562 16 1804 1805 varbiteq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 1805 ( "<>" PGNSP PGUID b f f 1562 1562 16 1805 1804 varbitne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 1806 ( "<" PGNSP PGUID b f f 1562 1562 16 1807 1809 varbitlt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 1807 ( ">" PGNSP PGUID b f f 1562 1562 16 1806 1808 varbitgt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 1808 ( "<=" PGNSP PGUID b f f 1562 1562 16 1809 1807 varbitle scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 1809 ( ">=" PGNSP PGUID b f f 1562 1562 16 1808 1806 varbitge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 1849 ( "+" PGNSP PGUID b f f 1186 1083 1083 1800 0 interval_pl_time - - )); DESCR("add"); DATA(insert OID = 1862 ( "=" PGNSP PGUID b t t 21 20 16 1868 1863 int28eq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 1863 ( "<>" PGNSP PGUID b f f 21 20 16 1869 1862 int28ne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 1864 ( "<" PGNSP PGUID b f f 21 20 16 1871 1867 int28lt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 1865 ( ">" PGNSP PGUID b f f 21 20 16 1870 1866 int28gt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 1866 ( "<=" PGNSP PGUID b f f 21 20 16 1873 1865 int28le scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 1867 ( ">=" PGNSP PGUID b f f 21 20 16 1872 1864 int28ge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 1868 ( "=" PGNSP PGUID b t t 20 21 16 1862 1869 int82eq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 1869 ( "<>" PGNSP PGUID b f f 20 21 16 1863 1868 int82ne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 1870 ( "<" PGNSP PGUID b f f 20 21 16 1865 1873 int82lt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 1871 ( ">" PGNSP PGUID b f f 20 21 16 1864 1872 int82gt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 1872 ( "<=" PGNSP PGUID b f f 20 21 16 1867 1871 int82le scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 1873 ( ">=" PGNSP PGUID b f f 20 21 16 1866 1870 int82ge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 1874 ( "&" PGNSP PGUID b f f 21 21 21 1874 0 int2and - - )); DESCR("bitwise and"); DATA(insert OID = 1875 ( "|" PGNSP PGUID b f f 21 21 21 1875 0 int2or - - )); DESCR("bitwise or"); DATA(insert OID = 1876 ( "#" PGNSP PGUID b f f 21 21 21 1876 0 int2xor - - )); DESCR("bitwise exclusive or"); DATA(insert OID = 1877 ( "~" PGNSP PGUID l f f 0 21 21 0 0 int2not - - )); DESCR("bitwise not"); DATA(insert OID = 1878 ( "<<" PGNSP PGUID b f f 21 23 21 0 0 int2shl - - )); DESCR("bitwise shift left"); DATA(insert OID = 1879 ( ">>" PGNSP PGUID b f f 21 23 21 0 0 int2shr - - )); DESCR("bitwise shift right"); DATA(insert OID = 1880 ( "&" PGNSP PGUID b f f 23 23 23 1880 0 int4and - - )); DESCR("bitwise and"); DATA(insert OID = 1881 ( "|" PGNSP PGUID b f f 23 23 23 1881 0 int4or - - )); DESCR("bitwise or"); DATA(insert OID = 1882 ( "#" PGNSP PGUID b f f 23 23 23 1882 0 int4xor - - )); DESCR("bitwise exclusive or"); DATA(insert OID = 1883 ( "~" PGNSP PGUID l f f 0 23 23 0 0 int4not - - )); DESCR("bitwise not"); DATA(insert OID = 1884 ( "<<" PGNSP PGUID b f f 23 23 23 0 0 int4shl - - )); DESCR("bitwise shift left"); DATA(insert OID = 1885 ( ">>" PGNSP PGUID b f f 23 23 23 0 0 int4shr - - )); DESCR("bitwise shift right"); DATA(insert OID = 1886 ( "&" PGNSP PGUID b f f 20 20 20 1886 0 int8and - - )); DESCR("bitwise and"); DATA(insert OID = 1887 ( "|" PGNSP PGUID b f f 20 20 20 1887 0 int8or - - )); DESCR("bitwise or"); DATA(insert OID = 1888 ( "#" PGNSP PGUID b f f 20 20 20 1888 0 int8xor - - )); DESCR("bitwise exclusive or"); DATA(insert OID = 1889 ( "~" PGNSP PGUID l f f 0 20 20 0 0 int8not - - )); DESCR("bitwise not"); DATA(insert OID = 1890 ( "<<" PGNSP PGUID b f f 20 23 20 0 0 int8shl - - )); DESCR("bitwise shift left"); DATA(insert OID = 1891 ( ">>" PGNSP PGUID b f f 20 23 20 0 0 int8shr - - )); DESCR("bitwise shift right"); DATA(insert OID = 1916 ( "+" PGNSP PGUID l f f 0 20 20 0 0 int8up - - )); DESCR("unary plus"); DATA(insert OID = 1917 ( "+" PGNSP PGUID l f f 0 21 21 0 0 int2up - - )); DESCR("unary plus"); DATA(insert OID = 1918 ( "+" PGNSP PGUID l f f 0 23 23 0 0 int4up - - )); DESCR("unary plus"); DATA(insert OID = 1919 ( "+" PGNSP PGUID l f f 0 700 700 0 0 float4up - - )); DESCR("unary plus"); DATA(insert OID = 1920 ( "+" PGNSP PGUID l f f 0 701 701 0 0 float8up - - )); DESCR("unary plus"); DATA(insert OID = 1921 ( "+" PGNSP PGUID l f f 0 1700 1700 0 0 numeric_uplus - - )); DESCR("unary plus"); /* bytea operators */ DATA(insert OID = 1955 ( "=" PGNSP PGUID b t t 17 17 16 1955 1956 byteaeq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 1956 ( "<>" PGNSP PGUID b f f 17 17 16 1956 1955 byteane neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 1957 ( "<" PGNSP PGUID b f f 17 17 16 1959 1960 bytealt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 1958 ( "<=" PGNSP PGUID b f f 17 17 16 1960 1959 byteale scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 1959 ( ">" PGNSP PGUID b f f 17 17 16 1957 1958 byteagt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 1960 ( ">=" PGNSP PGUID b f f 17 17 16 1958 1957 byteage scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 2016 ( "~~" PGNSP PGUID b f f 17 17 16 0 2017 bytealike likesel likejoinsel )); DESCR("matches LIKE expression"); #define OID_BYTEA_LIKE_OP 2016 DATA(insert OID = 2017 ( "!~~" PGNSP PGUID b f f 17 17 16 0 2016 byteanlike nlikesel nlikejoinsel )); DESCR("does not match LIKE expression"); DATA(insert OID = 2018 ( "||" PGNSP PGUID b f f 17 17 17 0 0 byteacat - - )); DESCR("concatenate"); /* timestamp operators */ DATA(insert OID = 2060 ( "=" PGNSP PGUID b t t 1114 1114 16 2060 2061 timestamp_eq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 2061 ( "<>" PGNSP PGUID b f f 1114 1114 16 2061 2060 timestamp_ne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 2062 ( "<" PGNSP PGUID b f f 1114 1114 16 2064 2065 timestamp_lt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 2063 ( "<=" PGNSP PGUID b f f 1114 1114 16 2065 2064 timestamp_le scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 2064 ( ">" PGNSP PGUID b f f 1114 1114 16 2062 2063 timestamp_gt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 2065 ( ">=" PGNSP PGUID b f f 1114 1114 16 2063 2062 timestamp_ge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 2066 ( "+" PGNSP PGUID b f f 1114 1186 1114 2553 0 timestamp_pl_interval - - )); DESCR("add"); DATA(insert OID = 2067 ( "-" PGNSP PGUID b f f 1114 1114 1186 0 0 timestamp_mi - - )); DESCR("subtract"); DATA(insert OID = 2068 ( "-" PGNSP PGUID b f f 1114 1186 1114 0 0 timestamp_mi_interval - - )); DESCR("subtract"); /* character-by-character (not collation order) comparison operators for character types */ DATA(insert OID = 2314 ( "~<~" PGNSP PGUID b f f 25 25 16 2318 2317 text_pattern_lt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 2315 ( "~<=~" PGNSP PGUID b f f 25 25 16 2317 2318 text_pattern_le scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 2317 ( "~>=~" PGNSP PGUID b f f 25 25 16 2315 2314 text_pattern_ge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 2318 ( "~>~" PGNSP PGUID b f f 25 25 16 2314 2315 text_pattern_gt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 2326 ( "~<~" PGNSP PGUID b f f 1042 1042 16 2330 2329 bpchar_pattern_lt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 2327 ( "~<=~" PGNSP PGUID b f f 1042 1042 16 2329 2330 bpchar_pattern_le scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 2329 ( "~>=~" PGNSP PGUID b f f 1042 1042 16 2327 2326 bpchar_pattern_ge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 2330 ( "~>~" PGNSP PGUID b f f 1042 1042 16 2326 2327 bpchar_pattern_gt scalargtsel scalargtjoinsel )); DESCR("greater than"); /* crosstype operations for date vs. timestamp and timestamptz */ DATA(insert OID = 2345 ( "<" PGNSP PGUID b f f 1082 1114 16 2375 2348 date_lt_timestamp scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 2346 ( "<=" PGNSP PGUID b f f 1082 1114 16 2374 2349 date_le_timestamp scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 2347 ( "=" PGNSP PGUID b t f 1082 1114 16 2373 2350 date_eq_timestamp eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 2348 ( ">=" PGNSP PGUID b f f 1082 1114 16 2372 2345 date_ge_timestamp scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 2349 ( ">" PGNSP PGUID b f f 1082 1114 16 2371 2346 date_gt_timestamp scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 2350 ( "<>" PGNSP PGUID b f f 1082 1114 16 2376 2347 date_ne_timestamp neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 2358 ( "<" PGNSP PGUID b f f 1082 1184 16 2388 2361 date_lt_timestamptz scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 2359 ( "<=" PGNSP PGUID b f f 1082 1184 16 2387 2362 date_le_timestamptz scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 2360 ( "=" PGNSP PGUID b t f 1082 1184 16 2386 2363 date_eq_timestamptz eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 2361 ( ">=" PGNSP PGUID b f f 1082 1184 16 2385 2358 date_ge_timestamptz scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 2362 ( ">" PGNSP PGUID b f f 1082 1184 16 2384 2359 date_gt_timestamptz scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 2363 ( "<>" PGNSP PGUID b f f 1082 1184 16 2389 2360 date_ne_timestamptz neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 2371 ( "<" PGNSP PGUID b f f 1114 1082 16 2349 2374 timestamp_lt_date scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 2372 ( "<=" PGNSP PGUID b f f 1114 1082 16 2348 2375 timestamp_le_date scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 2373 ( "=" PGNSP PGUID b t f 1114 1082 16 2347 2376 timestamp_eq_date eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 2374 ( ">=" PGNSP PGUID b f f 1114 1082 16 2346 2371 timestamp_ge_date scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 2375 ( ">" PGNSP PGUID b f f 1114 1082 16 2345 2372 timestamp_gt_date scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 2376 ( "<>" PGNSP PGUID b f f 1114 1082 16 2350 2373 timestamp_ne_date neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 2384 ( "<" PGNSP PGUID b f f 1184 1082 16 2362 2387 timestamptz_lt_date scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 2385 ( "<=" PGNSP PGUID b f f 1184 1082 16 2361 2388 timestamptz_le_date scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 2386 ( "=" PGNSP PGUID b t f 1184 1082 16 2360 2389 timestamptz_eq_date eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 2387 ( ">=" PGNSP PGUID b f f 1184 1082 16 2359 2384 timestamptz_ge_date scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 2388 ( ">" PGNSP PGUID b f f 1184 1082 16 2358 2385 timestamptz_gt_date scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 2389 ( "<>" PGNSP PGUID b f f 1184 1082 16 2363 2386 timestamptz_ne_date neqsel neqjoinsel )); DESCR("not equal"); /* crosstype operations for timestamp vs. timestamptz */ DATA(insert OID = 2534 ( "<" PGNSP PGUID b f f 1114 1184 16 2544 2537 timestamp_lt_timestamptz scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 2535 ( "<=" PGNSP PGUID b f f 1114 1184 16 2543 2538 timestamp_le_timestamptz scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 2536 ( "=" PGNSP PGUID b t f 1114 1184 16 2542 2539 timestamp_eq_timestamptz eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 2537 ( ">=" PGNSP PGUID b f f 1114 1184 16 2541 2534 timestamp_ge_timestamptz scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 2538 ( ">" PGNSP PGUID b f f 1114 1184 16 2540 2535 timestamp_gt_timestamptz scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 2539 ( "<>" PGNSP PGUID b f f 1114 1184 16 2545 2536 timestamp_ne_timestamptz neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 2540 ( "<" PGNSP PGUID b f f 1184 1114 16 2538 2543 timestamptz_lt_timestamp scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 2541 ( "<=" PGNSP PGUID b f f 1184 1114 16 2537 2544 timestamptz_le_timestamp scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 2542 ( "=" PGNSP PGUID b t f 1184 1114 16 2536 2545 timestamptz_eq_timestamp eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 2543 ( ">=" PGNSP PGUID b f f 1184 1114 16 2535 2540 timestamptz_ge_timestamp scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 2544 ( ">" PGNSP PGUID b f f 1184 1114 16 2534 2541 timestamptz_gt_timestamp scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 2545 ( "<>" PGNSP PGUID b f f 1184 1114 16 2539 2542 timestamptz_ne_timestamp neqsel neqjoinsel )); DESCR("not equal"); /* formerly-missing interval + datetime operators */ DATA(insert OID = 2551 ( "+" PGNSP PGUID b f f 1186 1082 1114 1076 0 interval_pl_date - - )); DESCR("add"); DATA(insert OID = 2552 ( "+" PGNSP PGUID b f f 1186 1266 1266 1802 0 interval_pl_timetz - - )); DESCR("add"); DATA(insert OID = 2553 ( "+" PGNSP PGUID b f f 1186 1114 1114 2066 0 interval_pl_timestamp - - )); DESCR("add"); DATA(insert OID = 2554 ( "+" PGNSP PGUID b f f 1186 1184 1184 1327 0 interval_pl_timestamptz - - )); DESCR("add"); DATA(insert OID = 2555 ( "+" PGNSP PGUID b f f 23 1082 1082 1100 0 integer_pl_date - - )); DESCR("add"); /* new operators for Y-direction rtree opfamilies */ DATA(insert OID = 2570 ( "<<|" PGNSP PGUID b f f 603 603 16 0 0 box_below positionsel positionjoinsel )); DESCR("is below"); DATA(insert OID = 2571 ( "&<|" PGNSP PGUID b f f 603 603 16 0 0 box_overbelow positionsel positionjoinsel )); DESCR("overlaps or is below"); DATA(insert OID = 2572 ( "|&>" PGNSP PGUID b f f 603 603 16 0 0 box_overabove positionsel positionjoinsel )); DESCR("overlaps or is above"); DATA(insert OID = 2573 ( "|>>" PGNSP PGUID b f f 603 603 16 0 0 box_above positionsel positionjoinsel )); DESCR("is above"); DATA(insert OID = 2574 ( "<<|" PGNSP PGUID b f f 604 604 16 0 0 poly_below positionsel positionjoinsel )); DESCR("is below"); DATA(insert OID = 2575 ( "&<|" PGNSP PGUID b f f 604 604 16 0 0 poly_overbelow positionsel positionjoinsel )); DESCR("overlaps or is below"); DATA(insert OID = 2576 ( "|&>" PGNSP PGUID b f f 604 604 16 0 0 poly_overabove positionsel positionjoinsel )); DESCR("overlaps or is above"); DATA(insert OID = 2577 ( "|>>" PGNSP PGUID b f f 604 604 16 0 0 poly_above positionsel positionjoinsel )); DESCR("is above"); DATA(insert OID = 2589 ( "&<|" PGNSP PGUID b f f 718 718 16 0 0 circle_overbelow positionsel positionjoinsel )); DESCR("overlaps or is below"); DATA(insert OID = 2590 ( "|&>" PGNSP PGUID b f f 718 718 16 0 0 circle_overabove positionsel positionjoinsel )); DESCR("overlaps or is above"); /* overlap/contains/contained for arrays */ DATA(insert OID = 2750 ( "&&" PGNSP PGUID b f f 2277 2277 16 2750 0 arrayoverlap arraycontsel arraycontjoinsel )); DESCR("overlaps"); #define OID_ARRAY_OVERLAP_OP 2750 DATA(insert OID = 2751 ( "@>" PGNSP PGUID b f f 2277 2277 16 2752 0 arraycontains arraycontsel arraycontjoinsel )); DESCR("contains"); #define OID_ARRAY_CONTAINS_OP 2751 DATA(insert OID = 2752 ( "<@" PGNSP PGUID b f f 2277 2277 16 2751 0 arraycontained arraycontsel arraycontjoinsel )); DESCR("is contained by"); #define OID_ARRAY_CONTAINED_OP 2752 /* capturing operators to preserve pre-8.3 behavior of text concatenation */ DATA(insert OID = 2779 ( "||" PGNSP PGUID b f f 25 2776 25 0 0 textanycat - - )); DESCR("concatenate"); DATA(insert OID = 2780 ( "||" PGNSP PGUID b f f 2776 25 25 0 0 anytextcat - - )); DESCR("concatenate"); /* obsolete names for contains/contained-by operators; remove these someday */ DATA(insert OID = 2860 ( "@" PGNSP PGUID b f f 604 604 16 2861 0 poly_contained contsel contjoinsel )); DESCR("deprecated, use <@ instead"); DATA(insert OID = 2861 ( "~" PGNSP PGUID b f f 604 604 16 2860 0 poly_contain contsel contjoinsel )); DESCR("deprecated, use @> instead"); DATA(insert OID = 2862 ( "@" PGNSP PGUID b f f 603 603 16 2863 0 box_contained contsel contjoinsel )); DESCR("deprecated, use <@ instead"); DATA(insert OID = 2863 ( "~" PGNSP PGUID b f f 603 603 16 2862 0 box_contain contsel contjoinsel )); DESCR("deprecated, use @> instead"); DATA(insert OID = 2864 ( "@" PGNSP PGUID b f f 718 718 16 2865 0 circle_contained contsel contjoinsel )); DESCR("deprecated, use <@ instead"); DATA(insert OID = 2865 ( "~" PGNSP PGUID b f f 718 718 16 2864 0 circle_contain contsel contjoinsel )); DESCR("deprecated, use @> instead"); DATA(insert OID = 2866 ( "@" PGNSP PGUID b f f 600 603 16 0 0 on_pb - - )); DESCR("deprecated, use <@ instead"); DATA(insert OID = 2867 ( "@" PGNSP PGUID b f f 600 602 16 2868 0 on_ppath - - )); DESCR("deprecated, use <@ instead"); DATA(insert OID = 2868 ( "~" PGNSP PGUID b f f 602 600 16 2867 0 path_contain_pt - - )); DESCR("deprecated, use @> instead"); DATA(insert OID = 2869 ( "@" PGNSP PGUID b f f 600 604 16 2870 0 pt_contained_poly - - )); DESCR("deprecated, use <@ instead"); DATA(insert OID = 2870 ( "~" PGNSP PGUID b f f 604 600 16 2869 0 poly_contain_pt - - )); DESCR("deprecated, use @> instead"); DATA(insert OID = 2871 ( "@" PGNSP PGUID b f f 600 718 16 2872 0 pt_contained_circle - - )); DESCR("deprecated, use <@ instead"); DATA(insert OID = 2872 ( "~" PGNSP PGUID b f f 718 600 16 2871 0 circle_contain_pt - - )); DESCR("deprecated, use @> instead"); DATA(insert OID = 2873 ( "@" PGNSP PGUID b f f 600 628 16 0 0 on_pl - - )); DESCR("deprecated, use <@ instead"); DATA(insert OID = 2874 ( "@" PGNSP PGUID b f f 600 601 16 0 0 on_ps - - )); DESCR("deprecated, use <@ instead"); DATA(insert OID = 2875 ( "@" PGNSP PGUID b f f 601 628 16 0 0 on_sl - - )); DESCR("deprecated, use <@ instead"); DATA(insert OID = 2876 ( "@" PGNSP PGUID b f f 601 603 16 0 0 on_sb - - )); DESCR("deprecated, use <@ instead"); DATA(insert OID = 2877 ( "~" PGNSP PGUID b f f 1034 1033 16 0 0 aclcontains - - )); DESCR("deprecated, use @> instead"); /* uuid operators */ DATA(insert OID = 2972 ( "=" PGNSP PGUID b t t 2950 2950 16 2972 2973 uuid_eq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 2973 ( "<>" PGNSP PGUID b f f 2950 2950 16 2973 2972 uuid_ne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 2974 ( "<" PGNSP PGUID b f f 2950 2950 16 2975 2977 uuid_lt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 2975 ( ">" PGNSP PGUID b f f 2950 2950 16 2974 2976 uuid_gt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 2976 ( "<=" PGNSP PGUID b f f 2950 2950 16 2977 2975 uuid_le scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 2977 ( ">=" PGNSP PGUID b f f 2950 2950 16 2976 2974 uuid_ge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); /* enum operators */ DATA(insert OID = 3516 ( "=" PGNSP PGUID b t t 3500 3500 16 3516 3517 enum_eq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 3517 ( "<>" PGNSP PGUID b f f 3500 3500 16 3517 3516 enum_ne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 3518 ( "<" PGNSP PGUID b f f 3500 3500 16 3519 3521 enum_lt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 3519 ( ">" PGNSP PGUID b f f 3500 3500 16 3518 3520 enum_gt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 3520 ( "<=" PGNSP PGUID b f f 3500 3500 16 3521 3519 enum_le scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 3521 ( ">=" PGNSP PGUID b f f 3500 3500 16 3520 3518 enum_ge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); /* * tsearch operations */ DATA(insert OID = 3627 ( "<" PGNSP PGUID b f f 3614 3614 16 3632 3631 tsvector_lt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 3628 ( "<=" PGNSP PGUID b f f 3614 3614 16 3631 3632 tsvector_le scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 3629 ( "=" PGNSP PGUID b t f 3614 3614 16 3629 3630 tsvector_eq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 3630 ( "<>" PGNSP PGUID b f f 3614 3614 16 3630 3629 tsvector_ne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 3631 ( ">=" PGNSP PGUID b f f 3614 3614 16 3628 3627 tsvector_ge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 3632 ( ">" PGNSP PGUID b f f 3614 3614 16 3627 3628 tsvector_gt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 3633 ( "||" PGNSP PGUID b f f 3614 3614 3614 0 0 tsvector_concat - - )); DESCR("concatenate"); DATA(insert OID = 3636 ( "@@" PGNSP PGUID b f f 3614 3615 16 3637 0 ts_match_vq tsmatchsel tsmatchjoinsel )); DESCR("text search match"); DATA(insert OID = 3637 ( "@@" PGNSP PGUID b f f 3615 3614 16 3636 0 ts_match_qv tsmatchsel tsmatchjoinsel )); DESCR("text search match"); DATA(insert OID = 3660 ( "@@@" PGNSP PGUID b f f 3614 3615 16 3661 0 ts_match_vq tsmatchsel tsmatchjoinsel )); DESCR("deprecated, use @@ instead"); DATA(insert OID = 3661 ( "@@@" PGNSP PGUID b f f 3615 3614 16 3660 0 ts_match_qv tsmatchsel tsmatchjoinsel )); DESCR("deprecated, use @@ instead"); DATA(insert OID = 3674 ( "<" PGNSP PGUID b f f 3615 3615 16 3679 3678 tsquery_lt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 3675 ( "<=" PGNSP PGUID b f f 3615 3615 16 3678 3679 tsquery_le scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 3676 ( "=" PGNSP PGUID b t f 3615 3615 16 3676 3677 tsquery_eq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 3677 ( "<>" PGNSP PGUID b f f 3615 3615 16 3677 3676 tsquery_ne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 3678 ( ">=" PGNSP PGUID b f f 3615 3615 16 3675 3674 tsquery_ge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 3679 ( ">" PGNSP PGUID b f f 3615 3615 16 3674 3675 tsquery_gt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 3680 ( "&&" PGNSP PGUID b f f 3615 3615 3615 0 0 tsquery_and - - )); DESCR("AND-concatenate"); DATA(insert OID = 3681 ( "||" PGNSP PGUID b f f 3615 3615 3615 0 0 tsquery_or - - )); DESCR("OR-concatenate"); DATA(insert OID = 3682 ( "!!" PGNSP PGUID l f f 0 3615 3615 0 0 tsquery_not - - )); DESCR("NOT tsquery"); DATA(insert OID = 3693 ( "@>" PGNSP PGUID b f f 3615 3615 16 3694 0 tsq_mcontains contsel contjoinsel )); DESCR("contains"); DATA(insert OID = 3694 ( "<@" PGNSP PGUID b f f 3615 3615 16 3693 0 tsq_mcontained contsel contjoinsel )); DESCR("is contained by"); DATA(insert OID = 3762 ( "@@" PGNSP PGUID b f f 25 25 16 0 0 ts_match_tt contsel contjoinsel )); DESCR("text search match"); DATA(insert OID = 3763 ( "@@" PGNSP PGUID b f f 25 3615 16 0 0 ts_match_tq contsel contjoinsel )); DESCR("text search match"); /* generic record comparison operators */ DATA(insert OID = 2988 ( "=" PGNSP PGUID b t f 2249 2249 16 2988 2989 record_eq eqsel eqjoinsel )); DESCR("equal"); #define RECORD_EQ_OP 2988 DATA(insert OID = 2989 ( "<>" PGNSP PGUID b f f 2249 2249 16 2989 2988 record_ne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 2990 ( "<" PGNSP PGUID b f f 2249 2249 16 2991 2993 record_lt scalarltsel scalarltjoinsel )); DESCR("less than"); #define RECORD_LT_OP 2990 DATA(insert OID = 2991 ( ">" PGNSP PGUID b f f 2249 2249 16 2990 2992 record_gt scalargtsel scalargtjoinsel )); DESCR("greater than"); #define RECORD_GT_OP 2991 DATA(insert OID = 2992 ( "<=" PGNSP PGUID b f f 2249 2249 16 2993 2991 record_le scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 2993 ( ">=" PGNSP PGUID b f f 2249 2249 16 2992 2990 record_ge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); /* generic range type operators */ DATA(insert OID = 3882 ( "=" PGNSP PGUID b t t 3831 3831 16 3882 3883 range_eq eqsel eqjoinsel )); DESCR("equal"); DATA(insert OID = 3883 ( "<>" PGNSP PGUID b f f 3831 3831 16 3883 3882 range_ne neqsel neqjoinsel )); DESCR("not equal"); DATA(insert OID = 3884 ( "<" PGNSP PGUID b f f 3831 3831 16 3887 3886 range_lt scalarltsel scalarltjoinsel )); DESCR("less than"); DATA(insert OID = 3885 ( "<=" PGNSP PGUID b f f 3831 3831 16 3886 3887 range_le scalarltsel scalarltjoinsel )); DESCR("less than or equal"); DATA(insert OID = 3886 ( ">=" PGNSP PGUID b f f 3831 3831 16 3885 3884 range_ge scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); DATA(insert OID = 3887 ( ">" PGNSP PGUID b f f 3831 3831 16 3884 3885 range_gt scalargtsel scalargtjoinsel )); DESCR("greater than"); DATA(insert OID = 3888 ( "&&" PGNSP PGUID b f f 3831 3831 16 3888 0 range_overlaps areasel areajoinsel )); DESCR("overlaps"); DATA(insert OID = 3889 ( "@>" PGNSP PGUID b f f 3831 2283 16 3891 0 range_contains_elem contsel contjoinsel )); DESCR("contains"); DATA(insert OID = 3890 ( "@>" PGNSP PGUID b f f 3831 3831 16 3892 0 range_contains contsel contjoinsel )); DESCR("contains"); DATA(insert OID = 3891 ( "<@" PGNSP PGUID b f f 2283 3831 16 3889 0 elem_contained_by_range contsel contjoinsel )); DESCR("is contained by"); DATA(insert OID = 3892 ( "<@" PGNSP PGUID b f f 3831 3831 16 3890 0 range_contained_by contsel contjoinsel )); DESCR("is contained by"); DATA(insert OID = 3893 ( "<<" PGNSP PGUID b f f 3831 3831 16 3894 0 range_before scalarltsel scalarltjoinsel )); DESCR("is left of"); DATA(insert OID = 3894 ( ">>" PGNSP PGUID b f f 3831 3831 16 3893 0 range_after scalargtsel scalargtjoinsel )); DESCR("is right of"); DATA(insert OID = 3895 ( "&<" PGNSP PGUID b f f 3831 3831 16 0 0 range_overleft scalarltsel scalarltjoinsel )); DESCR("overlaps or is left of"); DATA(insert OID = 3896 ( "&>" PGNSP PGUID b f f 3831 3831 16 0 0 range_overright scalargtsel scalargtjoinsel )); DESCR("overlaps or is right of"); DATA(insert OID = 3897 ( "-|-" PGNSP PGUID b f f 3831 3831 16 3897 0 range_adjacent contsel contjoinsel )); DESCR("is adjacent to"); DATA(insert OID = 3898 ( "+" PGNSP PGUID b f f 3831 3831 3831 3898 0 range_union - - )); DESCR("range union"); DATA(insert OID = 3899 ( "-" PGNSP PGUID b f f 3831 3831 3831 0 0 range_minus - - )); DESCR("range difference"); DATA(insert OID = 3900 ( "*" PGNSP PGUID b f f 3831 3831 3831 3900 0 range_intersect - - )); DESCR("range intersection"); /* * function prototypes */ extern void OperatorCreate(const char *operatorName, Oid operatorNamespace, Oid leftTypeId, Oid rightTypeId, Oid procedureId, List *commutatorName, List *negatorName, Oid restrictionId, Oid joinId, bool canMerge, bool canHash); #endif /* PG_OPERATOR_H */ PKBiZ$f@??server/catalog/schemapg.hnu[/*------------------------------------------------------------------------- * * schemapg.h * Schema_pg_xxx macros for use by relcache.c * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * NOTES * ****************************** * *** DO NOT EDIT THIS FILE! *** * ****************************** * * It has been GENERATED by genbki.pl * *------------------------------------------------------------------------- */ #ifndef SCHEMAPG_H #define SCHEMAPG_H #define Schema_pg_proc \ { 1255, {"proname"}, 19, -1, NAMEDATALEN, 1, 0, -1, -1, false, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1255, {"pronamespace"}, 26, -1, 4, 2, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1255, {"proowner"}, 26, -1, 4, 3, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1255, {"prolang"}, 26, -1, 4, 4, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1255, {"procost"}, 700, -1, 4, 5, 0, -1, -1, FLOAT4PASSBYVAL, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1255, {"prorows"}, 700, -1, 4, 6, 0, -1, -1, FLOAT4PASSBYVAL, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1255, {"provariadic"}, 26, -1, 4, 7, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1255, {"protransform"}, 24, -1, 4, 8, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1255, {"proisagg"}, 16, -1, 1, 9, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1255, {"proiswindow"}, 16, -1, 1, 10, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1255, {"prosecdef"}, 16, -1, 1, 11, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1255, {"proleakproof"}, 16, -1, 1, 12, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1255, {"proisstrict"}, 16, -1, 1, 13, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1255, {"proretset"}, 16, -1, 1, 14, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1255, {"provolatile"}, 18, -1, 1, 15, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1255, {"pronargs"}, 21, -1, 2, 16, 0, -1, -1, true, 'p', 's', true, false, false, true, 0, 0 }, \ { 1255, {"pronargdefaults"}, 21, -1, 2, 17, 0, -1, -1, true, 'p', 's', true, false, false, true, 0, 0 }, \ { 1255, {"prorettype"}, 26, -1, 4, 18, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1255, {"proargtypes"}, 30, -1, -1, 19, 1, -1, -1, false, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1255, {"proallargtypes"}, 1028, -1, -1, 20, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, 0 }, \ { 1255, {"proargmodes"}, 1002, -1, -1, 21, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, 0 }, \ { 1255, {"proargnames"}, 1009, -1, -1, 22, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, 100 }, \ { 1255, {"proargdefaults"}, 194, -1, -1, 23, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, 100 }, \ { 1255, {"prosrc"}, 25, -1, -1, 24, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, 100 }, \ { 1255, {"probin"}, 25, -1, -1, 25, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, 100 }, \ { 1255, {"proconfig"}, 1009, -1, -1, 26, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, 100 }, \ { 1255, {"proacl"}, 1034, -1, -1, 27, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, 0 } #define Schema_pg_type \ { 1247, {"typname"}, 19, -1, NAMEDATALEN, 1, 0, -1, -1, false, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1247, {"typnamespace"}, 26, -1, 4, 2, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1247, {"typowner"}, 26, -1, 4, 3, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1247, {"typlen"}, 21, -1, 2, 4, 0, -1, -1, true, 'p', 's', true, false, false, true, 0, 0 }, \ { 1247, {"typbyval"}, 16, -1, 1, 5, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1247, {"typtype"}, 18, -1, 1, 6, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1247, {"typcategory"}, 18, -1, 1, 7, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1247, {"typispreferred"}, 16, -1, 1, 8, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1247, {"typisdefined"}, 16, -1, 1, 9, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1247, {"typdelim"}, 18, -1, 1, 10, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1247, {"typrelid"}, 26, -1, 4, 11, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1247, {"typelem"}, 26, -1, 4, 12, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1247, {"typarray"}, 26, -1, 4, 13, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1247, {"typinput"}, 24, -1, 4, 14, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1247, {"typoutput"}, 24, -1, 4, 15, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1247, {"typreceive"}, 24, -1, 4, 16, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1247, {"typsend"}, 24, -1, 4, 17, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1247, {"typmodin"}, 24, -1, 4, 18, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1247, {"typmodout"}, 24, -1, 4, 19, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1247, {"typanalyze"}, 24, -1, 4, 20, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1247, {"typalign"}, 18, -1, 1, 21, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1247, {"typstorage"}, 18, -1, 1, 22, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1247, {"typnotnull"}, 16, -1, 1, 23, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1247, {"typbasetype"}, 26, -1, 4, 24, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1247, {"typtypmod"}, 23, -1, 4, 25, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1247, {"typndims"}, 23, -1, 4, 26, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1247, {"typcollation"}, 26, -1, 4, 27, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1247, {"typdefaultbin"}, 194, -1, -1, 28, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, 100 }, \ { 1247, {"typdefault"}, 25, -1, -1, 29, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, 100 }, \ { 1247, {"typacl"}, 1034, -1, -1, 30, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, 0 } #define Schema_pg_attribute \ { 1249, {"attrelid"}, 26, -1, 4, 1, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1249, {"attname"}, 19, -1, NAMEDATALEN, 2, 0, -1, -1, false, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1249, {"atttypid"}, 26, -1, 4, 3, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1249, {"attstattarget"}, 23, -1, 4, 4, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1249, {"attlen"}, 21, -1, 2, 5, 0, -1, -1, true, 'p', 's', true, false, false, true, 0, 0 }, \ { 1249, {"attnum"}, 21, -1, 2, 6, 0, -1, -1, true, 'p', 's', true, false, false, true, 0, 0 }, \ { 1249, {"attndims"}, 23, -1, 4, 7, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1249, {"attcacheoff"}, 23, -1, 4, 8, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1249, {"atttypmod"}, 23, -1, 4, 9, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1249, {"attbyval"}, 16, -1, 1, 10, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1249, {"attstorage"}, 18, -1, 1, 11, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1249, {"attalign"}, 18, -1, 1, 12, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1249, {"attnotnull"}, 16, -1, 1, 13, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1249, {"atthasdef"}, 16, -1, 1, 14, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1249, {"attisdropped"}, 16, -1, 1, 15, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1249, {"attislocal"}, 16, -1, 1, 16, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1249, {"attinhcount"}, 23, -1, 4, 17, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1249, {"attcollation"}, 26, -1, 4, 18, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1249, {"attacl"}, 1034, -1, -1, 19, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, 0 }, \ { 1249, {"attoptions"}, 1009, -1, -1, 20, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, 100 }, \ { 1249, {"attfdwoptions"}, 1009, -1, -1, 21, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, 100 } #define Schema_pg_class \ { 1259, {"relname"}, 19, -1, NAMEDATALEN, 1, 0, -1, -1, false, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1259, {"relnamespace"}, 26, -1, 4, 2, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1259, {"reltype"}, 26, -1, 4, 3, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1259, {"reloftype"}, 26, -1, 4, 4, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1259, {"relowner"}, 26, -1, 4, 5, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1259, {"relam"}, 26, -1, 4, 6, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1259, {"relfilenode"}, 26, -1, 4, 7, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1259, {"reltablespace"}, 26, -1, 4, 8, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1259, {"relpages"}, 23, -1, 4, 9, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1259, {"reltuples"}, 700, -1, 4, 10, 0, -1, -1, FLOAT4PASSBYVAL, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1259, {"relallvisible"}, 23, -1, 4, 11, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1259, {"reltoastrelid"}, 26, -1, 4, 12, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1259, {"reltoastidxid"}, 26, -1, 4, 13, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1259, {"relhasindex"}, 16, -1, 1, 14, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1259, {"relisshared"}, 16, -1, 1, 15, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1259, {"relpersistence"}, 18, -1, 1, 16, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1259, {"relkind"}, 18, -1, 1, 17, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1259, {"relnatts"}, 21, -1, 2, 18, 0, -1, -1, true, 'p', 's', true, false, false, true, 0, 0 }, \ { 1259, {"relchecks"}, 21, -1, 2, 19, 0, -1, -1, true, 'p', 's', true, false, false, true, 0, 0 }, \ { 1259, {"relhasoids"}, 16, -1, 1, 20, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1259, {"relhaspkey"}, 16, -1, 1, 21, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1259, {"relhasrules"}, 16, -1, 1, 22, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1259, {"relhastriggers"}, 16, -1, 1, 23, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1259, {"relhassubclass"}, 16, -1, 1, 24, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1259, {"relfrozenxid"}, 28, -1, 4, 25, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1259, {"relacl"}, 1034, -1, -1, 26, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, 0 }, \ { 1259, {"reloptions"}, 1009, -1, -1, 27, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, 100 } #define Schema_pg_index \ { 2610, {"indexrelid"}, 26, -1, 4, 1, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 2610, {"indrelid"}, 26, -1, 4, 2, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 2610, {"indnatts"}, 21, -1, 2, 3, 0, -1, -1, true, 'p', 's', true, false, false, true, 0, 0 }, \ { 2610, {"indisunique"}, 16, -1, 1, 4, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 2610, {"indisprimary"}, 16, -1, 1, 5, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 2610, {"indisexclusion"}, 16, -1, 1, 6, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 2610, {"indimmediate"}, 16, -1, 1, 7, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 2610, {"indisclustered"}, 16, -1, 1, 8, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 2610, {"indisvalid"}, 16, -1, 1, 9, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 2610, {"indcheckxmin"}, 16, -1, 1, 10, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 2610, {"indisready"}, 16, -1, 1, 11, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 2610, {"indkey"}, 22, -1, -1, 12, 1, -1, -1, false, 'p', 'i', true, false, false, true, 0, 0 }, \ { 2610, {"indcollation"}, 30, -1, -1, 13, 1, -1, -1, false, 'p', 'i', true, false, false, true, 0, 0 }, \ { 2610, {"indclass"}, 30, -1, -1, 14, 1, -1, -1, false, 'p', 'i', true, false, false, true, 0, 0 }, \ { 2610, {"indoption"}, 22, -1, -1, 15, 1, -1, -1, false, 'p', 'i', true, false, false, true, 0, 0 }, \ { 2610, {"indexprs"}, 194, -1, -1, 16, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, 100 }, \ { 2610, {"indpred"}, 194, -1, -1, 17, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, 100 } #define Schema_pg_database \ { 1262, {"datname"}, 19, -1, NAMEDATALEN, 1, 0, -1, -1, false, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1262, {"datdba"}, 26, -1, 4, 2, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1262, {"encoding"}, 23, -1, 4, 3, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1262, {"datcollate"}, 19, -1, NAMEDATALEN, 4, 0, -1, -1, false, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1262, {"datctype"}, 19, -1, NAMEDATALEN, 5, 0, -1, -1, false, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1262, {"datistemplate"}, 16, -1, 1, 6, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1262, {"datallowconn"}, 16, -1, 1, 7, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1262, {"datconnlimit"}, 23, -1, 4, 8, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1262, {"datlastsysoid"}, 26, -1, 4, 9, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1262, {"datfrozenxid"}, 28, -1, 4, 10, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1262, {"dattablespace"}, 26, -1, 4, 11, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1262, {"datacl"}, 1034, -1, -1, 12, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, 0 } #define Schema_pg_authid \ { 1260, {"rolname"}, 19, -1, NAMEDATALEN, 1, 0, -1, -1, false, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1260, {"rolsuper"}, 16, -1, 1, 2, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1260, {"rolinherit"}, 16, -1, 1, 3, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1260, {"rolcreaterole"}, 16, -1, 1, 4, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1260, {"rolcreatedb"}, 16, -1, 1, 5, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1260, {"rolcatupdate"}, 16, -1, 1, 6, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1260, {"rolcanlogin"}, 16, -1, 1, 7, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1260, {"rolreplication"}, 16, -1, 1, 8, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 }, \ { 1260, {"rolconnlimit"}, 23, -1, 4, 9, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1260, {"rolpassword"}, 25, -1, -1, 10, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, 100 }, \ { 1260, {"rolvaliduntil"}, 1184, -1, 8, 11, 0, -1, -1, FLOAT8PASSBYVAL, 'p', 'd', false, false, false, true, 0, 0 } #define Schema_pg_auth_members \ { 1261, {"roleid"}, 26, -1, 4, 1, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1261, {"member"}, 26, -1, 4, 2, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1261, {"grantor"}, 26, -1, 4, 3, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, 0 }, \ { 1261, {"admin_option"}, 16, -1, 1, 4, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, 0 } #endif /* SCHEMAPG_H */ PKBiZx9%%server/catalog/dependency.hnu[/*------------------------------------------------------------------------- * * dependency.h * Routines to support inter-object dependencies. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/dependency.h * *------------------------------------------------------------------------- */ #ifndef DEPENDENCY_H #define DEPENDENCY_H #include "catalog/objectaddress.h" /* * Precise semantics of a dependency relationship are specified by the * DependencyType code (which is stored in a "char" field in pg_depend, * so we assign ASCII-code values to the enumeration members). * * In all cases, a dependency relationship indicates that the referenced * object may not be dropped without also dropping the dependent object. * However, there are several subflavors: * * DEPENDENCY_NORMAL ('n'): normal relationship between separately-created * objects. The dependent object may be dropped without affecting the * referenced object. The referenced object may only be dropped by * specifying CASCADE, in which case the dependent object is dropped too. * Example: a table column has a normal dependency on its datatype. * * DEPENDENCY_AUTO ('a'): the dependent object can be dropped separately * from the referenced object, and should be automatically dropped * (regardless of RESTRICT or CASCADE mode) if the referenced object * is dropped. * Example: a named constraint on a table is made auto-dependent on * the table, so that it will go away if the table is dropped. * * DEPENDENCY_INTERNAL ('i'): the dependent object was created as part * of creation of the referenced object, and is really just a part of * its internal implementation. A DROP of the dependent object will be * disallowed outright (we'll tell the user to issue a DROP against the * referenced object, instead). A DROP of the referenced object will be * propagated through to drop the dependent object whether CASCADE is * specified or not. * Example: a trigger that's created to enforce a foreign-key constraint * is made internally dependent on the constraint's pg_constraint entry. * * DEPENDENCY_EXTENSION ('e'): the dependent object is a member of the * extension that is the referenced object. The dependent object can be * dropped only via DROP EXTENSION on the referenced object. Functionally * this dependency type acts the same as an internal dependency, but it's * kept separate for clarity and to simplify pg_dump. * * DEPENDENCY_PIN ('p'): there is no dependent object; this type of entry * is a signal that the system itself depends on the referenced object, * and so that object must never be deleted. Entries of this type are * created only during initdb. The fields for the dependent object * contain zeroes. * * Other dependency flavors may be needed in future. */ typedef enum DependencyType { DEPENDENCY_NORMAL = 'n', DEPENDENCY_AUTO = 'a', DEPENDENCY_INTERNAL = 'i', DEPENDENCY_EXTENSION = 'e', DEPENDENCY_PIN = 'p' } DependencyType; /* * There is also a SharedDependencyType enum type that determines the exact * semantics of an entry in pg_shdepend. Just like regular dependency entries, * any pg_shdepend entry means that the referenced object cannot be dropped * unless the dependent object is dropped at the same time. There are some * additional rules however: * * (a) For a SHARED_DEPENDENCY_PIN entry, there is no dependent object -- * rather, the referenced object is an essential part of the system. This * applies to the initdb-created superuser. Entries of this type are only * created by initdb; objects in this category don't need further pg_shdepend * entries if more objects come to depend on them. * * (b) a SHARED_DEPENDENCY_OWNER entry means that the referenced object is * the role owning the dependent object. The referenced object must be * a pg_authid entry. * * (c) a SHARED_DEPENDENCY_ACL entry means that the referenced object is * a role mentioned in the ACL field of the dependent object. The referenced * object must be a pg_authid entry. (SHARED_DEPENDENCY_ACL entries are not * created for the owner of an object; hence two objects may be linked by * one or the other, but not both, of these dependency types.) * * SHARED_DEPENDENCY_INVALID is a value used as a parameter in internal * routines, and is not valid in the catalog itself. */ typedef enum SharedDependencyType { SHARED_DEPENDENCY_PIN = 'p', SHARED_DEPENDENCY_OWNER = 'o', SHARED_DEPENDENCY_ACL = 'a', SHARED_DEPENDENCY_INVALID = 0 } SharedDependencyType; /* expansible list of ObjectAddresses (private in dependency.c) */ typedef struct ObjectAddresses ObjectAddresses; /* * This enum covers all system catalogs whose OIDs can appear in * pg_depend.classId or pg_shdepend.classId. */ typedef enum ObjectClass { OCLASS_CLASS, /* pg_class */ OCLASS_PROC, /* pg_proc */ OCLASS_TYPE, /* pg_type */ OCLASS_CAST, /* pg_cast */ OCLASS_COLLATION, /* pg_collation */ OCLASS_CONSTRAINT, /* pg_constraint */ OCLASS_CONVERSION, /* pg_conversion */ OCLASS_DEFAULT, /* pg_attrdef */ OCLASS_LANGUAGE, /* pg_language */ OCLASS_LARGEOBJECT, /* pg_largeobject */ OCLASS_OPERATOR, /* pg_operator */ OCLASS_OPCLASS, /* pg_opclass */ OCLASS_OPFAMILY, /* pg_opfamily */ OCLASS_AMOP, /* pg_amop */ OCLASS_AMPROC, /* pg_amproc */ OCLASS_REWRITE, /* pg_rewrite */ OCLASS_TRIGGER, /* pg_trigger */ OCLASS_SCHEMA, /* pg_namespace */ OCLASS_TSPARSER, /* pg_ts_parser */ OCLASS_TSDICT, /* pg_ts_dict */ OCLASS_TSTEMPLATE, /* pg_ts_template */ OCLASS_TSCONFIG, /* pg_ts_config */ OCLASS_ROLE, /* pg_authid */ OCLASS_DATABASE, /* pg_database */ OCLASS_TBLSPACE, /* pg_tablespace */ OCLASS_FDW, /* pg_foreign_data_wrapper */ OCLASS_FOREIGN_SERVER, /* pg_foreign_server */ OCLASS_USER_MAPPING, /* pg_user_mapping */ OCLASS_DEFACL, /* pg_default_acl */ OCLASS_EXTENSION, /* pg_extension */ MAX_OCLASS /* MUST BE LAST */ } ObjectClass; /* in dependency.c */ #define PERFORM_DELETION_INTERNAL 0x0001 #define PERFORM_DELETION_CONCURRENTLY 0x0002 extern void performDeletion(const ObjectAddress *object, DropBehavior behavior, int flags); extern void performMultipleDeletions(const ObjectAddresses *objects, DropBehavior behavior, int flags); extern void deleteWhatDependsOn(const ObjectAddress *object, bool showNotices); extern void recordDependencyOnExpr(const ObjectAddress *depender, Node *expr, List *rtable, DependencyType behavior); extern void recordDependencyOnSingleRelExpr(const ObjectAddress *depender, Node *expr, Oid relId, DependencyType behavior, DependencyType self_behavior); extern ObjectClass getObjectClass(const ObjectAddress *object); extern char *getObjectDescription(const ObjectAddress *object); extern char *getObjectDescriptionOids(Oid classid, Oid objid); extern ObjectAddresses *new_object_addresses(void); extern void add_exact_object_address(const ObjectAddress *object, ObjectAddresses *addrs); extern bool object_address_present(const ObjectAddress *object, const ObjectAddresses *addrs); extern void record_object_address_dependencies(const ObjectAddress *depender, ObjectAddresses *referenced, DependencyType behavior); extern void free_object_addresses(ObjectAddresses *addrs); /* in pg_depend.c */ extern void recordDependencyOn(const ObjectAddress *depender, const ObjectAddress *referenced, DependencyType behavior); extern void recordMultipleDependencies(const ObjectAddress *depender, const ObjectAddress *referenced, int nreferenced, DependencyType behavior); extern void recordDependencyOnCurrentExtension(const ObjectAddress *object, bool isReplace); extern long deleteDependencyRecordsFor(Oid classId, Oid objectId, bool skipExtensionDeps); extern long deleteDependencyRecordsForClass(Oid classId, Oid objectId, Oid refclassId, char deptype); extern long changeDependencyFor(Oid classId, Oid objectId, Oid refClassId, Oid oldRefObjectId, Oid newRefObjectId); extern Oid getExtensionOfObject(Oid classId, Oid objectId); extern bool sequenceIsOwned(Oid seqId, Oid *tableId, int32 *colId); extern void markSequenceUnowned(Oid seqId); extern List *getOwnedSequences(Oid relid); extern Oid get_constraint_index(Oid constraintId); extern Oid get_index_constraint(Oid indexId); /* in pg_shdepend.c */ extern void recordSharedDependencyOn(ObjectAddress *depender, ObjectAddress *referenced, SharedDependencyType deptype); extern void deleteSharedDependencyRecordsFor(Oid classId, Oid objectId, int32 objectSubId); extern void recordDependencyOnOwner(Oid classId, Oid objectId, Oid owner); extern void changeDependencyOnOwner(Oid classId, Oid objectId, Oid newOwnerId); extern void updateAclDependencies(Oid classId, Oid objectId, int32 objectSubId, Oid ownerId, int noldmembers, Oid *oldmembers, int nnewmembers, Oid *newmembers); extern bool checkSharedDependencies(Oid classId, Oid objectId, char **detail_msg, char **detail_log_msg); extern void shdepLockAndCheckObject(Oid classId, Oid objectId); extern void copyTemplateDependencies(Oid templateDbId, Oid newDbId); extern void dropDatabaseDependencies(Oid databaseId); extern void shdepDropOwned(List *relids, DropBehavior behavior); extern void shdepReassignOwned(List *relids, Oid newrole); #endif /* DEPENDENCY_H */ PKBiZÇs 8 8server/catalog/pg_amproc.hnu[/*------------------------------------------------------------------------- * * pg_amproc.h * definition of the system "amproc" relation (pg_amproc) * along with the relation's initial contents. * * The amproc table identifies support procedures associated with index * operator families and classes. These procedures can't be listed in pg_amop * since they are not the implementation of any indexable operator. * * The primary key for this table is . The "default" support functions for a * particular opclass within the family are those with amproclefttype = * amprocrighttype = opclass's opcintype. These are the ones loaded into the * relcache for an index and typically used for internal index operations. * Other support functions are typically used to handle cross-type indexable * operators with oprleft/oprright matching the entry's amproclefttype and * amprocrighttype. The exact behavior depends on the index AM, however, and * some don't pay attention to non-default functions at all. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_amproc.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * *------------------------------------------------------------------------- */ #ifndef PG_AMPROC_H #define PG_AMPROC_H #include "catalog/genbki.h" /* ---------------- * pg_amproc definition. cpp turns this into * typedef struct FormData_pg_amproc * ---------------- */ #define AccessMethodProcedureRelationId 2603 CATALOG(pg_amproc,2603) { Oid amprocfamily; /* the index opfamily this entry is for */ Oid amproclefttype; /* procedure's left input data type */ Oid amprocrighttype; /* procedure's right input data type */ int2 amprocnum; /* support procedure index */ regproc amproc; /* OID of the proc */ } FormData_pg_amproc; /* ---------------- * Form_pg_amproc corresponds to a pointer to a tuple with * the format of pg_amproc relation. * ---------------- */ typedef FormData_pg_amproc *Form_pg_amproc; /* ---------------- * compiler constants for pg_amproc * ---------------- */ #define Natts_pg_amproc 5 #define Anum_pg_amproc_amprocfamily 1 #define Anum_pg_amproc_amproclefttype 2 #define Anum_pg_amproc_amprocrighttype 3 #define Anum_pg_amproc_amprocnum 4 #define Anum_pg_amproc_amproc 5 /* ---------------- * initial contents of pg_amproc * ---------------- */ /* btree */ DATA(insert ( 397 2277 2277 1 382 )); DATA(insert ( 421 702 702 1 357 )); DATA(insert ( 423 1560 1560 1 1596 )); DATA(insert ( 424 16 16 1 1693 )); DATA(insert ( 426 1042 1042 1 1078 )); DATA(insert ( 428 17 17 1 1954 )); DATA(insert ( 429 18 18 1 358 )); DATA(insert ( 434 1082 1082 1 1092 )); DATA(insert ( 434 1082 1082 2 3136 )); DATA(insert ( 434 1082 1114 1 2344 )); DATA(insert ( 434 1082 1184 1 2357 )); DATA(insert ( 434 1114 1114 1 2045 )); DATA(insert ( 434 1114 1114 2 3137 )); DATA(insert ( 434 1114 1082 1 2370 )); DATA(insert ( 434 1114 1184 1 2526 )); DATA(insert ( 434 1184 1184 1 1314 )); DATA(insert ( 434 1184 1184 2 3137 )); DATA(insert ( 434 1184 1082 1 2383 )); DATA(insert ( 434 1184 1114 1 2533 )); DATA(insert ( 1970 700 700 1 354 )); DATA(insert ( 1970 700 700 2 3132 )); DATA(insert ( 1970 700 701 1 2194 )); DATA(insert ( 1970 701 701 1 355 )); DATA(insert ( 1970 701 701 2 3133 )); DATA(insert ( 1970 701 700 1 2195 )); DATA(insert ( 1974 869 869 1 926 )); DATA(insert ( 1976 21 21 1 350 )); DATA(insert ( 1976 21 21 2 3129 )); DATA(insert ( 1976 21 23 1 2190 )); DATA(insert ( 1976 21 20 1 2192 )); DATA(insert ( 1976 23 23 1 351 )); DATA(insert ( 1976 23 23 2 3130 )); DATA(insert ( 1976 23 20 1 2188 )); DATA(insert ( 1976 23 21 1 2191 )); DATA(insert ( 1976 20 20 1 842 )); DATA(insert ( 1976 20 20 2 3131 )); DATA(insert ( 1976 20 23 1 2189 )); DATA(insert ( 1976 20 21 1 2193 )); DATA(insert ( 1982 1186 1186 1 1315 )); DATA(insert ( 1984 829 829 1 836 )); DATA(insert ( 1986 19 19 1 359 )); DATA(insert ( 1986 19 19 2 3135 )); DATA(insert ( 1988 1700 1700 1 1769 )); DATA(insert ( 1989 26 26 1 356 )); DATA(insert ( 1989 26 26 2 3134 )); DATA(insert ( 1991 30 30 1 404 )); DATA(insert ( 2994 2249 2249 1 2987 )); DATA(insert ( 1994 25 25 1 360 )); DATA(insert ( 1996 1083 1083 1 1107 )); DATA(insert ( 2000 1266 1266 1 1358 )); DATA(insert ( 2002 1562 1562 1 1672 )); DATA(insert ( 2095 25 25 1 2166 )); DATA(insert ( 2097 1042 1042 1 2180 )); DATA(insert ( 2099 790 790 1 377 )); DATA(insert ( 2233 703 703 1 380 )); DATA(insert ( 2234 704 704 1 381 )); DATA(insert ( 2789 27 27 1 2794 )); DATA(insert ( 2968 2950 2950 1 2960 )); DATA(insert ( 3522 3500 3500 1 3514 )); /* hash */ DATA(insert ( 427 1042 1042 1 1080 )); DATA(insert ( 431 18 18 1 454 )); DATA(insert ( 435 1082 1082 1 450 )); DATA(insert ( 627 2277 2277 1 626 )); DATA(insert ( 1971 700 700 1 451 )); DATA(insert ( 1971 701 701 1 452 )); DATA(insert ( 1975 869 869 1 422 )); DATA(insert ( 1977 21 21 1 449 )); DATA(insert ( 1977 23 23 1 450 )); DATA(insert ( 1977 20 20 1 949 )); DATA(insert ( 1983 1186 1186 1 1697 )); DATA(insert ( 1985 829 829 1 399 )); DATA(insert ( 1987 19 19 1 455 )); DATA(insert ( 1990 26 26 1 453 )); DATA(insert ( 1992 30 30 1 457 )); DATA(insert ( 1995 25 25 1 400 )); DATA(insert ( 1997 1083 1083 1 1688 )); DATA(insert ( 1998 1700 1700 1 432 )); DATA(insert ( 1999 1184 1184 1 2039 )); DATA(insert ( 2001 1266 1266 1 1696 )); DATA(insert ( 2040 1114 1114 1 2039 )); DATA(insert ( 2222 16 16 1 454 )); DATA(insert ( 2223 17 17 1 456 )); DATA(insert ( 2224 22 22 1 398 )); DATA(insert ( 2225 28 28 1 450 )); DATA(insert ( 2226 29 29 1 450 )); DATA(insert ( 2227 702 702 1 450 )); DATA(insert ( 2228 703 703 1 450 )); DATA(insert ( 2229 25 25 1 400 )); DATA(insert ( 2231 1042 1042 1 1080 )); DATA(insert ( 2235 1033 1033 1 329 )); DATA(insert ( 2969 2950 2950 1 2963 )); DATA(insert ( 3523 3500 3500 1 3515 )); /* gist */ DATA(insert ( 2593 603 603 1 2578 )); DATA(insert ( 2593 603 603 2 2583 )); DATA(insert ( 2593 603 603 3 2579 )); DATA(insert ( 2593 603 603 4 2580 )); DATA(insert ( 2593 603 603 5 2581 )); DATA(insert ( 2593 603 603 6 2582 )); DATA(insert ( 2593 603 603 7 2584 )); DATA(insert ( 2594 604 604 1 2585 )); DATA(insert ( 2594 604 604 2 2583 )); DATA(insert ( 2594 604 604 3 2586 )); DATA(insert ( 2594 604 604 4 2580 )); DATA(insert ( 2594 604 604 5 2581 )); DATA(insert ( 2594 604 604 6 2582 )); DATA(insert ( 2594 604 604 7 2584 )); DATA(insert ( 2595 718 718 1 2591 )); DATA(insert ( 2595 718 718 2 2583 )); DATA(insert ( 2595 718 718 3 2592 )); DATA(insert ( 2595 718 718 4 2580 )); DATA(insert ( 2595 718 718 5 2581 )); DATA(insert ( 2595 718 718 6 2582 )); DATA(insert ( 2595 718 718 7 2584 )); DATA(insert ( 3655 3614 3614 1 3654 )); DATA(insert ( 3655 3614 3614 2 3651 )); DATA(insert ( 3655 3614 3614 3 3648 )); DATA(insert ( 3655 3614 3614 4 3649 )); DATA(insert ( 3655 3614 3614 5 3653 )); DATA(insert ( 3655 3614 3614 6 3650 )); DATA(insert ( 3655 3614 3614 7 3652 )); DATA(insert ( 3702 3615 3615 1 3701 )); DATA(insert ( 3702 3615 3615 2 3698 )); DATA(insert ( 3702 3615 3615 3 3695 )); DATA(insert ( 3702 3615 3615 4 3696 )); DATA(insert ( 3702 3615 3615 5 3700 )); DATA(insert ( 3702 3615 3615 6 3697 )); DATA(insert ( 3702 3615 3615 7 3699 )); DATA(insert ( 1029 600 600 1 2179 )); DATA(insert ( 1029 600 600 2 2583 )); DATA(insert ( 1029 600 600 3 1030 )); DATA(insert ( 1029 600 600 4 2580 )); DATA(insert ( 1029 600 600 5 2581 )); DATA(insert ( 1029 600 600 6 2582 )); DATA(insert ( 1029 600 600 7 2584 )); DATA(insert ( 1029 600 600 8 3064 )); /* gin */ DATA(insert ( 2745 1007 1007 1 351 )); DATA(insert ( 2745 1007 1007 2 2743 )); DATA(insert ( 2745 1007 1007 3 2774 )); DATA(insert ( 2745 1007 1007 4 2744 )); DATA(insert ( 2745 1009 1009 1 360 )); DATA(insert ( 2745 1009 1009 2 2743 )); DATA(insert ( 2745 1009 1009 3 2774 )); DATA(insert ( 2745 1009 1009 4 2744 )); DATA(insert ( 2745 1015 1015 1 360 )); DATA(insert ( 2745 1015 1015 2 2743 )); DATA(insert ( 2745 1015 1015 3 2774 )); DATA(insert ( 2745 1015 1015 4 2744 )); DATA(insert ( 2745 1023 1023 1 357 )); DATA(insert ( 2745 1023 1023 2 2743 )); DATA(insert ( 2745 1023 1023 3 2774 )); DATA(insert ( 2745 1023 1023 4 2744 )); DATA(insert ( 2745 1561 1561 1 1596 )); DATA(insert ( 2745 1561 1561 2 2743 )); DATA(insert ( 2745 1561 1561 3 2774 )); DATA(insert ( 2745 1561 1561 4 2744 )); DATA(insert ( 2745 1000 1000 1 1693 )); DATA(insert ( 2745 1000 1000 2 2743 )); DATA(insert ( 2745 1000 1000 3 2774 )); DATA(insert ( 2745 1000 1000 4 2744 )); DATA(insert ( 2745 1014 1014 1 1078 )); DATA(insert ( 2745 1014 1014 2 2743 )); DATA(insert ( 2745 1014 1014 3 2774 )); DATA(insert ( 2745 1014 1014 4 2744 )); DATA(insert ( 2745 1001 1001 1 1954 )); DATA(insert ( 2745 1001 1001 2 2743 )); DATA(insert ( 2745 1001 1001 3 2774 )); DATA(insert ( 2745 1001 1001 4 2744 )); DATA(insert ( 2745 1002 1002 1 358 )); DATA(insert ( 2745 1002 1002 2 2743 )); DATA(insert ( 2745 1002 1002 3 2774 )); DATA(insert ( 2745 1002 1002 4 2744 )); DATA(insert ( 2745 1182 1182 1 1092 )); DATA(insert ( 2745 1182 1182 2 2743 )); DATA(insert ( 2745 1182 1182 3 2774 )); DATA(insert ( 2745 1182 1182 4 2744 )); DATA(insert ( 2745 1021 1021 1 354 )); DATA(insert ( 2745 1021 1021 2 2743 )); DATA(insert ( 2745 1021 1021 3 2774 )); DATA(insert ( 2745 1021 1021 4 2744 )); DATA(insert ( 2745 1022 1022 1 355 )); DATA(insert ( 2745 1022 1022 2 2743 )); DATA(insert ( 2745 1022 1022 3 2774 )); DATA(insert ( 2745 1022 1022 4 2744 )); DATA(insert ( 2745 1041 1041 1 926 )); DATA(insert ( 2745 1041 1041 2 2743 )); DATA(insert ( 2745 1041 1041 3 2774 )); DATA(insert ( 2745 1041 1041 4 2744 )); DATA(insert ( 2745 651 651 1 926 )); DATA(insert ( 2745 651 651 2 2743 )); DATA(insert ( 2745 651 651 3 2774 )); DATA(insert ( 2745 651 651 4 2744 )); DATA(insert ( 2745 1005 1005 1 350 )); DATA(insert ( 2745 1005 1005 2 2743 )); DATA(insert ( 2745 1005 1005 3 2774 )); DATA(insert ( 2745 1005 1005 4 2744 )); DATA(insert ( 2745 1016 1016 1 842 )); DATA(insert ( 2745 1016 1016 2 2743 )); DATA(insert ( 2745 1016 1016 3 2774 )); DATA(insert ( 2745 1016 1016 4 2744 )); DATA(insert ( 2745 1187 1187 1 1315 )); DATA(insert ( 2745 1187 1187 2 2743 )); DATA(insert ( 2745 1187 1187 3 2774 )); DATA(insert ( 2745 1187 1187 4 2744 )); DATA(insert ( 2745 1040 1040 1 836 )); DATA(insert ( 2745 1040 1040 2 2743 )); DATA(insert ( 2745 1040 1040 3 2774 )); DATA(insert ( 2745 1040 1040 4 2744 )); DATA(insert ( 2745 1003 1003 1 359 )); DATA(insert ( 2745 1003 1003 2 2743 )); DATA(insert ( 2745 1003 1003 3 2774 )); DATA(insert ( 2745 1003 1003 4 2744 )); DATA(insert ( 2745 1231 1231 1 1769 )); DATA(insert ( 2745 1231 1231 2 2743 )); DATA(insert ( 2745 1231 1231 3 2774 )); DATA(insert ( 2745 1231 1231 4 2744 )); DATA(insert ( 2745 1028 1028 1 356 )); DATA(insert ( 2745 1028 1028 2 2743 )); DATA(insert ( 2745 1028 1028 3 2774 )); DATA(insert ( 2745 1028 1028 4 2744 )); DATA(insert ( 2745 1013 1013 1 404 )); DATA(insert ( 2745 1013 1013 2 2743 )); DATA(insert ( 2745 1013 1013 3 2774 )); DATA(insert ( 2745 1013 1013 4 2744 )); DATA(insert ( 2745 1183 1183 1 1107 )); DATA(insert ( 2745 1183 1183 2 2743 )); DATA(insert ( 2745 1183 1183 3 2774 )); DATA(insert ( 2745 1183 1183 4 2744 )); DATA(insert ( 2745 1185 1185 1 1314 )); DATA(insert ( 2745 1185 1185 2 2743 )); DATA(insert ( 2745 1185 1185 3 2774 )); DATA(insert ( 2745 1185 1185 4 2744 )); DATA(insert ( 2745 1270 1270 1 1358 )); DATA(insert ( 2745 1270 1270 2 2743 )); DATA(insert ( 2745 1270 1270 3 2774 )); DATA(insert ( 2745 1270 1270 4 2744 )); DATA(insert ( 2745 1563 1563 1 1672 )); DATA(insert ( 2745 1563 1563 2 2743 )); DATA(insert ( 2745 1563 1563 3 2774 )); DATA(insert ( 2745 1563 1563 4 2744 )); DATA(insert ( 2745 1115 1115 1 2045 )); DATA(insert ( 2745 1115 1115 2 2743 )); DATA(insert ( 2745 1115 1115 3 2774 )); DATA(insert ( 2745 1115 1115 4 2744 )); DATA(insert ( 2745 791 791 1 377 )); DATA(insert ( 2745 791 791 2 2743 )); DATA(insert ( 2745 791 791 3 2774 )); DATA(insert ( 2745 791 791 4 2744 )); DATA(insert ( 2745 1024 1024 1 380 )); DATA(insert ( 2745 1024 1024 2 2743 )); DATA(insert ( 2745 1024 1024 3 2774 )); DATA(insert ( 2745 1024 1024 4 2744 )); DATA(insert ( 2745 1025 1025 1 381 )); DATA(insert ( 2745 1025 1025 2 2743 )); DATA(insert ( 2745 1025 1025 3 2774 )); DATA(insert ( 2745 1025 1025 4 2744 )); DATA(insert ( 3659 3614 3614 1 3724 )); DATA(insert ( 3659 3614 3614 2 3656 )); DATA(insert ( 3659 3614 3614 3 3657 )); DATA(insert ( 3659 3614 3614 4 3658 )); DATA(insert ( 3659 3614 3614 5 2700 )); DATA(insert ( 3626 3614 3614 1 3622 )); DATA(insert ( 3683 3615 3615 1 3668 )); DATA(insert ( 3901 3831 3831 1 3870 )); DATA(insert ( 3903 3831 3831 1 3902 )); DATA(insert ( 3919 3831 3831 1 3875 )); DATA(insert ( 3919 3831 3831 2 3876 )); DATA(insert ( 3919 3831 3831 3 3877 )); DATA(insert ( 3919 3831 3831 4 3878 )); DATA(insert ( 3919 3831 3831 5 3879 )); DATA(insert ( 3919 3831 3831 6 3880 )); DATA(insert ( 3919 3831 3831 7 3881 )); /* sp-gist */ DATA(insert ( 4015 600 600 1 4018 )); DATA(insert ( 4015 600 600 2 4019 )); DATA(insert ( 4015 600 600 3 4020 )); DATA(insert ( 4015 600 600 4 4021 )); DATA(insert ( 4015 600 600 5 4022 )); DATA(insert ( 4016 600 600 1 4023 )); DATA(insert ( 4016 600 600 2 4024 )); DATA(insert ( 4016 600 600 3 4025 )); DATA(insert ( 4016 600 600 4 4026 )); DATA(insert ( 4016 600 600 5 4022 )); DATA(insert ( 4017 25 25 1 4027 )); DATA(insert ( 4017 25 25 2 4028 )); DATA(insert ( 4017 25 25 3 4029 )); DATA(insert ( 4017 25 25 4 4030 )); DATA(insert ( 4017 25 25 5 4031 )); #endif /* PG_AMPROC_H */ PKBiZƾ1q)q)server/catalog/pg_aggregate.hnu[/*------------------------------------------------------------------------- * * pg_aggregate.h * definition of the system "aggregate" relation (pg_aggregate) * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_aggregate.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * *------------------------------------------------------------------------- */ #ifndef PG_AGGREGATE_H #define PG_AGGREGATE_H #include "catalog/genbki.h" #include "nodes/pg_list.h" /* ---------------------------------------------------------------- * pg_aggregate definition. * * cpp turns this into typedef struct FormData_pg_aggregate * * aggfnoid pg_proc OID of the aggregate itself * aggtransfn transition function * aggfinalfn final function (0 if none) * aggsortop associated sort operator (0 if none) * aggtranstype type of aggregate's transition (state) data * agginitval initial value for transition state (can be NULL) * ---------------------------------------------------------------- */ #define AggregateRelationId 2600 CATALOG(pg_aggregate,2600) BKI_WITHOUT_OIDS { regproc aggfnoid; regproc aggtransfn; regproc aggfinalfn; Oid aggsortop; Oid aggtranstype; #ifdef CATALOG_VARLEN /* variable-length fields start here */ text agginitval; #endif } FormData_pg_aggregate; /* ---------------- * Form_pg_aggregate corresponds to a pointer to a tuple with * the format of pg_aggregate relation. * ---------------- */ typedef FormData_pg_aggregate *Form_pg_aggregate; /* ---------------- * compiler constants for pg_aggregate * ---------------- */ #define Natts_pg_aggregate 6 #define Anum_pg_aggregate_aggfnoid 1 #define Anum_pg_aggregate_aggtransfn 2 #define Anum_pg_aggregate_aggfinalfn 3 #define Anum_pg_aggregate_aggsortop 4 #define Anum_pg_aggregate_aggtranstype 5 #define Anum_pg_aggregate_agginitval 6 /* ---------------- * initial contents of pg_aggregate * --------------- */ /* avg */ DATA(insert ( 2100 int8_avg_accum numeric_avg 0 1231 "{0,0}" )); DATA(insert ( 2101 int4_avg_accum int8_avg 0 1016 "{0,0}" )); DATA(insert ( 2102 int2_avg_accum int8_avg 0 1016 "{0,0}" )); DATA(insert ( 2103 numeric_avg_accum numeric_avg 0 1231 "{0,0}" )); DATA(insert ( 2104 float4_accum float8_avg 0 1022 "{0,0,0}" )); DATA(insert ( 2105 float8_accum float8_avg 0 1022 "{0,0,0}" )); DATA(insert ( 2106 interval_accum interval_avg 0 1187 "{0 second,0 second}" )); /* sum */ DATA(insert ( 2107 int8_sum - 0 1700 _null_ )); DATA(insert ( 2108 int4_sum - 0 20 _null_ )); DATA(insert ( 2109 int2_sum - 0 20 _null_ )); DATA(insert ( 2110 float4pl - 0 700 _null_ )); DATA(insert ( 2111 float8pl - 0 701 _null_ )); DATA(insert ( 2112 cash_pl - 0 790 _null_ )); DATA(insert ( 2113 interval_pl - 0 1186 _null_ )); DATA(insert ( 2114 numeric_add - 0 1700 _null_ )); /* max */ DATA(insert ( 2115 int8larger - 413 20 _null_ )); DATA(insert ( 2116 int4larger - 521 23 _null_ )); DATA(insert ( 2117 int2larger - 520 21 _null_ )); DATA(insert ( 2118 oidlarger - 610 26 _null_ )); DATA(insert ( 2119 float4larger - 623 700 _null_ )); DATA(insert ( 2120 float8larger - 674 701 _null_ )); DATA(insert ( 2121 int4larger - 563 702 _null_ )); DATA(insert ( 2122 date_larger - 1097 1082 _null_ )); DATA(insert ( 2123 time_larger - 1112 1083 _null_ )); DATA(insert ( 2124 timetz_larger - 1554 1266 _null_ )); DATA(insert ( 2125 cashlarger - 903 790 _null_ )); DATA(insert ( 2126 timestamp_larger - 2064 1114 _null_ )); DATA(insert ( 2127 timestamptz_larger - 1324 1184 _null_ )); DATA(insert ( 2128 interval_larger - 1334 1186 _null_ )); DATA(insert ( 2129 text_larger - 666 25 _null_ )); DATA(insert ( 2130 numeric_larger - 1756 1700 _null_ )); DATA(insert ( 2050 array_larger - 1073 2277 _null_ )); DATA(insert ( 2244 bpchar_larger - 1060 1042 _null_ )); DATA(insert ( 2797 tidlarger - 2800 27 _null_ )); DATA(insert ( 3526 enum_larger - 3519 3500 _null_ )); /* min */ DATA(insert ( 2131 int8smaller - 412 20 _null_ )); DATA(insert ( 2132 int4smaller - 97 23 _null_ )); DATA(insert ( 2133 int2smaller - 95 21 _null_ )); DATA(insert ( 2134 oidsmaller - 609 26 _null_ )); DATA(insert ( 2135 float4smaller - 622 700 _null_ )); DATA(insert ( 2136 float8smaller - 672 701 _null_ )); DATA(insert ( 2137 int4smaller - 562 702 _null_ )); DATA(insert ( 2138 date_smaller - 1095 1082 _null_ )); DATA(insert ( 2139 time_smaller - 1110 1083 _null_ )); DATA(insert ( 2140 timetz_smaller - 1552 1266 _null_ )); DATA(insert ( 2141 cashsmaller - 902 790 _null_ )); DATA(insert ( 2142 timestamp_smaller - 2062 1114 _null_ )); DATA(insert ( 2143 timestamptz_smaller - 1322 1184 _null_ )); DATA(insert ( 2144 interval_smaller - 1332 1186 _null_ )); DATA(insert ( 2145 text_smaller - 664 25 _null_ )); DATA(insert ( 2146 numeric_smaller - 1754 1700 _null_ )); DATA(insert ( 2051 array_smaller - 1072 2277 _null_ )); DATA(insert ( 2245 bpchar_smaller - 1058 1042 _null_ )); DATA(insert ( 2798 tidsmaller - 2799 27 _null_ )); DATA(insert ( 3527 enum_smaller - 3518 3500 _null_ )); /* count */ DATA(insert ( 2147 int8inc_any - 0 20 "0" )); DATA(insert ( 2803 int8inc - 0 20 "0" )); /* var_pop */ DATA(insert ( 2718 int8_accum numeric_var_pop 0 1231 "{0,0,0}" )); DATA(insert ( 2719 int4_accum numeric_var_pop 0 1231 "{0,0,0}" )); DATA(insert ( 2720 int2_accum numeric_var_pop 0 1231 "{0,0,0}" )); DATA(insert ( 2721 float4_accum float8_var_pop 0 1022 "{0,0,0}" )); DATA(insert ( 2722 float8_accum float8_var_pop 0 1022 "{0,0,0}" )); DATA(insert ( 2723 numeric_accum numeric_var_pop 0 1231 "{0,0,0}" )); /* var_samp */ DATA(insert ( 2641 int8_accum numeric_var_samp 0 1231 "{0,0,0}" )); DATA(insert ( 2642 int4_accum numeric_var_samp 0 1231 "{0,0,0}" )); DATA(insert ( 2643 int2_accum numeric_var_samp 0 1231 "{0,0,0}" )); DATA(insert ( 2644 float4_accum float8_var_samp 0 1022 "{0,0,0}" )); DATA(insert ( 2645 float8_accum float8_var_samp 0 1022 "{0,0,0}" )); DATA(insert ( 2646 numeric_accum numeric_var_samp 0 1231 "{0,0,0}" )); /* variance: historical Postgres syntax for var_samp */ DATA(insert ( 2148 int8_accum numeric_var_samp 0 1231 "{0,0,0}" )); DATA(insert ( 2149 int4_accum numeric_var_samp 0 1231 "{0,0,0}" )); DATA(insert ( 2150 int2_accum numeric_var_samp 0 1231 "{0,0,0}" )); DATA(insert ( 2151 float4_accum float8_var_samp 0 1022 "{0,0,0}" )); DATA(insert ( 2152 float8_accum float8_var_samp 0 1022 "{0,0,0}" )); DATA(insert ( 2153 numeric_accum numeric_var_samp 0 1231 "{0,0,0}" )); /* stddev_pop */ DATA(insert ( 2724 int8_accum numeric_stddev_pop 0 1231 "{0,0,0}" )); DATA(insert ( 2725 int4_accum numeric_stddev_pop 0 1231 "{0,0,0}" )); DATA(insert ( 2726 int2_accum numeric_stddev_pop 0 1231 "{0,0,0}" )); DATA(insert ( 2727 float4_accum float8_stddev_pop 0 1022 "{0,0,0}" )); DATA(insert ( 2728 float8_accum float8_stddev_pop 0 1022 "{0,0,0}" )); DATA(insert ( 2729 numeric_accum numeric_stddev_pop 0 1231 "{0,0,0}" )); /* stddev_samp */ DATA(insert ( 2712 int8_accum numeric_stddev_samp 0 1231 "{0,0,0}" )); DATA(insert ( 2713 int4_accum numeric_stddev_samp 0 1231 "{0,0,0}" )); DATA(insert ( 2714 int2_accum numeric_stddev_samp 0 1231 "{0,0,0}" )); DATA(insert ( 2715 float4_accum float8_stddev_samp 0 1022 "{0,0,0}" )); DATA(insert ( 2716 float8_accum float8_stddev_samp 0 1022 "{0,0,0}" )); DATA(insert ( 2717 numeric_accum numeric_stddev_samp 0 1231 "{0,0,0}" )); /* stddev: historical Postgres syntax for stddev_samp */ DATA(insert ( 2154 int8_accum numeric_stddev_samp 0 1231 "{0,0,0}" )); DATA(insert ( 2155 int4_accum numeric_stddev_samp 0 1231 "{0,0,0}" )); DATA(insert ( 2156 int2_accum numeric_stddev_samp 0 1231 "{0,0,0}" )); DATA(insert ( 2157 float4_accum float8_stddev_samp 0 1022 "{0,0,0}" )); DATA(insert ( 2158 float8_accum float8_stddev_samp 0 1022 "{0,0,0}" )); DATA(insert ( 2159 numeric_accum numeric_stddev_samp 0 1231 "{0,0,0}" )); /* SQL2003 binary regression aggregates */ DATA(insert ( 2818 int8inc_float8_float8 - 0 20 "0" )); DATA(insert ( 2819 float8_regr_accum float8_regr_sxx 0 1022 "{0,0,0,0,0,0}" )); DATA(insert ( 2820 float8_regr_accum float8_regr_syy 0 1022 "{0,0,0,0,0,0}" )); DATA(insert ( 2821 float8_regr_accum float8_regr_sxy 0 1022 "{0,0,0,0,0,0}" )); DATA(insert ( 2822 float8_regr_accum float8_regr_avgx 0 1022 "{0,0,0,0,0,0}" )); DATA(insert ( 2823 float8_regr_accum float8_regr_avgy 0 1022 "{0,0,0,0,0,0}" )); DATA(insert ( 2824 float8_regr_accum float8_regr_r2 0 1022 "{0,0,0,0,0,0}" )); DATA(insert ( 2825 float8_regr_accum float8_regr_slope 0 1022 "{0,0,0,0,0,0}" )); DATA(insert ( 2826 float8_regr_accum float8_regr_intercept 0 1022 "{0,0,0,0,0,0}" )); DATA(insert ( 2827 float8_regr_accum float8_covar_pop 0 1022 "{0,0,0,0,0,0}" )); DATA(insert ( 2828 float8_regr_accum float8_covar_samp 0 1022 "{0,0,0,0,0,0}" )); DATA(insert ( 2829 float8_regr_accum float8_corr 0 1022 "{0,0,0,0,0,0}" )); /* boolean-and and boolean-or */ DATA(insert ( 2517 booland_statefunc - 58 16 _null_ )); DATA(insert ( 2518 boolor_statefunc - 59 16 _null_ )); DATA(insert ( 2519 booland_statefunc - 58 16 _null_ )); /* bitwise integer */ DATA(insert ( 2236 int2and - 0 21 _null_ )); DATA(insert ( 2237 int2or - 0 21 _null_ )); DATA(insert ( 2238 int4and - 0 23 _null_ )); DATA(insert ( 2239 int4or - 0 23 _null_ )); DATA(insert ( 2240 int8and - 0 20 _null_ )); DATA(insert ( 2241 int8or - 0 20 _null_ )); DATA(insert ( 2242 bitand - 0 1560 _null_ )); DATA(insert ( 2243 bitor - 0 1560 _null_ )); /* xml */ DATA(insert ( 2901 xmlconcat2 - 0 142 _null_ )); /* array */ DATA(insert ( 2335 array_agg_transfn array_agg_finalfn 0 2281 _null_ )); /* text */ DATA(insert ( 3538 string_agg_transfn string_agg_finalfn 0 2281 _null_ )); /* bytea */ DATA(insert ( 3545 bytea_string_agg_transfn bytea_string_agg_finalfn 0 2281 _null_ )); /* * prototypes for functions in pg_aggregate.c */ extern void AggregateCreate(const char *aggName, Oid aggNamespace, Oid *aggArgTypes, int numArgs, List *aggtransfnName, List *aggfinalfnName, List *aggsortopName, Oid aggTransType, const char *agginitval); #endif /* PG_AGGREGATE_H */ PKBiZg server/catalog/pg_shdepend.hnu[/*------------------------------------------------------------------------- * * pg_shdepend.h * definition of the system "shared dependency" relation (pg_shdepend) * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_shdepend.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * *------------------------------------------------------------------------- */ #ifndef PG_SHDEPEND_H #define PG_SHDEPEND_H #include "catalog/genbki.h" /* ---------------- * pg_shdepend definition. cpp turns this into * typedef struct FormData_pg_shdepend * ---------------- */ #define SharedDependRelationId 1214 CATALOG(pg_shdepend,1214) BKI_SHARED_RELATION BKI_WITHOUT_OIDS { /* * Identification of the dependent (referencing) object. * * These fields are all zeroes for a DEPENDENCY_PIN entry. Also, dbid can * be zero to denote a shared object. */ Oid dbid; /* OID of database containing object */ Oid classid; /* OID of table containing object */ Oid objid; /* OID of object itself */ int4 objsubid; /* column number, or 0 if not used */ /* * Identification of the independent (referenced) object. This is always * a shared object, so we need no database ID field. We don't bother with * a sub-object ID either. */ Oid refclassid; /* OID of table containing object */ Oid refobjid; /* OID of object itself */ /* * Precise semantics of the relationship are specified by the deptype * field. See SharedDependencyType in catalog/dependency.h. */ char deptype; /* see codes in dependency.h */ } FormData_pg_shdepend; /* ---------------- * Form_pg_shdepend corresponds to a pointer to a row with * the format of pg_shdepend relation. * ---------------- */ typedef FormData_pg_shdepend *Form_pg_shdepend; /* ---------------- * compiler constants for pg_shdepend * ---------------- */ #define Natts_pg_shdepend 7 #define Anum_pg_shdepend_dbid 1 #define Anum_pg_shdepend_classid 2 #define Anum_pg_shdepend_objid 3 #define Anum_pg_shdepend_objsubid 4 #define Anum_pg_shdepend_refclassid 5 #define Anum_pg_shdepend_refobjid 6 #define Anum_pg_shdepend_deptype 7 /* * pg_shdepend has no preloaded contents; system-defined dependencies are * loaded into it during a late stage of the initdb process. * * NOTE: we do not represent all possible dependency pairs in pg_shdepend; * for example, there's not much value in creating an explicit dependency * from a relation to its database. Currently, only dependencies on roles * are explicitly stored in pg_shdepend. */ #endif /* PG_SHDEPEND_H */ PKBiZ{b server/catalog/pg_collation_fn.hnu[/*------------------------------------------------------------------------- * * pg_collation_fn.h * prototypes for functions in catalog/pg_collation.c * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_collation_fn.h * *------------------------------------------------------------------------- */ #ifndef PG_COLLATION_FN_H #define PG_COLLATION_FN_H extern Oid CollationCreate(const char *collname, Oid collnamespace, Oid collowner, int32 collencoding, const char *collcollate, const char *collctype); extern void RemoveCollationById(Oid collationOid); #endif /* PG_COLLATION_FN_H */ PKBiZ2ܦmmserver/catalog/pg_ts_config.hnu[/*------------------------------------------------------------------------- * * pg_ts_config.h * definition of configuration of tsearch * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_ts_config.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * * XXX do NOT break up DATA() statements into multiple lines! * the scripts are not as smart as you might think... * *------------------------------------------------------------------------- */ #ifndef PG_TS_CONFIG_H #define PG_TS_CONFIG_H #include "catalog/genbki.h" /* ---------------- * pg_ts_config definition. cpp turns this into * typedef struct FormData_pg_ts_config * ---------------- */ #define TSConfigRelationId 3602 CATALOG(pg_ts_config,3602) { NameData cfgname; /* name of configuration */ Oid cfgnamespace; /* name space */ Oid cfgowner; /* owner */ Oid cfgparser; /* OID of parser (in pg_ts_parser) */ } FormData_pg_ts_config; typedef FormData_pg_ts_config *Form_pg_ts_config; /* ---------------- * compiler constants for pg_ts_config * ---------------- */ #define Natts_pg_ts_config 4 #define Anum_pg_ts_config_cfgname 1 #define Anum_pg_ts_config_cfgnamespace 2 #define Anum_pg_ts_config_cfgowner 3 #define Anum_pg_ts_config_cfgparser 4 /* ---------------- * initial contents of pg_ts_config * ---------------- */ DATA(insert OID = 3748 ( "simple" PGNSP PGUID 3722 )); DESCR("simple configuration"); #endif /* PG_TS_CONFIG_H */ PKBiZW&lserver/catalog/pg_ts_parser.hnu[/*------------------------------------------------------------------------- * * pg_ts_parser.h * definition of parsers for tsearch * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_ts_parser.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * * XXX do NOT break up DATA() statements into multiple lines! * the scripts are not as smart as you might think... * *------------------------------------------------------------------------- */ #ifndef PG_TS_PARSER_H #define PG_TS_PARSER_H #include "catalog/genbki.h" /* ---------------- * pg_ts_parser definition. cpp turns this into * typedef struct FormData_pg_ts_parser * ---------------- */ #define TSParserRelationId 3601 CATALOG(pg_ts_parser,3601) { NameData prsname; /* parser's name */ Oid prsnamespace; /* name space */ regproc prsstart; /* init parsing session */ regproc prstoken; /* return next token */ regproc prsend; /* finalize parsing session */ regproc prsheadline; /* return data for headline creation */ regproc prslextype; /* return descriptions of lexeme's types */ } FormData_pg_ts_parser; typedef FormData_pg_ts_parser *Form_pg_ts_parser; /* ---------------- * compiler constants for pg_ts_parser * ---------------- */ #define Natts_pg_ts_parser 7 #define Anum_pg_ts_parser_prsname 1 #define Anum_pg_ts_parser_prsnamespace 2 #define Anum_pg_ts_parser_prsstart 3 #define Anum_pg_ts_parser_prstoken 4 #define Anum_pg_ts_parser_prsend 5 #define Anum_pg_ts_parser_prsheadline 6 #define Anum_pg_ts_parser_prslextype 7 /* ---------------- * initial contents of pg_ts_parser * ---------------- */ DATA(insert OID = 3722 ( "default" PGNSP prsd_start prsd_nexttoken prsd_end prsd_headline prsd_lextype )); DESCR("default word parser"); #endif /* PG_TS_PARSER_H */ PKBiZ?JqPserver/catalog/pg_collation.hnu[/*------------------------------------------------------------------------- * * pg_collation.h * definition of the system "collation" relation (pg_collation) * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION * src/include/catalog/pg_collation.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * *------------------------------------------------------------------------- */ #ifndef PG_COLLATION_H #define PG_COLLATION_H #include "catalog/genbki.h" /* ---------------- * pg_collation definition. cpp turns this into * typedef struct FormData_pg_collation * ---------------- */ #define CollationRelationId 3456 CATALOG(pg_collation,3456) { NameData collname; /* collation name */ Oid collnamespace; /* OID of namespace containing collation */ Oid collowner; /* owner of collation */ int4 collencoding; /* encoding for this collation; -1 = "all" */ NameData collcollate; /* LC_COLLATE setting */ NameData collctype; /* LC_CTYPE setting */ } FormData_pg_collation; /* ---------------- * Form_pg_collation corresponds to a pointer to a row with * the format of pg_collation relation. * ---------------- */ typedef FormData_pg_collation *Form_pg_collation; /* ---------------- * compiler constants for pg_collation * ---------------- */ #define Natts_pg_collation 6 #define Anum_pg_collation_collname 1 #define Anum_pg_collation_collnamespace 2 #define Anum_pg_collation_collowner 3 #define Anum_pg_collation_collencoding 4 #define Anum_pg_collation_collcollate 5 #define Anum_pg_collation_collctype 6 /* ---------------- * initial contents of pg_collation * ---------------- */ DATA(insert OID = 100 ( default PGNSP PGUID -1 "" "" )); DESCR("database's default collation"); #define DEFAULT_COLLATION_OID 100 DATA(insert OID = 950 ( C PGNSP PGUID -1 "C" "C" )); DESCR("standard C collation"); #define C_COLLATION_OID 950 DATA(insert OID = 951 ( POSIX PGNSP PGUID -1 "POSIX" "POSIX" )); DESCR("standard POSIX collation"); #define POSIX_COLLATION_OID 951 #endif /* PG_COLLATION_H */ PKBiZѺs.A.Aserver/catalog/indexing.hnu[/*------------------------------------------------------------------------- * * indexing.h * This file provides some definitions to support indexing * on system catalogs * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/indexing.h * *------------------------------------------------------------------------- */ #ifndef INDEXING_H #define INDEXING_H #include "access/htup.h" #include "utils/relcache.h" /* * The state object used by CatalogOpenIndexes and friends is actually the * same as the executor's ResultRelInfo, but we give it another type name * to decouple callers from that fact. */ typedef struct ResultRelInfo *CatalogIndexState; /* * indexing.c prototypes */ extern CatalogIndexState CatalogOpenIndexes(Relation heapRel); extern void CatalogCloseIndexes(CatalogIndexState indstate); extern void CatalogIndexInsert(CatalogIndexState indstate, HeapTuple heapTuple); extern void CatalogUpdateIndexes(Relation heapRel, HeapTuple heapTuple); /* * These macros are just to keep the C compiler from spitting up on the * upcoming commands for genbki.pl. */ #define DECLARE_INDEX(name,oid,decl) extern int no_such_variable #define DECLARE_UNIQUE_INDEX(name,oid,decl) extern int no_such_variable #define BUILD_INDICES /* * What follows are lines processed by genbki.pl to create the statements * the bootstrap parser will turn into DefineIndex commands. * * The keyword is DECLARE_INDEX or DECLARE_UNIQUE_INDEX. The first two * arguments are the index name and OID, the rest is much like a standard * 'create index' SQL command. * * For each index, we also provide a #define for its OID. References to * the index in the C code should always use these #defines, not the actual * index name (much less the numeric OID). */ DECLARE_UNIQUE_INDEX(pg_aggregate_fnoid_index, 2650, on pg_aggregate using btree(aggfnoid oid_ops)); #define AggregateFnoidIndexId 2650 DECLARE_UNIQUE_INDEX(pg_am_name_index, 2651, on pg_am using btree(amname name_ops)); #define AmNameIndexId 2651 DECLARE_UNIQUE_INDEX(pg_am_oid_index, 2652, on pg_am using btree(oid oid_ops)); #define AmOidIndexId 2652 DECLARE_UNIQUE_INDEX(pg_amop_fam_strat_index, 2653, on pg_amop using btree(amopfamily oid_ops, amoplefttype oid_ops, amoprighttype oid_ops, amopstrategy int2_ops)); #define AccessMethodStrategyIndexId 2653 DECLARE_UNIQUE_INDEX(pg_amop_opr_fam_index, 2654, on pg_amop using btree(amopopr oid_ops, amoppurpose char_ops, amopfamily oid_ops)); #define AccessMethodOperatorIndexId 2654 DECLARE_UNIQUE_INDEX(pg_amop_oid_index, 2756, on pg_amop using btree(oid oid_ops)); #define AccessMethodOperatorOidIndexId 2756 DECLARE_UNIQUE_INDEX(pg_amproc_fam_proc_index, 2655, on pg_amproc using btree(amprocfamily oid_ops, amproclefttype oid_ops, amprocrighttype oid_ops, amprocnum int2_ops)); #define AccessMethodProcedureIndexId 2655 DECLARE_UNIQUE_INDEX(pg_amproc_oid_index, 2757, on pg_amproc using btree(oid oid_ops)); #define AccessMethodProcedureOidIndexId 2757 DECLARE_UNIQUE_INDEX(pg_attrdef_adrelid_adnum_index, 2656, on pg_attrdef using btree(adrelid oid_ops, adnum int2_ops)); #define AttrDefaultIndexId 2656 DECLARE_UNIQUE_INDEX(pg_attrdef_oid_index, 2657, on pg_attrdef using btree(oid oid_ops)); #define AttrDefaultOidIndexId 2657 DECLARE_UNIQUE_INDEX(pg_attribute_relid_attnam_index, 2658, on pg_attribute using btree(attrelid oid_ops, attname name_ops)); #define AttributeRelidNameIndexId 2658 DECLARE_UNIQUE_INDEX(pg_attribute_relid_attnum_index, 2659, on pg_attribute using btree(attrelid oid_ops, attnum int2_ops)); #define AttributeRelidNumIndexId 2659 DECLARE_UNIQUE_INDEX(pg_authid_rolname_index, 2676, on pg_authid using btree(rolname name_ops)); #define AuthIdRolnameIndexId 2676 DECLARE_UNIQUE_INDEX(pg_authid_oid_index, 2677, on pg_authid using btree(oid oid_ops)); #define AuthIdOidIndexId 2677 DECLARE_UNIQUE_INDEX(pg_auth_members_role_member_index, 2694, on pg_auth_members using btree(roleid oid_ops, member oid_ops)); #define AuthMemRoleMemIndexId 2694 DECLARE_UNIQUE_INDEX(pg_auth_members_member_role_index, 2695, on pg_auth_members using btree(member oid_ops, roleid oid_ops)); #define AuthMemMemRoleIndexId 2695 DECLARE_UNIQUE_INDEX(pg_cast_oid_index, 2660, on pg_cast using btree(oid oid_ops)); #define CastOidIndexId 2660 DECLARE_UNIQUE_INDEX(pg_cast_source_target_index, 2661, on pg_cast using btree(castsource oid_ops, casttarget oid_ops)); #define CastSourceTargetIndexId 2661 DECLARE_UNIQUE_INDEX(pg_class_oid_index, 2662, on pg_class using btree(oid oid_ops)); #define ClassOidIndexId 2662 DECLARE_UNIQUE_INDEX(pg_class_relname_nsp_index, 2663, on pg_class using btree(relname name_ops, relnamespace oid_ops)); #define ClassNameNspIndexId 2663 DECLARE_UNIQUE_INDEX(pg_collation_name_enc_nsp_index, 3164, on pg_collation using btree(collname name_ops, collencoding int4_ops, collnamespace oid_ops)); #define CollationNameEncNspIndexId 3164 DECLARE_UNIQUE_INDEX(pg_collation_oid_index, 3085, on pg_collation using btree(oid oid_ops)); #define CollationOidIndexId 3085 /* This following index is not used for a cache and is not unique */ DECLARE_INDEX(pg_constraint_conname_nsp_index, 2664, on pg_constraint using btree(conname name_ops, connamespace oid_ops)); #define ConstraintNameNspIndexId 2664 /* This following index is not used for a cache and is not unique */ DECLARE_INDEX(pg_constraint_conrelid_index, 2665, on pg_constraint using btree(conrelid oid_ops)); #define ConstraintRelidIndexId 2665 /* This following index is not used for a cache and is not unique */ DECLARE_INDEX(pg_constraint_contypid_index, 2666, on pg_constraint using btree(contypid oid_ops)); #define ConstraintTypidIndexId 2666 DECLARE_UNIQUE_INDEX(pg_constraint_oid_index, 2667, on pg_constraint using btree(oid oid_ops)); #define ConstraintOidIndexId 2667 DECLARE_UNIQUE_INDEX(pg_conversion_default_index, 2668, on pg_conversion using btree(connamespace oid_ops, conforencoding int4_ops, contoencoding int4_ops, oid oid_ops)); #define ConversionDefaultIndexId 2668 DECLARE_UNIQUE_INDEX(pg_conversion_name_nsp_index, 2669, on pg_conversion using btree(conname name_ops, connamespace oid_ops)); #define ConversionNameNspIndexId 2669 DECLARE_UNIQUE_INDEX(pg_conversion_oid_index, 2670, on pg_conversion using btree(oid oid_ops)); #define ConversionOidIndexId 2670 DECLARE_UNIQUE_INDEX(pg_database_datname_index, 2671, on pg_database using btree(datname name_ops)); #define DatabaseNameIndexId 2671 DECLARE_UNIQUE_INDEX(pg_database_oid_index, 2672, on pg_database using btree(oid oid_ops)); #define DatabaseOidIndexId 2672 /* This following index is not used for a cache and is not unique */ DECLARE_INDEX(pg_depend_depender_index, 2673, on pg_depend using btree(classid oid_ops, objid oid_ops, objsubid int4_ops)); #define DependDependerIndexId 2673 /* This following index is not used for a cache and is not unique */ DECLARE_INDEX(pg_depend_reference_index, 2674, on pg_depend using btree(refclassid oid_ops, refobjid oid_ops, refobjsubid int4_ops)); #define DependReferenceIndexId 2674 DECLARE_UNIQUE_INDEX(pg_description_o_c_o_index, 2675, on pg_description using btree(objoid oid_ops, classoid oid_ops, objsubid int4_ops)); #define DescriptionObjIndexId 2675 DECLARE_UNIQUE_INDEX(pg_shdescription_o_c_index, 2397, on pg_shdescription using btree(objoid oid_ops, classoid oid_ops)); #define SharedDescriptionObjIndexId 2397 DECLARE_UNIQUE_INDEX(pg_enum_oid_index, 3502, on pg_enum using btree(oid oid_ops)); #define EnumOidIndexId 3502 DECLARE_UNIQUE_INDEX(pg_enum_typid_label_index, 3503, on pg_enum using btree(enumtypid oid_ops, enumlabel name_ops)); #define EnumTypIdLabelIndexId 3503 DECLARE_UNIQUE_INDEX(pg_enum_typid_sortorder_index, 3534, on pg_enum using btree(enumtypid oid_ops, enumsortorder float4_ops)); #define EnumTypIdSortOrderIndexId 3534 /* This following index is not used for a cache and is not unique */ DECLARE_INDEX(pg_index_indrelid_index, 2678, on pg_index using btree(indrelid oid_ops)); #define IndexIndrelidIndexId 2678 DECLARE_UNIQUE_INDEX(pg_index_indexrelid_index, 2679, on pg_index using btree(indexrelid oid_ops)); #define IndexRelidIndexId 2679 DECLARE_UNIQUE_INDEX(pg_inherits_relid_seqno_index, 2680, on pg_inherits using btree(inhrelid oid_ops, inhseqno int4_ops)); #define InheritsRelidSeqnoIndexId 2680 /* This following index is not used for a cache and is not unique */ DECLARE_INDEX(pg_inherits_parent_index, 2187, on pg_inherits using btree(inhparent oid_ops)); #define InheritsParentIndexId 2187 DECLARE_UNIQUE_INDEX(pg_language_name_index, 2681, on pg_language using btree(lanname name_ops)); #define LanguageNameIndexId 2681 DECLARE_UNIQUE_INDEX(pg_language_oid_index, 2682, on pg_language using btree(oid oid_ops)); #define LanguageOidIndexId 2682 DECLARE_UNIQUE_INDEX(pg_largeobject_loid_pn_index, 2683, on pg_largeobject using btree(loid oid_ops, pageno int4_ops)); #define LargeObjectLOidPNIndexId 2683 DECLARE_UNIQUE_INDEX(pg_largeobject_metadata_oid_index, 2996, on pg_largeobject_metadata using btree(oid oid_ops)); #define LargeObjectMetadataOidIndexId 2996 DECLARE_UNIQUE_INDEX(pg_namespace_nspname_index, 2684, on pg_namespace using btree(nspname name_ops)); #define NamespaceNameIndexId 2684 DECLARE_UNIQUE_INDEX(pg_namespace_oid_index, 2685, on pg_namespace using btree(oid oid_ops)); #define NamespaceOidIndexId 2685 DECLARE_UNIQUE_INDEX(pg_opclass_am_name_nsp_index, 2686, on pg_opclass using btree(opcmethod oid_ops, opcname name_ops, opcnamespace oid_ops)); #define OpclassAmNameNspIndexId 2686 DECLARE_UNIQUE_INDEX(pg_opclass_oid_index, 2687, on pg_opclass using btree(oid oid_ops)); #define OpclassOidIndexId 2687 DECLARE_UNIQUE_INDEX(pg_operator_oid_index, 2688, on pg_operator using btree(oid oid_ops)); #define OperatorOidIndexId 2688 DECLARE_UNIQUE_INDEX(pg_operator_oprname_l_r_n_index, 2689, on pg_operator using btree(oprname name_ops, oprleft oid_ops, oprright oid_ops, oprnamespace oid_ops)); #define OperatorNameNspIndexId 2689 DECLARE_UNIQUE_INDEX(pg_opfamily_am_name_nsp_index, 2754, on pg_opfamily using btree(opfmethod oid_ops, opfname name_ops, opfnamespace oid_ops)); #define OpfamilyAmNameNspIndexId 2754 DECLARE_UNIQUE_INDEX(pg_opfamily_oid_index, 2755, on pg_opfamily using btree(oid oid_ops)); #define OpfamilyOidIndexId 2755 DECLARE_UNIQUE_INDEX(pg_pltemplate_name_index, 1137, on pg_pltemplate using btree(tmplname name_ops)); #define PLTemplateNameIndexId 1137 DECLARE_UNIQUE_INDEX(pg_proc_oid_index, 2690, on pg_proc using btree(oid oid_ops)); #define ProcedureOidIndexId 2690 DECLARE_UNIQUE_INDEX(pg_proc_proname_args_nsp_index, 2691, on pg_proc using btree(proname name_ops, proargtypes oidvector_ops, pronamespace oid_ops)); #define ProcedureNameArgsNspIndexId 2691 DECLARE_UNIQUE_INDEX(pg_rewrite_oid_index, 2692, on pg_rewrite using btree(oid oid_ops)); #define RewriteOidIndexId 2692 DECLARE_UNIQUE_INDEX(pg_rewrite_rel_rulename_index, 2693, on pg_rewrite using btree(ev_class oid_ops, rulename name_ops)); #define RewriteRelRulenameIndexId 2693 /* This following index is not used for a cache and is not unique */ DECLARE_INDEX(pg_shdepend_depender_index, 1232, on pg_shdepend using btree(dbid oid_ops, classid oid_ops, objid oid_ops, objsubid int4_ops)); #define SharedDependDependerIndexId 1232 /* This following index is not used for a cache and is not unique */ DECLARE_INDEX(pg_shdepend_reference_index, 1233, on pg_shdepend using btree(refclassid oid_ops, refobjid oid_ops)); #define SharedDependReferenceIndexId 1233 DECLARE_UNIQUE_INDEX(pg_statistic_relid_att_inh_index, 2696, on pg_statistic using btree(starelid oid_ops, staattnum int2_ops, stainherit bool_ops)); #define StatisticRelidAttnumInhIndexId 2696 DECLARE_UNIQUE_INDEX(pg_tablespace_oid_index, 2697, on pg_tablespace using btree(oid oid_ops)); #define TablespaceOidIndexId 2697 DECLARE_UNIQUE_INDEX(pg_tablespace_spcname_index, 2698, on pg_tablespace using btree(spcname name_ops)); #define TablespaceNameIndexId 2698 /* This following index is not used for a cache and is not unique */ DECLARE_INDEX(pg_trigger_tgconstraint_index, 2699, on pg_trigger using btree(tgconstraint oid_ops)); #define TriggerConstraintIndexId 2699 DECLARE_UNIQUE_INDEX(pg_trigger_tgrelid_tgname_index, 2701, on pg_trigger using btree(tgrelid oid_ops, tgname name_ops)); #define TriggerRelidNameIndexId 2701 DECLARE_UNIQUE_INDEX(pg_trigger_oid_index, 2702, on pg_trigger using btree(oid oid_ops)); #define TriggerOidIndexId 2702 DECLARE_UNIQUE_INDEX(pg_ts_config_cfgname_index, 3608, on pg_ts_config using btree(cfgname name_ops, cfgnamespace oid_ops)); #define TSConfigNameNspIndexId 3608 DECLARE_UNIQUE_INDEX(pg_ts_config_oid_index, 3712, on pg_ts_config using btree(oid oid_ops)); #define TSConfigOidIndexId 3712 DECLARE_UNIQUE_INDEX(pg_ts_config_map_index, 3609, on pg_ts_config_map using btree(mapcfg oid_ops, maptokentype int4_ops, mapseqno int4_ops)); #define TSConfigMapIndexId 3609 DECLARE_UNIQUE_INDEX(pg_ts_dict_dictname_index, 3604, on pg_ts_dict using btree(dictname name_ops, dictnamespace oid_ops)); #define TSDictionaryNameNspIndexId 3604 DECLARE_UNIQUE_INDEX(pg_ts_dict_oid_index, 3605, on pg_ts_dict using btree(oid oid_ops)); #define TSDictionaryOidIndexId 3605 DECLARE_UNIQUE_INDEX(pg_ts_parser_prsname_index, 3606, on pg_ts_parser using btree(prsname name_ops, prsnamespace oid_ops)); #define TSParserNameNspIndexId 3606 DECLARE_UNIQUE_INDEX(pg_ts_parser_oid_index, 3607, on pg_ts_parser using btree(oid oid_ops)); #define TSParserOidIndexId 3607 DECLARE_UNIQUE_INDEX(pg_ts_template_tmplname_index, 3766, on pg_ts_template using btree(tmplname name_ops, tmplnamespace oid_ops)); #define TSTemplateNameNspIndexId 3766 DECLARE_UNIQUE_INDEX(pg_ts_template_oid_index, 3767, on pg_ts_template using btree(oid oid_ops)); #define TSTemplateOidIndexId 3767 DECLARE_UNIQUE_INDEX(pg_type_oid_index, 2703, on pg_type using btree(oid oid_ops)); #define TypeOidIndexId 2703 DECLARE_UNIQUE_INDEX(pg_type_typname_nsp_index, 2704, on pg_type using btree(typname name_ops, typnamespace oid_ops)); #define TypeNameNspIndexId 2704 DECLARE_UNIQUE_INDEX(pg_foreign_data_wrapper_oid_index, 112, on pg_foreign_data_wrapper using btree(oid oid_ops)); #define ForeignDataWrapperOidIndexId 112 DECLARE_UNIQUE_INDEX(pg_foreign_data_wrapper_name_index, 548, on pg_foreign_data_wrapper using btree(fdwname name_ops)); #define ForeignDataWrapperNameIndexId 548 DECLARE_UNIQUE_INDEX(pg_foreign_server_oid_index, 113, on pg_foreign_server using btree(oid oid_ops)); #define ForeignServerOidIndexId 113 DECLARE_UNIQUE_INDEX(pg_foreign_server_name_index, 549, on pg_foreign_server using btree(srvname name_ops)); #define ForeignServerNameIndexId 549 DECLARE_UNIQUE_INDEX(pg_user_mapping_oid_index, 174, on pg_user_mapping using btree(oid oid_ops)); #define UserMappingOidIndexId 174 DECLARE_UNIQUE_INDEX(pg_user_mapping_user_server_index, 175, on pg_user_mapping using btree(umuser oid_ops, umserver oid_ops)); #define UserMappingUserServerIndexId 175 DECLARE_UNIQUE_INDEX(pg_foreign_table_relid_index, 3119, on pg_foreign_table using btree(ftrelid oid_ops)); #define ForeignTableRelidIndexId 3119 DECLARE_UNIQUE_INDEX(pg_default_acl_role_nsp_obj_index, 827, on pg_default_acl using btree(defaclrole oid_ops, defaclnamespace oid_ops, defaclobjtype char_ops)); #define DefaultAclRoleNspObjIndexId 827 DECLARE_UNIQUE_INDEX(pg_default_acl_oid_index, 828, on pg_default_acl using btree(oid oid_ops)); #define DefaultAclOidIndexId 828 DECLARE_UNIQUE_INDEX(pg_db_role_setting_databaseid_rol_index, 2965, on pg_db_role_setting using btree(setdatabase oid_ops, setrole oid_ops)); #define DbRoleSettingDatidRolidIndexId 2965 DECLARE_UNIQUE_INDEX(pg_seclabel_object_index, 3597, on pg_seclabel using btree(objoid oid_ops, classoid oid_ops, objsubid int4_ops, provider text_ops)); #define SecLabelObjectIndexId 3597 DECLARE_UNIQUE_INDEX(pg_shseclabel_object_index, 3593, on pg_shseclabel using btree(objoid oid_ops, classoid oid_ops, provider text_ops)); #define SharedSecLabelObjectIndexId 3593 DECLARE_UNIQUE_INDEX(pg_extension_oid_index, 3080, on pg_extension using btree(oid oid_ops)); #define ExtensionOidIndexId 3080 DECLARE_UNIQUE_INDEX(pg_extension_name_index, 3081, on pg_extension using btree(extname name_ops)); #define ExtensionNameIndexId 3081 DECLARE_UNIQUE_INDEX(pg_range_rngtypid_index, 3542, on pg_range using btree(rngtypid oid_ops)); #define RangeTypidIndexId 3542 /* last step of initialization script: build the indexes declared above */ BUILD_INDICES #endif /* INDEXING_H */ PKBiZ0! ! server/catalog/index.hnu[/*------------------------------------------------------------------------- * * index.h * prototypes for catalog/index.c. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/index.h * *------------------------------------------------------------------------- */ #ifndef INDEX_H #define INDEX_H #include "nodes/execnodes.h" #define DEFAULT_INDEX_TYPE "btree" /* Typedef for callback function for IndexBuildHeapScan */ typedef void (*IndexBuildCallback) (Relation index, HeapTuple htup, Datum *values, bool *isnull, bool tupleIsAlive, void *state); /* Action code for index_set_state_flags */ typedef enum { INDEX_CREATE_SET_READY, INDEX_CREATE_SET_VALID, INDEX_DROP_CLEAR_VALID, INDEX_DROP_SET_DEAD } IndexStateFlagsAction; extern void index_check_primary_key(Relation heapRel, IndexInfo *indexInfo, bool is_alter_table); extern Oid index_create(Relation heapRelation, const char *indexRelationName, Oid indexRelationId, Oid relFileNode, IndexInfo *indexInfo, List *indexColNames, Oid accessMethodObjectId, Oid tableSpaceId, Oid *collationObjectId, Oid *classObjectId, int16 *coloptions, Datum reloptions, bool isprimary, bool isconstraint, bool deferrable, bool initdeferred, bool allow_system_table_mods, bool skip_build, bool concurrent); extern void index_constraint_create(Relation heapRelation, Oid indexRelationId, IndexInfo *indexInfo, const char *constraintName, char constraintType, bool deferrable, bool initdeferred, bool mark_as_primary, bool update_pgindex, bool remove_old_dependencies, bool allow_system_table_mods); extern void index_drop(Oid indexId, bool concurrent); extern IndexInfo *BuildIndexInfo(Relation index); extern void FormIndexDatum(IndexInfo *indexInfo, TupleTableSlot *slot, EState *estate, Datum *values, bool *isnull); extern void index_build(Relation heapRelation, Relation indexRelation, IndexInfo *indexInfo, bool isprimary, bool isreindex); extern double IndexBuildHeapScan(Relation heapRelation, Relation indexRelation, IndexInfo *indexInfo, bool allow_sync, IndexBuildCallback callback, void *callback_state); extern void validate_index(Oid heapId, Oid indexId, Snapshot snapshot); extern void index_set_state_flags(Oid indexId, IndexStateFlagsAction action); extern void reindex_index(Oid indexId, bool skip_constraint_checks); /* Flag bits for reindex_relation(): */ #define REINDEX_REL_PROCESS_TOAST 0x01 #define REINDEX_REL_SUPPRESS_INDEX_USE 0x02 #define REINDEX_REL_CHECK_CONSTRAINTS 0x04 extern bool reindex_relation(Oid relid, int flags); extern bool ReindexIsProcessingHeap(Oid heapOid); extern bool ReindexIsProcessingIndex(Oid indexOid); extern Oid IndexGetRelation(Oid indexId, bool missing_ok); #endif /* INDEX_H */ PKBiZI#server/catalog/pg_conversion.hnu[/*------------------------------------------------------------------------- * * pg_conversion.h * definition of the system "conversion" relation (pg_conversion) * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_conversion.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * *------------------------------------------------------------------------- */ #ifndef PG_CONVERSION_H #define PG_CONVERSION_H #include "catalog/genbki.h" /* ---------------------------------------------------------------- * pg_conversion definition. * * cpp turns this into typedef struct FormData_pg_namespace * * conname name of the conversion * connamespace name space which the conversion belongs to * conowner owner of the conversion * conforencoding FOR encoding id * contoencoding TO encoding id * conproc OID of the conversion proc * condefault TRUE if this is a default conversion * ---------------------------------------------------------------- */ #define ConversionRelationId 2607 CATALOG(pg_conversion,2607) { NameData conname; Oid connamespace; Oid conowner; int4 conforencoding; int4 contoencoding; regproc conproc; bool condefault; } FormData_pg_conversion; /* ---------------- * Form_pg_conversion corresponds to a pointer to a tuple with * the format of pg_conversion relation. * ---------------- */ typedef FormData_pg_conversion *Form_pg_conversion; /* ---------------- * compiler constants for pg_conversion * ---------------- */ #define Natts_pg_conversion 7 #define Anum_pg_conversion_conname 1 #define Anum_pg_conversion_connamespace 2 #define Anum_pg_conversion_conowner 3 #define Anum_pg_conversion_conforencoding 4 #define Anum_pg_conversion_contoencoding 5 #define Anum_pg_conversion_conproc 6 #define Anum_pg_conversion_condefault 7 /* ---------------- * initial contents of pg_conversion * --------------- */ #endif /* PG_CONVERSION_H */ PKBiZȈlAA!server/catalog/pg_conversion_fn.hnu[/*------------------------------------------------------------------------- * * pg_conversion_fn.h * prototypes for functions in catalog/pg_conversion.c * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_conversion_fn.h * *------------------------------------------------------------------------- */ #ifndef PG_CONVERSION_FN_H #define PG_CONVERSION_FN_H extern Oid ConversionCreate(const char *conname, Oid connamespace, Oid conowner, int32 conforencoding, int32 contoencoding, Oid conproc, bool def); extern void RemoveConversionById(Oid conversionOid); extern Oid FindDefaultConversion(Oid connamespace, int32 for_encoding, int32 to_encoding); #endif /* PG_CONVERSION_FN_H */ PKBiZAwZ  !server/catalog/pg_ts_config_map.hnu[/*------------------------------------------------------------------------- * * pg_ts_config_map.h * definition of token mappings for configurations of tsearch * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_ts_config_map.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * * XXX do NOT break up DATA() statements into multiple lines! * the scripts are not as smart as you might think... * *------------------------------------------------------------------------- */ #ifndef PG_TS_CONFIG_MAP_H #define PG_TS_CONFIG_MAP_H #include "catalog/genbki.h" /* ---------------- * pg_ts_config_map definition. cpp turns this into * typedef struct FormData_pg_ts_config_map * ---------------- */ #define TSConfigMapRelationId 3603 CATALOG(pg_ts_config_map,3603) BKI_WITHOUT_OIDS { Oid mapcfg; /* OID of configuration owning this entry */ int4 maptokentype; /* token type from parser */ int4 mapseqno; /* order in which to consult dictionaries */ Oid mapdict; /* dictionary to consult */ } FormData_pg_ts_config_map; typedef FormData_pg_ts_config_map *Form_pg_ts_config_map; /* ---------------- * compiler constants for pg_ts_config_map * ---------------- */ #define Natts_pg_ts_config_map 4 #define Anum_pg_ts_config_map_mapcfg 1 #define Anum_pg_ts_config_map_maptokentype 2 #define Anum_pg_ts_config_map_mapseqno 3 #define Anum_pg_ts_config_map_mapdict 4 /* ---------------- * initial contents of pg_ts_config_map * ---------------- */ DATA(insert ( 3748 1 1 3765 )); DATA(insert ( 3748 2 1 3765 )); DATA(insert ( 3748 3 1 3765 )); DATA(insert ( 3748 4 1 3765 )); DATA(insert ( 3748 5 1 3765 )); DATA(insert ( 3748 6 1 3765 )); DATA(insert ( 3748 7 1 3765 )); DATA(insert ( 3748 8 1 3765 )); DATA(insert ( 3748 9 1 3765 )); DATA(insert ( 3748 10 1 3765 )); DATA(insert ( 3748 11 1 3765 )); DATA(insert ( 3748 15 1 3765 )); DATA(insert ( 3748 16 1 3765 )); DATA(insert ( 3748 17 1 3765 )); DATA(insert ( 3748 18 1 3765 )); DATA(insert ( 3748 19 1 3765 )); DATA(insert ( 3748 20 1 3765 )); DATA(insert ( 3748 21 1 3765 )); DATA(insert ( 3748 22 1 3765 )); #endif /* PG_TS_CONFIG_MAP_H */ PKBiZ# m&??server/catalog/pg_shseclabel.hnu[/* ------------------------------------------------------------------------- * * pg_shseclabel.h * definition of the system "security label" relation (pg_shseclabel) * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * ------------------------------------------------------------------------- */ #ifndef PG_SHSECLABEL_H #define PG_SHSECLABEL_H #include "catalog/genbki.h" /* ---------------- * pg_shseclabel definition. cpp turns this into * typedef struct FormData_pg_shseclabel * ---------------- */ #define SharedSecLabelRelationId 3592 CATALOG(pg_shseclabel,3592) BKI_SHARED_RELATION BKI_WITHOUT_OIDS { Oid objoid; /* OID of the shared object itself */ Oid classoid; /* OID of table containing the shared object */ #ifdef CATALOG_VARLEN /* variable-length fields start here */ text provider; /* name of label provider */ text label; /* security label of the object */ #endif } FormData_pg_shseclabel; /* ---------------- * compiler constants for pg_shseclabel * ---------------- */ #define Natts_pg_shseclabel 4 #define Anum_pg_shseclabel_objoid 1 #define Anum_pg_shseclabel_classoid 2 #define Anum_pg_shseclabel_provider 3 #define Anum_pg_shseclabel_label 4 #endif /* PG_SHSECLABEL_H */ PKBiZDuINNserver/catalog/pg_type_fn.hnu[/*------------------------------------------------------------------------- * * pg_type_fn.h * prototypes for functions in catalog/pg_type.c * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_type_fn.h * *------------------------------------------------------------------------- */ #ifndef PG_TYPE_FN_H #define PG_TYPE_FN_H #include "nodes/nodes.h" extern Oid TypeShellMake(const char *typeName, Oid typeNamespace, Oid ownerId); extern Oid TypeCreate(Oid newTypeOid, const char *typeName, Oid typeNamespace, Oid relationOid, char relationKind, Oid ownerId, int16 internalSize, char typeType, char typeCategory, bool typePreferred, char typDelim, Oid inputProcedure, Oid outputProcedure, Oid receiveProcedure, Oid sendProcedure, Oid typmodinProcedure, Oid typmodoutProcedure, Oid analyzeProcedure, Oid elementType, bool isImplicitArray, Oid arrayType, Oid baseType, const char *defaultTypeValue, char *defaultTypeBin, bool passedByValue, char alignment, char storage, int32 typeMod, int32 typNDims, bool typeNotNull, Oid typeCollation); extern void GenerateTypeDependencies(Oid typeNamespace, Oid typeObjectId, Oid relationOid, char relationKind, Oid owner, Oid inputProcedure, Oid outputProcedure, Oid receiveProcedure, Oid sendProcedure, Oid typmodinProcedure, Oid typmodoutProcedure, Oid analyzeProcedure, Oid elementType, bool isImplicitArray, Oid baseType, Oid typeCollation, Node *defaultExpr, bool rebuild); extern void RenameTypeInternal(Oid typeOid, const char *newTypeName, Oid typeNamespace); extern char *makeArrayTypeName(const char *typeName, Oid typeNamespace); extern bool moveArrayTypeName(Oid typeOid, const char *typeName, Oid typeNamespace); #endif /* PG_TYPE_FN_H */ PKBiZV>(server/catalog/pg_foreign_data_wrapper.hnu[/*------------------------------------------------------------------------- * * pg_foreign_data_wrapper.h * definition of the system "foreign-data wrapper" relation (pg_foreign_data_wrapper) * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_foreign_data_wrapper.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * *------------------------------------------------------------------------- */ #ifndef PG_FOREIGN_DATA_WRAPPER_H #define PG_FOREIGN_DATA_WRAPPER_H #include "catalog/genbki.h" /* ---------------- * pg_foreign_data_wrapper definition. cpp turns this into * typedef struct FormData_pg_foreign_data_wrapper * ---------------- */ #define ForeignDataWrapperRelationId 2328 CATALOG(pg_foreign_data_wrapper,2328) { NameData fdwname; /* foreign-data wrapper name */ Oid fdwowner; /* FDW owner */ Oid fdwhandler; /* handler function, or 0 if none */ Oid fdwvalidator; /* option validation function, or 0 if none */ #ifdef CATALOG_VARLEN /* variable-length fields start here */ aclitem fdwacl[1]; /* access permissions */ text fdwoptions[1]; /* FDW options */ #endif } FormData_pg_foreign_data_wrapper; /* ---------------- * Form_pg_fdw corresponds to a pointer to a tuple with * the format of pg_fdw relation. * ---------------- */ typedef FormData_pg_foreign_data_wrapper *Form_pg_foreign_data_wrapper; /* ---------------- * compiler constants for pg_fdw * ---------------- */ #define Natts_pg_foreign_data_wrapper 6 #define Anum_pg_foreign_data_wrapper_fdwname 1 #define Anum_pg_foreign_data_wrapper_fdwowner 2 #define Anum_pg_foreign_data_wrapper_fdwhandler 3 #define Anum_pg_foreign_data_wrapper_fdwvalidator 4 #define Anum_pg_foreign_data_wrapper_fdwacl 5 #define Anum_pg_foreign_data_wrapper_fdwoptions 6 #endif /* PG_FOREIGN_DATA_WRAPPER_H */ PKBiZt t server/catalog/pg_constraint.hnu[/*------------------------------------------------------------------------- * * pg_constraint.h * definition of the system "constraint" relation (pg_constraint) * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_constraint.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * *------------------------------------------------------------------------- */ #ifndef PG_CONSTRAINT_H #define PG_CONSTRAINT_H #include "catalog/genbki.h" #include "catalog/dependency.h" #include "nodes/pg_list.h" /* ---------------- * pg_constraint definition. cpp turns this into * typedef struct FormData_pg_constraint * ---------------- */ #define ConstraintRelationId 2606 CATALOG(pg_constraint,2606) { /* * conname + connamespace is deliberately not unique; we allow, for * example, the same name to be used for constraints of different * relations. This is partly for backwards compatibility with past * Postgres practice, and partly because we don't want to have to obtain a * global lock to generate a globally unique name for a nameless * constraint. We associate a namespace with constraint names only for * SQL-spec compatibility. */ NameData conname; /* name of this constraint */ Oid connamespace; /* OID of namespace containing constraint */ char contype; /* constraint type; see codes below */ bool condeferrable; /* deferrable constraint? */ bool condeferred; /* deferred by default? */ bool convalidated; /* constraint has been validated? */ /* * conrelid and conkey are only meaningful if the constraint applies to a * specific relation (this excludes domain constraints and assertions). * Otherwise conrelid is 0 and conkey is NULL. */ Oid conrelid; /* relation this constraint constrains */ /* * contypid links to the pg_type row for a domain if this is a domain * constraint. Otherwise it's 0. * * For SQL-style global ASSERTIONs, both conrelid and contypid would be * zero. This is not presently supported, however. */ Oid contypid; /* domain this constraint constrains */ /* * conindid links to the index supporting the constraint, if any; * otherwise it's 0. This is used for unique, primary-key, and exclusion * constraints, and less obviously for foreign-key constraints (where the * index is a unique index on the referenced relation's referenced * columns). Notice that the index is on conrelid in the first case but * confrelid in the second. */ Oid conindid; /* index supporting this constraint */ /* * These fields, plus confkey, are only meaningful for a foreign-key * constraint. Otherwise confrelid is 0 and the char fields are spaces. */ Oid confrelid; /* relation referenced by foreign key */ char confupdtype; /* foreign key's ON UPDATE action */ char confdeltype; /* foreign key's ON DELETE action */ char confmatchtype; /* foreign key's match type */ /* Has a local definition (hence, do not drop when coninhcount is 0) */ bool conislocal; /* Number of times inherited from direct parent relation(s) */ int4 coninhcount; /* Has a local definition and cannot be inherited */ bool connoinherit; #ifdef CATALOG_VARLEN /* variable-length fields start here */ /* * Columns of conrelid that the constraint applies to, if known (this is * NULL for trigger constraints) */ int2 conkey[1]; /* * If a foreign key, the referenced columns of confrelid */ int2 confkey[1]; /* * If a foreign key, the OIDs of the PK = FK equality operators for each * column of the constraint */ Oid conpfeqop[1]; /* * If a foreign key, the OIDs of the PK = PK equality operators for each * column of the constraint (i.e., equality for the referenced columns) */ Oid conppeqop[1]; /* * If a foreign key, the OIDs of the FK = FK equality operators for each * column of the constraint (i.e., equality for the referencing columns) */ Oid conffeqop[1]; /* * If an exclusion constraint, the OIDs of the exclusion operators for * each column of the constraint */ Oid conexclop[1]; /* * If a check constraint, nodeToString representation of expression */ pg_node_tree conbin; /* * If a check constraint, source-text representation of expression */ text consrc; #endif } FormData_pg_constraint; /* ---------------- * Form_pg_constraint corresponds to a pointer to a tuple with * the format of pg_constraint relation. * ---------------- */ typedef FormData_pg_constraint *Form_pg_constraint; /* ---------------- * compiler constants for pg_constraint * ---------------- */ #define Natts_pg_constraint 24 #define Anum_pg_constraint_conname 1 #define Anum_pg_constraint_connamespace 2 #define Anum_pg_constraint_contype 3 #define Anum_pg_constraint_condeferrable 4 #define Anum_pg_constraint_condeferred 5 #define Anum_pg_constraint_convalidated 6 #define Anum_pg_constraint_conrelid 7 #define Anum_pg_constraint_contypid 8 #define Anum_pg_constraint_conindid 9 #define Anum_pg_constraint_confrelid 10 #define Anum_pg_constraint_confupdtype 11 #define Anum_pg_constraint_confdeltype 12 #define Anum_pg_constraint_confmatchtype 13 #define Anum_pg_constraint_conislocal 14 #define Anum_pg_constraint_coninhcount 15 #define Anum_pg_constraint_connoinherit 16 #define Anum_pg_constraint_conkey 17 #define Anum_pg_constraint_confkey 18 #define Anum_pg_constraint_conpfeqop 19 #define Anum_pg_constraint_conppeqop 20 #define Anum_pg_constraint_conffeqop 21 #define Anum_pg_constraint_conexclop 22 #define Anum_pg_constraint_conbin 23 #define Anum_pg_constraint_consrc 24 /* Valid values for contype */ #define CONSTRAINT_CHECK 'c' #define CONSTRAINT_FOREIGN 'f' #define CONSTRAINT_PRIMARY 'p' #define CONSTRAINT_UNIQUE 'u' #define CONSTRAINT_TRIGGER 't' #define CONSTRAINT_EXCLUSION 'x' /* * Valid values for confupdtype and confdeltype are the FKCONSTR_ACTION_xxx * constants defined in parsenodes.h. Valid values for confmatchtype are * the FKCONSTR_MATCH_xxx constants defined in parsenodes.h. */ /* * Identify constraint type for lookup purposes */ typedef enum ConstraintCategory { CONSTRAINT_RELATION, CONSTRAINT_DOMAIN, CONSTRAINT_ASSERTION /* for future expansion */ } ConstraintCategory; /* * prototypes for functions in pg_constraint.c */ extern Oid CreateConstraintEntry(const char *constraintName, Oid constraintNamespace, char constraintType, bool isDeferrable, bool isDeferred, bool isValidated, Oid relId, const int16 *constraintKey, int constraintNKeys, Oid domainId, Oid indexRelId, Oid foreignRelId, const int16 *foreignKey, const Oid *pfEqOp, const Oid *ppEqOp, const Oid *ffEqOp, int foreignNKeys, char foreignUpdateType, char foreignDeleteType, char foreignMatchType, const Oid *exclOp, Node *conExpr, const char *conBin, const char *conSrc, bool conIsLocal, int conInhCount, bool conNoInherit); extern void RemoveConstraintById(Oid conId); extern void RenameConstraintById(Oid conId, const char *newname); extern void SetValidatedConstraintById(Oid conId); extern bool ConstraintNameIsUsed(ConstraintCategory conCat, Oid objId, Oid objNamespace, const char *conname); extern char *ChooseConstraintName(const char *name1, const char *name2, const char *label, Oid namespaceid, List *others); extern void AlterConstraintNamespaces(Oid ownerId, Oid oldNspId, Oid newNspId, bool isType, ObjectAddresses *objsMoved); extern void get_constraint_relation_oids(Oid constraint_oid, Oid *conrelid, Oid *confrelid); extern Oid get_relation_constraint_oid(Oid relid, const char *conname, bool missing_ok); extern Oid get_domain_constraint_oid(Oid typid, const char *conname, bool missing_ok); extern bool check_functional_grouping(Oid relid, Index varno, Index varlevelsup, List *grouping_columns, List **constraintDeps); #endif /* PG_CONSTRAINT_H */ PKBiZ_o# # server/catalog/pg_range.hnu[/*------------------------------------------------------------------------- * * pg_range.h * definition of the system "range" relation (pg_range) * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_range.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * * XXX do NOT break up DATA() statements into multiple lines! * the scripts are not as smart as you might think... * *------------------------------------------------------------------------- */ #ifndef PG_RANGE_H #define PG_RANGE_H #include "catalog/genbki.h" /* ---------------- * pg_range definition. cpp turns this into * typedef struct FormData_pg_range * ---------------- */ #define RangeRelationId 3541 CATALOG(pg_range,3541) BKI_WITHOUT_OIDS { Oid rngtypid; /* OID of owning range type */ Oid rngsubtype; /* OID of range's element type (subtype) */ Oid rngcollation; /* collation for this range type, or 0 */ Oid rngsubopc; /* subtype's btree opclass */ regproc rngcanonical; /* canonicalize range, or 0 */ regproc rngsubdiff; /* subtype difference as a float8, or 0 */ } FormData_pg_range; /* ---------------- * Form_pg_range corresponds to a pointer to a tuple with * the format of pg_range relation. * ---------------- */ typedef FormData_pg_range *Form_pg_range; /* ---------------- * compiler constants for pg_range * ---------------- */ #define Natts_pg_range 6 #define Anum_pg_range_rngtypid 1 #define Anum_pg_range_rngsubtype 2 #define Anum_pg_range_rngcollation 3 #define Anum_pg_range_rngsubopc 4 #define Anum_pg_range_rngcanonical 5 #define Anum_pg_range_rngsubdiff 6 /* ---------------- * initial contents of pg_range * ---------------- */ DATA(insert ( 3904 23 0 1978 int4range_canonical int4range_subdiff)); DATA(insert ( 3906 1700 0 3125 - numrange_subdiff)); DATA(insert ( 3908 1114 0 3128 - tsrange_subdiff)); DATA(insert ( 3910 1184 0 3127 - tstzrange_subdiff)); DATA(insert ( 3912 1082 0 3122 daterange_canonical daterange_subdiff)); DATA(insert ( 3926 20 0 3124 int8range_canonical int8range_subdiff)); /* * prototypes for functions in pg_range.c */ extern void RangeCreate(Oid rangeTypeOid, Oid rangeSubType, Oid rangeCollation, Oid rangeSubOpclass, RegProcedure rangeCanonical, RegProcedure rangeSubDiff); extern void RangeDelete(Oid rangeTypeOid); #endif /* PG_RANGE_H */ PKBiZ~ server/catalog/objectaddress.hnu[/*------------------------------------------------------------------------- * * objectaddress.h * functions for working with object addresses * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/objectaddress.h * *------------------------------------------------------------------------- */ #ifndef OBJECTADDRESS_H #define OBJECTADDRESS_H #include "nodes/parsenodes.h" #include "storage/lock.h" #include "utils/relcache.h" /* * An ObjectAddress represents a database object of any type. */ typedef struct ObjectAddress { Oid classId; /* Class Id from pg_class */ Oid objectId; /* OID of the object */ int32 objectSubId; /* Subitem within object (eg column), or 0 */ } ObjectAddress; extern ObjectAddress get_object_address(ObjectType objtype, List *objname, List *objargs, Relation *relp, LOCKMODE lockmode, bool missing_ok); extern void check_object_ownership(Oid roleid, ObjectType objtype, ObjectAddress address, List *objname, List *objargs, Relation relation); extern Oid get_object_namespace(const ObjectAddress *address); #endif /* PARSE_OBJECT_H */ PKBiZfDffserver/catalog/pg_rewrite.hnu[/*------------------------------------------------------------------------- * * pg_rewrite.h * definition of the system "rewrite-rule" relation (pg_rewrite) * along with the relation's initial contents. * * As of Postgres 7.3, the primary key for this table is * --- ie, rule names are only unique among the rules of a given table. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_rewrite.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * *------------------------------------------------------------------------- */ #ifndef PG_REWRITE_H #define PG_REWRITE_H #include "catalog/genbki.h" /* ---------------- * pg_rewrite definition. cpp turns this into * typedef struct FormData_pg_rewrite * ---------------- */ #define RewriteRelationId 2618 CATALOG(pg_rewrite,2618) { NameData rulename; Oid ev_class; int2 ev_attr; char ev_type; char ev_enabled; bool is_instead; #ifdef CATALOG_VARLEN /* variable-length fields start here */ pg_node_tree ev_qual; pg_node_tree ev_action; #endif } FormData_pg_rewrite; /* ---------------- * Form_pg_rewrite corresponds to a pointer to a tuple with * the format of pg_rewrite relation. * ---------------- */ typedef FormData_pg_rewrite *Form_pg_rewrite; /* ---------------- * compiler constants for pg_rewrite * ---------------- */ #define Natts_pg_rewrite 8 #define Anum_pg_rewrite_rulename 1 #define Anum_pg_rewrite_ev_class 2 #define Anum_pg_rewrite_ev_attr 3 #define Anum_pg_rewrite_ev_type 4 #define Anum_pg_rewrite_ev_enabled 5 #define Anum_pg_rewrite_is_instead 6 #define Anum_pg_rewrite_ev_qual 7 #define Anum_pg_rewrite_ev_action 8 #endif /* PG_REWRITE_H */ PKBiZ   server/catalog/catversion.hnu[/*------------------------------------------------------------------------- * * catversion.h * "Catalog version number" for PostgreSQL. * * The catalog version number is used to flag incompatible changes in * the PostgreSQL system catalogs. Whenever anyone changes the format of * a system catalog relation, or adds, deletes, or modifies standard * catalog entries in such a way that an updated backend wouldn't work * with an old database (or vice versa), the catalog version number * should be changed. The version number stored in pg_control by initdb * is checked against the version number compiled into the backend at * startup time, so that a backend can refuse to run in an incompatible * database. * * The point of this feature is to provide a finer grain of compatibility * checking than is possible from looking at the major version number * stored in PG_VERSION. It shouldn't matter to end users, but during * development cycles we usually make quite a few incompatible changes * to the contents of the system catalogs, and we don't want to bump the * major version number for each one. What we can do instead is bump * this internal version number. This should save some grief for * developers who might otherwise waste time tracking down "bugs" that * are really just code-vs-database incompatibilities. * * The rule for developers is: if you commit a change that requires * an initdb, you should update the catalog version number (as well as * notifying the pghackers mailing list, which has been the informal * practice for a long time). * * The catalog version number is placed here since modifying files in * include/catalog is the most common kind of initdb-forcing change. * But it could be used to protect any kind of incompatible change in * database contents or layout, such as altering tuple headers. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/catversion.h * *------------------------------------------------------------------------- */ #ifndef CATVERSION_H #define CATVERSION_H /* * We could use anything we wanted for version numbers, but I recommend * following the "YYYYMMDDN" style often used for DNS zone serial numbers. * YYYYMMDD are the date of the change, and N is the number of the change * on that day. (Hopefully we'll never commit ten independent sets of * catalog changes on the same day...) */ /* yyyymmddN */ #define CATALOG_VERSION_NO 201204301 #endif PKBiZ server/catalog/pg_language.hnu[/*------------------------------------------------------------------------- * * pg_language.h * definition of the system "language" relation (pg_language) * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_language.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * *------------------------------------------------------------------------- */ #ifndef PG_LANGUAGE_H #define PG_LANGUAGE_H #include "catalog/genbki.h" /* ---------------- * pg_language definition. cpp turns this into * typedef struct FormData_pg_language * ---------------- */ #define LanguageRelationId 2612 CATALOG(pg_language,2612) { NameData lanname; /* Language name */ Oid lanowner; /* Language's owner */ bool lanispl; /* Is a procedural language */ bool lanpltrusted; /* PL is trusted */ Oid lanplcallfoid; /* Call handler for PL */ Oid laninline; /* Optional anonymous-block handler function */ Oid lanvalidator; /* Optional validation function */ #ifdef CATALOG_VARLEN /* variable-length fields start here */ aclitem lanacl[1]; /* Access privileges */ #endif } FormData_pg_language; /* ---------------- * Form_pg_language corresponds to a pointer to a tuple with * the format of pg_language relation. * ---------------- */ typedef FormData_pg_language *Form_pg_language; /* ---------------- * compiler constants for pg_language * ---------------- */ #define Natts_pg_language 8 #define Anum_pg_language_lanname 1 #define Anum_pg_language_lanowner 2 #define Anum_pg_language_lanispl 3 #define Anum_pg_language_lanpltrusted 4 #define Anum_pg_language_lanplcallfoid 5 #define Anum_pg_language_laninline 6 #define Anum_pg_language_lanvalidator 7 #define Anum_pg_language_lanacl 8 /* ---------------- * initial contents of pg_language * ---------------- */ DATA(insert OID = 12 ( "internal" PGUID f f 0 0 2246 _null_ )); DESCR("built-in functions"); #define INTERNALlanguageId 12 DATA(insert OID = 13 ( "c" PGUID f f 0 0 2247 _null_ )); DESCR("dynamically-loaded C functions"); #define ClanguageId 13 DATA(insert OID = 14 ( "sql" PGUID f t 0 0 2248 _null_ )); DESCR("SQL-language functions"); #define SQLlanguageId 14 #endif /* PG_LANGUAGE_H */ PKBiZY server/catalog/pg_description.hnu[/*------------------------------------------------------------------------- * * pg_description.h * definition of the system "description" relation (pg_description) * * NOTE: an object is identified by the OID of the row that primarily * defines the object, plus the OID of the table that that row appears in. * For example, a function is identified by the OID of its pg_proc row * plus the pg_class OID of table pg_proc. This allows unique identification * of objects without assuming that OIDs are unique across tables. * * Since attributes don't have OIDs of their own, we identify an attribute * comment by the objoid+classoid of its parent table, plus an "objsubid" * giving the attribute column number. "objsubid" must be zero in a comment * for a table itself, so that it is distinct from any column comment. * Currently, objsubid is unused and zero for all other kinds of objects, * but perhaps it might be useful someday to associate comments with * constituent elements of other kinds of objects (arguments of a function, * for example). * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_description.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * * XXX do NOT break up DATA() statements into multiple lines! * the scripts are not as smart as you might think... * *------------------------------------------------------------------------- */ #ifndef PG_DESCRIPTION_H #define PG_DESCRIPTION_H #include "catalog/genbki.h" /* ---------------- * pg_description definition. cpp turns this into * typedef struct FormData_pg_description * ---------------- */ #define DescriptionRelationId 2609 CATALOG(pg_description,2609) BKI_WITHOUT_OIDS { Oid objoid; /* OID of object itself */ Oid classoid; /* OID of table containing object */ int4 objsubid; /* column number, or 0 if not used */ #ifdef CATALOG_VARLEN /* variable-length fields start here */ text description; /* description of object */ #endif } FormData_pg_description; /* ---------------- * Form_pg_description corresponds to a pointer to a tuple with * the format of pg_description relation. * ---------------- */ typedef FormData_pg_description *Form_pg_description; /* ---------------- * compiler constants for pg_description * ---------------- */ #define Natts_pg_description 4 #define Anum_pg_description_objoid 1 #define Anum_pg_description_classoid 2 #define Anum_pg_description_objsubid 3 #define Anum_pg_description_description 4 /* ---------------- * initial contents of pg_description * ---------------- */ /* * Because the contents of this table are taken from the other *.h files, * there is no initialization here. The initial contents are extracted * by genbki.pl and loaded during initdb. */ #endif /* PG_DESCRIPTION_H */ PKBiZhж--server/catalog/pg_opclass.hnu[/*------------------------------------------------------------------------- * * pg_opclass.h * definition of the system "opclass" relation (pg_opclass) * along with the relation's initial contents. * * The primary key for this table is --- * that is, there is a row for each valid combination of opclass name and * index access method type. This row specifies the expected input data type * for the opclass (the type of the heap column, or the expression output type * in the case of an index expression). Note that types binary-coercible to * the specified type will be accepted too. * * For a given pair, there can be at most one row that * has opcdefault = true; this row is the default opclass for such data in * such an index. (This is not currently enforced by an index, because we * don't support partial indexes on system catalogs.) * * Normally opckeytype = InvalidOid (zero), indicating that the data stored * in the index is the same as the data in the indexed column. If opckeytype * is nonzero then it indicates that a conversion step is needed to produce * the stored index data, which will be of type opckeytype (which might be * the same or different from the input datatype). Performing such a * conversion is the responsibility of the index access method --- not all * AMs support this. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_opclass.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * *------------------------------------------------------------------------- */ #ifndef PG_OPCLASS_H #define PG_OPCLASS_H #include "catalog/genbki.h" /* ---------------- * pg_opclass definition. cpp turns this into * typedef struct FormData_pg_opclass * ---------------- */ #define OperatorClassRelationId 2616 CATALOG(pg_opclass,2616) { Oid opcmethod; /* index access method opclass is for */ NameData opcname; /* name of this opclass */ Oid opcnamespace; /* namespace of this opclass */ Oid opcowner; /* opclass owner */ Oid opcfamily; /* containing operator family */ Oid opcintype; /* type of data indexed by opclass */ bool opcdefault; /* T if opclass is default for opcintype */ Oid opckeytype; /* type of data in index, or InvalidOid */ } FormData_pg_opclass; /* ---------------- * Form_pg_opclass corresponds to a pointer to a tuple with * the format of pg_opclass relation. * ---------------- */ typedef FormData_pg_opclass *Form_pg_opclass; /* ---------------- * compiler constants for pg_opclass * ---------------- */ #define Natts_pg_opclass 8 #define Anum_pg_opclass_opcmethod 1 #define Anum_pg_opclass_opcname 2 #define Anum_pg_opclass_opcnamespace 3 #define Anum_pg_opclass_opcowner 4 #define Anum_pg_opclass_opcfamily 5 #define Anum_pg_opclass_opcintype 6 #define Anum_pg_opclass_opcdefault 7 #define Anum_pg_opclass_opckeytype 8 /* ---------------- * initial contents of pg_opclass * * Note: we hard-wire an OID only for a few entries that have to be explicitly * referenced in the C code or in built-in catalog entries. The rest get OIDs * assigned on-the-fly during initdb. * ---------------- */ DATA(insert ( 403 abstime_ops PGNSP PGUID 421 702 t 0 )); DATA(insert ( 403 array_ops PGNSP PGUID 397 2277 t 0 )); DATA(insert ( 405 array_ops PGNSP PGUID 627 2277 t 0 )); DATA(insert ( 403 bit_ops PGNSP PGUID 423 1560 t 0 )); DATA(insert ( 403 bool_ops PGNSP PGUID 424 16 t 0 )); DATA(insert ( 403 bpchar_ops PGNSP PGUID 426 1042 t 0 )); DATA(insert ( 405 bpchar_ops PGNSP PGUID 427 1042 t 0 )); DATA(insert ( 403 bytea_ops PGNSP PGUID 428 17 t 0 )); DATA(insert ( 403 char_ops PGNSP PGUID 429 18 t 0 )); DATA(insert ( 405 char_ops PGNSP PGUID 431 18 t 0 )); DATA(insert ( 403 cidr_ops PGNSP PGUID 1974 869 f 0 )); DATA(insert ( 405 cidr_ops PGNSP PGUID 1975 869 f 0 )); DATA(insert OID = 3122 ( 403 date_ops PGNSP PGUID 434 1082 t 0 )); #define DATE_BTREE_OPS_OID 3122 DATA(insert ( 405 date_ops PGNSP PGUID 435 1082 t 0 )); DATA(insert ( 403 float4_ops PGNSP PGUID 1970 700 t 0 )); DATA(insert ( 405 float4_ops PGNSP PGUID 1971 700 t 0 )); DATA(insert OID = 3123 ( 403 float8_ops PGNSP PGUID 1970 701 t 0 )); #define FLOAT8_BTREE_OPS_OID 3123 DATA(insert ( 405 float8_ops PGNSP PGUID 1971 701 t 0 )); DATA(insert ( 403 inet_ops PGNSP PGUID 1974 869 t 0 )); DATA(insert ( 405 inet_ops PGNSP PGUID 1975 869 t 0 )); DATA(insert OID = 1979 ( 403 int2_ops PGNSP PGUID 1976 21 t 0 )); #define INT2_BTREE_OPS_OID 1979 DATA(insert ( 405 int2_ops PGNSP PGUID 1977 21 t 0 )); DATA(insert OID = 1978 ( 403 int4_ops PGNSP PGUID 1976 23 t 0 )); #define INT4_BTREE_OPS_OID 1978 DATA(insert ( 405 int4_ops PGNSP PGUID 1977 23 t 0 )); DATA(insert OID = 3124 ( 403 int8_ops PGNSP PGUID 1976 20 t 0 )); #define INT8_BTREE_OPS_OID 3124 DATA(insert ( 405 int8_ops PGNSP PGUID 1977 20 t 0 )); DATA(insert ( 403 interval_ops PGNSP PGUID 1982 1186 t 0 )); DATA(insert ( 405 interval_ops PGNSP PGUID 1983 1186 t 0 )); DATA(insert ( 403 macaddr_ops PGNSP PGUID 1984 829 t 0 )); DATA(insert ( 405 macaddr_ops PGNSP PGUID 1985 829 t 0 )); /* * Here's an ugly little hack to save space in the system catalog indexes. * btree doesn't ordinarily allow a storage type different from input type; * but cstring and name are the same thing except for trailing padding, * and we can safely omit that within an index entry. So we declare the * btree opclass for name as using cstring storage type. */ DATA(insert ( 403 name_ops PGNSP PGUID 1986 19 t 2275 )); DATA(insert ( 405 name_ops PGNSP PGUID 1987 19 t 0 )); DATA(insert OID = 3125 ( 403 numeric_ops PGNSP PGUID 1988 1700 t 0 )); #define NUMERIC_BTREE_OPS_OID 3125 DATA(insert ( 405 numeric_ops PGNSP PGUID 1998 1700 t 0 )); DATA(insert OID = 1981 ( 403 oid_ops PGNSP PGUID 1989 26 t 0 )); #define OID_BTREE_OPS_OID 1981 DATA(insert ( 405 oid_ops PGNSP PGUID 1990 26 t 0 )); DATA(insert ( 403 oidvector_ops PGNSP PGUID 1991 30 t 0 )); DATA(insert ( 405 oidvector_ops PGNSP PGUID 1992 30 t 0 )); DATA(insert ( 403 record_ops PGNSP PGUID 2994 2249 t 0 )); DATA(insert OID = 3126 ( 403 text_ops PGNSP PGUID 1994 25 t 0 )); #define TEXT_BTREE_OPS_OID 3126 DATA(insert ( 405 text_ops PGNSP PGUID 1995 25 t 0 )); DATA(insert ( 403 time_ops PGNSP PGUID 1996 1083 t 0 )); DATA(insert ( 405 time_ops PGNSP PGUID 1997 1083 t 0 )); DATA(insert OID = 3127 ( 403 timestamptz_ops PGNSP PGUID 434 1184 t 0 )); #define TIMESTAMPTZ_BTREE_OPS_OID 3127 DATA(insert ( 405 timestamptz_ops PGNSP PGUID 1999 1184 t 0 )); DATA(insert ( 403 timetz_ops PGNSP PGUID 2000 1266 t 0 )); DATA(insert ( 405 timetz_ops PGNSP PGUID 2001 1266 t 0 )); DATA(insert ( 403 varbit_ops PGNSP PGUID 2002 1562 t 0 )); DATA(insert ( 403 varchar_ops PGNSP PGUID 1994 25 f 0 )); DATA(insert ( 405 varchar_ops PGNSP PGUID 1995 25 f 0 )); DATA(insert OID = 3128 ( 403 timestamp_ops PGNSP PGUID 434 1114 t 0 )); #define TIMESTAMP_BTREE_OPS_OID 3128 DATA(insert ( 405 timestamp_ops PGNSP PGUID 2040 1114 t 0 )); DATA(insert ( 403 text_pattern_ops PGNSP PGUID 2095 25 f 0 )); DATA(insert ( 403 varchar_pattern_ops PGNSP PGUID 2095 25 f 0 )); DATA(insert ( 403 bpchar_pattern_ops PGNSP PGUID 2097 1042 f 0 )); DATA(insert ( 403 money_ops PGNSP PGUID 2099 790 t 0 )); DATA(insert ( 405 bool_ops PGNSP PGUID 2222 16 t 0 )); DATA(insert ( 405 bytea_ops PGNSP PGUID 2223 17 t 0 )); DATA(insert ( 405 int2vector_ops PGNSP PGUID 2224 22 t 0 )); DATA(insert ( 403 tid_ops PGNSP PGUID 2789 27 t 0 )); DATA(insert ( 405 xid_ops PGNSP PGUID 2225 28 t 0 )); DATA(insert ( 405 cid_ops PGNSP PGUID 2226 29 t 0 )); DATA(insert ( 405 abstime_ops PGNSP PGUID 2227 702 t 0 )); DATA(insert ( 405 reltime_ops PGNSP PGUID 2228 703 t 0 )); DATA(insert ( 405 text_pattern_ops PGNSP PGUID 2229 25 f 0 )); DATA(insert ( 405 varchar_pattern_ops PGNSP PGUID 2229 25 f 0 )); DATA(insert ( 405 bpchar_pattern_ops PGNSP PGUID 2231 1042 f 0 )); DATA(insert ( 403 reltime_ops PGNSP PGUID 2233 703 t 0 )); DATA(insert ( 403 tinterval_ops PGNSP PGUID 2234 704 t 0 )); DATA(insert ( 405 aclitem_ops PGNSP PGUID 2235 1033 t 0 )); DATA(insert ( 783 box_ops PGNSP PGUID 2593 603 t 0 )); DATA(insert ( 783 point_ops PGNSP PGUID 1029 600 t 603 )); DATA(insert ( 783 poly_ops PGNSP PGUID 2594 604 t 603 )); DATA(insert ( 783 circle_ops PGNSP PGUID 2595 718 t 603 )); DATA(insert ( 2742 _int4_ops PGNSP PGUID 2745 1007 t 23 )); DATA(insert ( 2742 _text_ops PGNSP PGUID 2745 1009 t 25 )); DATA(insert ( 2742 _abstime_ops PGNSP PGUID 2745 1023 t 702 )); DATA(insert ( 2742 _bit_ops PGNSP PGUID 2745 1561 t 1560 )); DATA(insert ( 2742 _bool_ops PGNSP PGUID 2745 1000 t 16 )); DATA(insert ( 2742 _bpchar_ops PGNSP PGUID 2745 1014 t 1042 )); DATA(insert ( 2742 _bytea_ops PGNSP PGUID 2745 1001 t 17 )); DATA(insert ( 2742 _char_ops PGNSP PGUID 2745 1002 t 18 )); DATA(insert ( 2742 _cidr_ops PGNSP PGUID 2745 651 t 650 )); DATA(insert ( 2742 _date_ops PGNSP PGUID 2745 1182 t 1082 )); DATA(insert ( 2742 _float4_ops PGNSP PGUID 2745 1021 t 700 )); DATA(insert ( 2742 _float8_ops PGNSP PGUID 2745 1022 t 701 )); DATA(insert ( 2742 _inet_ops PGNSP PGUID 2745 1041 t 869 )); DATA(insert ( 2742 _int2_ops PGNSP PGUID 2745 1005 t 21 )); DATA(insert ( 2742 _int8_ops PGNSP PGUID 2745 1016 t 20 )); DATA(insert ( 2742 _interval_ops PGNSP PGUID 2745 1187 t 1186 )); DATA(insert ( 2742 _macaddr_ops PGNSP PGUID 2745 1040 t 829 )); DATA(insert ( 2742 _name_ops PGNSP PGUID 2745 1003 t 19 )); DATA(insert ( 2742 _numeric_ops PGNSP PGUID 2745 1231 t 1700 )); DATA(insert ( 2742 _oid_ops PGNSP PGUID 2745 1028 t 26 )); DATA(insert ( 2742 _oidvector_ops PGNSP PGUID 2745 1013 t 30 )); DATA(insert ( 2742 _time_ops PGNSP PGUID 2745 1183 t 1083 )); DATA(insert ( 2742 _timestamptz_ops PGNSP PGUID 2745 1185 t 1184 )); DATA(insert ( 2742 _timetz_ops PGNSP PGUID 2745 1270 t 1266 )); DATA(insert ( 2742 _varbit_ops PGNSP PGUID 2745 1563 t 1562 )); DATA(insert ( 2742 _varchar_ops PGNSP PGUID 2745 1015 t 1043 )); DATA(insert ( 2742 _timestamp_ops PGNSP PGUID 2745 1115 t 1114 )); DATA(insert ( 2742 _money_ops PGNSP PGUID 2745 791 t 790 )); DATA(insert ( 2742 _reltime_ops PGNSP PGUID 2745 1024 t 703 )); DATA(insert ( 2742 _tinterval_ops PGNSP PGUID 2745 1025 t 704 )); DATA(insert ( 403 uuid_ops PGNSP PGUID 2968 2950 t 0 )); DATA(insert ( 405 uuid_ops PGNSP PGUID 2969 2950 t 0 )); DATA(insert ( 403 enum_ops PGNSP PGUID 3522 3500 t 0 )); DATA(insert ( 405 enum_ops PGNSP PGUID 3523 3500 t 0 )); DATA(insert ( 403 tsvector_ops PGNSP PGUID 3626 3614 t 0 )); DATA(insert ( 783 tsvector_ops PGNSP PGUID 3655 3614 t 3642 )); DATA(insert ( 2742 tsvector_ops PGNSP PGUID 3659 3614 t 25 )); DATA(insert ( 403 tsquery_ops PGNSP PGUID 3683 3615 t 0 )); DATA(insert ( 783 tsquery_ops PGNSP PGUID 3702 3615 t 20 )); DATA(insert ( 403 range_ops PGNSP PGUID 3901 3831 t 0 )); DATA(insert ( 405 range_ops PGNSP PGUID 3903 3831 t 0 )); DATA(insert ( 783 range_ops PGNSP PGUID 3919 3831 t 0 )); DATA(insert ( 4000 quad_point_ops PGNSP PGUID 4015 600 t 0 )); DATA(insert ( 4000 kd_point_ops PGNSP PGUID 4016 600 f 0 )); DATA(insert ( 4000 text_ops PGNSP PGUID 4017 25 t 0 )); #endif /* PG_OPCLASS_H */ PKBiZj|ց server/catalog/pg_database.hnu[/*------------------------------------------------------------------------- * * pg_database.h * definition of the system "database" relation (pg_database) * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_database.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * *------------------------------------------------------------------------- */ #ifndef PG_DATABASE_H #define PG_DATABASE_H #include "catalog/genbki.h" /* ---------------- * pg_database definition. cpp turns this into * typedef struct FormData_pg_database * ---------------- */ #define DatabaseRelationId 1262 #define DatabaseRelation_Rowtype_Id 1248 CATALOG(pg_database,1262) BKI_SHARED_RELATION BKI_ROWTYPE_OID(1248) BKI_SCHEMA_MACRO { NameData datname; /* database name */ Oid datdba; /* owner of database */ int4 encoding; /* character encoding */ NameData datcollate; /* LC_COLLATE setting */ NameData datctype; /* LC_CTYPE setting */ bool datistemplate; /* allowed as CREATE DATABASE template? */ bool datallowconn; /* new connections allowed? */ int4 datconnlimit; /* max connections allowed (-1=no limit) */ Oid datlastsysoid; /* highest OID to consider a system OID */ TransactionId datfrozenxid; /* all Xids < this are frozen in this DB */ Oid dattablespace; /* default table space for this DB */ #ifdef CATALOG_VARLEN /* variable-length fields start here */ aclitem datacl[1]; /* access permissions */ #endif } FormData_pg_database; /* ---------------- * Form_pg_database corresponds to a pointer to a tuple with * the format of pg_database relation. * ---------------- */ typedef FormData_pg_database *Form_pg_database; /* ---------------- * compiler constants for pg_database * ---------------- */ #define Natts_pg_database 12 #define Anum_pg_database_datname 1 #define Anum_pg_database_datdba 2 #define Anum_pg_database_encoding 3 #define Anum_pg_database_datcollate 4 #define Anum_pg_database_datctype 5 #define Anum_pg_database_datistemplate 6 #define Anum_pg_database_datallowconn 7 #define Anum_pg_database_datconnlimit 8 #define Anum_pg_database_datlastsysoid 9 #define Anum_pg_database_datfrozenxid 10 #define Anum_pg_database_dattablespace 11 #define Anum_pg_database_datacl 12 DATA(insert OID = 1 ( template1 PGUID ENCODING "LC_COLLATE" "LC_CTYPE" t t -1 0 0 1663 _null_)); SHDESCR("default template for new databases"); #define TemplateDbOid 1 #endif /* PG_DATABASE_H */ PKBiZ*hhserver/catalog/pg_default_acl.hnu[/*------------------------------------------------------------------------- * * pg_default_acl.h * definition of default ACLs for new objects. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_default_acl.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * *------------------------------------------------------------------------- */ #ifndef PG_DEFAULT_ACL_H #define PG_DEFAULT_ACL_H #include "catalog/genbki.h" /* ---------------- * pg_default_acl definition. cpp turns this into * typedef struct FormData_pg_default_acl * ---------------- */ #define DefaultAclRelationId 826 CATALOG(pg_default_acl,826) { Oid defaclrole; /* OID of role owning this ACL */ Oid defaclnamespace; /* OID of namespace, or 0 for all */ char defaclobjtype; /* see DEFACLOBJ_xxx constants below */ #ifdef CATALOG_VARLEN /* variable-length fields start here */ aclitem defaclacl[1]; /* permissions to add at CREATE time */ #endif } FormData_pg_default_acl; /* ---------------- * Form_pg_default_acl corresponds to a pointer to a tuple with * the format of pg_default_acl relation. * ---------------- */ typedef FormData_pg_default_acl *Form_pg_default_acl; /* ---------------- * compiler constants for pg_default_acl * ---------------- */ #define Natts_pg_default_acl 4 #define Anum_pg_default_acl_defaclrole 1 #define Anum_pg_default_acl_defaclnamespace 2 #define Anum_pg_default_acl_defaclobjtype 3 #define Anum_pg_default_acl_defaclacl 4 /* ---------------- * pg_default_acl has no initial contents * ---------------- */ /* * Types of objects for which the user is allowed to specify default * permissions through pg_default_acl. These codes are used in the * defaclobjtype column. */ #define DEFACLOBJ_RELATION 'r' /* table, view */ #define DEFACLOBJ_SEQUENCE 'S' /* sequence */ #define DEFACLOBJ_FUNCTION 'f' /* function */ #define DEFACLOBJ_TYPE 'T' /* type */ #endif /* PG_DEFAULT_ACL_H */ PKBiZ& server/catalog/pg_ts_dict.hnu[/*------------------------------------------------------------------------- * * pg_ts_dict.h * definition of dictionaries for tsearch * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_ts_dict.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * * XXX do NOT break up DATA() statements into multiple lines! * the scripts are not as smart as you might think... * *------------------------------------------------------------------------- */ #ifndef PG_TS_DICT_H #define PG_TS_DICT_H #include "catalog/genbki.h" /* ---------------- * pg_ts_dict definition. cpp turns this into * typedef struct FormData_pg_ts_dict * ---------------- */ #define TSDictionaryRelationId 3600 CATALOG(pg_ts_dict,3600) { NameData dictname; /* dictionary name */ Oid dictnamespace; /* name space */ Oid dictowner; /* owner */ Oid dicttemplate; /* dictionary's template */ #ifdef CATALOG_VARLEN /* variable-length fields start here */ text dictinitoption; /* options passed to dict_init() */ #endif } FormData_pg_ts_dict; typedef FormData_pg_ts_dict *Form_pg_ts_dict; /* ---------------- * compiler constants for pg_ts_dict * ---------------- */ #define Natts_pg_ts_dict 5 #define Anum_pg_ts_dict_dictname 1 #define Anum_pg_ts_dict_dictnamespace 2 #define Anum_pg_ts_dict_dictowner 3 #define Anum_pg_ts_dict_dicttemplate 4 #define Anum_pg_ts_dict_dictinitoption 5 /* ---------------- * initial contents of pg_ts_dict * ---------------- */ DATA(insert OID = 3765 ( "simple" PGNSP PGUID 3727 _null_)); DESCR("simple dictionary: just lower case and check for stopword"); #endif /* PG_TS_DICT_H */ PKBiZ@)SSserver/catalog/pg_seclabel.hnu[/* ------------------------------------------------------------------------- * * pg_seclabel.h * definition of the system "security label" relation (pg_seclabel) * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * ------------------------------------------------------------------------- */ #ifndef PG_SECLABEL_H #define PG_SECLABEL_H #include "catalog/genbki.h" /* ---------------- * pg_seclabel definition. cpp turns this into * typedef struct FormData_pg_seclabel * ---------------- */ #define SecLabelRelationId 3596 CATALOG(pg_seclabel,3596) BKI_WITHOUT_OIDS { Oid objoid; /* OID of the object itself */ Oid classoid; /* OID of table containing the object */ int4 objsubid; /* column number, or 0 if not used */ #ifdef CATALOG_VARLEN /* variable-length fields start here */ text provider; /* name of label provider */ text label; /* security label of the object */ #endif } FormData_pg_seclabel; /* ---------------- * compiler constants for pg_seclabel * ---------------- */ #define Natts_pg_seclabel 5 #define Anum_pg_seclabel_objoid 1 #define Anum_pg_seclabel_classoid 2 #define Anum_pg_seclabel_objsubid 3 #define Anum_pg_seclabel_provider 4 #define Anum_pg_seclabel_label 5 #endif /* PG_SECLABEL_H */ PKBiZIserver/catalog/toasting.hnu[/*------------------------------------------------------------------------- * * toasting.h * This file provides some definitions to support creation of toast tables * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/toasting.h * *------------------------------------------------------------------------- */ #ifndef TOASTING_H #define TOASTING_H /* * toasting.c prototypes */ extern void AlterTableCreateToastTable(Oid relOid, Datum reloptions); extern void BootstrapToastTable(char *relName, Oid toastOid, Oid toastIndexOid); /* * This macro is just to keep the C compiler from spitting up on the * upcoming commands for genbki.pl. */ #define DECLARE_TOAST(name,toastoid,indexoid) extern int no_such_variable /* * What follows are lines processed by genbki.pl to create the statements * the bootstrap parser will turn into BootstrapToastTable commands. * Each line specifies the system catalog that needs a toast table, * the OID to assign to the toast table, and the OID to assign to the * toast table's index. The reason we hard-wire these OIDs is that we * need stable OIDs for shared relations, and that includes toast tables * of shared relations. */ /* normal catalogs */ DECLARE_TOAST(pg_attrdef, 2830, 2831); DECLARE_TOAST(pg_constraint, 2832, 2833); DECLARE_TOAST(pg_description, 2834, 2835); DECLARE_TOAST(pg_proc, 2836, 2837); DECLARE_TOAST(pg_rewrite, 2838, 2839); DECLARE_TOAST(pg_seclabel, 3598, 3599); DECLARE_TOAST(pg_statistic, 2840, 2841); DECLARE_TOAST(pg_trigger, 2336, 2337); /* shared catalogs */ DECLARE_TOAST(pg_shdescription, 2846, 2847); #define PgShdescriptionToastTable 2846 #define PgShdescriptionToastIndex 2847 DECLARE_TOAST(pg_db_role_setting, 2966, 2967); #define PgDbRoleSettingToastTable 2966 #define PgDbRoleSettingToastIndex 2967 #endif /* TOASTING_H */ PKBiZVp server/catalog/pg_auth_members.hnu[/*------------------------------------------------------------------------- * * pg_auth_members.h * definition of the system "authorization identifier members" relation * (pg_auth_members) along with the relation's initial contents. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_auth_members.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * *------------------------------------------------------------------------- */ #ifndef PG_AUTH_MEMBERS_H #define PG_AUTH_MEMBERS_H #include "catalog/genbki.h" /* ---------------- * pg_auth_members definition. cpp turns this into * typedef struct FormData_pg_auth_members * ---------------- */ #define AuthMemRelationId 1261 #define AuthMemRelation_Rowtype_Id 2843 CATALOG(pg_auth_members,1261) BKI_SHARED_RELATION BKI_WITHOUT_OIDS BKI_ROWTYPE_OID(2843) BKI_SCHEMA_MACRO { Oid roleid; /* ID of a role */ Oid member; /* ID of a member of that role */ Oid grantor; /* who granted the membership */ bool admin_option; /* granted with admin option? */ } FormData_pg_auth_members; /* ---------------- * Form_pg_auth_members corresponds to a pointer to a tuple with * the format of pg_auth_members relation. * ---------------- */ typedef FormData_pg_auth_members *Form_pg_auth_members; /* ---------------- * compiler constants for pg_auth_members * ---------------- */ #define Natts_pg_auth_members 4 #define Anum_pg_auth_members_roleid 1 #define Anum_pg_auth_members_member 2 #define Anum_pg_auth_members_grantor 3 #define Anum_pg_auth_members_admin_option 4 #endif /* PG_AUTH_MEMBERS_H */ PKBiZq\&&server/catalog/pg_largeobject.hnu[/*------------------------------------------------------------------------- * * pg_largeobject.h * definition of the system "largeobject" relation (pg_largeobject) * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_largeobject.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * *------------------------------------------------------------------------- */ #ifndef PG_LARGEOBJECT_H #define PG_LARGEOBJECT_H #include "catalog/genbki.h" /* ---------------- * pg_largeobject definition. cpp turns this into * typedef struct FormData_pg_largeobject * ---------------- */ #define LargeObjectRelationId 2613 CATALOG(pg_largeobject,2613) BKI_WITHOUT_OIDS { Oid loid; /* Identifier of large object */ int4 pageno; /* Page number (starting from 0) */ /* data has variable length, but we allow direct access; see inv_api.c */ bytea data; /* Data for page (may be zero-length) */ } FormData_pg_largeobject; /* ---------------- * Form_pg_largeobject corresponds to a pointer to a tuple with * the format of pg_largeobject relation. * ---------------- */ typedef FormData_pg_largeobject *Form_pg_largeobject; /* ---------------- * compiler constants for pg_largeobject * ---------------- */ #define Natts_pg_largeobject 3 #define Anum_pg_largeobject_loid 1 #define Anum_pg_largeobject_pageno 2 #define Anum_pg_largeobject_data 3 extern Oid LargeObjectCreate(Oid loid); extern void LargeObjectDrop(Oid loid); extern void LargeObjectAlterOwner(Oid loid, Oid newOwnerId); extern bool LargeObjectExists(Oid loid); #endif /* PG_LARGEOBJECT_H */ PKBiZS}ssserver/catalog/pg_trigger.hnu[/*------------------------------------------------------------------------- * * pg_trigger.h * definition of the system "trigger" relation (pg_trigger) * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_trigger.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * *------------------------------------------------------------------------- */ #ifndef PG_TRIGGER_H #define PG_TRIGGER_H #include "catalog/genbki.h" /* ---------------- * pg_trigger definition. cpp turns this into * typedef struct FormData_pg_trigger * * Note: when tgconstraint is nonzero, tgconstrrelid, tgconstrindid, * tgdeferrable, and tginitdeferred are largely redundant with the referenced * pg_constraint entry. However, it is possible for a non-deferrable trigger * to be associated with a deferrable constraint. * ---------------- */ #define TriggerRelationId 2620 CATALOG(pg_trigger,2620) { Oid tgrelid; /* relation trigger is attached to */ NameData tgname; /* trigger's name */ Oid tgfoid; /* OID of function to be called */ int2 tgtype; /* BEFORE/AFTER/INSTEAD, UPDATE/DELETE/INSERT, * ROW/STATEMENT; see below */ char tgenabled; /* trigger's firing configuration WRT * session_replication_role */ bool tgisinternal; /* trigger is system-generated */ Oid tgconstrrelid; /* constraint's FROM table, if any */ Oid tgconstrindid; /* constraint's supporting index, if any */ Oid tgconstraint; /* associated pg_constraint entry, if any */ bool tgdeferrable; /* constraint trigger is deferrable */ bool tginitdeferred; /* constraint trigger is deferred initially */ int2 tgnargs; /* # of extra arguments in tgargs */ /* * Variable-length fields start here, but we allow direct access to * tgattr. Note: tgattr and tgargs must not be null. */ int2vector tgattr; /* column numbers, if trigger is on columns */ #ifdef CATALOG_VARLEN bytea tgargs; /* first\000second\000tgnargs\000 */ pg_node_tree tgqual; /* WHEN expression, or NULL if none */ #endif } FormData_pg_trigger; /* ---------------- * Form_pg_trigger corresponds to a pointer to a tuple with * the format of pg_trigger relation. * ---------------- */ typedef FormData_pg_trigger *Form_pg_trigger; /* ---------------- * compiler constants for pg_trigger * ---------------- */ #define Natts_pg_trigger 15 #define Anum_pg_trigger_tgrelid 1 #define Anum_pg_trigger_tgname 2 #define Anum_pg_trigger_tgfoid 3 #define Anum_pg_trigger_tgtype 4 #define Anum_pg_trigger_tgenabled 5 #define Anum_pg_trigger_tgisinternal 6 #define Anum_pg_trigger_tgconstrrelid 7 #define Anum_pg_trigger_tgconstrindid 8 #define Anum_pg_trigger_tgconstraint 9 #define Anum_pg_trigger_tgdeferrable 10 #define Anum_pg_trigger_tginitdeferred 11 #define Anum_pg_trigger_tgnargs 12 #define Anum_pg_trigger_tgattr 13 #define Anum_pg_trigger_tgargs 14 #define Anum_pg_trigger_tgqual 15 /* Bits within tgtype */ #define TRIGGER_TYPE_ROW (1 << 0) #define TRIGGER_TYPE_BEFORE (1 << 1) #define TRIGGER_TYPE_INSERT (1 << 2) #define TRIGGER_TYPE_DELETE (1 << 3) #define TRIGGER_TYPE_UPDATE (1 << 4) #define TRIGGER_TYPE_TRUNCATE (1 << 5) #define TRIGGER_TYPE_INSTEAD (1 << 6) #define TRIGGER_TYPE_LEVEL_MASK (TRIGGER_TYPE_ROW) #define TRIGGER_TYPE_STATEMENT 0 /* Note bits within TRIGGER_TYPE_TIMING_MASK aren't adjacent */ #define TRIGGER_TYPE_TIMING_MASK \ (TRIGGER_TYPE_BEFORE | TRIGGER_TYPE_INSTEAD) #define TRIGGER_TYPE_AFTER 0 #define TRIGGER_TYPE_EVENT_MASK \ (TRIGGER_TYPE_INSERT | TRIGGER_TYPE_DELETE | TRIGGER_TYPE_UPDATE | TRIGGER_TYPE_TRUNCATE) /* Macros for manipulating tgtype */ #define TRIGGER_CLEAR_TYPE(type) ((type) = 0) #define TRIGGER_SETT_ROW(type) ((type) |= TRIGGER_TYPE_ROW) #define TRIGGER_SETT_STATEMENT(type) ((type) |= TRIGGER_TYPE_STATEMENT) #define TRIGGER_SETT_BEFORE(type) ((type) |= TRIGGER_TYPE_BEFORE) #define TRIGGER_SETT_AFTER(type) ((type) |= TRIGGER_TYPE_AFTER) #define TRIGGER_SETT_INSTEAD(type) ((type) |= TRIGGER_TYPE_INSTEAD) #define TRIGGER_SETT_INSERT(type) ((type) |= TRIGGER_TYPE_INSERT) #define TRIGGER_SETT_DELETE(type) ((type) |= TRIGGER_TYPE_DELETE) #define TRIGGER_SETT_UPDATE(type) ((type) |= TRIGGER_TYPE_UPDATE) #define TRIGGER_SETT_TRUNCATE(type) ((type) |= TRIGGER_TYPE_TRUNCATE) #define TRIGGER_FOR_ROW(type) ((type) & TRIGGER_TYPE_ROW) #define TRIGGER_FOR_BEFORE(type) (((type) & TRIGGER_TYPE_TIMING_MASK) == TRIGGER_TYPE_BEFORE) #define TRIGGER_FOR_AFTER(type) (((type) & TRIGGER_TYPE_TIMING_MASK) == TRIGGER_TYPE_AFTER) #define TRIGGER_FOR_INSTEAD(type) (((type) & TRIGGER_TYPE_TIMING_MASK) == TRIGGER_TYPE_INSTEAD) #define TRIGGER_FOR_INSERT(type) ((type) & TRIGGER_TYPE_INSERT) #define TRIGGER_FOR_DELETE(type) ((type) & TRIGGER_TYPE_DELETE) #define TRIGGER_FOR_UPDATE(type) ((type) & TRIGGER_TYPE_UPDATE) #define TRIGGER_FOR_TRUNCATE(type) ((type) & TRIGGER_TYPE_TRUNCATE) /* * Efficient macro for checking if tgtype matches a particular level * (TRIGGER_TYPE_ROW or TRIGGER_TYPE_STATEMENT), timing (TRIGGER_TYPE_BEFORE, * TRIGGER_TYPE_AFTER or TRIGGER_TYPE_INSTEAD), and event (TRIGGER_TYPE_INSERT, * TRIGGER_TYPE_DELETE, TRIGGER_TYPE_UPDATE, or TRIGGER_TYPE_TRUNCATE). Note * that a tgtype can match more than one event, but only one level or timing. */ #define TRIGGER_TYPE_MATCHES(type, level, timing, event) \ (((type) & (TRIGGER_TYPE_LEVEL_MASK | TRIGGER_TYPE_TIMING_MASK | (event))) == ((level) | (timing) | (event))) #endif /* PG_TRIGGER_H */ PKBiZ server/catalog/pg_authid.hnu[/*------------------------------------------------------------------------- * * pg_authid.h * definition of the system "authorization identifier" relation (pg_authid) * along with the relation's initial contents. * * pg_shadow and pg_group are now publicly accessible views on pg_authid. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_authid.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * *------------------------------------------------------------------------- */ #ifndef PG_AUTHID_H #define PG_AUTHID_H #include "catalog/genbki.h" /* * The CATALOG definition has to refer to the type of rolvaliduntil as * "timestamptz" (lower case) so that bootstrap mode recognizes it. But * the C header files define this type as TimestampTz. Since the field is * potentially-null and therefore can't be accessed directly from C code, * there is no particular need for the C struct definition to show the * field type as TimestampTz --- instead we just make it int. */ #define timestamptz int /* ---------------- * pg_authid definition. cpp turns this into * typedef struct FormData_pg_authid * ---------------- */ #define AuthIdRelationId 1260 #define AuthIdRelation_Rowtype_Id 2842 CATALOG(pg_authid,1260) BKI_SHARED_RELATION BKI_ROWTYPE_OID(2842) BKI_SCHEMA_MACRO { NameData rolname; /* name of role */ bool rolsuper; /* read this field via superuser() only! */ bool rolinherit; /* inherit privileges from other roles? */ bool rolcreaterole; /* allowed to create more roles? */ bool rolcreatedb; /* allowed to create databases? */ bool rolcatupdate; /* allowed to alter catalogs manually? */ bool rolcanlogin; /* allowed to log in as session user? */ bool rolreplication; /* role used for streaming replication */ int4 rolconnlimit; /* max connections allowed (-1=no limit) */ /* remaining fields may be null; use heap_getattr to read them! */ text rolpassword; /* password, if any */ timestamptz rolvaliduntil; /* password expiration time, if any */ } FormData_pg_authid; #undef timestamptz /* ---------------- * Form_pg_authid corresponds to a pointer to a tuple with * the format of pg_authid relation. * ---------------- */ typedef FormData_pg_authid *Form_pg_authid; /* ---------------- * compiler constants for pg_authid * ---------------- */ #define Natts_pg_authid 11 #define Anum_pg_authid_rolname 1 #define Anum_pg_authid_rolsuper 2 #define Anum_pg_authid_rolinherit 3 #define Anum_pg_authid_rolcreaterole 4 #define Anum_pg_authid_rolcreatedb 5 #define Anum_pg_authid_rolcatupdate 6 #define Anum_pg_authid_rolcanlogin 7 #define Anum_pg_authid_rolreplication 8 #define Anum_pg_authid_rolconnlimit 9 #define Anum_pg_authid_rolpassword 10 #define Anum_pg_authid_rolvaliduntil 11 /* ---------------- * initial contents of pg_authid * * The uppercase quantities will be replaced at initdb time with * user choices. * ---------------- */ DATA(insert OID = 10 ( "POSTGRES" t t t t t t t -1 _null_ _null_ )); #define BOOTSTRAP_SUPERUSERID 10 #endif /* PG_AUTHID_H */ PKBiZVi|RRserver/catalog/pg_inherits_fn.hnu[/*------------------------------------------------------------------------- * * pg_inherits_fn.h * prototypes for functions in catalog/pg_inherits.c * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_inherits_fn.h * *------------------------------------------------------------------------- */ #ifndef PG_INHERITS_FN_H #define PG_INHERITS_FN_H #include "nodes/pg_list.h" #include "storage/lock.h" extern List *find_inheritance_children(Oid parentrelId, LOCKMODE lockmode); extern List *find_all_inheritors(Oid parentrelId, LOCKMODE lockmode, List **parents); extern bool has_subclass(Oid relationId); extern bool typeInheritsFrom(Oid subclassTypeId, Oid superclassTypeId); #endif /* PG_INHERITS_FN_H */ PKBiZ33server/catalog/catalog.hnu[/*------------------------------------------------------------------------- * * catalog.h * prototypes for functions in backend/catalog/catalog.c * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/catalog.h * *------------------------------------------------------------------------- */ #ifndef CATALOG_H #define CATALOG_H /* * 'pgrminclude ignore' needed here because CppAsString2() does not throw * an error if the symbol is not defined. */ #include "catalog/catversion.h" /* pgrminclude ignore */ #include "catalog/pg_class.h" #include "storage/relfilenode.h" #include "utils/relcache.h" #define OIDCHARS 10 /* max chars printed by %u */ #define TABLESPACE_VERSION_DIRECTORY "PG_" PG_MAJORVERSION "_" \ CppAsString2(CATALOG_VERSION_NO) extern const char *forkNames[]; extern ForkNumber forkname_to_number(char *forkName); extern int forkname_chars(const char *str, ForkNumber *); extern char *relpathbackend(RelFileNode rnode, BackendId backend, ForkNumber forknum); extern char *GetDatabasePath(Oid dbNode, Oid spcNode); /* First argument is a RelFileNodeBackend */ #define relpath(rnode, forknum) \ relpathbackend((rnode).node, (rnode).backend, (forknum)) /* First argument is a RelFileNode */ #define relpathperm(rnode, forknum) \ relpathbackend((rnode), InvalidBackendId, (forknum)) extern bool IsSystemRelation(Relation relation); extern bool IsToastRelation(Relation relation); extern bool IsSystemClass(Form_pg_class reltuple); extern bool IsToastClass(Form_pg_class reltuple); extern bool IsSystemNamespace(Oid namespaceId); extern bool IsToastNamespace(Oid namespaceId); extern bool IsReservedName(const char *name); extern bool IsSharedRelation(Oid relationId); extern Oid GetNewOid(Relation relation); extern Oid GetNewOidWithIndex(Relation relation, Oid indexId, AttrNumber oidcolumn); extern Oid GetNewRelFileNode(Oid reltablespace, Relation pg_class, char relpersistence); #endif /* CATALOG_H */ PKBiZY핅server/catalog/pg_type.hnu[/*------------------------------------------------------------------------- * * pg_type.h * definition of the system "type" relation (pg_type) * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_type.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * *------------------------------------------------------------------------- */ #ifndef PG_TYPE_H #define PG_TYPE_H #include "catalog/genbki.h" /* ---------------- * pg_type definition. cpp turns this into * typedef struct FormData_pg_type * * Some of the values in a pg_type instance are copied into * pg_attribute instances. Some parts of Postgres use the pg_type copy, * while others use the pg_attribute copy, so they must match. * See struct FormData_pg_attribute for details. * ---------------- */ #define TypeRelationId 1247 #define TypeRelation_Rowtype_Id 71 CATALOG(pg_type,1247) BKI_BOOTSTRAP BKI_ROWTYPE_OID(71) BKI_SCHEMA_MACRO { NameData typname; /* type name */ Oid typnamespace; /* OID of namespace containing this type */ Oid typowner; /* type owner */ /* * For a fixed-size type, typlen is the number of bytes we use to * represent a value of this type, e.g. 4 for an int4. But for a * variable-length type, typlen is negative. We use -1 to indicate a * "varlena" type (one that has a length word), -2 to indicate a * null-terminated C string. */ int2 typlen; /* * typbyval determines whether internal Postgres routines pass a value of * this type by value or by reference. typbyval had better be FALSE if * the length is not 1, 2, or 4 (or 8 on 8-byte-Datum machines). * Variable-length types are always passed by reference. Note that * typbyval can be false even if the length would allow pass-by-value; * this is currently true for type float4, for example. */ bool typbyval; /* * typtype is 'b' for a base type, 'c' for a composite type (e.g., a * table's rowtype), 'd' for a domain, 'e' for an enum type, 'p' for a * pseudo-type, or 'r' for a range type. (Use the TYPTYPE macros below.) * * If typtype is 'c', typrelid is the OID of the class' entry in pg_class. */ char typtype; /* * typcategory and typispreferred help the parser distinguish preferred * and non-preferred coercions. The category can be any single ASCII * character (but not \0). The categories used for built-in types are * identified by the TYPCATEGORY macros below. */ char typcategory; /* arbitrary type classification */ bool typispreferred; /* is type "preferred" within its category? */ /* * If typisdefined is false, the entry is only a placeholder (forward * reference). We know the type name, but not yet anything else about it. */ bool typisdefined; char typdelim; /* delimiter for arrays of this type */ Oid typrelid; /* 0 if not a composite type */ /* * If typelem is not 0 then it identifies another row in pg_type. The * current type can then be subscripted like an array yielding values of * type typelem. A non-zero typelem does not guarantee this type to be a * "real" array type; some ordinary fixed-length types can also be * subscripted (e.g., name, point). Variable-length types can *not* be * turned into pseudo-arrays like that. Hence, the way to determine * whether a type is a "true" array type is if: * * typelem != 0 and typlen == -1. */ Oid typelem; /* * If there is a "true" array type having this type as element type, * typarray links to it. Zero if no associated "true" array type. */ Oid typarray; /* * I/O conversion procedures for the datatype. */ regproc typinput; /* text format (required) */ regproc typoutput; regproc typreceive; /* binary format (optional) */ regproc typsend; /* * I/O functions for optional type modifiers. */ regproc typmodin; regproc typmodout; /* * Custom ANALYZE procedure for the datatype (0 selects the default). */ regproc typanalyze; /* ---------------- * typalign is the alignment required when storing a value of this * type. It applies to storage on disk as well as most * representations of the value inside Postgres. When multiple values * are stored consecutively, such as in the representation of a * complete row on disk, padding is inserted before a datum of this * type so that it begins on the specified boundary. The alignment * reference is the beginning of the first datum in the sequence. * * 'c' = CHAR alignment, ie no alignment needed. * 's' = SHORT alignment (2 bytes on most machines). * 'i' = INT alignment (4 bytes on most machines). * 'd' = DOUBLE alignment (8 bytes on many machines, but by no means all). * * See include/access/tupmacs.h for the macros that compute these * alignment requirements. Note also that we allow the nominal alignment * to be violated when storing "packed" varlenas; the TOAST mechanism * takes care of hiding that from most code. * * NOTE: for types used in system tables, it is critical that the * size and alignment defined in pg_type agree with the way that the * compiler will lay out the field in a struct representing a table row. * ---------------- */ char typalign; /* ---------------- * typstorage tells if the type is prepared for toasting and what * the default strategy for attributes of this type should be. * * 'p' PLAIN type not prepared for toasting * 'e' EXTERNAL external storage possible, don't try to compress * 'x' EXTENDED try to compress and store external if required * 'm' MAIN like 'x' but try to keep in main tuple * ---------------- */ char typstorage; /* * This flag represents a "NOT NULL" constraint against this datatype. * * If true, the attnotnull column for a corresponding table column using * this datatype will always enforce the NOT NULL constraint. * * Used primarily for domain types. */ bool typnotnull; /* * Domains use typbasetype to show the base (or domain) type that the * domain is based on. Zero if the type is not a domain. */ Oid typbasetype; /* * Domains use typtypmod to record the typmod to be applied to their base * type (-1 if base type does not use a typmod). -1 if this type is not a * domain. */ int4 typtypmod; /* * typndims is the declared number of dimensions for an array domain type * (i.e., typbasetype is an array type). Otherwise zero. */ int4 typndims; /* * Collation: 0 if type cannot use collations, DEFAULT_COLLATION_OID for * collatable base types, possibly other OID for domains */ Oid typcollation; #ifdef CATALOG_VARLEN /* variable-length fields start here */ /* * If typdefaultbin is not NULL, it is the nodeToString representation of * a default expression for the type. Currently this is only used for * domains. */ pg_node_tree typdefaultbin; /* * typdefault is NULL if the type has no associated default value. If * typdefaultbin is not NULL, typdefault must contain a human-readable * version of the default expression represented by typdefaultbin. If * typdefaultbin is NULL and typdefault is not, then typdefault is the * external representation of the type's default value, which may be fed * to the type's input converter to produce a constant. */ text typdefault; /* * Access permissions */ aclitem typacl[1]; #endif } FormData_pg_type; /* ---------------- * Form_pg_type corresponds to a pointer to a row with * the format of pg_type relation. * ---------------- */ typedef FormData_pg_type *Form_pg_type; /* ---------------- * compiler constants for pg_type * ---------------- */ #define Natts_pg_type 30 #define Anum_pg_type_typname 1 #define Anum_pg_type_typnamespace 2 #define Anum_pg_type_typowner 3 #define Anum_pg_type_typlen 4 #define Anum_pg_type_typbyval 5 #define Anum_pg_type_typtype 6 #define Anum_pg_type_typcategory 7 #define Anum_pg_type_typispreferred 8 #define Anum_pg_type_typisdefined 9 #define Anum_pg_type_typdelim 10 #define Anum_pg_type_typrelid 11 #define Anum_pg_type_typelem 12 #define Anum_pg_type_typarray 13 #define Anum_pg_type_typinput 14 #define Anum_pg_type_typoutput 15 #define Anum_pg_type_typreceive 16 #define Anum_pg_type_typsend 17 #define Anum_pg_type_typmodin 18 #define Anum_pg_type_typmodout 19 #define Anum_pg_type_typanalyze 20 #define Anum_pg_type_typalign 21 #define Anum_pg_type_typstorage 22 #define Anum_pg_type_typnotnull 23 #define Anum_pg_type_typbasetype 24 #define Anum_pg_type_typtypmod 25 #define Anum_pg_type_typndims 26 #define Anum_pg_type_typcollation 27 #define Anum_pg_type_typdefaultbin 28 #define Anum_pg_type_typdefault 29 #define Anum_pg_type_typacl 30 /* ---------------- * initial contents of pg_type * ---------------- */ /* * Keep the following ordered by OID so that later changes can be made more * easily. * * For types used in the system catalogs, make sure the values here match * TypInfo[] in bootstrap.c. */ /* OIDS 1 - 99 */ DATA(insert OID = 16 ( bool PGNSP PGUID 1 t b B t t \054 0 0 1000 boolin boolout boolrecv boolsend - - - c p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("boolean, 'true'/'false'"); #define BOOLOID 16 DATA(insert OID = 17 ( bytea PGNSP PGUID -1 f b U f t \054 0 0 1001 byteain byteaout bytearecv byteasend - - - i x f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("variable-length string, binary values escaped"); #define BYTEAOID 17 DATA(insert OID = 18 ( char PGNSP PGUID 1 t b S f t \054 0 0 1002 charin charout charrecv charsend - - - c p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("single character"); #define CHAROID 18 DATA(insert OID = 19 ( name PGNSP PGUID NAMEDATALEN f b S f t \054 0 18 1003 namein nameout namerecv namesend - - - c p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("63-byte type for storing system identifiers"); #define NAMEOID 19 DATA(insert OID = 20 ( int8 PGNSP PGUID 8 FLOAT8PASSBYVAL b N f t \054 0 0 1016 int8in int8out int8recv int8send - - - d p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("~18 digit integer, 8-byte storage"); #define INT8OID 20 DATA(insert OID = 21 ( int2 PGNSP PGUID 2 t b N f t \054 0 0 1005 int2in int2out int2recv int2send - - - s p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("-32 thousand to 32 thousand, 2-byte storage"); #define INT2OID 21 DATA(insert OID = 22 ( int2vector PGNSP PGUID -1 f b A f t \054 0 21 1006 int2vectorin int2vectorout int2vectorrecv int2vectorsend - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("array of int2, used in system tables"); #define INT2VECTOROID 22 DATA(insert OID = 23 ( int4 PGNSP PGUID 4 t b N f t \054 0 0 1007 int4in int4out int4recv int4send - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("-2 billion to 2 billion integer, 4-byte storage"); #define INT4OID 23 DATA(insert OID = 24 ( regproc PGNSP PGUID 4 t b N f t \054 0 0 1008 regprocin regprocout regprocrecv regprocsend - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("registered procedure"); #define REGPROCOID 24 DATA(insert OID = 25 ( text PGNSP PGUID -1 f b S t t \054 0 0 1009 textin textout textrecv textsend - - - i x f 0 -1 0 100 _null_ _null_ _null_ )); DESCR("variable-length string, no limit specified"); #define TEXTOID 25 DATA(insert OID = 26 ( oid PGNSP PGUID 4 t b N t t \054 0 0 1028 oidin oidout oidrecv oidsend - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("object identifier(oid), maximum 4 billion"); #define OIDOID 26 DATA(insert OID = 27 ( tid PGNSP PGUID 6 f b U f t \054 0 0 1010 tidin tidout tidrecv tidsend - - - s p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("(block, offset), physical location of tuple"); #define TIDOID 27 DATA(insert OID = 28 ( xid PGNSP PGUID 4 t b U f t \054 0 0 1011 xidin xidout xidrecv xidsend - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("transaction id"); #define XIDOID 28 DATA(insert OID = 29 ( cid PGNSP PGUID 4 t b U f t \054 0 0 1012 cidin cidout cidrecv cidsend - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("command identifier type, sequence in transaction id"); #define CIDOID 29 DATA(insert OID = 30 ( oidvector PGNSP PGUID -1 f b A f t \054 0 26 1013 oidvectorin oidvectorout oidvectorrecv oidvectorsend - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("array of oids, used in system tables"); #define OIDVECTOROID 30 /* hand-built rowtype entries for bootstrapped catalogs */ /* NB: OIDs assigned here must match the BKI_ROWTYPE_OID declarations */ DATA(insert OID = 71 ( pg_type PGNSP PGUID -1 f c C f t \054 1247 0 0 record_in record_out record_recv record_send - - - d x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 75 ( pg_attribute PGNSP PGUID -1 f c C f t \054 1249 0 0 record_in record_out record_recv record_send - - - d x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 81 ( pg_proc PGNSP PGUID -1 f c C f t \054 1255 0 0 record_in record_out record_recv record_send - - - d x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 83 ( pg_class PGNSP PGUID -1 f c C f t \054 1259 0 0 record_in record_out record_recv record_send - - - d x f 0 -1 0 0 _null_ _null_ _null_ )); /* OIDS 100 - 199 */ DATA(insert OID = 114 ( json PGNSP PGUID -1 f b U f t \054 0 0 199 json_in json_out json_recv json_send - - - i x f 0 -1 0 0 _null_ _null_ _null_ )); #define JSONOID 114 DATA(insert OID = 142 ( xml PGNSP PGUID -1 f b U f t \054 0 0 143 xml_in xml_out xml_recv xml_send - - - i x f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("XML content"); #define XMLOID 142 DATA(insert OID = 143 ( _xml PGNSP PGUID -1 f b A f t \054 0 142 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 199 ( _json PGNSP PGUID -1 f b A f t \054 0 114 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 194 ( pg_node_tree PGNSP PGUID -1 f b S f t \054 0 0 0 pg_node_tree_in pg_node_tree_out pg_node_tree_recv pg_node_tree_send - - - i x f 0 -1 0 100 _null_ _null_ _null_ )); DESCR("string representing an internal node tree"); #define PGNODETREEOID 194 /* OIDS 200 - 299 */ DATA(insert OID = 210 ( smgr PGNSP PGUID 2 t b U f t \054 0 0 0 smgrin smgrout - - - - - s p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("storage manager"); /* OIDS 300 - 399 */ /* OIDS 400 - 499 */ /* OIDS 500 - 599 */ /* OIDS 600 - 699 */ DATA(insert OID = 600 ( point PGNSP PGUID 16 f b G f t \054 0 701 1017 point_in point_out point_recv point_send - - - d p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("geometric point '(x, y)'"); #define POINTOID 600 DATA(insert OID = 601 ( lseg PGNSP PGUID 32 f b G f t \054 0 600 1018 lseg_in lseg_out lseg_recv lseg_send - - - d p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("geometric line segment '(pt1,pt2)'"); #define LSEGOID 601 DATA(insert OID = 602 ( path PGNSP PGUID -1 f b G f t \054 0 0 1019 path_in path_out path_recv path_send - - - d x f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("geometric path '(pt1,...)'"); #define PATHOID 602 DATA(insert OID = 603 ( box PGNSP PGUID 32 f b G f t \073 0 600 1020 box_in box_out box_recv box_send - - - d p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("geometric box '(lower left,upper right)'"); #define BOXOID 603 DATA(insert OID = 604 ( polygon PGNSP PGUID -1 f b G f t \054 0 0 1027 poly_in poly_out poly_recv poly_send - - - d x f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("geometric polygon '(pt1,...)'"); #define POLYGONOID 604 DATA(insert OID = 628 ( line PGNSP PGUID 32 f b G f t \054 0 701 629 line_in line_out line_recv line_send - - - d p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("geometric line (not implemented)"); #define LINEOID 628 DATA(insert OID = 629 ( _line PGNSP PGUID -1 f b A f t \054 0 628 0 array_in array_out array_recv array_send - - array_typanalyze d x f 0 -1 0 0 _null_ _null_ _null_ )); DESCR(""); /* OIDS 700 - 799 */ DATA(insert OID = 700 ( float4 PGNSP PGUID 4 FLOAT4PASSBYVAL b N f t \054 0 0 1021 float4in float4out float4recv float4send - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("single-precision floating point number, 4-byte storage"); #define FLOAT4OID 700 DATA(insert OID = 701 ( float8 PGNSP PGUID 8 FLOAT8PASSBYVAL b N t t \054 0 0 1022 float8in float8out float8recv float8send - - - d p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("double-precision floating point number, 8-byte storage"); #define FLOAT8OID 701 DATA(insert OID = 702 ( abstime PGNSP PGUID 4 t b D f t \054 0 0 1023 abstimein abstimeout abstimerecv abstimesend - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("absolute, limited-range date and time (Unix system time)"); #define ABSTIMEOID 702 DATA(insert OID = 703 ( reltime PGNSP PGUID 4 t b T f t \054 0 0 1024 reltimein reltimeout reltimerecv reltimesend - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("relative, limited-range time interval (Unix delta time)"); #define RELTIMEOID 703 DATA(insert OID = 704 ( tinterval PGNSP PGUID 12 f b T f t \054 0 0 1025 tintervalin tintervalout tintervalrecv tintervalsend - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("(abstime,abstime), time interval"); #define TINTERVALOID 704 DATA(insert OID = 705 ( unknown PGNSP PGUID -2 f b X f t \054 0 0 0 unknownin unknownout unknownrecv unknownsend - - - c p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR(""); #define UNKNOWNOID 705 DATA(insert OID = 718 ( circle PGNSP PGUID 24 f b G f t \054 0 0 719 circle_in circle_out circle_recv circle_send - - - d p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("geometric circle '(center,radius)'"); #define CIRCLEOID 718 DATA(insert OID = 719 ( _circle PGNSP PGUID -1 f b A f t \054 0 718 0 array_in array_out array_recv array_send - - array_typanalyze d x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 790 ( money PGNSP PGUID 8 FLOAT8PASSBYVAL b N f t \054 0 0 791 cash_in cash_out cash_recv cash_send - - - d p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("monetary amounts, $d,ddd.cc"); #define CASHOID 790 DATA(insert OID = 791 ( _money PGNSP PGUID -1 f b A f t \054 0 790 0 array_in array_out array_recv array_send - - array_typanalyze d x f 0 -1 0 0 _null_ _null_ _null_ )); /* OIDS 800 - 899 */ DATA(insert OID = 829 ( macaddr PGNSP PGUID 6 f b U f t \054 0 0 1040 macaddr_in macaddr_out macaddr_recv macaddr_send - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("XX:XX:XX:XX:XX:XX, MAC address"); #define MACADDROID 829 DATA(insert OID = 869 ( inet PGNSP PGUID -1 f b I t t \054 0 0 1041 inet_in inet_out inet_recv inet_send - - - i m f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("IP address/netmask, host address, netmask optional"); #define INETOID 869 DATA(insert OID = 650 ( cidr PGNSP PGUID -1 f b I f t \054 0 0 651 cidr_in cidr_out cidr_recv cidr_send - - - i m f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("network IP address/netmask, network address"); #define CIDROID 650 /* OIDS 900 - 999 */ /* OIDS 1000 - 1099 */ DATA(insert OID = 1000 ( _bool PGNSP PGUID -1 f b A f t \054 0 16 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 1001 ( _bytea PGNSP PGUID -1 f b A f t \054 0 17 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 1002 ( _char PGNSP PGUID -1 f b A f t \054 0 18 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 1003 ( _name PGNSP PGUID -1 f b A f t \054 0 19 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 1005 ( _int2 PGNSP PGUID -1 f b A f t \054 0 21 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); #define INT2ARRAYOID 1005 DATA(insert OID = 1006 ( _int2vector PGNSP PGUID -1 f b A f t \054 0 22 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 1007 ( _int4 PGNSP PGUID -1 f b A f t \054 0 23 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); #define INT4ARRAYOID 1007 DATA(insert OID = 1008 ( _regproc PGNSP PGUID -1 f b A f t \054 0 24 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 1009 ( _text PGNSP PGUID -1 f b A f t \054 0 25 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 100 _null_ _null_ _null_ )); #define TEXTARRAYOID 1009 DATA(insert OID = 1028 ( _oid PGNSP PGUID -1 f b A f t \054 0 26 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); #define OIDARRAYOID 1028 DATA(insert OID = 1010 ( _tid PGNSP PGUID -1 f b A f t \054 0 27 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 1011 ( _xid PGNSP PGUID -1 f b A f t \054 0 28 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 1012 ( _cid PGNSP PGUID -1 f b A f t \054 0 29 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 1013 ( _oidvector PGNSP PGUID -1 f b A f t \054 0 30 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 1014 ( _bpchar PGNSP PGUID -1 f b A f t \054 0 1042 0 array_in array_out array_recv array_send bpchartypmodin bpchartypmodout array_typanalyze i x f 0 -1 0 100 _null_ _null_ _null_ )); DATA(insert OID = 1015 ( _varchar PGNSP PGUID -1 f b A f t \054 0 1043 0 array_in array_out array_recv array_send varchartypmodin varchartypmodout array_typanalyze i x f 0 -1 0 100 _null_ _null_ _null_ )); DATA(insert OID = 1016 ( _int8 PGNSP PGUID -1 f b A f t \054 0 20 0 array_in array_out array_recv array_send - - array_typanalyze d x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 1017 ( _point PGNSP PGUID -1 f b A f t \054 0 600 0 array_in array_out array_recv array_send - - array_typanalyze d x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 1018 ( _lseg PGNSP PGUID -1 f b A f t \054 0 601 0 array_in array_out array_recv array_send - - array_typanalyze d x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 1019 ( _path PGNSP PGUID -1 f b A f t \054 0 602 0 array_in array_out array_recv array_send - - array_typanalyze d x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 1020 ( _box PGNSP PGUID -1 f b A f t \073 0 603 0 array_in array_out array_recv array_send - - array_typanalyze d x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 1021 ( _float4 PGNSP PGUID -1 f b A f t \054 0 700 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); #define FLOAT4ARRAYOID 1021 DATA(insert OID = 1022 ( _float8 PGNSP PGUID -1 f b A f t \054 0 701 0 array_in array_out array_recv array_send - - array_typanalyze d x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 1023 ( _abstime PGNSP PGUID -1 f b A f t \054 0 702 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 1024 ( _reltime PGNSP PGUID -1 f b A f t \054 0 703 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 1025 ( _tinterval PGNSP PGUID -1 f b A f t \054 0 704 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 1027 ( _polygon PGNSP PGUID -1 f b A f t \054 0 604 0 array_in array_out array_recv array_send - - array_typanalyze d x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 1033 ( aclitem PGNSP PGUID 12 f b U f t \054 0 0 1034 aclitemin aclitemout - - - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("access control list"); #define ACLITEMOID 1033 DATA(insert OID = 1034 ( _aclitem PGNSP PGUID -1 f b A f t \054 0 1033 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 1040 ( _macaddr PGNSP PGUID -1 f b A f t \054 0 829 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 1041 ( _inet PGNSP PGUID -1 f b A f t \054 0 869 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 651 ( _cidr PGNSP PGUID -1 f b A f t \054 0 650 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 1263 ( _cstring PGNSP PGUID -1 f b A f t \054 0 2275 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); #define CSTRINGARRAYOID 1263 DATA(insert OID = 1042 ( bpchar PGNSP PGUID -1 f b S f t \054 0 0 1014 bpcharin bpcharout bpcharrecv bpcharsend bpchartypmodin bpchartypmodout - i x f 0 -1 0 100 _null_ _null_ _null_ )); DESCR("char(length), blank-padded string, fixed storage length"); #define BPCHAROID 1042 DATA(insert OID = 1043 ( varchar PGNSP PGUID -1 f b S f t \054 0 0 1015 varcharin varcharout varcharrecv varcharsend varchartypmodin varchartypmodout - i x f 0 -1 0 100 _null_ _null_ _null_ )); DESCR("varchar(length), non-blank-padded string, variable storage length"); #define VARCHAROID 1043 DATA(insert OID = 1082 ( date PGNSP PGUID 4 t b D f t \054 0 0 1182 date_in date_out date_recv date_send - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("date"); #define DATEOID 1082 DATA(insert OID = 1083 ( time PGNSP PGUID 8 FLOAT8PASSBYVAL b D f t \054 0 0 1183 time_in time_out time_recv time_send timetypmodin timetypmodout - d p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("time of day"); #define TIMEOID 1083 /* OIDS 1100 - 1199 */ DATA(insert OID = 1114 ( timestamp PGNSP PGUID 8 FLOAT8PASSBYVAL b D f t \054 0 0 1115 timestamp_in timestamp_out timestamp_recv timestamp_send timestamptypmodin timestamptypmodout - d p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("date and time"); #define TIMESTAMPOID 1114 DATA(insert OID = 1115 ( _timestamp PGNSP PGUID -1 f b A f t \054 0 1114 0 array_in array_out array_recv array_send timestamptypmodin timestamptypmodout array_typanalyze d x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 1182 ( _date PGNSP PGUID -1 f b A f t \054 0 1082 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 1183 ( _time PGNSP PGUID -1 f b A f t \054 0 1083 0 array_in array_out array_recv array_send timetypmodin timetypmodout array_typanalyze d x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 1184 ( timestamptz PGNSP PGUID 8 FLOAT8PASSBYVAL b D t t \054 0 0 1185 timestamptz_in timestamptz_out timestamptz_recv timestamptz_send timestamptztypmodin timestamptztypmodout - d p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("date and time with time zone"); #define TIMESTAMPTZOID 1184 DATA(insert OID = 1185 ( _timestamptz PGNSP PGUID -1 f b A f t \054 0 1184 0 array_in array_out array_recv array_send timestamptztypmodin timestamptztypmodout array_typanalyze d x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 1186 ( interval PGNSP PGUID 16 f b T t t \054 0 0 1187 interval_in interval_out interval_recv interval_send intervaltypmodin intervaltypmodout - d p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("@ , time interval"); #define INTERVALOID 1186 DATA(insert OID = 1187 ( _interval PGNSP PGUID -1 f b A f t \054 0 1186 0 array_in array_out array_recv array_send intervaltypmodin intervaltypmodout array_typanalyze d x f 0 -1 0 0 _null_ _null_ _null_ )); /* OIDS 1200 - 1299 */ DATA(insert OID = 1231 ( _numeric PGNSP PGUID -1 f b A f t \054 0 1700 0 array_in array_out array_recv array_send numerictypmodin numerictypmodout array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 1266 ( timetz PGNSP PGUID 12 f b D f t \054 0 0 1270 timetz_in timetz_out timetz_recv timetz_send timetztypmodin timetztypmodout - d p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("time of day with time zone"); #define TIMETZOID 1266 DATA(insert OID = 1270 ( _timetz PGNSP PGUID -1 f b A f t \054 0 1266 0 array_in array_out array_recv array_send timetztypmodin timetztypmodout array_typanalyze d x f 0 -1 0 0 _null_ _null_ _null_ )); /* OIDS 1500 - 1599 */ DATA(insert OID = 1560 ( bit PGNSP PGUID -1 f b V f t \054 0 0 1561 bit_in bit_out bit_recv bit_send bittypmodin bittypmodout - i x f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("fixed-length bit string"); #define BITOID 1560 DATA(insert OID = 1561 ( _bit PGNSP PGUID -1 f b A f t \054 0 1560 0 array_in array_out array_recv array_send bittypmodin bittypmodout array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 1562 ( varbit PGNSP PGUID -1 f b V t t \054 0 0 1563 varbit_in varbit_out varbit_recv varbit_send varbittypmodin varbittypmodout - i x f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("variable-length bit string"); #define VARBITOID 1562 DATA(insert OID = 1563 ( _varbit PGNSP PGUID -1 f b A f t \054 0 1562 0 array_in array_out array_recv array_send varbittypmodin varbittypmodout array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); /* OIDS 1600 - 1699 */ /* OIDS 1700 - 1799 */ DATA(insert OID = 1700 ( numeric PGNSP PGUID -1 f b N f t \054 0 0 1231 numeric_in numeric_out numeric_recv numeric_send numerictypmodin numerictypmodout - i m f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("numeric(precision, decimal), arbitrary precision number"); #define NUMERICOID 1700 DATA(insert OID = 1790 ( refcursor PGNSP PGUID -1 f b U f t \054 0 0 2201 textin textout textrecv textsend - - - i x f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("reference to cursor (portal name)"); #define REFCURSOROID 1790 /* OIDS 2200 - 2299 */ DATA(insert OID = 2201 ( _refcursor PGNSP PGUID -1 f b A f t \054 0 1790 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 2202 ( regprocedure PGNSP PGUID 4 t b N f t \054 0 0 2207 regprocedurein regprocedureout regprocedurerecv regproceduresend - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("registered procedure (with args)"); #define REGPROCEDUREOID 2202 DATA(insert OID = 2203 ( regoper PGNSP PGUID 4 t b N f t \054 0 0 2208 regoperin regoperout regoperrecv regopersend - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("registered operator"); #define REGOPEROID 2203 DATA(insert OID = 2204 ( regoperator PGNSP PGUID 4 t b N f t \054 0 0 2209 regoperatorin regoperatorout regoperatorrecv regoperatorsend - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("registered operator (with args)"); #define REGOPERATOROID 2204 DATA(insert OID = 2205 ( regclass PGNSP PGUID 4 t b N f t \054 0 0 2210 regclassin regclassout regclassrecv regclasssend - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("registered class"); #define REGCLASSOID 2205 DATA(insert OID = 2206 ( regtype PGNSP PGUID 4 t b N f t \054 0 0 2211 regtypein regtypeout regtyperecv regtypesend - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("registered type"); #define REGTYPEOID 2206 DATA(insert OID = 2207 ( _regprocedure PGNSP PGUID -1 f b A f t \054 0 2202 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 2208 ( _regoper PGNSP PGUID -1 f b A f t \054 0 2203 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 2209 ( _regoperator PGNSP PGUID -1 f b A f t \054 0 2204 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 2210 ( _regclass PGNSP PGUID -1 f b A f t \054 0 2205 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 2211 ( _regtype PGNSP PGUID -1 f b A f t \054 0 2206 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); #define REGTYPEARRAYOID 2211 /* uuid */ DATA(insert OID = 2950 ( uuid PGNSP PGUID 16 f b U f t \054 0 0 2951 uuid_in uuid_out uuid_recv uuid_send - - - c p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("UUID datatype"); DATA(insert OID = 2951 ( _uuid PGNSP PGUID -1 f b A f t \054 0 2950 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); /* text search */ DATA(insert OID = 3614 ( tsvector PGNSP PGUID -1 f b U f t \054 0 0 3643 tsvectorin tsvectorout tsvectorrecv tsvectorsend - - ts_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("text representation for text search"); #define TSVECTOROID 3614 DATA(insert OID = 3642 ( gtsvector PGNSP PGUID -1 f b U f t \054 0 0 3644 gtsvectorin gtsvectorout - - - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("GiST index internal text representation for text search"); #define GTSVECTOROID 3642 DATA(insert OID = 3615 ( tsquery PGNSP PGUID -1 f b U f t \054 0 0 3645 tsqueryin tsqueryout tsqueryrecv tsquerysend - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("query representation for text search"); #define TSQUERYOID 3615 DATA(insert OID = 3734 ( regconfig PGNSP PGUID 4 t b N f t \054 0 0 3735 regconfigin regconfigout regconfigrecv regconfigsend - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("registered text search configuration"); #define REGCONFIGOID 3734 DATA(insert OID = 3769 ( regdictionary PGNSP PGUID 4 t b N f t \054 0 0 3770 regdictionaryin regdictionaryout regdictionaryrecv regdictionarysend - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("registered text search dictionary"); #define REGDICTIONARYOID 3769 DATA(insert OID = 3643 ( _tsvector PGNSP PGUID -1 f b A f t \054 0 3614 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 3644 ( _gtsvector PGNSP PGUID -1 f b A f t \054 0 3642 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 3645 ( _tsquery PGNSP PGUID -1 f b A f t \054 0 3615 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 3735 ( _regconfig PGNSP PGUID -1 f b A f t \054 0 3734 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 3770 ( _regdictionary PGNSP PGUID -1 f b A f t \054 0 3769 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 2970 ( txid_snapshot PGNSP PGUID -1 f b U f t \054 0 0 2949 txid_snapshot_in txid_snapshot_out txid_snapshot_recv txid_snapshot_send - - - d x f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("txid snapshot"); DATA(insert OID = 2949 ( _txid_snapshot PGNSP PGUID -1 f b A f t \054 0 2970 0 array_in array_out array_recv array_send - - array_typanalyze d x f 0 -1 0 0 _null_ _null_ _null_ )); /* range types */ DATA(insert OID = 3904 ( int4range PGNSP PGUID -1 f r R f t \054 0 0 3905 range_in range_out range_recv range_send - - range_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("range of integers"); #define INT4RANGEOID 3904 DATA(insert OID = 3905 ( _int4range PGNSP PGUID -1 f b A f t \054 0 3904 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 3906 ( numrange PGNSP PGUID -1 f r R f t \054 0 0 3907 range_in range_out range_recv range_send - - range_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("range of numerics"); DATA(insert OID = 3907 ( _numrange PGNSP PGUID -1 f b A f t \054 0 3906 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 3908 ( tsrange PGNSP PGUID -1 f r R f t \054 0 0 3909 range_in range_out range_recv range_send - - range_typanalyze d x f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("range of timestamps without time zone"); DATA(insert OID = 3909 ( _tsrange PGNSP PGUID -1 f b A f t \054 0 3908 0 array_in array_out array_recv array_send - - array_typanalyze d x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 3910 ( tstzrange PGNSP PGUID -1 f r R f t \054 0 0 3911 range_in range_out range_recv range_send - - range_typanalyze d x f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("range of timestamps with time zone"); DATA(insert OID = 3911 ( _tstzrange PGNSP PGUID -1 f b A f t \054 0 3910 0 array_in array_out array_recv array_send - - array_typanalyze d x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 3912 ( daterange PGNSP PGUID -1 f r R f t \054 0 0 3913 range_in range_out range_recv range_send - - range_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("range of dates"); DATA(insert OID = 3913 ( _daterange PGNSP PGUID -1 f b A f t \054 0 3912 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 3926 ( int8range PGNSP PGUID -1 f r R f t \054 0 0 3927 range_in range_out range_recv range_send - - range_typanalyze d x f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("range of bigints"); DATA(insert OID = 3927 ( _int8range PGNSP PGUID -1 f b A f t \054 0 3926 0 array_in array_out array_recv array_send - - array_typanalyze d x f 0 -1 0 0 _null_ _null_ _null_ )); /* * pseudo-types * * types with typtype='p' represent various special cases in the type system. * * These cannot be used to define table columns, but are valid as function * argument and result types (if supported by the function's implementation * language). * * Note: cstring is a borderline case; it is still considered a pseudo-type, * but there is now support for it in records and arrays. Perhaps we should * just treat it as a regular base type? */ DATA(insert OID = 2249 ( record PGNSP PGUID -1 f p P f t \054 0 0 2287 record_in record_out record_recv record_send - - - d x f 0 -1 0 0 _null_ _null_ _null_ )); #define RECORDOID 2249 DATA(insert OID = 2287 ( _record PGNSP PGUID -1 f p P f t \054 0 2249 0 array_in array_out array_recv array_send - - array_typanalyze d x f 0 -1 0 0 _null_ _null_ _null_ )); #define RECORDARRAYOID 2287 DATA(insert OID = 2275 ( cstring PGNSP PGUID -2 f p P f t \054 0 0 1263 cstring_in cstring_out cstring_recv cstring_send - - - c p f 0 -1 0 0 _null_ _null_ _null_ )); #define CSTRINGOID 2275 DATA(insert OID = 2276 ( any PGNSP PGUID 4 t p P f t \054 0 0 0 any_in any_out - - - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); #define ANYOID 2276 DATA(insert OID = 2277 ( anyarray PGNSP PGUID -1 f p P f t \054 0 0 0 anyarray_in anyarray_out anyarray_recv anyarray_send - - - d x f 0 -1 0 0 _null_ _null_ _null_ )); #define ANYARRAYOID 2277 DATA(insert OID = 2278 ( void PGNSP PGUID 4 t p P f t \054 0 0 0 void_in void_out void_recv void_send - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); #define VOIDOID 2278 DATA(insert OID = 2279 ( trigger PGNSP PGUID 4 t p P f t \054 0 0 0 trigger_in trigger_out - - - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); #define TRIGGEROID 2279 DATA(insert OID = 2280 ( language_handler PGNSP PGUID 4 t p P f t \054 0 0 0 language_handler_in language_handler_out - - - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); #define LANGUAGE_HANDLEROID 2280 DATA(insert OID = 2281 ( internal PGNSP PGUID SIZEOF_POINTER t p P f t \054 0 0 0 internal_in internal_out - - - - - ALIGNOF_POINTER p f 0 -1 0 0 _null_ _null_ _null_ )); #define INTERNALOID 2281 DATA(insert OID = 2282 ( opaque PGNSP PGUID 4 t p P f t \054 0 0 0 opaque_in opaque_out - - - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); #define OPAQUEOID 2282 DATA(insert OID = 2283 ( anyelement PGNSP PGUID 4 t p P f t \054 0 0 0 anyelement_in anyelement_out - - - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); #define ANYELEMENTOID 2283 DATA(insert OID = 2776 ( anynonarray PGNSP PGUID 4 t p P f t \054 0 0 0 anynonarray_in anynonarray_out - - - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); #define ANYNONARRAYOID 2776 DATA(insert OID = 3500 ( anyenum PGNSP PGUID 4 t p P f t \054 0 0 0 anyenum_in anyenum_out - - - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); #define ANYENUMOID 3500 DATA(insert OID = 3115 ( fdw_handler PGNSP PGUID 4 t p P f t \054 0 0 0 fdw_handler_in fdw_handler_out - - - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); #define FDW_HANDLEROID 3115 DATA(insert OID = 3831 ( anyrange PGNSP PGUID -1 f p P f t \054 0 0 0 anyrange_in anyrange_out - - - - - d x f 0 -1 0 0 _null_ _null_ _null_ )); #define ANYRANGEOID 3831 /* * macros */ #define TYPTYPE_BASE 'b' /* base type (ordinary scalar type) */ #define TYPTYPE_COMPOSITE 'c' /* composite (e.g., table's rowtype) */ #define TYPTYPE_DOMAIN 'd' /* domain over another type */ #define TYPTYPE_ENUM 'e' /* enumerated type */ #define TYPTYPE_PSEUDO 'p' /* pseudo-type */ #define TYPTYPE_RANGE 'r' /* range type */ #define TYPCATEGORY_INVALID '\0' /* not an allowed category */ #define TYPCATEGORY_ARRAY 'A' #define TYPCATEGORY_BOOLEAN 'B' #define TYPCATEGORY_COMPOSITE 'C' #define TYPCATEGORY_DATETIME 'D' #define TYPCATEGORY_ENUM 'E' #define TYPCATEGORY_GEOMETRIC 'G' #define TYPCATEGORY_NETWORK 'I' /* think INET */ #define TYPCATEGORY_NUMERIC 'N' #define TYPCATEGORY_PSEUDOTYPE 'P' #define TYPCATEGORY_RANGE 'R' #define TYPCATEGORY_STRING 'S' #define TYPCATEGORY_TIMESPAN 'T' #define TYPCATEGORY_USER 'U' #define TYPCATEGORY_BITSTRING 'V' /* er ... "varbit"? */ #define TYPCATEGORY_UNKNOWN 'X' /* Is a type OID a polymorphic pseudotype? (Beware of multiple evaluation) */ #define IsPolymorphicType(typid) \ ((typid) == ANYELEMENTOID || \ (typid) == ANYARRAYOID || \ (typid) == ANYNONARRAYOID || \ (typid) == ANYENUMOID || \ (typid) == ANYRANGEOID) #endif /* PG_TYPE_H */ PKBiZdserver/catalog/pg_inherits.hnu[/*------------------------------------------------------------------------- * * pg_inherits.h * definition of the system "inherits" relation (pg_inherits) * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_inherits.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * *------------------------------------------------------------------------- */ #ifndef PG_INHERITS_H #define PG_INHERITS_H #include "catalog/genbki.h" /* ---------------- * pg_inherits definition. cpp turns this into * typedef struct FormData_pg_inherits * ---------------- */ #define InheritsRelationId 2611 CATALOG(pg_inherits,2611) BKI_WITHOUT_OIDS { Oid inhrelid; Oid inhparent; int4 inhseqno; } FormData_pg_inherits; /* ---------------- * Form_pg_inherits corresponds to a pointer to a tuple with * the format of pg_inherits relation. * ---------------- */ typedef FormData_pg_inherits *Form_pg_inherits; /* ---------------- * compiler constants for pg_inherits * ---------------- */ #define Natts_pg_inherits 3 #define Anum_pg_inherits_inhrelid 1 #define Anum_pg_inherits_inhparent 2 #define Anum_pg_inherits_inhseqno 3 /* ---------------- * pg_inherits has no initial contents * ---------------- */ #endif /* PG_INHERITS_H */ PKBiZ2server/catalog/namespace.hnu[/*------------------------------------------------------------------------- * * namespace.h * prototypes for functions in backend/catalog/namespace.c * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/namespace.h * *------------------------------------------------------------------------- */ #ifndef NAMESPACE_H #define NAMESPACE_H #include "nodes/primnodes.h" #include "storage/lock.h" /* * This structure holds a list of possible functions or operators * found by namespace lookup. Each function/operator is identified * by OID and by argument types; the list must be pruned by type * resolution rules that are embodied in the parser, not here. * See FuncnameGetCandidates's comments for more info. */ typedef struct _FuncCandidateList { struct _FuncCandidateList *next; int pathpos; /* for internal use of namespace lookup */ Oid oid; /* the function or operator's OID */ int nargs; /* number of arg types returned */ int nvargs; /* number of args to become variadic array */ int ndargs; /* number of defaulted args */ int *argnumbers; /* args' positional indexes, if named call */ Oid args[1]; /* arg types --- VARIABLE LENGTH ARRAY */ } *FuncCandidateList; /* VARIABLE LENGTH STRUCT */ /* * Structure for xxxOverrideSearchPath functions */ typedef struct OverrideSearchPath { List *schemas; /* OIDs of explicitly named schemas */ bool addCatalog; /* implicitly prepend pg_catalog? */ bool addTemp; /* implicitly prepend temp schema? */ } OverrideSearchPath; typedef void (*RangeVarGetRelidCallback) (const RangeVar *relation, Oid relId, Oid oldRelId, void *callback_arg); #define RangeVarGetRelid(relation, lockmode, missing_ok) \ RangeVarGetRelidExtended(relation, lockmode, missing_ok, false, NULL, NULL) extern Oid RangeVarGetRelidExtended(const RangeVar *relation, LOCKMODE lockmode, bool missing_ok, bool nowait, RangeVarGetRelidCallback callback, void *callback_arg); extern Oid RangeVarGetCreationNamespace(const RangeVar *newRelation); extern Oid RangeVarGetAndCheckCreationNamespace(RangeVar *newRelation, LOCKMODE lockmode, Oid *existing_relation_id); extern void RangeVarAdjustRelationPersistence(RangeVar *newRelation, Oid nspid); extern Oid RelnameGetRelid(const char *relname); extern bool RelationIsVisible(Oid relid); extern Oid TypenameGetTypid(const char *typname); extern Oid TypenameGetTypidExtended(const char *typname, bool temp_ok); extern bool TypeIsVisible(Oid typid); extern FuncCandidateList FuncnameGetCandidates(List *names, int nargs, List *argnames, bool expand_variadic, bool expand_defaults); extern bool FunctionIsVisible(Oid funcid); extern Oid OpernameGetOprid(List *names, Oid oprleft, Oid oprright); extern FuncCandidateList OpernameGetCandidates(List *names, char oprkind); extern bool OperatorIsVisible(Oid oprid); extern Oid OpclassnameGetOpcid(Oid amid, const char *opcname); extern bool OpclassIsVisible(Oid opcid); extern Oid OpfamilynameGetOpfid(Oid amid, const char *opfname); extern bool OpfamilyIsVisible(Oid opfid); extern Oid CollationGetCollid(const char *collname); extern bool CollationIsVisible(Oid collid); extern Oid ConversionGetConid(const char *conname); extern bool ConversionIsVisible(Oid conid); extern Oid get_ts_parser_oid(List *names, bool missing_ok); extern bool TSParserIsVisible(Oid prsId); extern Oid get_ts_dict_oid(List *names, bool missing_ok); extern bool TSDictionaryIsVisible(Oid dictId); extern Oid get_ts_template_oid(List *names, bool missing_ok); extern bool TSTemplateIsVisible(Oid tmplId); extern Oid get_ts_config_oid(List *names, bool missing_ok); extern bool TSConfigIsVisible(Oid cfgid); extern void DeconstructQualifiedName(List *names, char **nspname_p, char **objname_p); extern Oid LookupNamespaceNoError(const char *nspname); extern Oid LookupExplicitNamespace(const char *nspname); extern Oid get_namespace_oid(const char *nspname, bool missing_ok); extern Oid LookupCreationNamespace(const char *nspname); extern void CheckSetNamespace(Oid oldNspOid, Oid nspOid, Oid classid, Oid objid); extern Oid QualifiedNameGetCreationNamespace(List *names, char **objname_p); extern RangeVar *makeRangeVarFromNameList(List *names); extern char *NameListToString(List *names); extern char *NameListToQuotedString(List *names); extern bool isTempNamespace(Oid namespaceId); extern bool isTempToastNamespace(Oid namespaceId); extern bool isTempOrToastNamespace(Oid namespaceId); extern bool isAnyTempNamespace(Oid namespaceId); extern bool isOtherTempNamespace(Oid namespaceId); extern int GetTempNamespaceBackendId(Oid namespaceId); extern Oid GetTempToastNamespace(void); extern void ResetTempTableNamespace(void); extern OverrideSearchPath *GetOverrideSearchPath(MemoryContext context); extern OverrideSearchPath *CopyOverrideSearchPath(OverrideSearchPath *path); extern void PushOverrideSearchPath(OverrideSearchPath *newpath); extern void PopOverrideSearchPath(void); extern Oid get_collation_oid(List *collname, bool missing_ok); extern Oid get_conversion_oid(List *conname, bool missing_ok); extern Oid FindDefaultConversionProc(int4 for_encoding, int4 to_encoding); /* initialization & transaction cleanup code */ extern void InitializeSearchPath(void); extern void AtEOXact_Namespace(bool isCommit); extern void AtEOSubXact_Namespace(bool isCommit, SubTransactionId mySubid, SubTransactionId parentSubid); /* stuff for search_path GUC variable */ extern char *namespace_search_path; extern List *fetch_search_path(bool includeImplicit); extern int fetch_search_path_array(Oid *sarray, int sarray_len); #endif /* NAMESPACE_H */ PKBiZ0&&server/catalog/pg_attribute.hnu[/*------------------------------------------------------------------------- * * pg_attribute.h * definition of the system "attribute" relation (pg_attribute) * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_attribute.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * *------------------------------------------------------------------------- */ #ifndef PG_ATTRIBUTE_H #define PG_ATTRIBUTE_H #include "catalog/genbki.h" /* ---------------- * pg_attribute definition. cpp turns this into * typedef struct FormData_pg_attribute * * If you change the following, make sure you change the structs for * system attributes in catalog/heap.c also. * You may need to change catalog/genbki.pl as well. * ---------------- */ #define AttributeRelationId 1249 #define AttributeRelation_Rowtype_Id 75 CATALOG(pg_attribute,1249) BKI_BOOTSTRAP BKI_WITHOUT_OIDS BKI_ROWTYPE_OID(75) BKI_SCHEMA_MACRO { Oid attrelid; /* OID of relation containing this attribute */ NameData attname; /* name of attribute */ /* * atttypid is the OID of the instance in Catalog Class pg_type that * defines the data type of this attribute (e.g. int4). Information in * that instance is redundant with the attlen, attbyval, and attalign * attributes of this instance, so they had better match or Postgres will * fail. */ Oid atttypid; /* * attstattarget is the target number of statistics datapoints to collect * during VACUUM ANALYZE of this column. A zero here indicates that we do * not wish to collect any stats about this column. A "-1" here indicates * that no value has been explicitly set for this column, so ANALYZE * should use the default setting. */ int4 attstattarget; /* * attlen is a copy of the typlen field from pg_type for this attribute. * See atttypid comments above. */ int2 attlen; /* * attnum is the "attribute number" for the attribute: A value that * uniquely identifies this attribute within its class. For user * attributes, Attribute numbers are greater than 0 and not greater than * the number of attributes in the class. I.e. if the Class pg_class says * that Class XYZ has 10 attributes, then the user attribute numbers in * Class pg_attribute must be 1-10. * * System attributes have attribute numbers less than 0 that are unique * within the class, but not constrained to any particular range. * * Note that (attnum - 1) is often used as the index to an array. */ int2 attnum; /* * attndims is the declared number of dimensions, if an array type, * otherwise zero. */ int4 attndims; /* * fastgetattr() uses attcacheoff to cache byte offsets of attributes in * heap tuples. The value actually stored in pg_attribute (-1) indicates * no cached value. But when we copy these tuples into a tuple * descriptor, we may then update attcacheoff in the copies. This speeds * up the attribute walking process. */ int4 attcacheoff; /* * atttypmod records type-specific data supplied at table creation time * (for example, the max length of a varchar field). It is passed to * type-specific input and output functions as the third argument. The * value will generally be -1 for types that do not need typmod. */ int4 atttypmod; /* * attbyval is a copy of the typbyval field from pg_type for this * attribute. See atttypid comments above. */ bool attbyval; /*---------- * attstorage tells for VARLENA attributes, what the heap access * methods can do to it if a given tuple doesn't fit into a page. * Possible values are * 'p': Value must be stored plain always * 'e': Value can be stored in "secondary" relation (if relation * has one, see pg_class.reltoastrelid) * 'm': Value can be stored compressed inline * 'x': Value can be stored compressed inline or in "secondary" * Note that 'm' fields can also be moved out to secondary storage, * but only as a last resort ('e' and 'x' fields are moved first). *---------- */ char attstorage; /* * attalign is a copy of the typalign field from pg_type for this * attribute. See atttypid comments above. */ char attalign; /* This flag represents the "NOT NULL" constraint */ bool attnotnull; /* Has DEFAULT value or not */ bool atthasdef; /* Is dropped (ie, logically invisible) or not */ bool attisdropped; /* Has a local definition (hence, do not drop when attinhcount is 0) */ bool attislocal; /* Number of times inherited from direct parent relation(s) */ int4 attinhcount; /* attribute's collation */ Oid attcollation; #ifdef CATALOG_VARLEN /* variable-length fields start here */ /* NOTE: The following fields are not present in tuple descriptors. */ /* Column-level access permissions */ aclitem attacl[1]; /* Column-level options */ text attoptions[1]; /* Column-level FDW options */ text attfdwoptions[1]; #endif } FormData_pg_attribute; /* * ATTRIBUTE_FIXED_PART_SIZE is the size of the fixed-layout, * guaranteed-not-null part of a pg_attribute row. This is in fact as much * of the row as gets copied into tuple descriptors, so don't expect you * can access fields beyond attcollation except in a real tuple! */ #define ATTRIBUTE_FIXED_PART_SIZE \ (offsetof(FormData_pg_attribute,attcollation) + sizeof(Oid)) /* ---------------- * Form_pg_attribute corresponds to a pointer to a tuple with * the format of pg_attribute relation. * ---------------- */ typedef FormData_pg_attribute *Form_pg_attribute; /* ---------------- * compiler constants for pg_attribute * ---------------- */ #define Natts_pg_attribute 21 #define Anum_pg_attribute_attrelid 1 #define Anum_pg_attribute_attname 2 #define Anum_pg_attribute_atttypid 3 #define Anum_pg_attribute_attstattarget 4 #define Anum_pg_attribute_attlen 5 #define Anum_pg_attribute_attnum 6 #define Anum_pg_attribute_attndims 7 #define Anum_pg_attribute_attcacheoff 8 #define Anum_pg_attribute_atttypmod 9 #define Anum_pg_attribute_attbyval 10 #define Anum_pg_attribute_attstorage 11 #define Anum_pg_attribute_attalign 12 #define Anum_pg_attribute_attnotnull 13 #define Anum_pg_attribute_atthasdef 14 #define Anum_pg_attribute_attisdropped 15 #define Anum_pg_attribute_attislocal 16 #define Anum_pg_attribute_attinhcount 17 #define Anum_pg_attribute_attcollation 18 #define Anum_pg_attribute_attacl 19 #define Anum_pg_attribute_attoptions 20 #define Anum_pg_attribute_attfdwoptions 21 /* ---------------- * initial contents of pg_attribute * * The initial contents of pg_attribute are generated at compile time by * genbki.pl. Only "bootstrapped" relations need be included. * ---------------- */ #endif /* PG_ATTRIBUTE_H */ PKBiZ@zz"server/catalog/pg_foreign_server.hnu[/*------------------------------------------------------------------------- * * pg_foreign_server.h * definition of the system "foreign server" relation (pg_foreign_server) * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_foreign_server.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * *------------------------------------------------------------------------- */ #ifndef PG_FOREIGN_SERVER_H #define PG_FOREIGN_SERVER_H #include "catalog/genbki.h" /* ---------------- * pg_foreign_server definition. cpp turns this into * typedef struct FormData_pg_foreign_server * ---------------- */ #define ForeignServerRelationId 1417 CATALOG(pg_foreign_server,1417) { NameData srvname; /* foreign server name */ Oid srvowner; /* server owner */ Oid srvfdw; /* server FDW */ #ifdef CATALOG_VARLEN /* variable-length fields start here */ text srvtype; text srvversion; aclitem srvacl[1]; /* access permissions */ text srvoptions[1]; /* FDW-specific options */ #endif } FormData_pg_foreign_server; /* ---------------- * Form_pg_foreign_server corresponds to a pointer to a tuple with * the format of pg_foreign_server relation. * ---------------- */ typedef FormData_pg_foreign_server *Form_pg_foreign_server; /* ---------------- * compiler constants for pg_foreign_server * ---------------- */ #define Natts_pg_foreign_server 7 #define Anum_pg_foreign_server_srvname 1 #define Anum_pg_foreign_server_srvowner 2 #define Anum_pg_foreign_server_srvfdw 3 #define Anum_pg_foreign_server_srvtype 4 #define Anum_pg_foreign_server_srvversion 5 #define Anum_pg_foreign_server_srvacl 6 #define Anum_pg_foreign_server_srvoptions 7 #endif /* PG_FOREIGN_SERVER_H */ PKBiZ̻XX server/catalog/pg_user_mapping.hnu[/*------------------------------------------------------------------------- * * pg_user_mapping.h * definition of the system "user mapping" relation (pg_user_mapping) * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_user_mapping.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * *------------------------------------------------------------------------- */ #ifndef PG_USER_MAPPING_H #define PG_USER_MAPPING_H #include "catalog/genbki.h" /* ---------------- * pg_user_mapping definition. cpp turns this into * typedef struct FormData_pg_user_mapping * ---------------- */ #define UserMappingRelationId 1418 CATALOG(pg_user_mapping,1418) { Oid umuser; /* Id of the user, InvalidOid if PUBLIC is * wanted */ Oid umserver; /* server of this mapping */ #ifdef CATALOG_VARLEN /* variable-length fields start here */ text umoptions[1]; /* user mapping options */ #endif } FormData_pg_user_mapping; /* ---------------- * Form_pg_user_mapping corresponds to a pointer to a tuple with * the format of pg_user_mapping relation. * ---------------- */ typedef FormData_pg_user_mapping *Form_pg_user_mapping; /* ---------------- * compiler constants for pg_user_mapping * ---------------- */ #define Natts_pg_user_mapping 3 #define Anum_pg_user_mapping_umuser 1 #define Anum_pg_user_mapping_umserver 2 #define Anum_pg_user_mapping_umoptions 3 #endif /* PG_USER_MAPPING_H */ PKBiZ$ !server/catalog/pg_shdescription.hnu[/*------------------------------------------------------------------------- * * pg_shdescription.h * definition of the system "shared description" relation * (pg_shdescription) * * NOTE: an object is identified by the OID of the row that primarily * defines the object, plus the OID of the table that that row appears in. * For example, a database is identified by the OID of its pg_database row * plus the pg_class OID of table pg_database. This allows unique * identification of objects without assuming that OIDs are unique * across tables. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_shdescription.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * * XXX do NOT break up DATA() statements into multiple lines! * the scripts are not as smart as you might think... * *------------------------------------------------------------------------- */ #ifndef PG_SHDESCRIPTION_H #define PG_SHDESCRIPTION_H #include "catalog/genbki.h" /* ---------------- * pg_shdescription definition. cpp turns this into * typedef struct FormData_pg_shdescription * ---------------- */ #define SharedDescriptionRelationId 2396 CATALOG(pg_shdescription,2396) BKI_SHARED_RELATION BKI_WITHOUT_OIDS { Oid objoid; /* OID of object itself */ Oid classoid; /* OID of table containing object */ #ifdef CATALOG_VARLEN /* variable-length fields start here */ text description; /* description of object */ #endif } FormData_pg_shdescription; /* ---------------- * Form_pg_shdescription corresponds to a pointer to a tuple with * the format of pg_shdescription relation. * ---------------- */ typedef FormData_pg_shdescription *Form_pg_shdescription; /* ---------------- * compiler constants for pg_shdescription * ---------------- */ #define Natts_pg_shdescription 3 #define Anum_pg_shdescription_objoid 1 #define Anum_pg_shdescription_classoid 2 #define Anum_pg_shdescription_description 3 /* ---------------- * initial contents of pg_shdescription * ---------------- */ /* * Because the contents of this table are taken from the other *.h files, * there is no initialization here. The initial contents are extracted * by genbki.pl and loaded during initdb. */ #endif /* PG_SHDESCRIPTION_H */ PKBiZb{2(server/catalog/pg_largeobject_metadata.hnu[/*------------------------------------------------------------------------- * * pg_largeobject_metadata.h * definition of the system "largeobject_metadata" relation (pg_largeobject_metadata) * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_largeobject_metadata.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * *------------------------------------------------------------------------- */ #ifndef PG_LARGEOBJECT_METADATA_H #define PG_LARGEOBJECT_METADATA_H #include "catalog/genbki.h" /* ---------------- * pg_largeobject_metadata definition. cpp turns this into * typedef struct FormData_pg_largeobject_metadata * ---------------- */ #define LargeObjectMetadataRelationId 2995 CATALOG(pg_largeobject_metadata,2995) { Oid lomowner; /* OID of the largeobject owner */ #ifdef CATALOG_VARLEN /* variable-length fields start here */ aclitem lomacl[1]; /* access permissions */ #endif } FormData_pg_largeobject_metadata; /* ---------------- * Form_pg_largeobject_metadata corresponds to a pointer to a tuple * with the format of pg_largeobject_metadata relation. * ---------------- */ typedef FormData_pg_largeobject_metadata *Form_pg_largeobject_metadata; /* ---------------- * compiler constants for pg_largeobject_metadata * ---------------- */ #define Natts_pg_largeobject_metadata 2 #define Anum_pg_largeobject_metadata_lomowner 1 #define Anum_pg_largeobject_metadata_lomacl 2 #endif /* PG_LARGEOBJECT_METADATA_H */ PKBiZ;XXserver/catalog/pg_extension.hnu[/*------------------------------------------------------------------------- * * pg_extension.h * definition of the system "extension" relation (pg_extension) * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_extension.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * *------------------------------------------------------------------------- */ #ifndef PG_EXTENSION_H #define PG_EXTENSION_H #include "catalog/genbki.h" /* ---------------- * pg_extension definition. cpp turns this into * typedef struct FormData_pg_extension * ---------------- */ #define ExtensionRelationId 3079 CATALOG(pg_extension,3079) { NameData extname; /* extension name */ Oid extowner; /* extension owner */ Oid extnamespace; /* namespace of contained objects */ bool extrelocatable; /* if true, allow ALTER EXTENSION SET SCHEMA */ #ifdef CATALOG_VARLEN /* variable-length fields start here */ /* extversion should never be null, but the others can be. */ text extversion; /* extension version name */ Oid extconfig[1]; /* dumpable configuration tables */ text extcondition[1]; /* WHERE clauses for config tables */ #endif } FormData_pg_extension; /* ---------------- * Form_pg_extension corresponds to a pointer to a tuple with * the format of pg_extension relation. * ---------------- */ typedef FormData_pg_extension *Form_pg_extension; /* ---------------- * compiler constants for pg_extension * ---------------- */ #define Natts_pg_extension 7 #define Anum_pg_extension_extname 1 #define Anum_pg_extension_extowner 2 #define Anum_pg_extension_extnamespace 3 #define Anum_pg_extension_extrelocatable 4 #define Anum_pg_extension_extversion 5 #define Anum_pg_extension_extconfig 6 #define Anum_pg_extension_extcondition 7 /* ---------------- * pg_extension has no initial contents * ---------------- */ #endif /* PG_EXTENSION_H */ PKBiZ0.|,,server/catalog/pg_statistic.hnu[/*------------------------------------------------------------------------- * * pg_statistic.h * definition of the system "statistic" relation (pg_statistic) * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_statistic.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * *------------------------------------------------------------------------- */ #ifndef PG_STATISTIC_H #define PG_STATISTIC_H #include "catalog/genbki.h" /* ---------------- * pg_statistic definition. cpp turns this into * typedef struct FormData_pg_statistic * ---------------- */ #define StatisticRelationId 2619 CATALOG(pg_statistic,2619) BKI_WITHOUT_OIDS { /* These fields form the unique key for the entry: */ Oid starelid; /* relation containing attribute */ int2 staattnum; /* attribute (column) stats are for */ bool stainherit; /* true if inheritance children are included */ /* the fraction of the column's entries that are NULL: */ float4 stanullfrac; /* * stawidth is the average width in bytes of non-null entries. For * fixed-width datatypes this is of course the same as the typlen, but for * var-width types it is more useful. Note that this is the average width * of the data as actually stored, post-TOASTing (eg, for a * moved-out-of-line value, only the size of the pointer object is * counted). This is the appropriate definition for the primary use of * the statistic, which is to estimate sizes of in-memory hash tables of * tuples. */ int4 stawidth; /* ---------------- * stadistinct indicates the (approximate) number of distinct non-null * data values in the column. The interpretation is: * 0 unknown or not computed * > 0 actual number of distinct values * < 0 negative of multiplier for number of rows * The special negative case allows us to cope with columns that are * unique (stadistinct = -1) or nearly so (for example, a column in which * non-null values appear about twice on the average could be represented * by stadistinct = -0.5 if there are no nulls, or -0.4 if 20% of the * column is nulls). Because the number-of-rows statistic in pg_class may * be updated more frequently than pg_statistic is, it's important to be * able to describe such situations as a multiple of the number of rows, * rather than a fixed number of distinct values. But in other cases a * fixed number is correct (eg, a boolean column). * ---------------- */ float4 stadistinct; /* ---------------- * To allow keeping statistics on different kinds of datatypes, * we do not hard-wire any particular meaning for the remaining * statistical fields. Instead, we provide several "slots" in which * statistical data can be placed. Each slot includes: * kind integer code identifying kind of data (see below) * op OID of associated operator, if needed * numbers float4 array (for statistical values) * values anyarray (for representations of data values) * The ID and operator fields are never NULL; they are zeroes in an * unused slot. The numbers and values fields are NULL in an unused * slot, and might also be NULL in a used slot if the slot kind has * no need for one or the other. * ---------------- */ int2 stakind1; int2 stakind2; int2 stakind3; int2 stakind4; int2 stakind5; Oid staop1; Oid staop2; Oid staop3; Oid staop4; Oid staop5; #ifdef CATALOG_VARLEN /* variable-length fields start here */ float4 stanumbers1[1]; float4 stanumbers2[1]; float4 stanumbers3[1]; float4 stanumbers4[1]; float4 stanumbers5[1]; /* * Values in these arrays are values of the column's data type, or of some * related type such as an array element type. We presently have to cheat * quite a bit to allow polymorphic arrays of this kind, but perhaps * someday it'll be a less bogus facility. */ anyarray stavalues1; anyarray stavalues2; anyarray stavalues3; anyarray stavalues4; anyarray stavalues5; #endif } FormData_pg_statistic; #define STATISTIC_NUM_SLOTS 5 /* ---------------- * Form_pg_statistic corresponds to a pointer to a tuple with * the format of pg_statistic relation. * ---------------- */ typedef FormData_pg_statistic *Form_pg_statistic; /* ---------------- * compiler constants for pg_statistic * ---------------- */ #define Natts_pg_statistic 26 #define Anum_pg_statistic_starelid 1 #define Anum_pg_statistic_staattnum 2 #define Anum_pg_statistic_stainherit 3 #define Anum_pg_statistic_stanullfrac 4 #define Anum_pg_statistic_stawidth 5 #define Anum_pg_statistic_stadistinct 6 #define Anum_pg_statistic_stakind1 7 #define Anum_pg_statistic_stakind2 8 #define Anum_pg_statistic_stakind3 9 #define Anum_pg_statistic_stakind4 10 #define Anum_pg_statistic_stakind5 11 #define Anum_pg_statistic_staop1 12 #define Anum_pg_statistic_staop2 13 #define Anum_pg_statistic_staop3 14 #define Anum_pg_statistic_staop4 15 #define Anum_pg_statistic_staop5 16 #define Anum_pg_statistic_stanumbers1 17 #define Anum_pg_statistic_stanumbers2 18 #define Anum_pg_statistic_stanumbers3 19 #define Anum_pg_statistic_stanumbers4 20 #define Anum_pg_statistic_stanumbers5 21 #define Anum_pg_statistic_stavalues1 22 #define Anum_pg_statistic_stavalues2 23 #define Anum_pg_statistic_stavalues3 24 #define Anum_pg_statistic_stavalues4 25 #define Anum_pg_statistic_stavalues5 26 /* * Currently, five statistical slot "kinds" are defined by core PostgreSQL, * as documented below. Additional "kinds" will probably appear in * future to help cope with non-scalar datatypes. Also, custom data types * can define their own "kind" codes by mutual agreement between a custom * typanalyze routine and the selectivity estimation functions of the type's * operators. * * Code reading the pg_statistic relation should not assume that a particular * data "kind" will appear in any particular slot. Instead, search the * stakind fields to see if the desired data is available. (The standard * function get_attstatsslot() may be used for this.) */ /* * The present allocation of "kind" codes is: * * 1-99: reserved for assignment by the core PostgreSQL project * (values in this range will be documented in this file) * 100-199: reserved for assignment by the PostGIS project * (values to be documented in PostGIS documentation) * 200-299: reserved for assignment by the ESRI ST_Geometry project * (values to be documented in ESRI ST_Geometry documentation) * 300-9999: reserved for future public assignments * * For private use you may choose a "kind" code at random in the range * 10000-30000. However, for code that is to be widely disseminated it is * better to obtain a publicly defined "kind" code by request from the * PostgreSQL Global Development Group. */ /* * In a "most common values" slot, staop is the OID of the "=" operator * used to decide whether values are the same or not. stavalues contains * the K most common non-null values appearing in the column, and stanumbers * contains their frequencies (fractions of total row count). The values * shall be ordered in decreasing frequency. Note that since the arrays are * variable-size, K may be chosen by the statistics collector. Values should * not appear in MCV unless they have been observed to occur more than once; * a unique column will have no MCV slot. */ #define STATISTIC_KIND_MCV 1 /* * A "histogram" slot describes the distribution of scalar data. staop is * the OID of the "<" operator that describes the sort ordering. (In theory, * more than one histogram could appear, if a datatype has more than one * useful sort operator.) stavalues contains M (>=2) non-null values that * divide the non-null column data values into M-1 bins of approximately equal * population. The first stavalues item is the MIN and the last is the MAX. * stanumbers is not used and should be NULL. IMPORTANT POINT: if an MCV * slot is also provided, then the histogram describes the data distribution * *after removing the values listed in MCV* (thus, it's a "compressed * histogram" in the technical parlance). This allows a more accurate * representation of the distribution of a column with some very-common * values. In a column with only a few distinct values, it's possible that * the MCV list describes the entire data population; in this case the * histogram reduces to empty and should be omitted. */ #define STATISTIC_KIND_HISTOGRAM 2 /* * A "correlation" slot describes the correlation between the physical order * of table tuples and the ordering of data values of this column, as seen * by the "<" operator identified by staop. (As with the histogram, more * than one entry could theoretically appear.) stavalues is not used and * should be NULL. stanumbers contains a single entry, the correlation * coefficient between the sequence of data values and the sequence of * their actual tuple positions. The coefficient ranges from +1 to -1. */ #define STATISTIC_KIND_CORRELATION 3 /* * A "most common elements" slot is similar to a "most common values" slot, * except that it stores the most common non-null *elements* of the column * values. This is useful when the column datatype is an array or some other * type with identifiable elements (for instance, tsvector). staop contains * the equality operator appropriate to the element type. stavalues contains * the most common element values, and stanumbers their frequencies. Unlike * MCV slots, frequencies are measured as the fraction of non-null rows the * element value appears in, not the frequency of all rows. Also unlike * MCV slots, the values are sorted into the element type's default order * (to support binary search for a particular value). Since this puts the * minimum and maximum frequencies at unpredictable spots in stanumbers, * there are two extra members of stanumbers, holding copies of the minimum * and maximum frequencies. Optionally, there can be a third extra member, * which holds the frequency of null elements (expressed in the same terms: * the fraction of non-null rows that contain at least one null element). If * this member is omitted, the column is presumed to contain no null elements. * * Note: in current usage for tsvector columns, the stavalues elements are of * type text, even though their representation within tsvector is not * exactly text. */ #define STATISTIC_KIND_MCELEM 4 /* * A "distinct elements count histogram" slot describes the distribution of * the number of distinct element values present in each row of an array-type * column. Only non-null rows are considered, and only non-null elements. * staop contains the equality operator appropriate to the element type. * stavalues is not used and should be NULL. The last member of stanumbers is * the average count of distinct element values over all non-null rows. The * preceding M (>=2) members form a histogram that divides the population of * distinct-elements counts into M-1 bins of approximately equal population. * The first of these is the minimum observed count, and the last the maximum. */ #define STATISTIC_KIND_DECHIST 5 #endif /* PG_STATISTIC_H */ PKBiZ"DVVserver/catalog/storage.hnu[/*------------------------------------------------------------------------- * * storage.h * prototypes for functions in backend/catalog/storage.c * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/storage.h * *------------------------------------------------------------------------- */ #ifndef STORAGE_H #define STORAGE_H #include "access/xlog.h" #include "storage/block.h" #include "storage/relfilenode.h" #include "utils/relcache.h" extern void RelationCreateStorage(RelFileNode rnode, char relpersistence); extern void RelationDropStorage(Relation rel); extern void RelationPreserveStorage(RelFileNode rnode, bool atCommit); extern void RelationTruncate(Relation rel, BlockNumber nblocks); /* * These functions used to be in storage/smgr/smgr.c, which explains the * naming */ extern void smgrDoPendingDeletes(bool isCommit); extern int smgrGetPendingDeletes(bool forCommit, RelFileNode **ptr); extern void AtSubCommit_smgr(void); extern void AtSubAbort_smgr(void); extern void PostPrepare_smgr(void); extern void log_smgrcreate(RelFileNode *rnode, ForkNumber forkNum); extern void smgr_redo(XLogRecPtr lsn, XLogRecord *record); extern void smgr_desc(StringInfo buf, uint8 xl_info, char *rec); #endif /* STORAGE_H */ PKBiZ #server/catalog/pg_db_role_setting.hnu[/*------------------------------------------------------------------------- * * pg_db_role_setting.h * definition of configuration settings * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_db_role_setting.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * * XXX do NOT break up DATA() statements into multiple lines! * the scripts are not as smart as you might think... * *------------------------------------------------------------------------- */ #ifndef PG_DB_ROLE_SETTING_H #define PG_DB_ROLE_SETTING_H #include "utils/guc.h" #include "utils/relcache.h" /* ---------------- * pg_db_role_setting definition. cpp turns this into * typedef struct FormData_pg_db_role_setting * ---------------- */ #define DbRoleSettingRelationId 2964 CATALOG(pg_db_role_setting,2964) BKI_SHARED_RELATION BKI_WITHOUT_OIDS { Oid setdatabase; /* database */ Oid setrole; /* role */ #ifdef CATALOG_VARLEN /* variable-length fields start here */ text setconfig[1]; /* GUC settings to apply at login */ #endif } FormData_pg_db_role_setting; typedef FormData_pg_db_role_setting *Form_pg_db_role_setting; /* ---------------- * compiler constants for pg_db_role_setting * ---------------- */ #define Natts_pg_db_role_setting 3 #define Anum_pg_db_role_setting_setdatabase 1 #define Anum_pg_db_role_setting_setrole 2 #define Anum_pg_db_role_setting_setconfig 3 /* ---------------- * initial contents of pg_db_role_setting are NOTHING * ---------------- */ /* * prototypes for functions in pg_db_role_setting.h */ extern void AlterSetting(Oid databaseid, Oid roleid, VariableSetStmt *setstmt); extern void DropSetting(Oid databaseid, Oid roleid); extern void ApplySetting(Oid databaseid, Oid roleid, Relation relsetting, GucSource source); #endif /* PG_DB_ROLE_SETTING_H */ PKBiZWfCCserver/catalog/pg_enum.hnu[/*------------------------------------------------------------------------- * * pg_enum.h * definition of the system "enum" relation (pg_enum) * along with the relation's initial contents. * * * Copyright (c) 2006-2012, PostgreSQL Global Development Group * * src/include/catalog/pg_enum.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * * XXX do NOT break up DATA() statements into multiple lines! * the scripts are not as smart as you might think... * *------------------------------------------------------------------------- */ #ifndef PG_ENUM_H #define PG_ENUM_H #include "catalog/genbki.h" #include "nodes/pg_list.h" /* ---------------- * pg_enum definition. cpp turns this into * typedef struct FormData_pg_enum * ---------------- */ #define EnumRelationId 3501 CATALOG(pg_enum,3501) { Oid enumtypid; /* OID of owning enum type */ float4 enumsortorder; /* sort position of this enum value */ NameData enumlabel; /* text representation of enum value */ } FormData_pg_enum; /* ---------------- * Form_pg_enum corresponds to a pointer to a tuple with * the format of pg_enum relation. * ---------------- */ typedef FormData_pg_enum *Form_pg_enum; /* ---------------- * compiler constants for pg_enum * ---------------- */ #define Natts_pg_enum 3 #define Anum_pg_enum_enumtypid 1 #define Anum_pg_enum_enumsortorder 2 #define Anum_pg_enum_enumlabel 3 /* ---------------- * pg_enum has no initial contents * ---------------- */ /* * prototypes for functions in pg_enum.c */ extern void EnumValuesCreate(Oid enumTypeOid, List *vals); extern void EnumValuesDelete(Oid enumTypeOid); extern void AddEnumLabel(Oid enumTypeOid, const char *newVal, const char *neighbor, bool newValIsAfter); #endif /* PG_ENUM_H */ PKBiZRvvserver/catalog/objectaccess.hnu[/* * objectaccess.h * * Object access hooks. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California */ #ifndef OBJECTACCESS_H #define OBJECTACCESS_H /* * Object access hooks are intended to be called just before or just after * performing certain actions on a SQL object. This is intended as * infrastructure for security or logging pluggins. * * OAT_POST_CREATE should be invoked just after the object is created. * Typically, this is done after inserting the primary catalog records and * associated dependencies. * * OAT_DROP should be invoked just before deletion of objects; typically * deleteOneObject(). Its arguments are packed within ObjectAccessDrop. * * Other types may be added in the future. */ typedef enum ObjectAccessType { OAT_POST_CREATE, OAT_DROP } ObjectAccessType; /* * Arguments of OAT_DROP event */ typedef struct { /* * Flags to inform extensions the context of this deletion. Also see * PERFORM_DELETION_* in dependency.h */ int dropflags; } ObjectAccessDrop; /* * Hook, and a macro to invoke it. */ typedef void (*object_access_hook_type) (ObjectAccessType access, Oid classId, Oid objectId, int subId, void *arg); extern PGDLLIMPORT object_access_hook_type object_access_hook; #define InvokeObjectAccessHook(access,classId,objectId,subId,arg) \ do { \ if (object_access_hook) \ (*object_access_hook)((access),(classId), \ (objectId),(subId),(arg)); \ } while(0) #endif /* OBJECTACCESS_H */ PKBiZhxserver/catalog/pg_proc_fn.hnu[/*------------------------------------------------------------------------- * * pg_proc_fn.h * prototypes for functions in catalog/pg_proc.c * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_proc_fn.h * *------------------------------------------------------------------------- */ #ifndef PG_PROC_FN_H #define PG_PROC_FN_H #include "nodes/pg_list.h" extern Oid ProcedureCreate(const char *procedureName, Oid procNamespace, bool replace, bool returnsSet, Oid returnType, Oid proowner, Oid languageObjectId, Oid languageValidator, const char *prosrc, const char *probin, bool isAgg, bool isWindowFunc, bool security_definer, bool isLeakProof, bool isStrict, char volatility, oidvector *parameterTypes, Datum allParameterTypes, Datum parameterModes, Datum parameterNames, List *parameterDefaults, Datum proconfig, float4 procost, float4 prorows); extern bool function_parse_error_transpose(const char *prosrc); #endif /* PG_PROC_FN_H */ PKBiZ'Tccserver/catalog/pg_tablespace.hnu[/*------------------------------------------------------------------------- * * pg_tablespace.h * definition of the system "tablespace" relation (pg_tablespace) * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_tablespace.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * *------------------------------------------------------------------------- */ #ifndef PG_TABLESPACE_H #define PG_TABLESPACE_H #include "catalog/genbki.h" /* ---------------- * pg_tablespace definition. cpp turns this into * typedef struct FormData_pg_tablespace * ---------------- */ #define TableSpaceRelationId 1213 CATALOG(pg_tablespace,1213) BKI_SHARED_RELATION { NameData spcname; /* tablespace name */ Oid spcowner; /* owner of tablespace */ #ifdef CATALOG_VARLEN /* variable-length fields start here */ aclitem spcacl[1]; /* access permissions */ text spcoptions[1]; /* per-tablespace options */ #endif } FormData_pg_tablespace; /* ---------------- * Form_pg_tablespace corresponds to a pointer to a tuple with * the format of pg_tablespace relation. * ---------------- */ typedef FormData_pg_tablespace *Form_pg_tablespace; /* ---------------- * compiler constants for pg_tablespace * ---------------- */ #define Natts_pg_tablespace 4 #define Anum_pg_tablespace_spcname 1 #define Anum_pg_tablespace_spcowner 2 #define Anum_pg_tablespace_spcacl 3 #define Anum_pg_tablespace_spcoptions 4 DATA(insert OID = 1663 ( pg_default PGUID _null_ _null_ )); DATA(insert OID = 1664 ( pg_global PGUID _null_ _null_ )); #define DEFAULTTABLESPACE_OID 1663 #define GLOBALTABLESPACE_OID 1664 #endif /* PG_TABLESPACE_H */ PKBiZJ$ server/catalog/pg_depend.hnu[/*------------------------------------------------------------------------- * * pg_depend.h * definition of the system "dependency" relation (pg_depend) * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_depend.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * *------------------------------------------------------------------------- */ #ifndef PG_DEPEND_H #define PG_DEPEND_H #include "catalog/genbki.h" /* ---------------- * pg_depend definition. cpp turns this into * typedef struct FormData_pg_depend * ---------------- */ #define DependRelationId 2608 CATALOG(pg_depend,2608) BKI_WITHOUT_OIDS { /* * Identification of the dependent (referencing) object. * * These fields are all zeroes for a DEPENDENCY_PIN entry. */ Oid classid; /* OID of table containing object */ Oid objid; /* OID of object itself */ int4 objsubid; /* column number, or 0 if not used */ /* * Identification of the independent (referenced) object. */ Oid refclassid; /* OID of table containing object */ Oid refobjid; /* OID of object itself */ int4 refobjsubid; /* column number, or 0 if not used */ /* * Precise semantics of the relationship are specified by the deptype * field. See DependencyType in catalog/dependency.h. */ char deptype; /* see codes in dependency.h */ } FormData_pg_depend; /* ---------------- * Form_pg_depend corresponds to a pointer to a row with * the format of pg_depend relation. * ---------------- */ typedef FormData_pg_depend *Form_pg_depend; /* ---------------- * compiler constants for pg_depend * ---------------- */ #define Natts_pg_depend 7 #define Anum_pg_depend_classid 1 #define Anum_pg_depend_objid 2 #define Anum_pg_depend_objsubid 3 #define Anum_pg_depend_refclassid 4 #define Anum_pg_depend_refobjid 5 #define Anum_pg_depend_refobjsubid 6 #define Anum_pg_depend_deptype 7 /* * pg_depend has no preloaded contents; system-defined dependencies are * loaded into it during a late stage of the initdb process. * * NOTE: we do not represent all possible dependency pairs in pg_depend; * for example, there's not much value in creating an explicit dependency * from an attribute to its relation. Usually we make a dependency for * cases where the relationship is conditional rather than essential * (for example, not all triggers are dependent on constraints, but all * attributes are dependent on relations) or where the dependency is not * convenient to find from the contents of other catalogs. */ #endif /* PG_DEPEND_H */ PKBiZ&9]]server/catalog/pg_opfamily.hnu[/*------------------------------------------------------------------------- * * pg_opfamily.h * definition of the system "opfamily" relation (pg_opfamily) * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_opfamily.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * *------------------------------------------------------------------------- */ #ifndef PG_OPFAMILY_H #define PG_OPFAMILY_H #include "catalog/genbki.h" /* ---------------- * pg_opfamily definition. cpp turns this into * typedef struct FormData_pg_opfamily * ---------------- */ #define OperatorFamilyRelationId 2753 CATALOG(pg_opfamily,2753) { Oid opfmethod; /* index access method opfamily is for */ NameData opfname; /* name of this opfamily */ Oid opfnamespace; /* namespace of this opfamily */ Oid opfowner; /* opfamily owner */ } FormData_pg_opfamily; /* ---------------- * Form_pg_opfamily corresponds to a pointer to a tuple with * the format of pg_opfamily relation. * ---------------- */ typedef FormData_pg_opfamily *Form_pg_opfamily; /* ---------------- * compiler constants for pg_opfamily * ---------------- */ #define Natts_pg_opfamily 4 #define Anum_pg_opfamily_opfmethod 1 #define Anum_pg_opfamily_opfname 2 #define Anum_pg_opfamily_opfnamespace 3 #define Anum_pg_opfamily_opfowner 4 /* ---------------- * initial contents of pg_opfamily * ---------------- */ DATA(insert OID = 421 ( 403 abstime_ops PGNSP PGUID )); DATA(insert OID = 397 ( 403 array_ops PGNSP PGUID )); DATA(insert OID = 627 ( 405 array_ops PGNSP PGUID )); DATA(insert OID = 423 ( 403 bit_ops PGNSP PGUID )); DATA(insert OID = 424 ( 403 bool_ops PGNSP PGUID )); #define BOOL_BTREE_FAM_OID 424 DATA(insert OID = 426 ( 403 bpchar_ops PGNSP PGUID )); #define BPCHAR_BTREE_FAM_OID 426 DATA(insert OID = 427 ( 405 bpchar_ops PGNSP PGUID )); DATA(insert OID = 428 ( 403 bytea_ops PGNSP PGUID )); #define BYTEA_BTREE_FAM_OID 428 DATA(insert OID = 429 ( 403 char_ops PGNSP PGUID )); DATA(insert OID = 431 ( 405 char_ops PGNSP PGUID )); DATA(insert OID = 434 ( 403 datetime_ops PGNSP PGUID )); DATA(insert OID = 435 ( 405 date_ops PGNSP PGUID )); DATA(insert OID = 1970 ( 403 float_ops PGNSP PGUID )); DATA(insert OID = 1971 ( 405 float_ops PGNSP PGUID )); DATA(insert OID = 1974 ( 403 network_ops PGNSP PGUID )); #define NETWORK_BTREE_FAM_OID 1974 DATA(insert OID = 1975 ( 405 network_ops PGNSP PGUID )); DATA(insert OID = 1976 ( 403 integer_ops PGNSP PGUID )); #define INTEGER_BTREE_FAM_OID 1976 DATA(insert OID = 1977 ( 405 integer_ops PGNSP PGUID )); DATA(insert OID = 1982 ( 403 interval_ops PGNSP PGUID )); DATA(insert OID = 1983 ( 405 interval_ops PGNSP PGUID )); DATA(insert OID = 1984 ( 403 macaddr_ops PGNSP PGUID )); DATA(insert OID = 1985 ( 405 macaddr_ops PGNSP PGUID )); DATA(insert OID = 1986 ( 403 name_ops PGNSP PGUID )); #define NAME_BTREE_FAM_OID 1986 DATA(insert OID = 1987 ( 405 name_ops PGNSP PGUID )); DATA(insert OID = 1988 ( 403 numeric_ops PGNSP PGUID )); DATA(insert OID = 1998 ( 405 numeric_ops PGNSP PGUID )); DATA(insert OID = 1989 ( 403 oid_ops PGNSP PGUID )); #define OID_BTREE_FAM_OID 1989 DATA(insert OID = 1990 ( 405 oid_ops PGNSP PGUID )); DATA(insert OID = 1991 ( 403 oidvector_ops PGNSP PGUID )); DATA(insert OID = 1992 ( 405 oidvector_ops PGNSP PGUID )); DATA(insert OID = 2994 ( 403 record_ops PGNSP PGUID )); DATA(insert OID = 1994 ( 403 text_ops PGNSP PGUID )); #define TEXT_BTREE_FAM_OID 1994 DATA(insert OID = 1995 ( 405 text_ops PGNSP PGUID )); DATA(insert OID = 1996 ( 403 time_ops PGNSP PGUID )); DATA(insert OID = 1997 ( 405 time_ops PGNSP PGUID )); DATA(insert OID = 1999 ( 405 timestamptz_ops PGNSP PGUID )); DATA(insert OID = 2000 ( 403 timetz_ops PGNSP PGUID )); DATA(insert OID = 2001 ( 405 timetz_ops PGNSP PGUID )); DATA(insert OID = 2002 ( 403 varbit_ops PGNSP PGUID )); DATA(insert OID = 2040 ( 405 timestamp_ops PGNSP PGUID )); DATA(insert OID = 2095 ( 403 text_pattern_ops PGNSP PGUID )); #define TEXT_PATTERN_BTREE_FAM_OID 2095 DATA(insert OID = 2097 ( 403 bpchar_pattern_ops PGNSP PGUID )); #define BPCHAR_PATTERN_BTREE_FAM_OID 2097 DATA(insert OID = 2099 ( 403 money_ops PGNSP PGUID )); DATA(insert OID = 2222 ( 405 bool_ops PGNSP PGUID )); #define BOOL_HASH_FAM_OID 2222 DATA(insert OID = 2223 ( 405 bytea_ops PGNSP PGUID )); DATA(insert OID = 2224 ( 405 int2vector_ops PGNSP PGUID )); DATA(insert OID = 2789 ( 403 tid_ops PGNSP PGUID )); DATA(insert OID = 2225 ( 405 xid_ops PGNSP PGUID )); DATA(insert OID = 2226 ( 405 cid_ops PGNSP PGUID )); DATA(insert OID = 2227 ( 405 abstime_ops PGNSP PGUID )); DATA(insert OID = 2228 ( 405 reltime_ops PGNSP PGUID )); DATA(insert OID = 2229 ( 405 text_pattern_ops PGNSP PGUID )); DATA(insert OID = 2231 ( 405 bpchar_pattern_ops PGNSP PGUID )); DATA(insert OID = 2233 ( 403 reltime_ops PGNSP PGUID )); DATA(insert OID = 2234 ( 403 tinterval_ops PGNSP PGUID )); DATA(insert OID = 2235 ( 405 aclitem_ops PGNSP PGUID )); DATA(insert OID = 2593 ( 783 box_ops PGNSP PGUID )); DATA(insert OID = 2594 ( 783 poly_ops PGNSP PGUID )); DATA(insert OID = 2595 ( 783 circle_ops PGNSP PGUID )); DATA(insert OID = 1029 ( 783 point_ops PGNSP PGUID )); DATA(insert OID = 2745 ( 2742 array_ops PGNSP PGUID )); DATA(insert OID = 2968 ( 403 uuid_ops PGNSP PGUID )); DATA(insert OID = 2969 ( 405 uuid_ops PGNSP PGUID )); DATA(insert OID = 3522 ( 403 enum_ops PGNSP PGUID )); DATA(insert OID = 3523 ( 405 enum_ops PGNSP PGUID )); DATA(insert OID = 3626 ( 403 tsvector_ops PGNSP PGUID )); DATA(insert OID = 3655 ( 783 tsvector_ops PGNSP PGUID )); DATA(insert OID = 3659 ( 2742 tsvector_ops PGNSP PGUID )); DATA(insert OID = 3683 ( 403 tsquery_ops PGNSP PGUID )); DATA(insert OID = 3702 ( 783 tsquery_ops PGNSP PGUID )); DATA(insert OID = 3901 ( 403 range_ops PGNSP PGUID )); DATA(insert OID = 3903 ( 405 range_ops PGNSP PGUID )); DATA(insert OID = 3919 ( 783 range_ops PGNSP PGUID )); DATA(insert OID = 4015 ( 4000 quad_point_ops PGNSP PGUID )); DATA(insert OID = 4016 ( 4000 kd_point_ops PGNSP PGUID )); DATA(insert OID = 4017 ( 4000 text_ops PGNSP PGUID )); #define TEXT_SPGIST_FAM_OID 4017 #endif /* PG_OPFAMILY_H */ PKBiZfs)server/catalog/pg_namespace.hnu[/*------------------------------------------------------------------------- * * pg_namespace.h * definition of the system "namespace" relation (pg_namespace) * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_namespace.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * *------------------------------------------------------------------------- */ #ifndef PG_NAMESPACE_H #define PG_NAMESPACE_H #include "catalog/genbki.h" /* ---------------------------------------------------------------- * pg_namespace definition. * * cpp turns this into typedef struct FormData_pg_namespace * * nspname name of the namespace * nspowner owner (creator) of the namespace * nspacl access privilege list * ---------------------------------------------------------------- */ #define NamespaceRelationId 2615 CATALOG(pg_namespace,2615) { NameData nspname; Oid nspowner; #ifdef CATALOG_VARLEN /* variable-length fields start here */ aclitem nspacl[1]; #endif } FormData_pg_namespace; /* ---------------- * Form_pg_namespace corresponds to a pointer to a tuple with * the format of pg_namespace relation. * ---------------- */ typedef FormData_pg_namespace *Form_pg_namespace; /* ---------------- * compiler constants for pg_namespace * ---------------- */ #define Natts_pg_namespace 3 #define Anum_pg_namespace_nspname 1 #define Anum_pg_namespace_nspowner 2 #define Anum_pg_namespace_nspacl 3 /* ---------------- * initial contents of pg_namespace * --------------- */ DATA(insert OID = 11 ( "pg_catalog" PGUID _null_ )); DESCR("system catalog schema"); #define PG_CATALOG_NAMESPACE 11 DATA(insert OID = 99 ( "pg_toast" PGUID _null_ )); DESCR("reserved schema for TOAST tables"); #define PG_TOAST_NAMESPACE 99 DATA(insert OID = 2200 ( "public" PGUID _null_ )); DESCR("standard public schema"); #define PG_PUBLIC_NAMESPACE 2200 /* * prototypes for functions in pg_namespace.c */ extern Oid NamespaceCreate(const char *nspName, Oid ownerId, bool isTemp); #endif /* PG_NAMESPACE_H */ PKBiZG.އserver/catalog/pg_attrdef.hnu[/*------------------------------------------------------------------------- * * pg_attrdef.h * definition of the system "attribute defaults" relation (pg_attrdef) * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_attrdef.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * *------------------------------------------------------------------------- */ #ifndef PG_ATTRDEF_H #define PG_ATTRDEF_H #include "catalog/genbki.h" /* ---------------- * pg_attrdef definition. cpp turns this into * typedef struct FormData_pg_attrdef * ---------------- */ #define AttrDefaultRelationId 2604 CATALOG(pg_attrdef,2604) { Oid adrelid; /* OID of table containing attribute */ int2 adnum; /* attnum of attribute */ #ifdef CATALOG_VARLEN /* variable-length fields start here */ pg_node_tree adbin; /* nodeToString representation of default */ text adsrc; /* human-readable representation of default */ #endif } FormData_pg_attrdef; /* ---------------- * Form_pg_attrdef corresponds to a pointer to a tuple with * the format of pg_attrdef relation. * ---------------- */ typedef FormData_pg_attrdef *Form_pg_attrdef; /* ---------------- * compiler constants for pg_attrdef * ---------------- */ #define Natts_pg_attrdef 4 #define Anum_pg_attrdef_adrelid 1 #define Anum_pg_attrdef_adnum 2 #define Anum_pg_attrdef_adbin 3 #define Anum_pg_attrdef_adsrc 4 #endif /* PG_ATTRDEF_H */ PKBiZdޞbbserver/catalog/pg_amop.hnu[/*------------------------------------------------------------------------- * * pg_amop.h * definition of the system "amop" relation (pg_amop) * along with the relation's initial contents. * * The amop table identifies the operators associated with each index operator * family and operator class (classes are subsets of families). An associated * operator can be either a search operator or an ordering operator, as * identified by amoppurpose. * * The primary key for this table is . amoplefttype and amoprighttype are just copies of the * operator's oprleft/oprright, ie its declared input data types. The * "default" operators for a particular opclass within the family are those * with amoplefttype = amoprighttype = opclass's opcintype. An opfamily may * also contain other operators, typically cross-data-type operators. All the * operators within a family are supposed to be compatible, in a way that is * defined by each individual index AM. * * We also keep a unique index on , so that * we can use a syscache to quickly answer questions of the form "is this * operator in this opfamily, and if so what are its semantics with respect to * the family?" This implies that the same operator cannot be listed for * multiple strategy numbers within a single opfamily, with the exception that * it's possible to list it for both search and ordering purposes (with * different strategy numbers for the two purposes). * * amopmethod is a copy of the owning opfamily's opfmethod field. This is an * intentional denormalization of the catalogs to buy lookup speed. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_amop.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * *------------------------------------------------------------------------- */ #ifndef PG_AMOP_H #define PG_AMOP_H #include "catalog/genbki.h" /* ---------------- * pg_amop definition. cpp turns this into * typedef struct FormData_pg_amop * ---------------- */ #define AccessMethodOperatorRelationId 2602 CATALOG(pg_amop,2602) { Oid amopfamily; /* the index opfamily this entry is for */ Oid amoplefttype; /* operator's left input data type */ Oid amoprighttype; /* operator's right input data type */ int2 amopstrategy; /* operator strategy number */ char amoppurpose; /* is operator for 's'earch or 'o'rdering? */ Oid amopopr; /* the operator's pg_operator OID */ Oid amopmethod; /* the index access method this entry is for */ Oid amopsortfamily; /* ordering opfamily OID, or 0 if search op */ } FormData_pg_amop; /* allowed values of amoppurpose: */ #define AMOP_SEARCH 's' /* operator is for search */ #define AMOP_ORDER 'o' /* operator is for ordering */ /* ---------------- * Form_pg_amop corresponds to a pointer to a tuple with * the format of pg_amop relation. * ---------------- */ typedef FormData_pg_amop *Form_pg_amop; /* ---------------- * compiler constants for pg_amop * ---------------- */ #define Natts_pg_amop 8 #define Anum_pg_amop_amopfamily 1 #define Anum_pg_amop_amoplefttype 2 #define Anum_pg_amop_amoprighttype 3 #define Anum_pg_amop_amopstrategy 4 #define Anum_pg_amop_amoppurpose 5 #define Anum_pg_amop_amopopr 6 #define Anum_pg_amop_amopmethod 7 #define Anum_pg_amop_amopsortfamily 8 /* ---------------- * initial contents of pg_amop * ---------------- */ /* * btree integer_ops */ /* default operators int2 */ DATA(insert ( 1976 21 21 1 s 95 403 0 )); DATA(insert ( 1976 21 21 2 s 522 403 0 )); DATA(insert ( 1976 21 21 3 s 94 403 0 )); DATA(insert ( 1976 21 21 4 s 524 403 0 )); DATA(insert ( 1976 21 21 5 s 520 403 0 )); /* crosstype operators int24 */ DATA(insert ( 1976 21 23 1 s 534 403 0 )); DATA(insert ( 1976 21 23 2 s 540 403 0 )); DATA(insert ( 1976 21 23 3 s 532 403 0 )); DATA(insert ( 1976 21 23 4 s 542 403 0 )); DATA(insert ( 1976 21 23 5 s 536 403 0 )); /* crosstype operators int28 */ DATA(insert ( 1976 21 20 1 s 1864 403 0 )); DATA(insert ( 1976 21 20 2 s 1866 403 0 )); DATA(insert ( 1976 21 20 3 s 1862 403 0 )); DATA(insert ( 1976 21 20 4 s 1867 403 0 )); DATA(insert ( 1976 21 20 5 s 1865 403 0 )); /* default operators int4 */ DATA(insert ( 1976 23 23 1 s 97 403 0 )); DATA(insert ( 1976 23 23 2 s 523 403 0 )); DATA(insert ( 1976 23 23 3 s 96 403 0 )); DATA(insert ( 1976 23 23 4 s 525 403 0 )); DATA(insert ( 1976 23 23 5 s 521 403 0 )); /* crosstype operators int42 */ DATA(insert ( 1976 23 21 1 s 535 403 0 )); DATA(insert ( 1976 23 21 2 s 541 403 0 )); DATA(insert ( 1976 23 21 3 s 533 403 0 )); DATA(insert ( 1976 23 21 4 s 543 403 0 )); DATA(insert ( 1976 23 21 5 s 537 403 0 )); /* crosstype operators int48 */ DATA(insert ( 1976 23 20 1 s 37 403 0 )); DATA(insert ( 1976 23 20 2 s 80 403 0 )); DATA(insert ( 1976 23 20 3 s 15 403 0 )); DATA(insert ( 1976 23 20 4 s 82 403 0 )); DATA(insert ( 1976 23 20 5 s 76 403 0 )); /* default operators int8 */ DATA(insert ( 1976 20 20 1 s 412 403 0 )); DATA(insert ( 1976 20 20 2 s 414 403 0 )); DATA(insert ( 1976 20 20 3 s 410 403 0 )); DATA(insert ( 1976 20 20 4 s 415 403 0 )); DATA(insert ( 1976 20 20 5 s 413 403 0 )); /* crosstype operators int82 */ DATA(insert ( 1976 20 21 1 s 1870 403 0 )); DATA(insert ( 1976 20 21 2 s 1872 403 0 )); DATA(insert ( 1976 20 21 3 s 1868 403 0 )); DATA(insert ( 1976 20 21 4 s 1873 403 0 )); DATA(insert ( 1976 20 21 5 s 1871 403 0 )); /* crosstype operators int84 */ DATA(insert ( 1976 20 23 1 s 418 403 0 )); DATA(insert ( 1976 20 23 2 s 420 403 0 )); DATA(insert ( 1976 20 23 3 s 416 403 0 )); DATA(insert ( 1976 20 23 4 s 430 403 0 )); DATA(insert ( 1976 20 23 5 s 419 403 0 )); /* * btree oid_ops */ DATA(insert ( 1989 26 26 1 s 609 403 0 )); DATA(insert ( 1989 26 26 2 s 611 403 0 )); DATA(insert ( 1989 26 26 3 s 607 403 0 )); DATA(insert ( 1989 26 26 4 s 612 403 0 )); DATA(insert ( 1989 26 26 5 s 610 403 0 )); /* * btree tid_ops */ DATA(insert ( 2789 27 27 1 s 2799 403 0 )); DATA(insert ( 2789 27 27 2 s 2801 403 0 )); DATA(insert ( 2789 27 27 3 s 387 403 0 )); DATA(insert ( 2789 27 27 4 s 2802 403 0 )); DATA(insert ( 2789 27 27 5 s 2800 403 0 )); /* * btree oidvector_ops */ DATA(insert ( 1991 30 30 1 s 645 403 0 )); DATA(insert ( 1991 30 30 2 s 647 403 0 )); DATA(insert ( 1991 30 30 3 s 649 403 0 )); DATA(insert ( 1991 30 30 4 s 648 403 0 )); DATA(insert ( 1991 30 30 5 s 646 403 0 )); /* * btree float_ops */ /* default operators float4 */ DATA(insert ( 1970 700 700 1 s 622 403 0 )); DATA(insert ( 1970 700 700 2 s 624 403 0 )); DATA(insert ( 1970 700 700 3 s 620 403 0 )); DATA(insert ( 1970 700 700 4 s 625 403 0 )); DATA(insert ( 1970 700 700 5 s 623 403 0 )); /* crosstype operators float48 */ DATA(insert ( 1970 700 701 1 s 1122 403 0 )); DATA(insert ( 1970 700 701 2 s 1124 403 0 )); DATA(insert ( 1970 700 701 3 s 1120 403 0 )); DATA(insert ( 1970 700 701 4 s 1125 403 0 )); DATA(insert ( 1970 700 701 5 s 1123 403 0 )); /* default operators float8 */ DATA(insert ( 1970 701 701 1 s 672 403 0 )); DATA(insert ( 1970 701 701 2 s 673 403 0 )); DATA(insert ( 1970 701 701 3 s 670 403 0 )); DATA(insert ( 1970 701 701 4 s 675 403 0 )); DATA(insert ( 1970 701 701 5 s 674 403 0 )); /* crosstype operators float84 */ DATA(insert ( 1970 701 700 1 s 1132 403 0 )); DATA(insert ( 1970 701 700 2 s 1134 403 0 )); DATA(insert ( 1970 701 700 3 s 1130 403 0 )); DATA(insert ( 1970 701 700 4 s 1135 403 0 )); DATA(insert ( 1970 701 700 5 s 1133 403 0 )); /* * btree char_ops */ DATA(insert ( 429 18 18 1 s 631 403 0 )); DATA(insert ( 429 18 18 2 s 632 403 0 )); DATA(insert ( 429 18 18 3 s 92 403 0 )); DATA(insert ( 429 18 18 4 s 634 403 0 )); DATA(insert ( 429 18 18 5 s 633 403 0 )); /* * btree name_ops */ DATA(insert ( 1986 19 19 1 s 660 403 0 )); DATA(insert ( 1986 19 19 2 s 661 403 0 )); DATA(insert ( 1986 19 19 3 s 93 403 0 )); DATA(insert ( 1986 19 19 4 s 663 403 0 )); DATA(insert ( 1986 19 19 5 s 662 403 0 )); /* * btree text_ops */ DATA(insert ( 1994 25 25 1 s 664 403 0 )); DATA(insert ( 1994 25 25 2 s 665 403 0 )); DATA(insert ( 1994 25 25 3 s 98 403 0 )); DATA(insert ( 1994 25 25 4 s 667 403 0 )); DATA(insert ( 1994 25 25 5 s 666 403 0 )); /* * btree bpchar_ops */ DATA(insert ( 426 1042 1042 1 s 1058 403 0 )); DATA(insert ( 426 1042 1042 2 s 1059 403 0 )); DATA(insert ( 426 1042 1042 3 s 1054 403 0 )); DATA(insert ( 426 1042 1042 4 s 1061 403 0 )); DATA(insert ( 426 1042 1042 5 s 1060 403 0 )); /* * btree bytea_ops */ DATA(insert ( 428 17 17 1 s 1957 403 0 )); DATA(insert ( 428 17 17 2 s 1958 403 0 )); DATA(insert ( 428 17 17 3 s 1955 403 0 )); DATA(insert ( 428 17 17 4 s 1960 403 0 )); DATA(insert ( 428 17 17 5 s 1959 403 0 )); /* * btree abstime_ops */ DATA(insert ( 421 702 702 1 s 562 403 0 )); DATA(insert ( 421 702 702 2 s 564 403 0 )); DATA(insert ( 421 702 702 3 s 560 403 0 )); DATA(insert ( 421 702 702 4 s 565 403 0 )); DATA(insert ( 421 702 702 5 s 563 403 0 )); /* * btree datetime_ops */ /* default operators date */ DATA(insert ( 434 1082 1082 1 s 1095 403 0 )); DATA(insert ( 434 1082 1082 2 s 1096 403 0 )); DATA(insert ( 434 1082 1082 3 s 1093 403 0 )); DATA(insert ( 434 1082 1082 4 s 1098 403 0 )); DATA(insert ( 434 1082 1082 5 s 1097 403 0 )); /* crosstype operators vs timestamp */ DATA(insert ( 434 1082 1114 1 s 2345 403 0 )); DATA(insert ( 434 1082 1114 2 s 2346 403 0 )); DATA(insert ( 434 1082 1114 3 s 2347 403 0 )); DATA(insert ( 434 1082 1114 4 s 2348 403 0 )); DATA(insert ( 434 1082 1114 5 s 2349 403 0 )); /* crosstype operators vs timestamptz */ DATA(insert ( 434 1082 1184 1 s 2358 403 0 )); DATA(insert ( 434 1082 1184 2 s 2359 403 0 )); DATA(insert ( 434 1082 1184 3 s 2360 403 0 )); DATA(insert ( 434 1082 1184 4 s 2361 403 0 )); DATA(insert ( 434 1082 1184 5 s 2362 403 0 )); /* default operators timestamp */ DATA(insert ( 434 1114 1114 1 s 2062 403 0 )); DATA(insert ( 434 1114 1114 2 s 2063 403 0 )); DATA(insert ( 434 1114 1114 3 s 2060 403 0 )); DATA(insert ( 434 1114 1114 4 s 2065 403 0 )); DATA(insert ( 434 1114 1114 5 s 2064 403 0 )); /* crosstype operators vs date */ DATA(insert ( 434 1114 1082 1 s 2371 403 0 )); DATA(insert ( 434 1114 1082 2 s 2372 403 0 )); DATA(insert ( 434 1114 1082 3 s 2373 403 0 )); DATA(insert ( 434 1114 1082 4 s 2374 403 0 )); DATA(insert ( 434 1114 1082 5 s 2375 403 0 )); /* crosstype operators vs timestamptz */ DATA(insert ( 434 1114 1184 1 s 2534 403 0 )); DATA(insert ( 434 1114 1184 2 s 2535 403 0 )); DATA(insert ( 434 1114 1184 3 s 2536 403 0 )); DATA(insert ( 434 1114 1184 4 s 2537 403 0 )); DATA(insert ( 434 1114 1184 5 s 2538 403 0 )); /* default operators timestamptz */ DATA(insert ( 434 1184 1184 1 s 1322 403 0 )); DATA(insert ( 434 1184 1184 2 s 1323 403 0 )); DATA(insert ( 434 1184 1184 3 s 1320 403 0 )); DATA(insert ( 434 1184 1184 4 s 1325 403 0 )); DATA(insert ( 434 1184 1184 5 s 1324 403 0 )); /* crosstype operators vs date */ DATA(insert ( 434 1184 1082 1 s 2384 403 0 )); DATA(insert ( 434 1184 1082 2 s 2385 403 0 )); DATA(insert ( 434 1184 1082 3 s 2386 403 0 )); DATA(insert ( 434 1184 1082 4 s 2387 403 0 )); DATA(insert ( 434 1184 1082 5 s 2388 403 0 )); /* crosstype operators vs timestamp */ DATA(insert ( 434 1184 1114 1 s 2540 403 0 )); DATA(insert ( 434 1184 1114 2 s 2541 403 0 )); DATA(insert ( 434 1184 1114 3 s 2542 403 0 )); DATA(insert ( 434 1184 1114 4 s 2543 403 0 )); DATA(insert ( 434 1184 1114 5 s 2544 403 0 )); /* * btree time_ops */ DATA(insert ( 1996 1083 1083 1 s 1110 403 0 )); DATA(insert ( 1996 1083 1083 2 s 1111 403 0 )); DATA(insert ( 1996 1083 1083 3 s 1108 403 0 )); DATA(insert ( 1996 1083 1083 4 s 1113 403 0 )); DATA(insert ( 1996 1083 1083 5 s 1112 403 0 )); /* * btree timetz_ops */ DATA(insert ( 2000 1266 1266 1 s 1552 403 0 )); DATA(insert ( 2000 1266 1266 2 s 1553 403 0 )); DATA(insert ( 2000 1266 1266 3 s 1550 403 0 )); DATA(insert ( 2000 1266 1266 4 s 1555 403 0 )); DATA(insert ( 2000 1266 1266 5 s 1554 403 0 )); /* * btree interval_ops */ DATA(insert ( 1982 1186 1186 1 s 1332 403 0 )); DATA(insert ( 1982 1186 1186 2 s 1333 403 0 )); DATA(insert ( 1982 1186 1186 3 s 1330 403 0 )); DATA(insert ( 1982 1186 1186 4 s 1335 403 0 )); DATA(insert ( 1982 1186 1186 5 s 1334 403 0 )); /* * btree macaddr */ DATA(insert ( 1984 829 829 1 s 1222 403 0 )); DATA(insert ( 1984 829 829 2 s 1223 403 0 )); DATA(insert ( 1984 829 829 3 s 1220 403 0 )); DATA(insert ( 1984 829 829 4 s 1225 403 0 )); DATA(insert ( 1984 829 829 5 s 1224 403 0 )); /* * btree network */ DATA(insert ( 1974 869 869 1 s 1203 403 0 )); DATA(insert ( 1974 869 869 2 s 1204 403 0 )); DATA(insert ( 1974 869 869 3 s 1201 403 0 )); DATA(insert ( 1974 869 869 4 s 1206 403 0 )); DATA(insert ( 1974 869 869 5 s 1205 403 0 )); /* * btree numeric */ DATA(insert ( 1988 1700 1700 1 s 1754 403 0 )); DATA(insert ( 1988 1700 1700 2 s 1755 403 0 )); DATA(insert ( 1988 1700 1700 3 s 1752 403 0 )); DATA(insert ( 1988 1700 1700 4 s 1757 403 0 )); DATA(insert ( 1988 1700 1700 5 s 1756 403 0 )); /* * btree bool */ DATA(insert ( 424 16 16 1 s 58 403 0 )); DATA(insert ( 424 16 16 2 s 1694 403 0 )); DATA(insert ( 424 16 16 3 s 91 403 0 )); DATA(insert ( 424 16 16 4 s 1695 403 0 )); DATA(insert ( 424 16 16 5 s 59 403 0 )); /* * btree bit */ DATA(insert ( 423 1560 1560 1 s 1786 403 0 )); DATA(insert ( 423 1560 1560 2 s 1788 403 0 )); DATA(insert ( 423 1560 1560 3 s 1784 403 0 )); DATA(insert ( 423 1560 1560 4 s 1789 403 0 )); DATA(insert ( 423 1560 1560 5 s 1787 403 0 )); /* * btree varbit */ DATA(insert ( 2002 1562 1562 1 s 1806 403 0 )); DATA(insert ( 2002 1562 1562 2 s 1808 403 0 )); DATA(insert ( 2002 1562 1562 3 s 1804 403 0 )); DATA(insert ( 2002 1562 1562 4 s 1809 403 0 )); DATA(insert ( 2002 1562 1562 5 s 1807 403 0 )); /* * btree text pattern */ DATA(insert ( 2095 25 25 1 s 2314 403 0 )); DATA(insert ( 2095 25 25 2 s 2315 403 0 )); DATA(insert ( 2095 25 25 3 s 98 403 0 )); DATA(insert ( 2095 25 25 4 s 2317 403 0 )); DATA(insert ( 2095 25 25 5 s 2318 403 0 )); /* * btree bpchar pattern */ DATA(insert ( 2097 1042 1042 1 s 2326 403 0 )); DATA(insert ( 2097 1042 1042 2 s 2327 403 0 )); DATA(insert ( 2097 1042 1042 3 s 1054 403 0 )); DATA(insert ( 2097 1042 1042 4 s 2329 403 0 )); DATA(insert ( 2097 1042 1042 5 s 2330 403 0 )); /* * btree money_ops */ DATA(insert ( 2099 790 790 1 s 902 403 0 )); DATA(insert ( 2099 790 790 2 s 904 403 0 )); DATA(insert ( 2099 790 790 3 s 900 403 0 )); DATA(insert ( 2099 790 790 4 s 905 403 0 )); DATA(insert ( 2099 790 790 5 s 903 403 0 )); /* * btree reltime_ops */ DATA(insert ( 2233 703 703 1 s 568 403 0 )); DATA(insert ( 2233 703 703 2 s 570 403 0 )); DATA(insert ( 2233 703 703 3 s 566 403 0 )); DATA(insert ( 2233 703 703 4 s 571 403 0 )); DATA(insert ( 2233 703 703 5 s 569 403 0 )); /* * btree tinterval_ops */ DATA(insert ( 2234 704 704 1 s 813 403 0 )); DATA(insert ( 2234 704 704 2 s 815 403 0 )); DATA(insert ( 2234 704 704 3 s 811 403 0 )); DATA(insert ( 2234 704 704 4 s 816 403 0 )); DATA(insert ( 2234 704 704 5 s 814 403 0 )); /* * btree array_ops */ DATA(insert ( 397 2277 2277 1 s 1072 403 0 )); DATA(insert ( 397 2277 2277 2 s 1074 403 0 )); DATA(insert ( 397 2277 2277 3 s 1070 403 0 )); DATA(insert ( 397 2277 2277 4 s 1075 403 0 )); DATA(insert ( 397 2277 2277 5 s 1073 403 0 )); /* * btree record_ops */ DATA(insert ( 2994 2249 2249 1 s 2990 403 0 )); DATA(insert ( 2994 2249 2249 2 s 2992 403 0 )); DATA(insert ( 2994 2249 2249 3 s 2988 403 0 )); DATA(insert ( 2994 2249 2249 4 s 2993 403 0 )); DATA(insert ( 2994 2249 2249 5 s 2991 403 0 )); /* * btree uuid_ops */ DATA(insert ( 2968 2950 2950 1 s 2974 403 0 )); DATA(insert ( 2968 2950 2950 2 s 2976 403 0 )); DATA(insert ( 2968 2950 2950 3 s 2972 403 0 )); DATA(insert ( 2968 2950 2950 4 s 2977 403 0 )); DATA(insert ( 2968 2950 2950 5 s 2975 403 0 )); /* * hash index _ops */ /* bpchar_ops */ DATA(insert ( 427 1042 1042 1 s 1054 405 0 )); /* char_ops */ DATA(insert ( 431 18 18 1 s 92 405 0 )); /* date_ops */ DATA(insert ( 435 1082 1082 1 s 1093 405 0 )); /* float_ops */ DATA(insert ( 1971 700 700 1 s 620 405 0 )); DATA(insert ( 1971 701 701 1 s 670 405 0 )); DATA(insert ( 1971 700 701 1 s 1120 405 0 )); DATA(insert ( 1971 701 700 1 s 1130 405 0 )); /* network_ops */ DATA(insert ( 1975 869 869 1 s 1201 405 0 )); /* integer_ops */ DATA(insert ( 1977 21 21 1 s 94 405 0 )); DATA(insert ( 1977 23 23 1 s 96 405 0 )); DATA(insert ( 1977 20 20 1 s 410 405 0 )); DATA(insert ( 1977 21 23 1 s 532 405 0 )); DATA(insert ( 1977 21 20 1 s 1862 405 0 )); DATA(insert ( 1977 23 21 1 s 533 405 0 )); DATA(insert ( 1977 23 20 1 s 15 405 0 )); DATA(insert ( 1977 20 21 1 s 1868 405 0 )); DATA(insert ( 1977 20 23 1 s 416 405 0 )); /* interval_ops */ DATA(insert ( 1983 1186 1186 1 s 1330 405 0 )); /* macaddr_ops */ DATA(insert ( 1985 829 829 1 s 1220 405 0 )); /* name_ops */ DATA(insert ( 1987 19 19 1 s 93 405 0 )); /* oid_ops */ DATA(insert ( 1990 26 26 1 s 607 405 0 )); /* oidvector_ops */ DATA(insert ( 1992 30 30 1 s 649 405 0 )); /* text_ops */ DATA(insert ( 1995 25 25 1 s 98 405 0 )); /* time_ops */ DATA(insert ( 1997 1083 1083 1 s 1108 405 0 )); /* timestamptz_ops */ DATA(insert ( 1999 1184 1184 1 s 1320 405 0 )); /* timetz_ops */ DATA(insert ( 2001 1266 1266 1 s 1550 405 0 )); /* timestamp_ops */ DATA(insert ( 2040 1114 1114 1 s 2060 405 0 )); /* bool_ops */ DATA(insert ( 2222 16 16 1 s 91 405 0 )); /* bytea_ops */ DATA(insert ( 2223 17 17 1 s 1955 405 0 )); /* int2vector_ops */ DATA(insert ( 2224 22 22 1 s 386 405 0 )); /* xid_ops */ DATA(insert ( 2225 28 28 1 s 352 405 0 )); /* cid_ops */ DATA(insert ( 2226 29 29 1 s 385 405 0 )); /* abstime_ops */ DATA(insert ( 2227 702 702 1 s 560 405 0 )); /* reltime_ops */ DATA(insert ( 2228 703 703 1 s 566 405 0 )); /* text_pattern_ops */ DATA(insert ( 2229 25 25 1 s 98 405 0 )); /* bpchar_pattern_ops */ DATA(insert ( 2231 1042 1042 1 s 1054 405 0 )); /* aclitem_ops */ DATA(insert ( 2235 1033 1033 1 s 974 405 0 )); /* uuid_ops */ DATA(insert ( 2969 2950 2950 1 s 2972 405 0 )); /* numeric_ops */ DATA(insert ( 1998 1700 1700 1 s 1752 405 0 )); /* array_ops */ DATA(insert ( 627 2277 2277 1 s 1070 405 0 )); /* * gist box_ops */ DATA(insert ( 2593 603 603 1 s 493 783 0 )); DATA(insert ( 2593 603 603 2 s 494 783 0 )); DATA(insert ( 2593 603 603 3 s 500 783 0 )); DATA(insert ( 2593 603 603 4 s 495 783 0 )); DATA(insert ( 2593 603 603 5 s 496 783 0 )); DATA(insert ( 2593 603 603 6 s 499 783 0 )); DATA(insert ( 2593 603 603 7 s 498 783 0 )); DATA(insert ( 2593 603 603 8 s 497 783 0 )); DATA(insert ( 2593 603 603 9 s 2571 783 0 )); DATA(insert ( 2593 603 603 10 s 2570 783 0 )); DATA(insert ( 2593 603 603 11 s 2573 783 0 )); DATA(insert ( 2593 603 603 12 s 2572 783 0 )); DATA(insert ( 2593 603 603 13 s 2863 783 0 )); DATA(insert ( 2593 603 603 14 s 2862 783 0 )); /* * gist point_ops */ DATA(insert ( 1029 600 600 11 s 506 783 0 )); DATA(insert ( 1029 600 600 1 s 507 783 0 )); DATA(insert ( 1029 600 600 5 s 508 783 0 )); DATA(insert ( 1029 600 600 10 s 509 783 0 )); DATA(insert ( 1029 600 600 6 s 510 783 0 )); DATA(insert ( 1029 600 600 15 o 517 783 1970 )); DATA(insert ( 1029 600 603 28 s 511 783 0 )); DATA(insert ( 1029 600 604 48 s 756 783 0 )); DATA(insert ( 1029 600 718 68 s 758 783 0 )); /* * gist poly_ops (supports polygons) */ DATA(insert ( 2594 604 604 1 s 485 783 0 )); DATA(insert ( 2594 604 604 2 s 486 783 0 )); DATA(insert ( 2594 604 604 3 s 492 783 0 )); DATA(insert ( 2594 604 604 4 s 487 783 0 )); DATA(insert ( 2594 604 604 5 s 488 783 0 )); DATA(insert ( 2594 604 604 6 s 491 783 0 )); DATA(insert ( 2594 604 604 7 s 490 783 0 )); DATA(insert ( 2594 604 604 8 s 489 783 0 )); DATA(insert ( 2594 604 604 9 s 2575 783 0 )); DATA(insert ( 2594 604 604 10 s 2574 783 0 )); DATA(insert ( 2594 604 604 11 s 2577 783 0 )); DATA(insert ( 2594 604 604 12 s 2576 783 0 )); DATA(insert ( 2594 604 604 13 s 2861 783 0 )); DATA(insert ( 2594 604 604 14 s 2860 783 0 )); /* * gist circle_ops */ DATA(insert ( 2595 718 718 1 s 1506 783 0 )); DATA(insert ( 2595 718 718 2 s 1507 783 0 )); DATA(insert ( 2595 718 718 3 s 1513 783 0 )); DATA(insert ( 2595 718 718 4 s 1508 783 0 )); DATA(insert ( 2595 718 718 5 s 1509 783 0 )); DATA(insert ( 2595 718 718 6 s 1512 783 0 )); DATA(insert ( 2595 718 718 7 s 1511 783 0 )); DATA(insert ( 2595 718 718 8 s 1510 783 0 )); DATA(insert ( 2595 718 718 9 s 2589 783 0 )); DATA(insert ( 2595 718 718 10 s 1515 783 0 )); DATA(insert ( 2595 718 718 11 s 1514 783 0 )); DATA(insert ( 2595 718 718 12 s 2590 783 0 )); DATA(insert ( 2595 718 718 13 s 2865 783 0 )); DATA(insert ( 2595 718 718 14 s 2864 783 0 )); /* * gin array_ops (these anyarray operators are used with all the opclasses * of the family) */ DATA(insert ( 2745 2277 2277 1 s 2750 2742 0 )); DATA(insert ( 2745 2277 2277 2 s 2751 2742 0 )); DATA(insert ( 2745 2277 2277 3 s 2752 2742 0 )); DATA(insert ( 2745 2277 2277 4 s 1070 2742 0 )); /* * btree enum_ops */ DATA(insert ( 3522 3500 3500 1 s 3518 403 0 )); DATA(insert ( 3522 3500 3500 2 s 3520 403 0 )); DATA(insert ( 3522 3500 3500 3 s 3516 403 0 )); DATA(insert ( 3522 3500 3500 4 s 3521 403 0 )); DATA(insert ( 3522 3500 3500 5 s 3519 403 0 )); /* * hash enum_ops */ DATA(insert ( 3523 3500 3500 1 s 3516 405 0 )); /* * btree tsvector_ops */ DATA(insert ( 3626 3614 3614 1 s 3627 403 0 )); DATA(insert ( 3626 3614 3614 2 s 3628 403 0 )); DATA(insert ( 3626 3614 3614 3 s 3629 403 0 )); DATA(insert ( 3626 3614 3614 4 s 3631 403 0 )); DATA(insert ( 3626 3614 3614 5 s 3632 403 0 )); /* * GiST tsvector_ops */ DATA(insert ( 3655 3614 3615 1 s 3636 783 0 )); /* * GIN tsvector_ops */ DATA(insert ( 3659 3614 3615 1 s 3636 2742 0 )); DATA(insert ( 3659 3614 3615 2 s 3660 2742 0 )); /* * btree tsquery_ops */ DATA(insert ( 3683 3615 3615 1 s 3674 403 0 )); DATA(insert ( 3683 3615 3615 2 s 3675 403 0 )); DATA(insert ( 3683 3615 3615 3 s 3676 403 0 )); DATA(insert ( 3683 3615 3615 4 s 3678 403 0 )); DATA(insert ( 3683 3615 3615 5 s 3679 403 0 )); /* * GiST tsquery_ops */ DATA(insert ( 3702 3615 3615 7 s 3693 783 0 )); DATA(insert ( 3702 3615 3615 8 s 3694 783 0 )); /* * btree range_ops */ DATA(insert ( 3901 3831 3831 1 s 3884 403 0 )); DATA(insert ( 3901 3831 3831 2 s 3885 403 0 )); DATA(insert ( 3901 3831 3831 3 s 3882 403 0 )); DATA(insert ( 3901 3831 3831 4 s 3886 403 0 )); DATA(insert ( 3901 3831 3831 5 s 3887 403 0 )); /* * hash range_ops */ DATA(insert ( 3903 3831 3831 1 s 3882 405 0 )); /* * GiST range_ops */ DATA(insert ( 3919 3831 3831 1 s 3893 783 0 )); DATA(insert ( 3919 3831 3831 2 s 3895 783 0 )); DATA(insert ( 3919 3831 3831 3 s 3888 783 0 )); DATA(insert ( 3919 3831 3831 4 s 3896 783 0 )); DATA(insert ( 3919 3831 3831 5 s 3894 783 0 )); DATA(insert ( 3919 3831 3831 6 s 3897 783 0 )); DATA(insert ( 3919 3831 3831 7 s 3890 783 0 )); DATA(insert ( 3919 3831 3831 8 s 3892 783 0 )); DATA(insert ( 3919 3831 2283 16 s 3889 783 0 )); DATA(insert ( 3919 3831 3831 18 s 3882 783 0 )); /* * SP-GiST quad_point_ops */ DATA(insert ( 4015 600 600 11 s 506 4000 0 )); DATA(insert ( 4015 600 600 1 s 507 4000 0 )); DATA(insert ( 4015 600 600 5 s 508 4000 0 )); DATA(insert ( 4015 600 600 10 s 509 4000 0 )); DATA(insert ( 4015 600 600 6 s 510 4000 0 )); DATA(insert ( 4015 600 603 8 s 511 4000 0 )); /* * SP-GiST kd_point_ops */ DATA(insert ( 4016 600 600 11 s 506 4000 0 )); DATA(insert ( 4016 600 600 1 s 507 4000 0 )); DATA(insert ( 4016 600 600 5 s 508 4000 0 )); DATA(insert ( 4016 600 600 10 s 509 4000 0 )); DATA(insert ( 4016 600 600 6 s 510 4000 0 )); DATA(insert ( 4016 600 603 8 s 511 4000 0 )); /* * SP-GiST text_ops */ DATA(insert ( 4017 25 25 1 s 2314 4000 0 )); DATA(insert ( 4017 25 25 2 s 2315 4000 0 )); DATA(insert ( 4017 25 25 3 s 98 4000 0 )); DATA(insert ( 4017 25 25 4 s 2317 4000 0 )); DATA(insert ( 4017 25 25 5 s 2318 4000 0 )); DATA(insert ( 4017 25 25 11 s 664 4000 0 )); DATA(insert ( 4017 25 25 12 s 665 4000 0 )); DATA(insert ( 4017 25 25 14 s 667 4000 0 )); DATA(insert ( 4017 25 25 15 s 666 4000 0 )); #endif /* PG_AMOP_H */ PKBiZ0edq q server/catalog/pg_pltemplate.hnu[/*------------------------------------------------------------------------- * * pg_pltemplate.h * definition of the system "PL template" relation (pg_pltemplate) * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_pltemplate.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * *------------------------------------------------------------------------- */ #ifndef PG_PLTEMPLATE_H #define PG_PLTEMPLATE_H #include "catalog/genbki.h" /* ---------------- * pg_pltemplate definition. cpp turns this into * typedef struct FormData_pg_pltemplate * ---------------- */ #define PLTemplateRelationId 1136 CATALOG(pg_pltemplate,1136) BKI_SHARED_RELATION BKI_WITHOUT_OIDS { NameData tmplname; /* name of PL */ bool tmpltrusted; /* PL is trusted? */ bool tmpldbacreate; /* PL is installable by db owner? */ #ifdef CATALOG_VARLEN /* variable-length fields start here */ text tmplhandler; /* name of call handler function */ text tmplinline; /* name of anonymous-block handler, or NULL */ text tmplvalidator; /* name of validator function, or NULL */ text tmpllibrary; /* path of shared library */ aclitem tmplacl[1]; /* access privileges for template */ #endif } FormData_pg_pltemplate; /* ---------------- * Form_pg_pltemplate corresponds to a pointer to a row with * the format of pg_pltemplate relation. * ---------------- */ typedef FormData_pg_pltemplate *Form_pg_pltemplate; /* ---------------- * compiler constants for pg_pltemplate * ---------------- */ #define Natts_pg_pltemplate 8 #define Anum_pg_pltemplate_tmplname 1 #define Anum_pg_pltemplate_tmpltrusted 2 #define Anum_pg_pltemplate_tmpldbacreate 3 #define Anum_pg_pltemplate_tmplhandler 4 #define Anum_pg_pltemplate_tmplinline 5 #define Anum_pg_pltemplate_tmplvalidator 6 #define Anum_pg_pltemplate_tmpllibrary 7 #define Anum_pg_pltemplate_tmplacl 8 /* ---------------- * initial contents of pg_pltemplate * ---------------- */ DATA(insert ( "plpgsql" t t "plpgsql_call_handler" "plpgsql_inline_handler" "plpgsql_validator" "$libdir/plpgsql" _null_ )); DATA(insert ( "pltcl" t t "pltcl_call_handler" _null_ _null_ "$libdir/pltcl" _null_ )); DATA(insert ( "pltclu" f f "pltclu_call_handler" _null_ _null_ "$libdir/pltcl" _null_ )); DATA(insert ( "plperl" t t "plperl_call_handler" "plperl_inline_handler" "plperl_validator" "$libdir/plperl" _null_ )); DATA(insert ( "plperlu" f f "plperlu_call_handler" "plperlu_inline_handler" "plperlu_validator" "$libdir/plperl" _null_ )); DATA(insert ( "plpythonu" f f "plpython_call_handler" "plpython_inline_handler" "plpython_validator" "$libdir/plpython2" _null_ )); DATA(insert ( "plpython2u" f f "plpython2_call_handler" "plpython2_inline_handler" "plpython2_validator" "$libdir/plpython2" _null_ )); DATA(insert ( "plpython3u" f f "plpython3_call_handler" "plpython3_inline_handler" "plpython3_validator" "$libdir/plpython3" _null_ )); #endif /* PG_PLTEMPLATE_H */ PKBiZH_server/catalog/pg_control.hnu[/*------------------------------------------------------------------------- * * pg_control.h * The system control file "pg_control" is not a heap relation. * However, we define it here so that the format is documented. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_control.h * *------------------------------------------------------------------------- */ #ifndef PG_CONTROL_H #define PG_CONTROL_H #include "access/xlogdefs.h" #include "pgtime.h" /* for pg_time_t */ #include "utils/pg_crc.h" /* Version identifier for this pg_control format */ #define PG_CONTROL_VERSION 922 /* * Body of CheckPoint XLOG records. This is declared here because we keep * a copy of the latest one in pg_control for possible disaster recovery. * Changing this struct requires a PG_CONTROL_VERSION bump. */ typedef struct CheckPoint { XLogRecPtr redo; /* next RecPtr available when we began to * create CheckPoint (i.e. REDO start point) */ TimeLineID ThisTimeLineID; /* current TLI */ bool fullPageWrites; /* current full_page_writes */ uint32 nextXidEpoch; /* higher-order bits of nextXid */ TransactionId nextXid; /* next free XID */ Oid nextOid; /* next free OID */ MultiXactId nextMulti; /* next free MultiXactId */ MultiXactOffset nextMultiOffset; /* next free MultiXact offset */ TransactionId oldestXid; /* cluster-wide minimum datfrozenxid */ Oid oldestXidDB; /* database with minimum datfrozenxid */ pg_time_t time; /* time stamp of checkpoint */ /* * Oldest XID still running. This is only needed to initialize hot standby * mode from an online checkpoint, so we only bother calculating this for * online checkpoints and only when wal_level is hot_standby. Otherwise * it's set to InvalidTransactionId. */ TransactionId oldestActiveXid; } CheckPoint; /* XLOG info values for XLOG rmgr */ #define XLOG_CHECKPOINT_SHUTDOWN 0x00 #define XLOG_CHECKPOINT_ONLINE 0x10 #define XLOG_NOOP 0x20 #define XLOG_NEXTOID 0x30 #define XLOG_SWITCH 0x40 #define XLOG_BACKUP_END 0x50 #define XLOG_PARAMETER_CHANGE 0x60 #define XLOG_RESTORE_POINT 0x70 #define XLOG_FPW_CHANGE 0x80 /* * System status indicator. Note this is stored in pg_control; if you change * it, you must bump PG_CONTROL_VERSION */ typedef enum DBState { DB_STARTUP = 0, DB_SHUTDOWNED, DB_SHUTDOWNED_IN_RECOVERY, DB_SHUTDOWNING, DB_IN_CRASH_RECOVERY, DB_IN_ARCHIVE_RECOVERY, DB_IN_PRODUCTION } DBState; /* * Contents of pg_control. * * NOTE: try to keep this under 512 bytes so that it will fit on one physical * sector of typical disk drives. This reduces the odds of corruption due to * power failure midway through a write. */ typedef struct ControlFileData { /* * Unique system identifier --- to ensure we match up xlog files with the * installation that produced them. */ uint64 system_identifier; /* * Version identifier information. Keep these fields at the same offset, * especially pg_control_version; they won't be real useful if they move * around. (For historical reasons they must be 8 bytes into the file * rather than immediately at the front.) * * pg_control_version identifies the format of pg_control itself. * catalog_version_no identifies the format of the system catalogs. * * There are additional version identifiers in individual files; for * example, WAL logs contain per-page magic numbers that can serve as * version cues for the WAL log. */ uint32 pg_control_version; /* PG_CONTROL_VERSION */ uint32 catalog_version_no; /* see catversion.h */ /* * System status data */ DBState state; /* see enum above */ pg_time_t time; /* time stamp of last pg_control update */ XLogRecPtr checkPoint; /* last check point record ptr */ XLogRecPtr prevCheckPoint; /* previous check point record ptr */ CheckPoint checkPointCopy; /* copy of last check point record */ /* * These two values determine the minimum point we must recover up to * before starting up: * * minRecoveryPoint is updated to the latest replayed LSN whenever we * flush a data change during archive recovery. That guards against * starting archive recovery, aborting it, and restarting with an earlier * stop location. If we've already flushed data changes from WAL record X * to disk, we mustn't start up until we reach X again. Zero when not * doing archive recovery. * * backupStartPoint is the redo pointer of the backup start checkpoint, if * we are recovering from an online backup and haven't reached the end of * backup yet. It is reset to zero when the end of backup is reached, and * we mustn't start up before that. A boolean would suffice otherwise, but * we use the redo pointer as a cross-check when we see an end-of-backup * record, to make sure the end-of-backup record corresponds the base * backup we're recovering from. * * backupEndPoint is the backup end location, if we are recovering from an * online backup which was taken from the standby and haven't reached the * end of backup yet. It is initialized to the minimum recovery point in * pg_control which was backed up last. It is reset to zero when the end * of backup is reached, and we mustn't start up before that. * * If backupEndRequired is true, we know for sure that we're restoring * from a backup, and must see a backup-end record before we can safely * start up. If it's false, but backupStartPoint is set, a backup_label * file was found at startup but it may have been a leftover from a stray * pg_start_backup() call, not accompanied by pg_stop_backup(). */ XLogRecPtr minRecoveryPoint; XLogRecPtr backupStartPoint; XLogRecPtr backupEndPoint; bool backupEndRequired; /* * Parameter settings that determine if the WAL can be used for archival * or hot standby. */ int wal_level; int MaxConnections; int max_prepared_xacts; int max_locks_per_xact; /* * This data is used to check for hardware-architecture compatibility of * the database and the backend executable. We need not check endianness * explicitly, since the pg_control version will surely look wrong to a * machine of different endianness, but we do need to worry about MAXALIGN * and floating-point format. (Note: storage layout nominally also * depends on SHORTALIGN and INTALIGN, but in practice these are the same * on all architectures of interest.) * * Testing just one double value is not a very bulletproof test for * floating-point compatibility, but it will catch most cases. */ uint32 maxAlign; /* alignment requirement for tuples */ double floatFormat; /* constant 1234567.0 */ #define FLOATFORMAT_VALUE 1234567.0 /* * This data is used to make sure that configuration of this database is * compatible with the backend executable. */ uint32 blcksz; /* data block size for this DB */ uint32 relseg_size; /* blocks per segment of large relation */ uint32 xlog_blcksz; /* block size within WAL files */ uint32 xlog_seg_size; /* size of each WAL segment */ uint32 nameDataLen; /* catalog name field width */ uint32 indexMaxKeys; /* max number of columns in an index */ uint32 toast_max_chunk_size; /* chunk size in TOAST tables */ /* flag indicating internal format of timestamp, interval, time */ bool enableIntTimes; /* int64 storage enabled? */ /* flags indicating pass-by-value status of various types */ bool float4ByVal; /* float4 pass-by-value? */ bool float8ByVal; /* float8, int8, etc pass-by-value? */ /* CRC of all above ... MUST BE LAST! */ pg_crc32 crc; } ControlFileData; /* * Physical size of the pg_control file. Note that this is considerably * bigger than the actually used size (ie, sizeof(ControlFileData)). * The idea is to keep the physical size constant independent of format * changes, so that ReadControlFile will deliver a suitable wrong-version * message instead of a read error if it's looking at an incompatible file. */ #define PG_CONTROL_SIZE 8192 #endif /* PG_CONTROL_H */ PKBiZaP> \\!server/catalog/pg_foreign_table.hnu[/*------------------------------------------------------------------------- * * pg_foreign_table.h * definition of the system "foreign table" relation (pg_foreign_table) * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_foreign_table.h * * NOTES * the genbki.sh script reads this file and generates .bki * information from the DATA() statements. * *------------------------------------------------------------------------- */ #ifndef PG_FOREIGN_TABLE_H #define PG_FOREIGN_TABLE_H #include "catalog/genbki.h" /* ---------------- * pg_foreign_table definition. cpp turns this into * typedef struct FormData_pg_foreign_table * ---------------- */ #define ForeignTableRelationId 3118 CATALOG(pg_foreign_table,3118) BKI_WITHOUT_OIDS { Oid ftrelid; /* OID of foreign table */ Oid ftserver; /* OID of foreign server */ #ifdef CATALOG_VARLEN /* variable-length fields start here */ text ftoptions[1]; /* FDW-specific options */ #endif } FormData_pg_foreign_table; /* ---------------- * Form_pg_foreign_table corresponds to a pointer to a tuple with * the format of pg_foreign_table relation. * ---------------- */ typedef FormData_pg_foreign_table *Form_pg_foreign_table; /* ---------------- * compiler constants for pg_foreign_table * ---------------- */ #define Natts_pg_foreign_table 3 #define Anum_pg_foreign_table_ftrelid 1 #define Anum_pg_foreign_table_ftserver 2 #define Anum_pg_foreign_table_ftoptions 3 #endif /* PG_FOREIGN_TABLE_H */ PKBiZ&,;;server/catalog/heap.hnu[/*------------------------------------------------------------------------- * * heap.h * prototypes for functions in backend/catalog/heap.c * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/heap.h * *------------------------------------------------------------------------- */ #ifndef HEAP_H #define HEAP_H #include "parser/parse_node.h" #include "catalog/indexing.h" typedef struct RawColumnDefault { AttrNumber attnum; /* attribute to attach default to */ Node *raw_default; /* default value (untransformed parse tree) */ } RawColumnDefault; typedef struct CookedConstraint { ConstrType contype; /* CONSTR_DEFAULT or CONSTR_CHECK */ char *name; /* name, or NULL if none */ AttrNumber attnum; /* which attr (only for DEFAULT) */ Node *expr; /* transformed default or check expr */ bool skip_validation; /* skip validation? (only for CHECK) */ bool is_local; /* constraint has local (non-inherited) def */ int inhcount; /* number of times constraint is inherited */ bool is_no_inherit; /* constraint has local def and cannot be * inherited */ } CookedConstraint; extern Relation heap_create(const char *relname, Oid relnamespace, Oid reltablespace, Oid relid, Oid relfilenode, TupleDesc tupDesc, char relkind, char relpersistence, bool shared_relation, bool mapped_relation, bool allow_system_table_mods); extern Oid heap_create_with_catalog(const char *relname, Oid relnamespace, Oid reltablespace, Oid relid, Oid reltypeid, Oid reloftypeid, Oid ownerid, TupleDesc tupdesc, List *cooked_constraints, char relkind, char relpersistence, bool shared_relation, bool mapped_relation, bool oidislocal, int oidinhcount, OnCommitAction oncommit, Datum reloptions, bool use_user_acl, bool allow_system_table_mods); extern void heap_create_init_fork(Relation rel); extern void heap_drop_with_catalog(Oid relid); extern void heap_truncate(List *relids); extern void heap_truncate_one_rel(Relation rel); extern void heap_truncate_check_FKs(List *relations, bool tempTables); extern List *heap_truncate_find_FKs(List *relationIds); extern void InsertPgAttributeTuple(Relation pg_attribute_rel, Form_pg_attribute new_attribute, CatalogIndexState indstate); extern void InsertPgClassTuple(Relation pg_class_desc, Relation new_rel_desc, Oid new_rel_oid, Datum relacl, Datum reloptions); extern List *AddRelationNewConstraints(Relation rel, List *newColDefaults, List *newConstraints, bool allow_merge, bool is_local); extern void StoreAttrDefault(Relation rel, AttrNumber attnum, Node *expr); extern Node *cookDefault(ParseState *pstate, Node *raw_default, Oid atttypid, int32 atttypmod, char *attname); extern void DeleteRelationTuple(Oid relid); extern void DeleteAttributeTuples(Oid relid); extern void RemoveAttributeById(Oid relid, AttrNumber attnum); extern void RemoveAttrDefault(Oid relid, AttrNumber attnum, DropBehavior behavior, bool complain, bool internal); extern void RemoveAttrDefaultById(Oid attrdefId); extern void RemoveStatistics(Oid relid, AttrNumber attnum); extern Form_pg_attribute SystemAttributeDefinition(AttrNumber attno, bool relhasoids); extern Form_pg_attribute SystemAttributeByName(const char *attname, bool relhasoids); extern void CheckAttributeNamesTypes(TupleDesc tupdesc, char relkind, bool allow_system_table_mods); extern void CheckAttributeType(const char *attname, Oid atttypid, Oid attcollation, List *containing_rowtypes, bool allow_system_table_mods); #endif /* HEAP_H */ PKBiZ 55server/catalog/pg_am.hnu[/*------------------------------------------------------------------------- * * pg_am.h * definition of the system "access method" relation (pg_am) * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_am.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * * XXX do NOT break up DATA() statements into multiple lines! * the scripts are not as smart as you might think... * *------------------------------------------------------------------------- */ #ifndef PG_AM_H #define PG_AM_H #include "catalog/genbki.h" /* ---------------- * pg_am definition. cpp turns this into * typedef struct FormData_pg_am * ---------------- */ #define AccessMethodRelationId 2601 CATALOG(pg_am,2601) { NameData amname; /* access method name */ int2 amstrategies; /* total number of strategies (operators) by * which we can traverse/search this AM. Zero * if AM does not have a fixed set of strategy * assignments. */ int2 amsupport; /* total number of support functions that this * AM uses */ bool amcanorder; /* does AM support order by column value? */ bool amcanorderbyop; /* does AM support order by operator result? */ bool amcanbackward; /* does AM support backward scan? */ bool amcanunique; /* does AM support UNIQUE indexes? */ bool amcanmulticol; /* does AM support multi-column indexes? */ bool amoptionalkey; /* can query omit key for the first column? */ bool amsearcharray; /* can AM handle ScalarArrayOpExpr quals? */ bool amsearchnulls; /* can AM search for NULL/NOT NULL entries? */ bool amstorage; /* can storage type differ from column type? */ bool amclusterable; /* does AM support cluster command? */ bool ampredlocks; /* does AM handle predicate locks? */ Oid amkeytype; /* type of data in index, or InvalidOid */ regproc aminsert; /* "insert this tuple" function */ regproc ambeginscan; /* "prepare for index scan" function */ regproc amgettuple; /* "next valid tuple" function, or 0 */ regproc amgetbitmap; /* "fetch all valid tuples" function, or 0 */ regproc amrescan; /* "(re)start index scan" function */ regproc amendscan; /* "end index scan" function */ regproc ammarkpos; /* "mark current scan position" function */ regproc amrestrpos; /* "restore marked scan position" function */ regproc ambuild; /* "build new index" function */ regproc ambuildempty; /* "build empty index" function */ regproc ambulkdelete; /* bulk-delete function */ regproc amvacuumcleanup; /* post-VACUUM cleanup function */ regproc amcanreturn; /* can indexscan return IndexTuples? */ regproc amcostestimate; /* estimate cost of an indexscan */ regproc amoptions; /* parse AM-specific parameters */ } FormData_pg_am; /* ---------------- * Form_pg_am corresponds to a pointer to a tuple with * the format of pg_am relation. * ---------------- */ typedef FormData_pg_am *Form_pg_am; /* ---------------- * compiler constants for pg_am * ---------------- */ #define Natts_pg_am 30 #define Anum_pg_am_amname 1 #define Anum_pg_am_amstrategies 2 #define Anum_pg_am_amsupport 3 #define Anum_pg_am_amcanorder 4 #define Anum_pg_am_amcanorderbyop 5 #define Anum_pg_am_amcanbackward 6 #define Anum_pg_am_amcanunique 7 #define Anum_pg_am_amcanmulticol 8 #define Anum_pg_am_amoptionalkey 9 #define Anum_pg_am_amsearcharray 10 #define Anum_pg_am_amsearchnulls 11 #define Anum_pg_am_amstorage 12 #define Anum_pg_am_amclusterable 13 #define Anum_pg_am_ampredlocks 14 #define Anum_pg_am_amkeytype 15 #define Anum_pg_am_aminsert 16 #define Anum_pg_am_ambeginscan 17 #define Anum_pg_am_amgettuple 18 #define Anum_pg_am_amgetbitmap 19 #define Anum_pg_am_amrescan 20 #define Anum_pg_am_amendscan 21 #define Anum_pg_am_ammarkpos 22 #define Anum_pg_am_amrestrpos 23 #define Anum_pg_am_ambuild 24 #define Anum_pg_am_ambuildempty 25 #define Anum_pg_am_ambulkdelete 26 #define Anum_pg_am_amvacuumcleanup 27 #define Anum_pg_am_amcanreturn 28 #define Anum_pg_am_amcostestimate 29 #define Anum_pg_am_amoptions 30 /* ---------------- * initial contents of pg_am * ---------------- */ DATA(insert OID = 403 ( btree 5 2 t f t t t t t t f t t 0 btinsert btbeginscan btgettuple btgetbitmap btrescan btendscan btmarkpos btrestrpos btbuild btbuildempty btbulkdelete btvacuumcleanup btcanreturn btcostestimate btoptions )); DESCR("b-tree index access method"); #define BTREE_AM_OID 403 DATA(insert OID = 405 ( hash 1 1 f f t f f f f f f f f 23 hashinsert hashbeginscan hashgettuple hashgetbitmap hashrescan hashendscan hashmarkpos hashrestrpos hashbuild hashbuildempty hashbulkdelete hashvacuumcleanup - hashcostestimate hashoptions )); DESCR("hash index access method"); #define HASH_AM_OID 405 DATA(insert OID = 783 ( gist 0 8 f t f f t t f t t t f 0 gistinsert gistbeginscan gistgettuple gistgetbitmap gistrescan gistendscan gistmarkpos gistrestrpos gistbuild gistbuildempty gistbulkdelete gistvacuumcleanup - gistcostestimate gistoptions )); DESCR("GiST index access method"); #define GIST_AM_OID 783 DATA(insert OID = 2742 ( gin 0 5 f f f f t t f f t f f 0 gininsert ginbeginscan - gingetbitmap ginrescan ginendscan ginmarkpos ginrestrpos ginbuild ginbuildempty ginbulkdelete ginvacuumcleanup - gincostestimate ginoptions )); DESCR("GIN index access method"); #define GIN_AM_OID 2742 DATA(insert OID = 4000 ( spgist 0 5 f f f f f t f t f f f 0 spginsert spgbeginscan spggettuple spggetbitmap spgrescan spgendscan spgmarkpos spgrestrpos spgbuild spgbuildempty spgbulkdelete spgvacuumcleanup spgcanreturn spgcostestimate spgoptions )); DESCR("SP-GiST index access method"); #define SPGIST_AM_OID 4000 #endif /* PG_AM_H */ PKBiZ  server/catalog/pg_proc.hnu[/*------------------------------------------------------------------------- * * pg_proc.h * definition of the system "procedure" relation (pg_proc) * along with the relation's initial contents. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_proc.h * * NOTES * The script catalog/genbki.pl reads this file and generates .bki * information from the DATA() statements. utils/Gen_fmgrtab.pl * generates fmgroids.h and fmgrtab.c the same way. * * XXX do NOT break up DATA() statements into multiple lines! * the scripts are not as smart as you might think... * XXX (eg. #if 0 #endif won't do what you think) * *------------------------------------------------------------------------- */ #ifndef PG_PROC_H #define PG_PROC_H #include "catalog/genbki.h" /* ---------------- * pg_proc definition. cpp turns this into * typedef struct FormData_pg_proc * ---------------- */ #define ProcedureRelationId 1255 #define ProcedureRelation_Rowtype_Id 81 CATALOG(pg_proc,1255) BKI_BOOTSTRAP BKI_ROWTYPE_OID(81) BKI_SCHEMA_MACRO { NameData proname; /* procedure name */ Oid pronamespace; /* OID of namespace containing this proc */ Oid proowner; /* procedure owner */ Oid prolang; /* OID of pg_language entry */ float4 procost; /* estimated execution cost */ float4 prorows; /* estimated # of rows out (if proretset) */ Oid provariadic; /* element type of variadic array, or 0 */ regproc protransform; /* transforms calls to it during planning */ bool proisagg; /* is it an aggregate? */ bool proiswindow; /* is it a window function? */ bool prosecdef; /* security definer */ bool proleakproof; /* is it a leak-proof function? */ bool proisstrict; /* strict with respect to NULLs? */ bool proretset; /* returns a set? */ char provolatile; /* see PROVOLATILE_ categories below */ int2 pronargs; /* number of arguments */ int2 pronargdefaults; /* number of arguments with defaults */ Oid prorettype; /* OID of result type */ /* * variable-length fields start here, but we allow direct access to * proargtypes */ oidvector proargtypes; /* parameter types (excludes OUT params) */ #ifdef CATALOG_VARLEN Oid proallargtypes[1]; /* all param types (NULL if IN only) */ char proargmodes[1]; /* parameter modes (NULL if IN only) */ text proargnames[1]; /* parameter names (NULL if no names) */ pg_node_tree proargdefaults;/* list of expression trees for argument * defaults (NULL if none) */ text prosrc; /* procedure source text */ text probin; /* secondary procedure info (can be NULL) */ text proconfig[1]; /* procedure-local GUC settings */ aclitem proacl[1]; /* access permissions */ #endif } FormData_pg_proc; /* ---------------- * Form_pg_proc corresponds to a pointer to a tuple with * the format of pg_proc relation. * ---------------- */ typedef FormData_pg_proc *Form_pg_proc; /* ---------------- * compiler constants for pg_proc * ---------------- */ #define Natts_pg_proc 27 #define Anum_pg_proc_proname 1 #define Anum_pg_proc_pronamespace 2 #define Anum_pg_proc_proowner 3 #define Anum_pg_proc_prolang 4 #define Anum_pg_proc_procost 5 #define Anum_pg_proc_prorows 6 #define Anum_pg_proc_provariadic 7 #define Anum_pg_proc_protransform 8 #define Anum_pg_proc_proisagg 9 #define Anum_pg_proc_proiswindow 10 #define Anum_pg_proc_prosecdef 11 #define Anum_pg_proc_proleakproof 12 #define Anum_pg_proc_proisstrict 13 #define Anum_pg_proc_proretset 14 #define Anum_pg_proc_provolatile 15 #define Anum_pg_proc_pronargs 16 #define Anum_pg_proc_pronargdefaults 17 #define Anum_pg_proc_prorettype 18 #define Anum_pg_proc_proargtypes 19 #define Anum_pg_proc_proallargtypes 20 #define Anum_pg_proc_proargmodes 21 #define Anum_pg_proc_proargnames 22 #define Anum_pg_proc_proargdefaults 23 #define Anum_pg_proc_prosrc 24 #define Anum_pg_proc_probin 25 #define Anum_pg_proc_proconfig 26 #define Anum_pg_proc_proacl 27 /* ---------------- * initial contents of pg_proc * ---------------- */ /* * Note: every entry in pg_proc.h is expected to have a DESCR() comment, * except for functions that implement pg_operator.h operators and don't * have a good reason to be called directly rather than via the operator. * (If you do expect such a function to be used directly, you should * duplicate the operator's comment.) initdb will supply suitable default * comments for functions referenced by pg_operator. * * Try to follow the style of existing functions' comments. * Some recommended conventions: * "I/O" for typinput, typoutput, typreceive, typsend functions * "I/O typmod" for typmodin, typmodout functions * "aggregate transition function" for aggtransfn functions, unless * they are reasonably useful in their own right * "aggregate final function" for aggfinalfn functions (likewise) * "convert srctypename to desttypename" for cast functions * "less-equal-greater" for B-tree comparison functions */ /* keep the following ordered by OID so that later changes can be made easier */ /* OIDS 1 - 99 */ DATA(insert OID = 1242 ( boolin PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 16 "2275" _null_ _null_ _null_ _null_ boolin _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 1243 ( boolout PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "16" _null_ _null_ _null_ _null_ boolout _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 1244 ( byteain PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "2275" _null_ _null_ _null_ _null_ byteain _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 31 ( byteaout PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "17" _null_ _null_ _null_ _null_ byteaout _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 1245 ( charin PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 18 "2275" _null_ _null_ _null_ _null_ charin _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 33 ( charout PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "18" _null_ _null_ _null_ _null_ charout _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 34 ( namein PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 19 "2275" _null_ _null_ _null_ _null_ namein _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 35 ( nameout PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "19" _null_ _null_ _null_ _null_ nameout _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 38 ( int2in PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 21 "2275" _null_ _null_ _null_ _null_ int2in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 39 ( int2out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "21" _null_ _null_ _null_ _null_ int2out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 40 ( int2vectorin PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 22 "2275" _null_ _null_ _null_ _null_ int2vectorin _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 41 ( int2vectorout PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "22" _null_ _null_ _null_ _null_ int2vectorout _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 42 ( int4in PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "2275" _null_ _null_ _null_ _null_ int4in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 43 ( int4out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "23" _null_ _null_ _null_ _null_ int4out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 44 ( regprocin PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 24 "2275" _null_ _null_ _null_ _null_ regprocin _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 45 ( regprocout PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 2275 "24" _null_ _null_ _null_ _null_ regprocout _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 46 ( textin PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 25 "2275" _null_ _null_ _null_ _null_ textin _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 47 ( textout PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "25" _null_ _null_ _null_ _null_ textout _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 48 ( tidin PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 27 "2275" _null_ _null_ _null_ _null_ tidin _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 49 ( tidout PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "27" _null_ _null_ _null_ _null_ tidout _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 50 ( xidin PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 28 "2275" _null_ _null_ _null_ _null_ xidin _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 51 ( xidout PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "28" _null_ _null_ _null_ _null_ xidout _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 52 ( cidin PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 29 "2275" _null_ _null_ _null_ _null_ cidin _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 53 ( cidout PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "29" _null_ _null_ _null_ _null_ cidout _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 54 ( oidvectorin PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 30 "2275" _null_ _null_ _null_ _null_ oidvectorin _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 55 ( oidvectorout PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "30" _null_ _null_ _null_ _null_ oidvectorout _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 56 ( boollt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "16 16" _null_ _null_ _null_ _null_ boollt _null_ _null_ _null_ )); DATA(insert OID = 57 ( boolgt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "16 16" _null_ _null_ _null_ _null_ boolgt _null_ _null_ _null_ )); DATA(insert OID = 60 ( booleq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "16 16" _null_ _null_ _null_ _null_ booleq _null_ _null_ _null_ )); DATA(insert OID = 61 ( chareq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "18 18" _null_ _null_ _null_ _null_ chareq _null_ _null_ _null_ )); DATA(insert OID = 62 ( nameeq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "19 19" _null_ _null_ _null_ _null_ nameeq _null_ _null_ _null_ )); DATA(insert OID = 63 ( int2eq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "21 21" _null_ _null_ _null_ _null_ int2eq _null_ _null_ _null_ )); DATA(insert OID = 64 ( int2lt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "21 21" _null_ _null_ _null_ _null_ int2lt _null_ _null_ _null_ )); DATA(insert OID = 65 ( int4eq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "23 23" _null_ _null_ _null_ _null_ int4eq _null_ _null_ _null_ )); DATA(insert OID = 66 ( int4lt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "23 23" _null_ _null_ _null_ _null_ int4lt _null_ _null_ _null_ )); DATA(insert OID = 67 ( texteq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "25 25" _null_ _null_ _null_ _null_ texteq _null_ _null_ _null_ )); DATA(insert OID = 68 ( xideq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "28 28" _null_ _null_ _null_ _null_ xideq _null_ _null_ _null_ )); DATA(insert OID = 69 ( cideq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "29 29" _null_ _null_ _null_ _null_ cideq _null_ _null_ _null_ )); DATA(insert OID = 70 ( charne PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "18 18" _null_ _null_ _null_ _null_ charne _null_ _null_ _null_ )); DATA(insert OID = 1246 ( charlt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "18 18" _null_ _null_ _null_ _null_ charlt _null_ _null_ _null_ )); DATA(insert OID = 72 ( charle PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "18 18" _null_ _null_ _null_ _null_ charle _null_ _null_ _null_ )); DATA(insert OID = 73 ( chargt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "18 18" _null_ _null_ _null_ _null_ chargt _null_ _null_ _null_ )); DATA(insert OID = 74 ( charge PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "18 18" _null_ _null_ _null_ _null_ charge _null_ _null_ _null_ )); DATA(insert OID = 77 ( int4 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "18" _null_ _null_ _null_ _null_ chartoi4 _null_ _null_ _null_ )); DESCR("convert char to int4"); DATA(insert OID = 78 ( char PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 18 "23" _null_ _null_ _null_ _null_ i4tochar _null_ _null_ _null_ )); DESCR("convert int4 to char"); DATA(insert OID = 79 ( nameregexeq PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "19 25" _null_ _null_ _null_ _null_ nameregexeq _null_ _null_ _null_ )); DATA(insert OID = 1252 ( nameregexne PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "19 25" _null_ _null_ _null_ _null_ nameregexne _null_ _null_ _null_ )); DATA(insert OID = 1254 ( textregexeq PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "25 25" _null_ _null_ _null_ _null_ textregexeq _null_ _null_ _null_ )); DATA(insert OID = 1256 ( textregexne PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "25 25" _null_ _null_ _null_ _null_ textregexne _null_ _null_ _null_ )); DATA(insert OID = 1257 ( textlen PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "25" _null_ _null_ _null_ _null_ textlen _null_ _null_ _null_ )); DESCR("length"); DATA(insert OID = 1258 ( textcat PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 25 "25 25" _null_ _null_ _null_ _null_ textcat _null_ _null_ _null_ )); DATA(insert OID = 84 ( boolne PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "16 16" _null_ _null_ _null_ _null_ boolne _null_ _null_ _null_ )); DATA(insert OID = 89 ( version PGNSP PGUID 12 1 0 0 0 f f f f t f s 0 0 25 "" _null_ _null_ _null_ _null_ pgsql_version _null_ _null_ _null_ )); DESCR("PostgreSQL version string"); /* OIDS 100 - 199 */ DATA(insert OID = 101 ( eqsel PGNSP PGUID 12 1 0 0 0 f f f f t f s 4 0 701 "2281 26 2281 23" _null_ _null_ _null_ _null_ eqsel _null_ _null_ _null_ )); DESCR("restriction selectivity of = and related operators"); DATA(insert OID = 102 ( neqsel PGNSP PGUID 12 1 0 0 0 f f f f t f s 4 0 701 "2281 26 2281 23" _null_ _null_ _null_ _null_ neqsel _null_ _null_ _null_ )); DESCR("restriction selectivity of <> and related operators"); DATA(insert OID = 103 ( scalarltsel PGNSP PGUID 12 1 0 0 0 f f f f t f s 4 0 701 "2281 26 2281 23" _null_ _null_ _null_ _null_ scalarltsel _null_ _null_ _null_ )); DESCR("restriction selectivity of < and related operators on scalar datatypes"); DATA(insert OID = 104 ( scalargtsel PGNSP PGUID 12 1 0 0 0 f f f f t f s 4 0 701 "2281 26 2281 23" _null_ _null_ _null_ _null_ scalargtsel _null_ _null_ _null_ )); DESCR("restriction selectivity of > and related operators on scalar datatypes"); DATA(insert OID = 105 ( eqjoinsel PGNSP PGUID 12 1 0 0 0 f f f f t f s 5 0 701 "2281 26 2281 21 2281" _null_ _null_ _null_ _null_ eqjoinsel _null_ _null_ _null_ )); DESCR("join selectivity of = and related operators"); DATA(insert OID = 106 ( neqjoinsel PGNSP PGUID 12 1 0 0 0 f f f f t f s 5 0 701 "2281 26 2281 21 2281" _null_ _null_ _null_ _null_ neqjoinsel _null_ _null_ _null_ )); DESCR("join selectivity of <> and related operators"); DATA(insert OID = 107 ( scalarltjoinsel PGNSP PGUID 12 1 0 0 0 f f f f t f s 5 0 701 "2281 26 2281 21 2281" _null_ _null_ _null_ _null_ scalarltjoinsel _null_ _null_ _null_ )); DESCR("join selectivity of < and related operators on scalar datatypes"); DATA(insert OID = 108 ( scalargtjoinsel PGNSP PGUID 12 1 0 0 0 f f f f t f s 5 0 701 "2281 26 2281 21 2281" _null_ _null_ _null_ _null_ scalargtjoinsel _null_ _null_ _null_ )); DESCR("join selectivity of > and related operators on scalar datatypes"); DATA(insert OID = 109 ( unknownin PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 705 "2275" _null_ _null_ _null_ _null_ unknownin _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 110 ( unknownout PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "705" _null_ _null_ _null_ _null_ unknownout _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 111 ( numeric_fac PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1700 "20" _null_ _null_ _null_ _null_ numeric_fac _null_ _null_ _null_ )); DATA(insert OID = 115 ( box_above_eq PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "603 603" _null_ _null_ _null_ _null_ box_above_eq _null_ _null_ _null_ )); DATA(insert OID = 116 ( box_below_eq PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "603 603" _null_ _null_ _null_ _null_ box_below_eq _null_ _null_ _null_ )); DATA(insert OID = 117 ( point_in PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 600 "2275" _null_ _null_ _null_ _null_ point_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 118 ( point_out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "600" _null_ _null_ _null_ _null_ point_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 119 ( lseg_in PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 601 "2275" _null_ _null_ _null_ _null_ lseg_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 120 ( lseg_out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "601" _null_ _null_ _null_ _null_ lseg_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 121 ( path_in PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 602 "2275" _null_ _null_ _null_ _null_ path_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 122 ( path_out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "602" _null_ _null_ _null_ _null_ path_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 123 ( box_in PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 603 "2275" _null_ _null_ _null_ _null_ box_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 124 ( box_out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "603" _null_ _null_ _null_ _null_ box_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 125 ( box_overlap PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "603 603" _null_ _null_ _null_ _null_ box_overlap _null_ _null_ _null_ )); DATA(insert OID = 126 ( box_ge PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "603 603" _null_ _null_ _null_ _null_ box_ge _null_ _null_ _null_ )); DATA(insert OID = 127 ( box_gt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "603 603" _null_ _null_ _null_ _null_ box_gt _null_ _null_ _null_ )); DATA(insert OID = 128 ( box_eq PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "603 603" _null_ _null_ _null_ _null_ box_eq _null_ _null_ _null_ )); DATA(insert OID = 129 ( box_lt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "603 603" _null_ _null_ _null_ _null_ box_lt _null_ _null_ _null_ )); DATA(insert OID = 130 ( box_le PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "603 603" _null_ _null_ _null_ _null_ box_le _null_ _null_ _null_ )); DATA(insert OID = 131 ( point_above PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "600 600" _null_ _null_ _null_ _null_ point_above _null_ _null_ _null_ )); DATA(insert OID = 132 ( point_left PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "600 600" _null_ _null_ _null_ _null_ point_left _null_ _null_ _null_ )); DATA(insert OID = 133 ( point_right PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "600 600" _null_ _null_ _null_ _null_ point_right _null_ _null_ _null_ )); DATA(insert OID = 134 ( point_below PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "600 600" _null_ _null_ _null_ _null_ point_below _null_ _null_ _null_ )); DATA(insert OID = 135 ( point_eq PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "600 600" _null_ _null_ _null_ _null_ point_eq _null_ _null_ _null_ )); DATA(insert OID = 136 ( on_pb PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "600 603" _null_ _null_ _null_ _null_ on_pb _null_ _null_ _null_ )); DATA(insert OID = 137 ( on_ppath PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "600 602" _null_ _null_ _null_ _null_ on_ppath _null_ _null_ _null_ )); DATA(insert OID = 138 ( box_center PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 600 "603" _null_ _null_ _null_ _null_ box_center _null_ _null_ _null_ )); DATA(insert OID = 139 ( areasel PGNSP PGUID 12 1 0 0 0 f f f f t f s 4 0 701 "2281 26 2281 23" _null_ _null_ _null_ _null_ areasel _null_ _null_ _null_ )); DESCR("restriction selectivity for area-comparison operators"); DATA(insert OID = 140 ( areajoinsel PGNSP PGUID 12 1 0 0 0 f f f f t f s 5 0 701 "2281 26 2281 21 2281" _null_ _null_ _null_ _null_ areajoinsel _null_ _null_ _null_ )); DESCR("join selectivity for area-comparison operators"); DATA(insert OID = 141 ( int4mul PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "23 23" _null_ _null_ _null_ _null_ int4mul _null_ _null_ _null_ )); DATA(insert OID = 144 ( int4ne PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "23 23" _null_ _null_ _null_ _null_ int4ne _null_ _null_ _null_ )); DATA(insert OID = 145 ( int2ne PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "21 21" _null_ _null_ _null_ _null_ int2ne _null_ _null_ _null_ )); DATA(insert OID = 146 ( int2gt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "21 21" _null_ _null_ _null_ _null_ int2gt _null_ _null_ _null_ )); DATA(insert OID = 147 ( int4gt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "23 23" _null_ _null_ _null_ _null_ int4gt _null_ _null_ _null_ )); DATA(insert OID = 148 ( int2le PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "21 21" _null_ _null_ _null_ _null_ int2le _null_ _null_ _null_ )); DATA(insert OID = 149 ( int4le PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "23 23" _null_ _null_ _null_ _null_ int4le _null_ _null_ _null_ )); DATA(insert OID = 150 ( int4ge PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "23 23" _null_ _null_ _null_ _null_ int4ge _null_ _null_ _null_ )); DATA(insert OID = 151 ( int2ge PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "21 21" _null_ _null_ _null_ _null_ int2ge _null_ _null_ _null_ )); DATA(insert OID = 152 ( int2mul PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 21 "21 21" _null_ _null_ _null_ _null_ int2mul _null_ _null_ _null_ )); DATA(insert OID = 153 ( int2div PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 21 "21 21" _null_ _null_ _null_ _null_ int2div _null_ _null_ _null_ )); DATA(insert OID = 154 ( int4div PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "23 23" _null_ _null_ _null_ _null_ int4div _null_ _null_ _null_ )); DATA(insert OID = 155 ( int2mod PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 21 "21 21" _null_ _null_ _null_ _null_ int2mod _null_ _null_ _null_ )); DATA(insert OID = 156 ( int4mod PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "23 23" _null_ _null_ _null_ _null_ int4mod _null_ _null_ _null_ )); DATA(insert OID = 157 ( textne PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "25 25" _null_ _null_ _null_ _null_ textne _null_ _null_ _null_ )); DATA(insert OID = 158 ( int24eq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "21 23" _null_ _null_ _null_ _null_ int24eq _null_ _null_ _null_ )); DATA(insert OID = 159 ( int42eq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "23 21" _null_ _null_ _null_ _null_ int42eq _null_ _null_ _null_ )); DATA(insert OID = 160 ( int24lt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "21 23" _null_ _null_ _null_ _null_ int24lt _null_ _null_ _null_ )); DATA(insert OID = 161 ( int42lt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "23 21" _null_ _null_ _null_ _null_ int42lt _null_ _null_ _null_ )); DATA(insert OID = 162 ( int24gt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "21 23" _null_ _null_ _null_ _null_ int24gt _null_ _null_ _null_ )); DATA(insert OID = 163 ( int42gt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "23 21" _null_ _null_ _null_ _null_ int42gt _null_ _null_ _null_ )); DATA(insert OID = 164 ( int24ne PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "21 23" _null_ _null_ _null_ _null_ int24ne _null_ _null_ _null_ )); DATA(insert OID = 165 ( int42ne PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "23 21" _null_ _null_ _null_ _null_ int42ne _null_ _null_ _null_ )); DATA(insert OID = 166 ( int24le PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "21 23" _null_ _null_ _null_ _null_ int24le _null_ _null_ _null_ )); DATA(insert OID = 167 ( int42le PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "23 21" _null_ _null_ _null_ _null_ int42le _null_ _null_ _null_ )); DATA(insert OID = 168 ( int24ge PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "21 23" _null_ _null_ _null_ _null_ int24ge _null_ _null_ _null_ )); DATA(insert OID = 169 ( int42ge PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "23 21" _null_ _null_ _null_ _null_ int42ge _null_ _null_ _null_ )); DATA(insert OID = 170 ( int24mul PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "21 23" _null_ _null_ _null_ _null_ int24mul _null_ _null_ _null_ )); DATA(insert OID = 171 ( int42mul PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "23 21" _null_ _null_ _null_ _null_ int42mul _null_ _null_ _null_ )); DATA(insert OID = 172 ( int24div PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "21 23" _null_ _null_ _null_ _null_ int24div _null_ _null_ _null_ )); DATA(insert OID = 173 ( int42div PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "23 21" _null_ _null_ _null_ _null_ int42div _null_ _null_ _null_ )); DATA(insert OID = 176 ( int2pl PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 21 "21 21" _null_ _null_ _null_ _null_ int2pl _null_ _null_ _null_ )); DATA(insert OID = 177 ( int4pl PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "23 23" _null_ _null_ _null_ _null_ int4pl _null_ _null_ _null_ )); DATA(insert OID = 178 ( int24pl PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "21 23" _null_ _null_ _null_ _null_ int24pl _null_ _null_ _null_ )); DATA(insert OID = 179 ( int42pl PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "23 21" _null_ _null_ _null_ _null_ int42pl _null_ _null_ _null_ )); DATA(insert OID = 180 ( int2mi PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 21 "21 21" _null_ _null_ _null_ _null_ int2mi _null_ _null_ _null_ )); DATA(insert OID = 181 ( int4mi PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "23 23" _null_ _null_ _null_ _null_ int4mi _null_ _null_ _null_ )); DATA(insert OID = 182 ( int24mi PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "21 23" _null_ _null_ _null_ _null_ int24mi _null_ _null_ _null_ )); DATA(insert OID = 183 ( int42mi PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "23 21" _null_ _null_ _null_ _null_ int42mi _null_ _null_ _null_ )); DATA(insert OID = 184 ( oideq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "26 26" _null_ _null_ _null_ _null_ oideq _null_ _null_ _null_ )); DATA(insert OID = 185 ( oidne PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "26 26" _null_ _null_ _null_ _null_ oidne _null_ _null_ _null_ )); DATA(insert OID = 186 ( box_same PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "603 603" _null_ _null_ _null_ _null_ box_same _null_ _null_ _null_ )); DATA(insert OID = 187 ( box_contain PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "603 603" _null_ _null_ _null_ _null_ box_contain _null_ _null_ _null_ )); DATA(insert OID = 188 ( box_left PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "603 603" _null_ _null_ _null_ _null_ box_left _null_ _null_ _null_ )); DATA(insert OID = 189 ( box_overleft PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "603 603" _null_ _null_ _null_ _null_ box_overleft _null_ _null_ _null_ )); DATA(insert OID = 190 ( box_overright PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "603 603" _null_ _null_ _null_ _null_ box_overright _null_ _null_ _null_ )); DATA(insert OID = 191 ( box_right PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "603 603" _null_ _null_ _null_ _null_ box_right _null_ _null_ _null_ )); DATA(insert OID = 192 ( box_contained PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "603 603" _null_ _null_ _null_ _null_ box_contained _null_ _null_ _null_ )); DATA(insert OID = 193 ( box_contain_pt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "603 600" _null_ _null_ _null_ _null_ box_contain_pt _null_ _null_ _null_ )); DATA(insert OID = 195 ( pg_node_tree_in PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 194 "2275" _null_ _null_ _null_ _null_ pg_node_tree_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 196 ( pg_node_tree_out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "194" _null_ _null_ _null_ _null_ pg_node_tree_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 197 ( pg_node_tree_recv PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 194 "2281" _null_ _null_ _null_ _null_ pg_node_tree_recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 198 ( pg_node_tree_send PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 17 "194" _null_ _null_ _null_ _null_ pg_node_tree_send _null_ _null_ _null_ )); DESCR("I/O"); /* OIDS 200 - 299 */ DATA(insert OID = 200 ( float4in PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 700 "2275" _null_ _null_ _null_ _null_ float4in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 201 ( float4out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "700" _null_ _null_ _null_ _null_ float4out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 202 ( float4mul PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 700 "700 700" _null_ _null_ _null_ _null_ float4mul _null_ _null_ _null_ )); DATA(insert OID = 203 ( float4div PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 700 "700 700" _null_ _null_ _null_ _null_ float4div _null_ _null_ _null_ )); DATA(insert OID = 204 ( float4pl PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 700 "700 700" _null_ _null_ _null_ _null_ float4pl _null_ _null_ _null_ )); DATA(insert OID = 205 ( float4mi PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 700 "700 700" _null_ _null_ _null_ _null_ float4mi _null_ _null_ _null_ )); DATA(insert OID = 206 ( float4um PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 700 "700" _null_ _null_ _null_ _null_ float4um _null_ _null_ _null_ )); DATA(insert OID = 207 ( float4abs PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 700 "700" _null_ _null_ _null_ _null_ float4abs _null_ _null_ _null_ )); DATA(insert OID = 208 ( float4_accum PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1022 "1022 700" _null_ _null_ _null_ _null_ float4_accum _null_ _null_ _null_ )); DESCR("aggregate transition function"); DATA(insert OID = 209 ( float4larger PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 700 "700 700" _null_ _null_ _null_ _null_ float4larger _null_ _null_ _null_ )); DESCR("larger of two"); DATA(insert OID = 211 ( float4smaller PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 700 "700 700" _null_ _null_ _null_ _null_ float4smaller _null_ _null_ _null_ )); DESCR("smaller of two"); DATA(insert OID = 212 ( int4um PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "23" _null_ _null_ _null_ _null_ int4um _null_ _null_ _null_ )); DATA(insert OID = 213 ( int2um PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 21 "21" _null_ _null_ _null_ _null_ int2um _null_ _null_ _null_ )); DATA(insert OID = 214 ( float8in PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "2275" _null_ _null_ _null_ _null_ float8in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 215 ( float8out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "701" _null_ _null_ _null_ _null_ float8out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 216 ( float8mul PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "701 701" _null_ _null_ _null_ _null_ float8mul _null_ _null_ _null_ )); DATA(insert OID = 217 ( float8div PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "701 701" _null_ _null_ _null_ _null_ float8div _null_ _null_ _null_ )); DATA(insert OID = 218 ( float8pl PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "701 701" _null_ _null_ _null_ _null_ float8pl _null_ _null_ _null_ )); DATA(insert OID = 219 ( float8mi PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "701 701" _null_ _null_ _null_ _null_ float8mi _null_ _null_ _null_ )); DATA(insert OID = 220 ( float8um PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ float8um _null_ _null_ _null_ )); DATA(insert OID = 221 ( float8abs PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ float8abs _null_ _null_ _null_ )); DATA(insert OID = 222 ( float8_accum PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1022 "1022 701" _null_ _null_ _null_ _null_ float8_accum _null_ _null_ _null_ )); DESCR("aggregate transition function"); DATA(insert OID = 223 ( float8larger PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "701 701" _null_ _null_ _null_ _null_ float8larger _null_ _null_ _null_ )); DESCR("larger of two"); DATA(insert OID = 224 ( float8smaller PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "701 701" _null_ _null_ _null_ _null_ float8smaller _null_ _null_ _null_ )); DESCR("smaller of two"); DATA(insert OID = 225 ( lseg_center PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 600 "601" _null_ _null_ _null_ _null_ lseg_center _null_ _null_ _null_ )); DATA(insert OID = 226 ( path_center PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 600 "602" _null_ _null_ _null_ _null_ path_center _null_ _null_ _null_ )); DATA(insert OID = 227 ( poly_center PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 600 "604" _null_ _null_ _null_ _null_ poly_center _null_ _null_ _null_ )); DATA(insert OID = 228 ( dround PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ dround _null_ _null_ _null_ )); DESCR("round to nearest integer"); DATA(insert OID = 229 ( dtrunc PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ dtrunc _null_ _null_ _null_ )); DESCR("truncate to integer"); DATA(insert OID = 2308 ( ceil PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ dceil _null_ _null_ _null_ )); DESCR("nearest integer >= value"); DATA(insert OID = 2320 ( ceiling PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ dceil _null_ _null_ _null_ )); DESCR("nearest integer >= value"); DATA(insert OID = 2309 ( floor PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ dfloor _null_ _null_ _null_ )); DESCR("nearest integer <= value"); DATA(insert OID = 2310 ( sign PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ dsign _null_ _null_ _null_ )); DESCR("sign of value"); DATA(insert OID = 230 ( dsqrt PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ dsqrt _null_ _null_ _null_ )); DATA(insert OID = 231 ( dcbrt PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ dcbrt _null_ _null_ _null_ )); DATA(insert OID = 232 ( dpow PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "701 701" _null_ _null_ _null_ _null_ dpow _null_ _null_ _null_ )); DATA(insert OID = 233 ( dexp PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ dexp _null_ _null_ _null_ )); DESCR("natural exponential (e^x)"); DATA(insert OID = 234 ( dlog1 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ dlog1 _null_ _null_ _null_ )); DESCR("natural logarithm"); DATA(insert OID = 235 ( float8 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "21" _null_ _null_ _null_ _null_ i2tod _null_ _null_ _null_ )); DESCR("convert int2 to float8"); DATA(insert OID = 236 ( float4 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 700 "21" _null_ _null_ _null_ _null_ i2tof _null_ _null_ _null_ )); DESCR("convert int2 to float4"); DATA(insert OID = 237 ( int2 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 21 "701" _null_ _null_ _null_ _null_ dtoi2 _null_ _null_ _null_ )); DESCR("convert float8 to int2"); DATA(insert OID = 238 ( int2 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 21 "700" _null_ _null_ _null_ _null_ ftoi2 _null_ _null_ _null_ )); DESCR("convert float4 to int2"); DATA(insert OID = 239 ( line_distance PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "628 628" _null_ _null_ _null_ _null_ line_distance _null_ _null_ _null_ )); DATA(insert OID = 240 ( abstimein PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 702 "2275" _null_ _null_ _null_ _null_ abstimein _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 241 ( abstimeout PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 2275 "702" _null_ _null_ _null_ _null_ abstimeout _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 242 ( reltimein PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 703 "2275" _null_ _null_ _null_ _null_ reltimein _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 243 ( reltimeout PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 2275 "703" _null_ _null_ _null_ _null_ reltimeout _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 244 ( timepl PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 702 "702 703" _null_ _null_ _null_ _null_ timepl _null_ _null_ _null_ )); DATA(insert OID = 245 ( timemi PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 702 "702 703" _null_ _null_ _null_ _null_ timemi _null_ _null_ _null_ )); DATA(insert OID = 246 ( tintervalin PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 704 "2275" _null_ _null_ _null_ _null_ tintervalin _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 247 ( tintervalout PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 2275 "704" _null_ _null_ _null_ _null_ tintervalout _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 248 ( intinterval PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "702 704" _null_ _null_ _null_ _null_ intinterval _null_ _null_ _null_ )); DATA(insert OID = 249 ( tintervalrel PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 703 "704" _null_ _null_ _null_ _null_ tintervalrel _null_ _null_ _null_ )); DESCR("tinterval to reltime"); DATA(insert OID = 250 ( timenow PGNSP PGUID 12 1 0 0 0 f f f f t f s 0 0 702 "" _null_ _null_ _null_ _null_ timenow _null_ _null_ _null_ )); DESCR("current date and time (abstime)"); DATA(insert OID = 251 ( abstimeeq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "702 702" _null_ _null_ _null_ _null_ abstimeeq _null_ _null_ _null_ )); DATA(insert OID = 252 ( abstimene PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "702 702" _null_ _null_ _null_ _null_ abstimene _null_ _null_ _null_ )); DATA(insert OID = 253 ( abstimelt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "702 702" _null_ _null_ _null_ _null_ abstimelt _null_ _null_ _null_ )); DATA(insert OID = 254 ( abstimegt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "702 702" _null_ _null_ _null_ _null_ abstimegt _null_ _null_ _null_ )); DATA(insert OID = 255 ( abstimele PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "702 702" _null_ _null_ _null_ _null_ abstimele _null_ _null_ _null_ )); DATA(insert OID = 256 ( abstimege PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "702 702" _null_ _null_ _null_ _null_ abstimege _null_ _null_ _null_ )); DATA(insert OID = 257 ( reltimeeq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "703 703" _null_ _null_ _null_ _null_ reltimeeq _null_ _null_ _null_ )); DATA(insert OID = 258 ( reltimene PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "703 703" _null_ _null_ _null_ _null_ reltimene _null_ _null_ _null_ )); DATA(insert OID = 259 ( reltimelt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "703 703" _null_ _null_ _null_ _null_ reltimelt _null_ _null_ _null_ )); DATA(insert OID = 260 ( reltimegt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "703 703" _null_ _null_ _null_ _null_ reltimegt _null_ _null_ _null_ )); DATA(insert OID = 261 ( reltimele PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "703 703" _null_ _null_ _null_ _null_ reltimele _null_ _null_ _null_ )); DATA(insert OID = 262 ( reltimege PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "703 703" _null_ _null_ _null_ _null_ reltimege _null_ _null_ _null_ )); DATA(insert OID = 263 ( tintervalsame PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "704 704" _null_ _null_ _null_ _null_ tintervalsame _null_ _null_ _null_ )); DATA(insert OID = 264 ( tintervalct PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "704 704" _null_ _null_ _null_ _null_ tintervalct _null_ _null_ _null_ )); DATA(insert OID = 265 ( tintervalov PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "704 704" _null_ _null_ _null_ _null_ tintervalov _null_ _null_ _null_ )); DATA(insert OID = 266 ( tintervalleneq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "704 703" _null_ _null_ _null_ _null_ tintervalleneq _null_ _null_ _null_ )); DATA(insert OID = 267 ( tintervallenne PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "704 703" _null_ _null_ _null_ _null_ tintervallenne _null_ _null_ _null_ )); DATA(insert OID = 268 ( tintervallenlt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "704 703" _null_ _null_ _null_ _null_ tintervallenlt _null_ _null_ _null_ )); DATA(insert OID = 269 ( tintervallengt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "704 703" _null_ _null_ _null_ _null_ tintervallengt _null_ _null_ _null_ )); DATA(insert OID = 270 ( tintervallenle PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "704 703" _null_ _null_ _null_ _null_ tintervallenle _null_ _null_ _null_ )); DATA(insert OID = 271 ( tintervallenge PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "704 703" _null_ _null_ _null_ _null_ tintervallenge _null_ _null_ _null_ )); DATA(insert OID = 272 ( tintervalstart PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 702 "704" _null_ _null_ _null_ _null_ tintervalstart _null_ _null_ _null_ )); DATA(insert OID = 273 ( tintervalend PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 702 "704" _null_ _null_ _null_ _null_ tintervalend _null_ _null_ _null_ )); DESCR("end of interval"); DATA(insert OID = 274 ( timeofday PGNSP PGUID 12 1 0 0 0 f f f f t f v 0 0 25 "" _null_ _null_ _null_ _null_ timeofday _null_ _null_ _null_ )); DESCR("current date and time - increments during transactions"); DATA(insert OID = 275 ( isfinite PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 16 "702" _null_ _null_ _null_ _null_ abstime_finite _null_ _null_ _null_ )); DESCR("finite abstime?"); DATA(insert OID = 277 ( inter_sl PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "601 628" _null_ _null_ _null_ _null_ inter_sl _null_ _null_ _null_ )); DATA(insert OID = 278 ( inter_lb PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "628 603" _null_ _null_ _null_ _null_ inter_lb _null_ _null_ _null_ )); DATA(insert OID = 279 ( float48mul PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "700 701" _null_ _null_ _null_ _null_ float48mul _null_ _null_ _null_ )); DATA(insert OID = 280 ( float48div PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "700 701" _null_ _null_ _null_ _null_ float48div _null_ _null_ _null_ )); DATA(insert OID = 281 ( float48pl PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "700 701" _null_ _null_ _null_ _null_ float48pl _null_ _null_ _null_ )); DATA(insert OID = 282 ( float48mi PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "700 701" _null_ _null_ _null_ _null_ float48mi _null_ _null_ _null_ )); DATA(insert OID = 283 ( float84mul PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "701 700" _null_ _null_ _null_ _null_ float84mul _null_ _null_ _null_ )); DATA(insert OID = 284 ( float84div PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "701 700" _null_ _null_ _null_ _null_ float84div _null_ _null_ _null_ )); DATA(insert OID = 285 ( float84pl PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "701 700" _null_ _null_ _null_ _null_ float84pl _null_ _null_ _null_ )); DATA(insert OID = 286 ( float84mi PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "701 700" _null_ _null_ _null_ _null_ float84mi _null_ _null_ _null_ )); DATA(insert OID = 287 ( float4eq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "700 700" _null_ _null_ _null_ _null_ float4eq _null_ _null_ _null_ )); DATA(insert OID = 288 ( float4ne PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "700 700" _null_ _null_ _null_ _null_ float4ne _null_ _null_ _null_ )); DATA(insert OID = 289 ( float4lt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "700 700" _null_ _null_ _null_ _null_ float4lt _null_ _null_ _null_ )); DATA(insert OID = 290 ( float4le PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "700 700" _null_ _null_ _null_ _null_ float4le _null_ _null_ _null_ )); DATA(insert OID = 291 ( float4gt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "700 700" _null_ _null_ _null_ _null_ float4gt _null_ _null_ _null_ )); DATA(insert OID = 292 ( float4ge PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "700 700" _null_ _null_ _null_ _null_ float4ge _null_ _null_ _null_ )); DATA(insert OID = 293 ( float8eq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "701 701" _null_ _null_ _null_ _null_ float8eq _null_ _null_ _null_ )); DATA(insert OID = 294 ( float8ne PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "701 701" _null_ _null_ _null_ _null_ float8ne _null_ _null_ _null_ )); DATA(insert OID = 295 ( float8lt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "701 701" _null_ _null_ _null_ _null_ float8lt _null_ _null_ _null_ )); DATA(insert OID = 296 ( float8le PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "701 701" _null_ _null_ _null_ _null_ float8le _null_ _null_ _null_ )); DATA(insert OID = 297 ( float8gt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "701 701" _null_ _null_ _null_ _null_ float8gt _null_ _null_ _null_ )); DATA(insert OID = 298 ( float8ge PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "701 701" _null_ _null_ _null_ _null_ float8ge _null_ _null_ _null_ )); DATA(insert OID = 299 ( float48eq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "700 701" _null_ _null_ _null_ _null_ float48eq _null_ _null_ _null_ )); /* OIDS 300 - 399 */ DATA(insert OID = 300 ( float48ne PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "700 701" _null_ _null_ _null_ _null_ float48ne _null_ _null_ _null_ )); DATA(insert OID = 301 ( float48lt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "700 701" _null_ _null_ _null_ _null_ float48lt _null_ _null_ _null_ )); DATA(insert OID = 302 ( float48le PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "700 701" _null_ _null_ _null_ _null_ float48le _null_ _null_ _null_ )); DATA(insert OID = 303 ( float48gt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "700 701" _null_ _null_ _null_ _null_ float48gt _null_ _null_ _null_ )); DATA(insert OID = 304 ( float48ge PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "700 701" _null_ _null_ _null_ _null_ float48ge _null_ _null_ _null_ )); DATA(insert OID = 305 ( float84eq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "701 700" _null_ _null_ _null_ _null_ float84eq _null_ _null_ _null_ )); DATA(insert OID = 306 ( float84ne PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "701 700" _null_ _null_ _null_ _null_ float84ne _null_ _null_ _null_ )); DATA(insert OID = 307 ( float84lt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "701 700" _null_ _null_ _null_ _null_ float84lt _null_ _null_ _null_ )); DATA(insert OID = 308 ( float84le PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "701 700" _null_ _null_ _null_ _null_ float84le _null_ _null_ _null_ )); DATA(insert OID = 309 ( float84gt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "701 700" _null_ _null_ _null_ _null_ float84gt _null_ _null_ _null_ )); DATA(insert OID = 310 ( float84ge PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "701 700" _null_ _null_ _null_ _null_ float84ge _null_ _null_ _null_ )); DATA(insert OID = 320 ( width_bucket PGNSP PGUID 12 1 0 0 0 f f f f t f i 4 0 23 "701 701 701 23" _null_ _null_ _null_ _null_ width_bucket_float8 _null_ _null_ _null_ )); DESCR("bucket number of operand in equidepth histogram"); DATA(insert OID = 311 ( float8 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "700" _null_ _null_ _null_ _null_ ftod _null_ _null_ _null_ )); DESCR("convert float4 to float8"); DATA(insert OID = 312 ( float4 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 700 "701" _null_ _null_ _null_ _null_ dtof _null_ _null_ _null_ )); DESCR("convert float8 to float4"); DATA(insert OID = 313 ( int4 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "21" _null_ _null_ _null_ _null_ i2toi4 _null_ _null_ _null_ )); DESCR("convert int2 to int4"); DATA(insert OID = 314 ( int2 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 21 "23" _null_ _null_ _null_ _null_ i4toi2 _null_ _null_ _null_ )); DESCR("convert int4 to int2"); DATA(insert OID = 315 ( int2vectoreq PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "22 22" _null_ _null_ _null_ _null_ int2vectoreq _null_ _null_ _null_ )); DATA(insert OID = 316 ( float8 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "23" _null_ _null_ _null_ _null_ i4tod _null_ _null_ _null_ )); DESCR("convert int4 to float8"); DATA(insert OID = 317 ( int4 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "701" _null_ _null_ _null_ _null_ dtoi4 _null_ _null_ _null_ )); DESCR("convert float8 to int4"); DATA(insert OID = 318 ( float4 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 700 "23" _null_ _null_ _null_ _null_ i4tof _null_ _null_ _null_ )); DESCR("convert int4 to float4"); DATA(insert OID = 319 ( int4 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "700" _null_ _null_ _null_ _null_ ftoi4 _null_ _null_ _null_ )); DESCR("convert float4 to int4"); DATA(insert OID = 330 ( btgettuple PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 16 "2281 2281" _null_ _null_ _null_ _null_ btgettuple _null_ _null_ _null_ )); DESCR("btree(internal)"); DATA(insert OID = 636 ( btgetbitmap PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 20 "2281 2281" _null_ _null_ _null_ _null_ btgetbitmap _null_ _null_ _null_ )); DESCR("btree(internal)"); DATA(insert OID = 331 ( btinsert PGNSP PGUID 12 1 0 0 0 f f f f t f v 6 0 16 "2281 2281 2281 2281 2281 2281" _null_ _null_ _null_ _null_ btinsert _null_ _null_ _null_ )); DESCR("btree(internal)"); DATA(insert OID = 333 ( btbeginscan PGNSP PGUID 12 1 0 0 0 f f f f t f v 3 0 2281 "2281 2281 2281" _null_ _null_ _null_ _null_ btbeginscan _null_ _null_ _null_ )); DESCR("btree(internal)"); DATA(insert OID = 334 ( btrescan PGNSP PGUID 12 1 0 0 0 f f f f t f v 5 0 2278 "2281 2281 2281 2281 2281" _null_ _null_ _null_ _null_ btrescan _null_ _null_ _null_ )); DESCR("btree(internal)"); DATA(insert OID = 335 ( btendscan PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 2278 "2281" _null_ _null_ _null_ _null_ btendscan _null_ _null_ _null_ )); DESCR("btree(internal)"); DATA(insert OID = 336 ( btmarkpos PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 2278 "2281" _null_ _null_ _null_ _null_ btmarkpos _null_ _null_ _null_ )); DESCR("btree(internal)"); DATA(insert OID = 337 ( btrestrpos PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 2278 "2281" _null_ _null_ _null_ _null_ btrestrpos _null_ _null_ _null_ )); DESCR("btree(internal)"); DATA(insert OID = 338 ( btbuild PGNSP PGUID 12 1 0 0 0 f f f f t f v 3 0 2281 "2281 2281 2281" _null_ _null_ _null_ _null_ btbuild _null_ _null_ _null_ )); DESCR("btree(internal)"); DATA(insert OID = 328 ( btbuildempty PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 2278 "2281" _null_ _null_ _null_ _null_ btbuildempty _null_ _null_ _null_ )); DESCR("btree(internal)"); DATA(insert OID = 332 ( btbulkdelete PGNSP PGUID 12 1 0 0 0 f f f f t f v 4 0 2281 "2281 2281 2281 2281" _null_ _null_ _null_ _null_ btbulkdelete _null_ _null_ _null_ )); DESCR("btree(internal)"); DATA(insert OID = 972 ( btvacuumcleanup PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 2281 "2281 2281" _null_ _null_ _null_ _null_ btvacuumcleanup _null_ _null_ _null_ )); DESCR("btree(internal)"); DATA(insert OID = 276 ( btcanreturn PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 16 "2281" _null_ _null_ _null_ _null_ btcanreturn _null_ _null_ _null_ )); DESCR("btree(internal)"); DATA(insert OID = 1268 ( btcostestimate PGNSP PGUID 12 1 0 0 0 f f f f t f v 7 0 2278 "2281 2281 2281 2281 2281 2281 2281" _null_ _null_ _null_ _null_ btcostestimate _null_ _null_ _null_ )); DESCR("btree(internal)"); DATA(insert OID = 2785 ( btoptions PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 17 "1009 16" _null_ _null_ _null_ _null_ btoptions _null_ _null_ _null_ )); DESCR("btree(internal)"); DATA(insert OID = 339 ( poly_same PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "604 604" _null_ _null_ _null_ _null_ poly_same _null_ _null_ _null_ )); DATA(insert OID = 340 ( poly_contain PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "604 604" _null_ _null_ _null_ _null_ poly_contain _null_ _null_ _null_ )); DATA(insert OID = 341 ( poly_left PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "604 604" _null_ _null_ _null_ _null_ poly_left _null_ _null_ _null_ )); DATA(insert OID = 342 ( poly_overleft PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "604 604" _null_ _null_ _null_ _null_ poly_overleft _null_ _null_ _null_ )); DATA(insert OID = 343 ( poly_overright PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "604 604" _null_ _null_ _null_ _null_ poly_overright _null_ _null_ _null_ )); DATA(insert OID = 344 ( poly_right PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "604 604" _null_ _null_ _null_ _null_ poly_right _null_ _null_ _null_ )); DATA(insert OID = 345 ( poly_contained PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "604 604" _null_ _null_ _null_ _null_ poly_contained _null_ _null_ _null_ )); DATA(insert OID = 346 ( poly_overlap PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "604 604" _null_ _null_ _null_ _null_ poly_overlap _null_ _null_ _null_ )); DATA(insert OID = 347 ( poly_in PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 604 "2275" _null_ _null_ _null_ _null_ poly_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 348 ( poly_out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "604" _null_ _null_ _null_ _null_ poly_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 350 ( btint2cmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "21 21" _null_ _null_ _null_ _null_ btint2cmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 3129 ( btint2sortsupport PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2278 "2281" _null_ _null_ _null_ _null_ btint2sortsupport _null_ _null_ _null_ )); DESCR("sort support"); DATA(insert OID = 351 ( btint4cmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "23 23" _null_ _null_ _null_ _null_ btint4cmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 3130 ( btint4sortsupport PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2278 "2281" _null_ _null_ _null_ _null_ btint4sortsupport _null_ _null_ _null_ )); DESCR("sort support"); DATA(insert OID = 842 ( btint8cmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "20 20" _null_ _null_ _null_ _null_ btint8cmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 3131 ( btint8sortsupport PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2278 "2281" _null_ _null_ _null_ _null_ btint8sortsupport _null_ _null_ _null_ )); DESCR("sort support"); DATA(insert OID = 354 ( btfloat4cmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "700 700" _null_ _null_ _null_ _null_ btfloat4cmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 3132 ( btfloat4sortsupport PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2278 "2281" _null_ _null_ _null_ _null_ btfloat4sortsupport _null_ _null_ _null_ )); DESCR("sort support"); DATA(insert OID = 355 ( btfloat8cmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "701 701" _null_ _null_ _null_ _null_ btfloat8cmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 3133 ( btfloat8sortsupport PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2278 "2281" _null_ _null_ _null_ _null_ btfloat8sortsupport _null_ _null_ _null_ )); DESCR("sort support"); DATA(insert OID = 356 ( btoidcmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "26 26" _null_ _null_ _null_ _null_ btoidcmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 3134 ( btoidsortsupport PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2278 "2281" _null_ _null_ _null_ _null_ btoidsortsupport _null_ _null_ _null_ )); DESCR("sort support"); DATA(insert OID = 404 ( btoidvectorcmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "30 30" _null_ _null_ _null_ _null_ btoidvectorcmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 357 ( btabstimecmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "702 702" _null_ _null_ _null_ _null_ btabstimecmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 358 ( btcharcmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "18 18" _null_ _null_ _null_ _null_ btcharcmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 359 ( btnamecmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "19 19" _null_ _null_ _null_ _null_ btnamecmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 3135 ( btnamesortsupport PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2278 "2281" _null_ _null_ _null_ _null_ btnamesortsupport _null_ _null_ _null_ )); DESCR("sort support"); DATA(insert OID = 360 ( bttextcmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "25 25" _null_ _null_ _null_ _null_ bttextcmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 377 ( cash_cmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "790 790" _null_ _null_ _null_ _null_ cash_cmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 380 ( btreltimecmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "703 703" _null_ _null_ _null_ _null_ btreltimecmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 381 ( bttintervalcmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "704 704" _null_ _null_ _null_ _null_ bttintervalcmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 382 ( btarraycmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "2277 2277" _null_ _null_ _null_ _null_ btarraycmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 361 ( lseg_distance PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "601 601" _null_ _null_ _null_ _null_ lseg_distance _null_ _null_ _null_ )); DATA(insert OID = 362 ( lseg_interpt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 600 "601 601" _null_ _null_ _null_ _null_ lseg_interpt _null_ _null_ _null_ )); DATA(insert OID = 363 ( dist_ps PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "600 601" _null_ _null_ _null_ _null_ dist_ps _null_ _null_ _null_ )); DATA(insert OID = 364 ( dist_pb PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "600 603" _null_ _null_ _null_ _null_ dist_pb _null_ _null_ _null_ )); DATA(insert OID = 365 ( dist_sb PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "601 603" _null_ _null_ _null_ _null_ dist_sb _null_ _null_ _null_ )); DATA(insert OID = 366 ( close_ps PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 600 "600 601" _null_ _null_ _null_ _null_ close_ps _null_ _null_ _null_ )); DATA(insert OID = 367 ( close_pb PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 600 "600 603" _null_ _null_ _null_ _null_ close_pb _null_ _null_ _null_ )); DATA(insert OID = 368 ( close_sb PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 600 "601 603" _null_ _null_ _null_ _null_ close_sb _null_ _null_ _null_ )); DATA(insert OID = 369 ( on_ps PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "600 601" _null_ _null_ _null_ _null_ on_ps _null_ _null_ _null_ )); DATA(insert OID = 370 ( path_distance PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "602 602" _null_ _null_ _null_ _null_ path_distance _null_ _null_ _null_ )); DATA(insert OID = 371 ( dist_ppath PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "600 602" _null_ _null_ _null_ _null_ dist_ppath _null_ _null_ _null_ )); DATA(insert OID = 372 ( on_sb PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "601 603" _null_ _null_ _null_ _null_ on_sb _null_ _null_ _null_ )); DATA(insert OID = 373 ( inter_sb PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "601 603" _null_ _null_ _null_ _null_ inter_sb _null_ _null_ _null_ )); /* OIDS 400 - 499 */ DATA(insert OID = 401 ( text PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 25 "1042" _null_ _null_ _null_ _null_ rtrim1 _null_ _null_ _null_ )); DESCR("convert char(n) to text"); DATA(insert OID = 406 ( text PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 25 "19" _null_ _null_ _null_ _null_ name_text _null_ _null_ _null_ )); DESCR("convert name to text"); DATA(insert OID = 407 ( name PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 19 "25" _null_ _null_ _null_ _null_ text_name _null_ _null_ _null_ )); DESCR("convert text to name"); DATA(insert OID = 408 ( bpchar PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1042 "19" _null_ _null_ _null_ _null_ name_bpchar _null_ _null_ _null_ )); DESCR("convert name to char(n)"); DATA(insert OID = 409 ( name PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 19 "1042" _null_ _null_ _null_ _null_ bpchar_name _null_ _null_ _null_ )); DESCR("convert char(n) to name"); DATA(insert OID = 440 ( hashgettuple PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 16 "2281 2281" _null_ _null_ _null_ _null_ hashgettuple _null_ _null_ _null_ )); DESCR("hash(internal)"); DATA(insert OID = 637 ( hashgetbitmap PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 20 "2281 2281" _null_ _null_ _null_ _null_ hashgetbitmap _null_ _null_ _null_ )); DESCR("hash(internal)"); DATA(insert OID = 441 ( hashinsert PGNSP PGUID 12 1 0 0 0 f f f f t f v 6 0 16 "2281 2281 2281 2281 2281 2281" _null_ _null_ _null_ _null_ hashinsert _null_ _null_ _null_ )); DESCR("hash(internal)"); DATA(insert OID = 443 ( hashbeginscan PGNSP PGUID 12 1 0 0 0 f f f f t f v 3 0 2281 "2281 2281 2281" _null_ _null_ _null_ _null_ hashbeginscan _null_ _null_ _null_ )); DESCR("hash(internal)"); DATA(insert OID = 444 ( hashrescan PGNSP PGUID 12 1 0 0 0 f f f f t f v 5 0 2278 "2281 2281 2281 2281 2281" _null_ _null_ _null_ _null_ hashrescan _null_ _null_ _null_ )); DESCR("hash(internal)"); DATA(insert OID = 445 ( hashendscan PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 2278 "2281" _null_ _null_ _null_ _null_ hashendscan _null_ _null_ _null_ )); DESCR("hash(internal)"); DATA(insert OID = 446 ( hashmarkpos PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 2278 "2281" _null_ _null_ _null_ _null_ hashmarkpos _null_ _null_ _null_ )); DESCR("hash(internal)"); DATA(insert OID = 447 ( hashrestrpos PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 2278 "2281" _null_ _null_ _null_ _null_ hashrestrpos _null_ _null_ _null_ )); DESCR("hash(internal)"); DATA(insert OID = 448 ( hashbuild PGNSP PGUID 12 1 0 0 0 f f f f t f v 3 0 2281 "2281 2281 2281" _null_ _null_ _null_ _null_ hashbuild _null_ _null_ _null_ )); DESCR("hash(internal)"); DATA(insert OID = 327 ( hashbuildempty PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 2278 "2281" _null_ _null_ _null_ _null_ hashbuildempty _null_ _null_ _null_ )); DESCR("hash(internal)"); DATA(insert OID = 442 ( hashbulkdelete PGNSP PGUID 12 1 0 0 0 f f f f t f v 4 0 2281 "2281 2281 2281 2281" _null_ _null_ _null_ _null_ hashbulkdelete _null_ _null_ _null_ )); DESCR("hash(internal)"); DATA(insert OID = 425 ( hashvacuumcleanup PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 2281 "2281 2281" _null_ _null_ _null_ _null_ hashvacuumcleanup _null_ _null_ _null_ )); DESCR("hash(internal)"); DATA(insert OID = 438 ( hashcostestimate PGNSP PGUID 12 1 0 0 0 f f f f t f v 7 0 2278 "2281 2281 2281 2281 2281 2281 2281" _null_ _null_ _null_ _null_ hashcostestimate _null_ _null_ _null_ )); DESCR("hash(internal)"); DATA(insert OID = 2786 ( hashoptions PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 17 "1009 16" _null_ _null_ _null_ _null_ hashoptions _null_ _null_ _null_ )); DESCR("hash(internal)"); DATA(insert OID = 449 ( hashint2 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "21" _null_ _null_ _null_ _null_ hashint2 _null_ _null_ _null_ )); DESCR("hash"); DATA(insert OID = 450 ( hashint4 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "23" _null_ _null_ _null_ _null_ hashint4 _null_ _null_ _null_ )); DESCR("hash"); DATA(insert OID = 949 ( hashint8 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "20" _null_ _null_ _null_ _null_ hashint8 _null_ _null_ _null_ )); DESCR("hash"); DATA(insert OID = 451 ( hashfloat4 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "700" _null_ _null_ _null_ _null_ hashfloat4 _null_ _null_ _null_ )); DESCR("hash"); DATA(insert OID = 452 ( hashfloat8 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "701" _null_ _null_ _null_ _null_ hashfloat8 _null_ _null_ _null_ )); DESCR("hash"); DATA(insert OID = 453 ( hashoid PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "26" _null_ _null_ _null_ _null_ hashoid _null_ _null_ _null_ )); DESCR("hash"); DATA(insert OID = 454 ( hashchar PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "18" _null_ _null_ _null_ _null_ hashchar _null_ _null_ _null_ )); DESCR("hash"); DATA(insert OID = 455 ( hashname PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "19" _null_ _null_ _null_ _null_ hashname _null_ _null_ _null_ )); DESCR("hash"); DATA(insert OID = 400 ( hashtext PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "25" _null_ _null_ _null_ _null_ hashtext _null_ _null_ _null_ )); DESCR("hash"); DATA(insert OID = 456 ( hashvarlena PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "2281" _null_ _null_ _null_ _null_ hashvarlena _null_ _null_ _null_ )); DESCR("hash"); DATA(insert OID = 457 ( hashoidvector PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "30" _null_ _null_ _null_ _null_ hashoidvector _null_ _null_ _null_ )); DESCR("hash"); DATA(insert OID = 329 ( hash_aclitem PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "1033" _null_ _null_ _null_ _null_ hash_aclitem _null_ _null_ _null_ )); DESCR("hash"); DATA(insert OID = 398 ( hashint2vector PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "22" _null_ _null_ _null_ _null_ hashint2vector _null_ _null_ _null_ )); DESCR("hash"); DATA(insert OID = 399 ( hashmacaddr PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "829" _null_ _null_ _null_ _null_ hashmacaddr _null_ _null_ _null_ )); DESCR("hash"); DATA(insert OID = 422 ( hashinet PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "869" _null_ _null_ _null_ _null_ hashinet _null_ _null_ _null_ )); DESCR("hash"); DATA(insert OID = 432 ( hash_numeric PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "1700" _null_ _null_ _null_ _null_ hash_numeric _null_ _null_ _null_ )); DESCR("hash"); DATA(insert OID = 458 ( text_larger PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 25 "25 25" _null_ _null_ _null_ _null_ text_larger _null_ _null_ _null_ )); DESCR("larger of two"); DATA(insert OID = 459 ( text_smaller PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 25 "25 25" _null_ _null_ _null_ _null_ text_smaller _null_ _null_ _null_ )); DESCR("smaller of two"); DATA(insert OID = 460 ( int8in PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 20 "2275" _null_ _null_ _null_ _null_ int8in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 461 ( int8out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "20" _null_ _null_ _null_ _null_ int8out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 462 ( int8um PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 20 "20" _null_ _null_ _null_ _null_ int8um _null_ _null_ _null_ )); DATA(insert OID = 463 ( int8pl PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 20 "20 20" _null_ _null_ _null_ _null_ int8pl _null_ _null_ _null_ )); DATA(insert OID = 464 ( int8mi PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 20 "20 20" _null_ _null_ _null_ _null_ int8mi _null_ _null_ _null_ )); DATA(insert OID = 465 ( int8mul PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 20 "20 20" _null_ _null_ _null_ _null_ int8mul _null_ _null_ _null_ )); DATA(insert OID = 466 ( int8div PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 20 "20 20" _null_ _null_ _null_ _null_ int8div _null_ _null_ _null_ )); DATA(insert OID = 467 ( int8eq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "20 20" _null_ _null_ _null_ _null_ int8eq _null_ _null_ _null_ )); DATA(insert OID = 468 ( int8ne PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "20 20" _null_ _null_ _null_ _null_ int8ne _null_ _null_ _null_ )); DATA(insert OID = 469 ( int8lt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "20 20" _null_ _null_ _null_ _null_ int8lt _null_ _null_ _null_ )); DATA(insert OID = 470 ( int8gt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "20 20" _null_ _null_ _null_ _null_ int8gt _null_ _null_ _null_ )); DATA(insert OID = 471 ( int8le PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "20 20" _null_ _null_ _null_ _null_ int8le _null_ _null_ _null_ )); DATA(insert OID = 472 ( int8ge PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "20 20" _null_ _null_ _null_ _null_ int8ge _null_ _null_ _null_ )); DATA(insert OID = 474 ( int84eq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "20 23" _null_ _null_ _null_ _null_ int84eq _null_ _null_ _null_ )); DATA(insert OID = 475 ( int84ne PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "20 23" _null_ _null_ _null_ _null_ int84ne _null_ _null_ _null_ )); DATA(insert OID = 476 ( int84lt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "20 23" _null_ _null_ _null_ _null_ int84lt _null_ _null_ _null_ )); DATA(insert OID = 477 ( int84gt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "20 23" _null_ _null_ _null_ _null_ int84gt _null_ _null_ _null_ )); DATA(insert OID = 478 ( int84le PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "20 23" _null_ _null_ _null_ _null_ int84le _null_ _null_ _null_ )); DATA(insert OID = 479 ( int84ge PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "20 23" _null_ _null_ _null_ _null_ int84ge _null_ _null_ _null_ )); DATA(insert OID = 480 ( int4 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "20" _null_ _null_ _null_ _null_ int84 _null_ _null_ _null_ )); DESCR("convert int8 to int4"); DATA(insert OID = 481 ( int8 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 20 "23" _null_ _null_ _null_ _null_ int48 _null_ _null_ _null_ )); DESCR("convert int4 to int8"); DATA(insert OID = 482 ( float8 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "20" _null_ _null_ _null_ _null_ i8tod _null_ _null_ _null_ )); DESCR("convert int8 to float8"); DATA(insert OID = 483 ( int8 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 20 "701" _null_ _null_ _null_ _null_ dtoi8 _null_ _null_ _null_ )); DESCR("convert float8 to int8"); /* OIDS 500 - 599 */ /* OIDS 600 - 699 */ DATA(insert OID = 626 ( hash_array PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "2277" _null_ _null_ _null_ _null_ hash_array _null_ _null_ _null_ )); DESCR("hash"); DATA(insert OID = 652 ( float4 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 700 "20" _null_ _null_ _null_ _null_ i8tof _null_ _null_ _null_ )); DESCR("convert int8 to float4"); DATA(insert OID = 653 ( int8 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 20 "700" _null_ _null_ _null_ _null_ ftoi8 _null_ _null_ _null_ )); DESCR("convert float4 to int8"); DATA(insert OID = 714 ( int2 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 21 "20" _null_ _null_ _null_ _null_ int82 _null_ _null_ _null_ )); DESCR("convert int8 to int2"); DATA(insert OID = 754 ( int8 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 20 "21" _null_ _null_ _null_ _null_ int28 _null_ _null_ _null_ )); DESCR("convert int2 to int8"); DATA(insert OID = 655 ( namelt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "19 19" _null_ _null_ _null_ _null_ namelt _null_ _null_ _null_ )); DATA(insert OID = 656 ( namele PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "19 19" _null_ _null_ _null_ _null_ namele _null_ _null_ _null_ )); DATA(insert OID = 657 ( namegt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "19 19" _null_ _null_ _null_ _null_ namegt _null_ _null_ _null_ )); DATA(insert OID = 658 ( namege PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "19 19" _null_ _null_ _null_ _null_ namege _null_ _null_ _null_ )); DATA(insert OID = 659 ( namene PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "19 19" _null_ _null_ _null_ _null_ namene _null_ _null_ _null_ )); DATA(insert OID = 668 ( bpchar PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 1042 "1042 23 16" _null_ _null_ _null_ _null_ bpchar _null_ _null_ _null_ )); DESCR("adjust char() to typmod length"); DATA(insert OID = 3097 ( varchar_transform PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2281 "2281" _null_ _null_ _null_ _null_ varchar_transform _null_ _null_ _null_ )); DESCR("transform a varchar length coercion"); DATA(insert OID = 669 ( varchar PGNSP PGUID 12 1 0 0 varchar_transform f f f f t f i 3 0 1043 "1043 23 16" _null_ _null_ _null_ _null_ varchar _null_ _null_ _null_ )); DESCR("adjust varchar() to typmod length"); DATA(insert OID = 676 ( mktinterval PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 704 "702 702" _null_ _null_ _null_ _null_ mktinterval _null_ _null_ _null_ )); DATA(insert OID = 619 ( oidvectorne PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "30 30" _null_ _null_ _null_ _null_ oidvectorne _null_ _null_ _null_ )); DATA(insert OID = 677 ( oidvectorlt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "30 30" _null_ _null_ _null_ _null_ oidvectorlt _null_ _null_ _null_ )); DATA(insert OID = 678 ( oidvectorle PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "30 30" _null_ _null_ _null_ _null_ oidvectorle _null_ _null_ _null_ )); DATA(insert OID = 679 ( oidvectoreq PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "30 30" _null_ _null_ _null_ _null_ oidvectoreq _null_ _null_ _null_ )); DATA(insert OID = 680 ( oidvectorge PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "30 30" _null_ _null_ _null_ _null_ oidvectorge _null_ _null_ _null_ )); DATA(insert OID = 681 ( oidvectorgt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "30 30" _null_ _null_ _null_ _null_ oidvectorgt _null_ _null_ _null_ )); /* OIDS 700 - 799 */ DATA(insert OID = 710 ( getpgusername PGNSP PGUID 12 1 0 0 0 f f f f t f s 0 0 19 "" _null_ _null_ _null_ _null_ current_user _null_ _null_ _null_ )); DESCR("deprecated, use current_user instead"); DATA(insert OID = 716 ( oidlt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "26 26" _null_ _null_ _null_ _null_ oidlt _null_ _null_ _null_ )); DATA(insert OID = 717 ( oidle PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "26 26" _null_ _null_ _null_ _null_ oidle _null_ _null_ _null_ )); DATA(insert OID = 720 ( octet_length PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "17" _null_ _null_ _null_ _null_ byteaoctetlen _null_ _null_ _null_ )); DESCR("octet length"); DATA(insert OID = 721 ( get_byte PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "17 23" _null_ _null_ _null_ _null_ byteaGetByte _null_ _null_ _null_ )); DESCR("get byte"); DATA(insert OID = 722 ( set_byte PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 17 "17 23 23" _null_ _null_ _null_ _null_ byteaSetByte _null_ _null_ _null_ )); DESCR("set byte"); DATA(insert OID = 723 ( get_bit PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "17 23" _null_ _null_ _null_ _null_ byteaGetBit _null_ _null_ _null_ )); DESCR("get bit"); DATA(insert OID = 724 ( set_bit PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 17 "17 23 23" _null_ _null_ _null_ _null_ byteaSetBit _null_ _null_ _null_ )); DESCR("set bit"); DATA(insert OID = 749 ( overlay PGNSP PGUID 12 1 0 0 0 f f f f t f i 4 0 17 "17 17 23 23" _null_ _null_ _null_ _null_ byteaoverlay _null_ _null_ _null_ )); DESCR("substitute portion of string"); DATA(insert OID = 752 ( overlay PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 17 "17 17 23" _null_ _null_ _null_ _null_ byteaoverlay_no_len _null_ _null_ _null_ )); DESCR("substitute portion of string"); DATA(insert OID = 725 ( dist_pl PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "600 628" _null_ _null_ _null_ _null_ dist_pl _null_ _null_ _null_ )); DATA(insert OID = 726 ( dist_lb PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "628 603" _null_ _null_ _null_ _null_ dist_lb _null_ _null_ _null_ )); DATA(insert OID = 727 ( dist_sl PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "601 628" _null_ _null_ _null_ _null_ dist_sl _null_ _null_ _null_ )); DATA(insert OID = 728 ( dist_cpoly PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "718 604" _null_ _null_ _null_ _null_ dist_cpoly _null_ _null_ _null_ )); DATA(insert OID = 729 ( poly_distance PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "604 604" _null_ _null_ _null_ _null_ poly_distance _null_ _null_ _null_ )); DATA(insert OID = 740 ( text_lt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "25 25" _null_ _null_ _null_ _null_ text_lt _null_ _null_ _null_ )); DATA(insert OID = 741 ( text_le PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "25 25" _null_ _null_ _null_ _null_ text_le _null_ _null_ _null_ )); DATA(insert OID = 742 ( text_gt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "25 25" _null_ _null_ _null_ _null_ text_gt _null_ _null_ _null_ )); DATA(insert OID = 743 ( text_ge PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "25 25" _null_ _null_ _null_ _null_ text_ge _null_ _null_ _null_ )); DATA(insert OID = 745 ( current_user PGNSP PGUID 12 1 0 0 0 f f f f t f s 0 0 19 "" _null_ _null_ _null_ _null_ current_user _null_ _null_ _null_ )); DESCR("current user name"); DATA(insert OID = 746 ( session_user PGNSP PGUID 12 1 0 0 0 f f f f t f s 0 0 19 "" _null_ _null_ _null_ _null_ session_user _null_ _null_ _null_ )); DESCR("session user name"); DATA(insert OID = 744 ( array_eq PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "2277 2277" _null_ _null_ _null_ _null_ array_eq _null_ _null_ _null_ )); DATA(insert OID = 390 ( array_ne PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "2277 2277" _null_ _null_ _null_ _null_ array_ne _null_ _null_ _null_ )); DATA(insert OID = 391 ( array_lt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "2277 2277" _null_ _null_ _null_ _null_ array_lt _null_ _null_ _null_ )); DATA(insert OID = 392 ( array_gt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "2277 2277" _null_ _null_ _null_ _null_ array_gt _null_ _null_ _null_ )); DATA(insert OID = 393 ( array_le PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "2277 2277" _null_ _null_ _null_ _null_ array_le _null_ _null_ _null_ )); DATA(insert OID = 396 ( array_ge PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "2277 2277" _null_ _null_ _null_ _null_ array_ge _null_ _null_ _null_ )); DATA(insert OID = 747 ( array_dims PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 25 "2277" _null_ _null_ _null_ _null_ array_dims _null_ _null_ _null_ )); DESCR("array dimensions"); DATA(insert OID = 748 ( array_ndims PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "2277" _null_ _null_ _null_ _null_ array_ndims _null_ _null_ _null_ )); DESCR("number of array dimensions"); DATA(insert OID = 750 ( array_in PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 2277 "2275 26 23" _null_ _null_ _null_ _null_ array_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 751 ( array_out PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 2275 "2277" _null_ _null_ _null_ _null_ array_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2091 ( array_lower PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "2277 23" _null_ _null_ _null_ _null_ array_lower _null_ _null_ _null_ )); DESCR("array lower dimension"); DATA(insert OID = 2092 ( array_upper PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "2277 23" _null_ _null_ _null_ _null_ array_upper _null_ _null_ _null_ )); DESCR("array upper dimension"); DATA(insert OID = 2176 ( array_length PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "2277 23" _null_ _null_ _null_ _null_ array_length _null_ _null_ _null_ )); DESCR("array length"); DATA(insert OID = 378 ( array_append PGNSP PGUID 12 1 0 0 0 f f f f f f i 2 0 2277 "2277 2283" _null_ _null_ _null_ _null_ array_push _null_ _null_ _null_ )); DESCR("append element onto end of array"); DATA(insert OID = 379 ( array_prepend PGNSP PGUID 12 1 0 0 0 f f f f f f i 2 0 2277 "2283 2277" _null_ _null_ _null_ _null_ array_push _null_ _null_ _null_ )); DESCR("prepend element onto front of array"); DATA(insert OID = 383 ( array_cat PGNSP PGUID 12 1 0 0 0 f f f f f f i 2 0 2277 "2277 2277" _null_ _null_ _null_ _null_ array_cat _null_ _null_ _null_ )); DATA(insert OID = 394 ( string_to_array PGNSP PGUID 12 1 0 0 0 f f f f f f i 2 0 1009 "25 25" _null_ _null_ _null_ _null_ text_to_array _null_ _null_ _null_ )); DESCR("split delimited text into text[]"); DATA(insert OID = 395 ( array_to_string PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 25 "2277 25" _null_ _null_ _null_ _null_ array_to_text _null_ _null_ _null_ )); DESCR("concatenate array elements, using delimiter, into text"); DATA(insert OID = 376 ( string_to_array PGNSP PGUID 12 1 0 0 0 f f f f f f i 3 0 1009 "25 25 25" _null_ _null_ _null_ _null_ text_to_array_null _null_ _null_ _null_ )); DESCR("split delimited text into text[], with null string"); DATA(insert OID = 384 ( array_to_string PGNSP PGUID 12 1 0 0 0 f f f f f f s 3 0 25 "2277 25 25" _null_ _null_ _null_ _null_ array_to_text_null _null_ _null_ _null_ )); DESCR("concatenate array elements, using delimiter and null string, into text"); DATA(insert OID = 515 ( array_larger PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 2277 "2277 2277" _null_ _null_ _null_ _null_ array_larger _null_ _null_ _null_ )); DESCR("larger of two"); DATA(insert OID = 516 ( array_smaller PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 2277 "2277 2277" _null_ _null_ _null_ _null_ array_smaller _null_ _null_ _null_ )); DESCR("smaller of two"); DATA(insert OID = 1191 ( generate_subscripts PGNSP PGUID 12 1 1000 0 0 f f f f t t i 3 0 23 "2277 23 16" _null_ _null_ _null_ _null_ generate_subscripts _null_ _null_ _null_ )); DESCR("array subscripts generator"); DATA(insert OID = 1192 ( generate_subscripts PGNSP PGUID 12 1 1000 0 0 f f f f t t i 2 0 23 "2277 23" _null_ _null_ _null_ _null_ generate_subscripts_nodir _null_ _null_ _null_ )); DESCR("array subscripts generator"); DATA(insert OID = 1193 ( array_fill PGNSP PGUID 12 1 0 0 0 f f f f f f i 2 0 2277 "2283 1007" _null_ _null_ _null_ _null_ array_fill _null_ _null_ _null_ )); DESCR("array constructor with value"); DATA(insert OID = 1286 ( array_fill PGNSP PGUID 12 1 0 0 0 f f f f f f i 3 0 2277 "2283 1007 1007" _null_ _null_ _null_ _null_ array_fill_with_lower_bounds _null_ _null_ _null_ )); DESCR("array constructor with value"); DATA(insert OID = 2331 ( unnest PGNSP PGUID 12 1 100 0 0 f f f f t t i 1 0 2283 "2277" _null_ _null_ _null_ _null_ array_unnest _null_ _null_ _null_ )); DESCR("expand array to set of rows"); DATA(insert OID = 2333 ( array_agg_transfn PGNSP PGUID 12 1 0 0 0 f f f f f f i 2 0 2281 "2281 2283" _null_ _null_ _null_ _null_ array_agg_transfn _null_ _null_ _null_ )); DESCR("aggregate transition function"); DATA(insert OID = 2334 ( array_agg_finalfn PGNSP PGUID 12 1 0 0 0 f f f f f f i 1 0 2277 "2281" _null_ _null_ _null_ _null_ array_agg_finalfn _null_ _null_ _null_ )); DESCR("aggregate final function"); DATA(insert OID = 2335 ( array_agg PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 2277 "2283" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("concatenate aggregate input into an array"); DATA(insert OID = 3816 ( array_typanalyze PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 16 "2281" _null_ _null_ _null_ _null_ array_typanalyze _null_ _null_ _null_ )); DESCR("array typanalyze"); DATA(insert OID = 3817 ( arraycontsel PGNSP PGUID 12 1 0 0 0 f f f f t f s 4 0 701 "2281 26 2281 23" _null_ _null_ _null_ _null_ arraycontsel _null_ _null_ _null_ )); DESCR("restriction selectivity for array-containment operators"); DATA(insert OID = 3818 ( arraycontjoinsel PGNSP PGUID 12 1 0 0 0 f f f f t f s 5 0 701 "2281 26 2281 21 2281" _null_ _null_ _null_ _null_ arraycontjoinsel _null_ _null_ _null_ )); DESCR("join selectivity for array-containment operators"); DATA(insert OID = 760 ( smgrin PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 210 "2275" _null_ _null_ _null_ _null_ smgrin _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 761 ( smgrout PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 2275 "210" _null_ _null_ _null_ _null_ smgrout _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 762 ( smgreq PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "210 210" _null_ _null_ _null_ _null_ smgreq _null_ _null_ _null_ )); DESCR("storage manager"); DATA(insert OID = 763 ( smgrne PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "210 210" _null_ _null_ _null_ _null_ smgrne _null_ _null_ _null_ )); DESCR("storage manager"); DATA(insert OID = 764 ( lo_import PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 26 "25" _null_ _null_ _null_ _null_ lo_import _null_ _null_ _null_ )); DESCR("large object import"); DATA(insert OID = 767 ( lo_import PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 26 "25 26" _null_ _null_ _null_ _null_ lo_import_with_oid _null_ _null_ _null_ )); DESCR("large object import"); DATA(insert OID = 765 ( lo_export PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 23 "26 25" _null_ _null_ _null_ _null_ lo_export _null_ _null_ _null_ )); DESCR("large object export"); DATA(insert OID = 766 ( int4inc PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "23" _null_ _null_ _null_ _null_ int4inc _null_ _null_ _null_ )); DESCR("increment"); DATA(insert OID = 768 ( int4larger PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "23 23" _null_ _null_ _null_ _null_ int4larger _null_ _null_ _null_ )); DESCR("larger of two"); DATA(insert OID = 769 ( int4smaller PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "23 23" _null_ _null_ _null_ _null_ int4smaller _null_ _null_ _null_ )); DESCR("smaller of two"); DATA(insert OID = 770 ( int2larger PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 21 "21 21" _null_ _null_ _null_ _null_ int2larger _null_ _null_ _null_ )); DESCR("larger of two"); DATA(insert OID = 771 ( int2smaller PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 21 "21 21" _null_ _null_ _null_ _null_ int2smaller _null_ _null_ _null_ )); DESCR("smaller of two"); DATA(insert OID = 774 ( gistgettuple PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 16 "2281 2281" _null_ _null_ _null_ _null_ gistgettuple _null_ _null_ _null_ )); DESCR("gist(internal)"); DATA(insert OID = 638 ( gistgetbitmap PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 20 "2281 2281" _null_ _null_ _null_ _null_ gistgetbitmap _null_ _null_ _null_ )); DESCR("gist(internal)"); DATA(insert OID = 775 ( gistinsert PGNSP PGUID 12 1 0 0 0 f f f f t f v 6 0 16 "2281 2281 2281 2281 2281 2281" _null_ _null_ _null_ _null_ gistinsert _null_ _null_ _null_ )); DESCR("gist(internal)"); DATA(insert OID = 777 ( gistbeginscan PGNSP PGUID 12 1 0 0 0 f f f f t f v 3 0 2281 "2281 2281 2281" _null_ _null_ _null_ _null_ gistbeginscan _null_ _null_ _null_ )); DESCR("gist(internal)"); DATA(insert OID = 778 ( gistrescan PGNSP PGUID 12 1 0 0 0 f f f f t f v 5 0 2278 "2281 2281 2281 2281 2281" _null_ _null_ _null_ _null_ gistrescan _null_ _null_ _null_ )); DESCR("gist(internal)"); DATA(insert OID = 779 ( gistendscan PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 2278 "2281" _null_ _null_ _null_ _null_ gistendscan _null_ _null_ _null_ )); DESCR("gist(internal)"); DATA(insert OID = 780 ( gistmarkpos PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 2278 "2281" _null_ _null_ _null_ _null_ gistmarkpos _null_ _null_ _null_ )); DESCR("gist(internal)"); DATA(insert OID = 781 ( gistrestrpos PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 2278 "2281" _null_ _null_ _null_ _null_ gistrestrpos _null_ _null_ _null_ )); DESCR("gist(internal)"); DATA(insert OID = 782 ( gistbuild PGNSP PGUID 12 1 0 0 0 f f f f t f v 3 0 2281 "2281 2281 2281" _null_ _null_ _null_ _null_ gistbuild _null_ _null_ _null_ )); DESCR("gist(internal)"); DATA(insert OID = 326 ( gistbuildempty PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 2278 "2281" _null_ _null_ _null_ _null_ gistbuildempty _null_ _null_ _null_ )); DESCR("gist(internal)"); DATA(insert OID = 776 ( gistbulkdelete PGNSP PGUID 12 1 0 0 0 f f f f t f v 4 0 2281 "2281 2281 2281 2281" _null_ _null_ _null_ _null_ gistbulkdelete _null_ _null_ _null_ )); DESCR("gist(internal)"); DATA(insert OID = 2561 ( gistvacuumcleanup PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 2281 "2281 2281" _null_ _null_ _null_ _null_ gistvacuumcleanup _null_ _null_ _null_ )); DESCR("gist(internal)"); DATA(insert OID = 772 ( gistcostestimate PGNSP PGUID 12 1 0 0 0 f f f f t f v 7 0 2278 "2281 2281 2281 2281 2281 2281 2281" _null_ _null_ _null_ _null_ gistcostestimate _null_ _null_ _null_ )); DESCR("gist(internal)"); DATA(insert OID = 2787 ( gistoptions PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 17 "1009 16" _null_ _null_ _null_ _null_ gistoptions _null_ _null_ _null_ )); DESCR("gist(internal)"); DATA(insert OID = 784 ( tintervaleq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "704 704" _null_ _null_ _null_ _null_ tintervaleq _null_ _null_ _null_ )); DATA(insert OID = 785 ( tintervalne PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "704 704" _null_ _null_ _null_ _null_ tintervalne _null_ _null_ _null_ )); DATA(insert OID = 786 ( tintervallt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "704 704" _null_ _null_ _null_ _null_ tintervallt _null_ _null_ _null_ )); DATA(insert OID = 787 ( tintervalgt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "704 704" _null_ _null_ _null_ _null_ tintervalgt _null_ _null_ _null_ )); DATA(insert OID = 788 ( tintervalle PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "704 704" _null_ _null_ _null_ _null_ tintervalle _null_ _null_ _null_ )); DATA(insert OID = 789 ( tintervalge PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "704 704" _null_ _null_ _null_ _null_ tintervalge _null_ _null_ _null_ )); /* OIDS 800 - 899 */ DATA(insert OID = 846 ( cash_mul_flt4 PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 790 "790 700" _null_ _null_ _null_ _null_ cash_mul_flt4 _null_ _null_ _null_ )); DATA(insert OID = 847 ( cash_div_flt4 PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 790 "790 700" _null_ _null_ _null_ _null_ cash_div_flt4 _null_ _null_ _null_ )); DATA(insert OID = 848 ( flt4_mul_cash PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 790 "700 790" _null_ _null_ _null_ _null_ flt4_mul_cash _null_ _null_ _null_ )); DATA(insert OID = 849 ( position PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "25 25" _null_ _null_ _null_ _null_ textpos _null_ _null_ _null_ )); DESCR("position of substring"); DATA(insert OID = 850 ( textlike PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "25 25" _null_ _null_ _null_ _null_ textlike _null_ _null_ _null_ )); DATA(insert OID = 851 ( textnlike PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "25 25" _null_ _null_ _null_ _null_ textnlike _null_ _null_ _null_ )); DATA(insert OID = 852 ( int48eq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "23 20" _null_ _null_ _null_ _null_ int48eq _null_ _null_ _null_ )); DATA(insert OID = 853 ( int48ne PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "23 20" _null_ _null_ _null_ _null_ int48ne _null_ _null_ _null_ )); DATA(insert OID = 854 ( int48lt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "23 20" _null_ _null_ _null_ _null_ int48lt _null_ _null_ _null_ )); DATA(insert OID = 855 ( int48gt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "23 20" _null_ _null_ _null_ _null_ int48gt _null_ _null_ _null_ )); DATA(insert OID = 856 ( int48le PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "23 20" _null_ _null_ _null_ _null_ int48le _null_ _null_ _null_ )); DATA(insert OID = 857 ( int48ge PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "23 20" _null_ _null_ _null_ _null_ int48ge _null_ _null_ _null_ )); DATA(insert OID = 858 ( namelike PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "19 25" _null_ _null_ _null_ _null_ namelike _null_ _null_ _null_ )); DATA(insert OID = 859 ( namenlike PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "19 25" _null_ _null_ _null_ _null_ namenlike _null_ _null_ _null_ )); DATA(insert OID = 860 ( bpchar PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1042 "18" _null_ _null_ _null_ _null_ char_bpchar _null_ _null_ _null_ )); DESCR("convert char to char(n)"); DATA(insert OID = 861 ( current_database PGNSP PGUID 12 1 0 0 0 f f f f t f s 0 0 19 "" _null_ _null_ _null_ _null_ current_database _null_ _null_ _null_ )); DESCR("name of the current database"); DATA(insert OID = 817 ( current_query PGNSP PGUID 12 1 0 0 0 f f f f f f v 0 0 25 "" _null_ _null_ _null_ _null_ current_query _null_ _null_ _null_ )); DESCR("get the currently executing query"); DATA(insert OID = 862 ( int4_mul_cash PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 790 "23 790" _null_ _null_ _null_ _null_ int4_mul_cash _null_ _null_ _null_ )); DATA(insert OID = 863 ( int2_mul_cash PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 790 "21 790" _null_ _null_ _null_ _null_ int2_mul_cash _null_ _null_ _null_ )); DATA(insert OID = 864 ( cash_mul_int4 PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 790 "790 23" _null_ _null_ _null_ _null_ cash_mul_int4 _null_ _null_ _null_ )); DATA(insert OID = 865 ( cash_div_int4 PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 790 "790 23" _null_ _null_ _null_ _null_ cash_div_int4 _null_ _null_ _null_ )); DATA(insert OID = 866 ( cash_mul_int2 PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 790 "790 21" _null_ _null_ _null_ _null_ cash_mul_int2 _null_ _null_ _null_ )); DATA(insert OID = 867 ( cash_div_int2 PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 790 "790 21" _null_ _null_ _null_ _null_ cash_div_int2 _null_ _null_ _null_ )); DATA(insert OID = 886 ( cash_in PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 790 "2275" _null_ _null_ _null_ _null_ cash_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 887 ( cash_out PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 2275 "790" _null_ _null_ _null_ _null_ cash_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 888 ( cash_eq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "790 790" _null_ _null_ _null_ _null_ cash_eq _null_ _null_ _null_ )); DATA(insert OID = 889 ( cash_ne PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "790 790" _null_ _null_ _null_ _null_ cash_ne _null_ _null_ _null_ )); DATA(insert OID = 890 ( cash_lt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "790 790" _null_ _null_ _null_ _null_ cash_lt _null_ _null_ _null_ )); DATA(insert OID = 891 ( cash_le PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "790 790" _null_ _null_ _null_ _null_ cash_le _null_ _null_ _null_ )); DATA(insert OID = 892 ( cash_gt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "790 790" _null_ _null_ _null_ _null_ cash_gt _null_ _null_ _null_ )); DATA(insert OID = 893 ( cash_ge PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "790 790" _null_ _null_ _null_ _null_ cash_ge _null_ _null_ _null_ )); DATA(insert OID = 894 ( cash_pl PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 790 "790 790" _null_ _null_ _null_ _null_ cash_pl _null_ _null_ _null_ )); DATA(insert OID = 895 ( cash_mi PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 790 "790 790" _null_ _null_ _null_ _null_ cash_mi _null_ _null_ _null_ )); DATA(insert OID = 896 ( cash_mul_flt8 PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 790 "790 701" _null_ _null_ _null_ _null_ cash_mul_flt8 _null_ _null_ _null_ )); DATA(insert OID = 897 ( cash_div_flt8 PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 790 "790 701" _null_ _null_ _null_ _null_ cash_div_flt8 _null_ _null_ _null_ )); DATA(insert OID = 898 ( cashlarger PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 790 "790 790" _null_ _null_ _null_ _null_ cashlarger _null_ _null_ _null_ )); DESCR("larger of two"); DATA(insert OID = 899 ( cashsmaller PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 790 "790 790" _null_ _null_ _null_ _null_ cashsmaller _null_ _null_ _null_ )); DESCR("smaller of two"); DATA(insert OID = 919 ( flt8_mul_cash PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 790 "701 790" _null_ _null_ _null_ _null_ flt8_mul_cash _null_ _null_ _null_ )); DATA(insert OID = 935 ( cash_words PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 25 "790" _null_ _null_ _null_ _null_ cash_words _null_ _null_ _null_ )); DESCR("output money amount as words"); DATA(insert OID = 3822 ( cash_div_cash PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "790 790" _null_ _null_ _null_ _null_ cash_div_cash _null_ _null_ _null_ )); DATA(insert OID = 3823 ( numeric PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 1700 "790" _null_ _null_ _null_ _null_ cash_numeric _null_ _null_ _null_ )); DESCR("convert money to numeric"); DATA(insert OID = 3824 ( money PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 790 "1700" _null_ _null_ _null_ _null_ numeric_cash _null_ _null_ _null_ )); DESCR("convert numeric to money"); DATA(insert OID = 3811 ( money PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 790 "23" _null_ _null_ _null_ _null_ int4_cash _null_ _null_ _null_ )); DESCR("convert int4 to money"); DATA(insert OID = 3812 ( money PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 790 "20" _null_ _null_ _null_ _null_ int8_cash _null_ _null_ _null_ )); DESCR("convert int8 to money"); /* OIDS 900 - 999 */ DATA(insert OID = 940 ( mod PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 21 "21 21" _null_ _null_ _null_ _null_ int2mod _null_ _null_ _null_ )); DESCR("modulus"); DATA(insert OID = 941 ( mod PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "23 23" _null_ _null_ _null_ _null_ int4mod _null_ _null_ _null_ )); DESCR("modulus"); DATA(insert OID = 945 ( int8mod PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 20 "20 20" _null_ _null_ _null_ _null_ int8mod _null_ _null_ _null_ )); DATA(insert OID = 947 ( mod PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 20 "20 20" _null_ _null_ _null_ _null_ int8mod _null_ _null_ _null_ )); DESCR("modulus"); DATA(insert OID = 944 ( char PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 18 "25" _null_ _null_ _null_ _null_ text_char _null_ _null_ _null_ )); DESCR("convert text to char"); DATA(insert OID = 946 ( text PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 25 "18" _null_ _null_ _null_ _null_ char_text _null_ _null_ _null_ )); DESCR("convert char to text"); DATA(insert OID = 952 ( lo_open PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 23 "26 23" _null_ _null_ _null_ _null_ lo_open _null_ _null_ _null_ )); DESCR("large object open"); DATA(insert OID = 953 ( lo_close PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 23 "23" _null_ _null_ _null_ _null_ lo_close _null_ _null_ _null_ )); DESCR("large object close"); DATA(insert OID = 954 ( loread PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 17 "23 23" _null_ _null_ _null_ _null_ loread _null_ _null_ _null_ )); DESCR("large object read"); DATA(insert OID = 955 ( lowrite PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 23 "23 17" _null_ _null_ _null_ _null_ lowrite _null_ _null_ _null_ )); DESCR("large object write"); DATA(insert OID = 956 ( lo_lseek PGNSP PGUID 12 1 0 0 0 f f f f t f v 3 0 23 "23 23 23" _null_ _null_ _null_ _null_ lo_lseek _null_ _null_ _null_ )); DESCR("large object seek"); DATA(insert OID = 957 ( lo_creat PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 26 "23" _null_ _null_ _null_ _null_ lo_creat _null_ _null_ _null_ )); DESCR("large object create"); DATA(insert OID = 715 ( lo_create PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 26 "26" _null_ _null_ _null_ _null_ lo_create _null_ _null_ _null_ )); DESCR("large object create"); DATA(insert OID = 958 ( lo_tell PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 23 "23" _null_ _null_ _null_ _null_ lo_tell _null_ _null_ _null_ )); DESCR("large object position"); DATA(insert OID = 1004 ( lo_truncate PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 23 "23 23" _null_ _null_ _null_ _null_ lo_truncate _null_ _null_ _null_ )); DESCR("truncate large object"); DATA(insert OID = 959 ( on_pl PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "600 628" _null_ _null_ _null_ _null_ on_pl _null_ _null_ _null_ )); DATA(insert OID = 960 ( on_sl PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "601 628" _null_ _null_ _null_ _null_ on_sl _null_ _null_ _null_ )); DATA(insert OID = 961 ( close_pl PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 600 "600 628" _null_ _null_ _null_ _null_ close_pl _null_ _null_ _null_ )); DATA(insert OID = 962 ( close_sl PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 600 "601 628" _null_ _null_ _null_ _null_ close_sl _null_ _null_ _null_ )); DATA(insert OID = 963 ( close_lb PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 600 "628 603" _null_ _null_ _null_ _null_ close_lb _null_ _null_ _null_ )); DATA(insert OID = 964 ( lo_unlink PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 23 "26" _null_ _null_ _null_ _null_ lo_unlink _null_ _null_ _null_ )); DESCR("large object unlink (delete)"); DATA(insert OID = 973 ( path_inter PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "602 602" _null_ _null_ _null_ _null_ path_inter _null_ _null_ _null_ )); DATA(insert OID = 975 ( area PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "603" _null_ _null_ _null_ _null_ box_area _null_ _null_ _null_ )); DESCR("box area"); DATA(insert OID = 976 ( width PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "603" _null_ _null_ _null_ _null_ box_width _null_ _null_ _null_ )); DESCR("box width"); DATA(insert OID = 977 ( height PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "603" _null_ _null_ _null_ _null_ box_height _null_ _null_ _null_ )); DESCR("box height"); DATA(insert OID = 978 ( box_distance PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "603 603" _null_ _null_ _null_ _null_ box_distance _null_ _null_ _null_ )); DATA(insert OID = 979 ( area PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "602" _null_ _null_ _null_ _null_ path_area _null_ _null_ _null_ )); DESCR("area of a closed path"); DATA(insert OID = 980 ( box_intersect PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 603 "603 603" _null_ _null_ _null_ _null_ box_intersect _null_ _null_ _null_ )); DATA(insert OID = 981 ( diagonal PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 601 "603" _null_ _null_ _null_ _null_ box_diagonal _null_ _null_ _null_ )); DESCR("box diagonal"); DATA(insert OID = 982 ( path_n_lt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "602 602" _null_ _null_ _null_ _null_ path_n_lt _null_ _null_ _null_ )); DATA(insert OID = 983 ( path_n_gt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "602 602" _null_ _null_ _null_ _null_ path_n_gt _null_ _null_ _null_ )); DATA(insert OID = 984 ( path_n_eq PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "602 602" _null_ _null_ _null_ _null_ path_n_eq _null_ _null_ _null_ )); DATA(insert OID = 985 ( path_n_le PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "602 602" _null_ _null_ _null_ _null_ path_n_le _null_ _null_ _null_ )); DATA(insert OID = 986 ( path_n_ge PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "602 602" _null_ _null_ _null_ _null_ path_n_ge _null_ _null_ _null_ )); DATA(insert OID = 987 ( path_length PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "602" _null_ _null_ _null_ _null_ path_length _null_ _null_ _null_ )); DATA(insert OID = 988 ( point_ne PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "600 600" _null_ _null_ _null_ _null_ point_ne _null_ _null_ _null_ )); DATA(insert OID = 989 ( point_vert PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "600 600" _null_ _null_ _null_ _null_ point_vert _null_ _null_ _null_ )); DATA(insert OID = 990 ( point_horiz PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "600 600" _null_ _null_ _null_ _null_ point_horiz _null_ _null_ _null_ )); DATA(insert OID = 991 ( point_distance PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "600 600" _null_ _null_ _null_ _null_ point_distance _null_ _null_ _null_ )); DATA(insert OID = 992 ( slope PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "600 600" _null_ _null_ _null_ _null_ point_slope _null_ _null_ _null_ )); DESCR("slope between points"); DATA(insert OID = 993 ( lseg PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 601 "600 600" _null_ _null_ _null_ _null_ lseg_construct _null_ _null_ _null_ )); DESCR("convert points to line segment"); DATA(insert OID = 994 ( lseg_intersect PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "601 601" _null_ _null_ _null_ _null_ lseg_intersect _null_ _null_ _null_ )); DATA(insert OID = 995 ( lseg_parallel PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "601 601" _null_ _null_ _null_ _null_ lseg_parallel _null_ _null_ _null_ )); DATA(insert OID = 996 ( lseg_perp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "601 601" _null_ _null_ _null_ _null_ lseg_perp _null_ _null_ _null_ )); DATA(insert OID = 997 ( lseg_vertical PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 16 "601" _null_ _null_ _null_ _null_ lseg_vertical _null_ _null_ _null_ )); DATA(insert OID = 998 ( lseg_horizontal PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 16 "601" _null_ _null_ _null_ _null_ lseg_horizontal _null_ _null_ _null_ )); DATA(insert OID = 999 ( lseg_eq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "601 601" _null_ _null_ _null_ _null_ lseg_eq _null_ _null_ _null_ )); /* OIDS 1000 - 1999 */ DATA(insert OID = 1026 ( timezone PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1114 "1186 1184" _null_ _null_ _null_ _null_ timestamptz_izone _null_ _null_ _null_ )); DESCR("adjust timestamp to new time zone"); DATA(insert OID = 1031 ( aclitemin PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 1033 "2275" _null_ _null_ _null_ _null_ aclitemin _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 1032 ( aclitemout PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 2275 "1033" _null_ _null_ _null_ _null_ aclitemout _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 1035 ( aclinsert PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1034 "1034 1033" _null_ _null_ _null_ _null_ aclinsert _null_ _null_ _null_ )); DESCR("add/update ACL item"); DATA(insert OID = 1036 ( aclremove PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1034 "1034 1033" _null_ _null_ _null_ _null_ aclremove _null_ _null_ _null_ )); DESCR("remove ACL item"); DATA(insert OID = 1037 ( aclcontains PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1034 1033" _null_ _null_ _null_ _null_ aclcontains _null_ _null_ _null_ )); DESCR("contains"); DATA(insert OID = 1062 ( aclitemeq PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1033 1033" _null_ _null_ _null_ _null_ aclitem_eq _null_ _null_ _null_ )); DATA(insert OID = 1365 ( makeaclitem PGNSP PGUID 12 1 0 0 0 f f f f t f i 4 0 1033 "26 26 25 16" _null_ _null_ _null_ _null_ makeaclitem _null_ _null_ _null_ )); DESCR("make ACL item"); DATA(insert OID = 3943 ( acldefault PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1034 "18 26" _null_ _null_ _null_ _null_ acldefault_sql _null_ _null_ _null_ )); DESCR("TODO"); DATA(insert OID = 1689 ( aclexplode PGNSP PGUID 12 1 10 0 0 f f f f t t s 1 0 2249 "1034" "{1034,26,26,25,16}" "{i,o,o,o,o}" "{acl,grantor,grantee,privilege_type,is_grantable}" _null_ aclexplode _null_ _null_ _null_ )); DESCR("convert ACL item array to table, for use by information schema"); DATA(insert OID = 1044 ( bpcharin PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 1042 "2275 26 23" _null_ _null_ _null_ _null_ bpcharin _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 1045 ( bpcharout PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "1042" _null_ _null_ _null_ _null_ bpcharout _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2913 ( bpchartypmodin PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "1263" _null_ _null_ _null_ _null_ bpchartypmodin _null_ _null_ _null_ )); DESCR("I/O typmod"); DATA(insert OID = 2914 ( bpchartypmodout PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "23" _null_ _null_ _null_ _null_ bpchartypmodout _null_ _null_ _null_ )); DESCR("I/O typmod"); DATA(insert OID = 1046 ( varcharin PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 1043 "2275 26 23" _null_ _null_ _null_ _null_ varcharin _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 1047 ( varcharout PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "1043" _null_ _null_ _null_ _null_ varcharout _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2915 ( varchartypmodin PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "1263" _null_ _null_ _null_ _null_ varchartypmodin _null_ _null_ _null_ )); DESCR("I/O typmod"); DATA(insert OID = 2916 ( varchartypmodout PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "23" _null_ _null_ _null_ _null_ varchartypmodout _null_ _null_ _null_ )); DESCR("I/O typmod"); DATA(insert OID = 1048 ( bpchareq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1042 1042" _null_ _null_ _null_ _null_ bpchareq _null_ _null_ _null_ )); DATA(insert OID = 1049 ( bpcharlt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1042 1042" _null_ _null_ _null_ _null_ bpcharlt _null_ _null_ _null_ )); DATA(insert OID = 1050 ( bpcharle PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1042 1042" _null_ _null_ _null_ _null_ bpcharle _null_ _null_ _null_ )); DATA(insert OID = 1051 ( bpchargt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1042 1042" _null_ _null_ _null_ _null_ bpchargt _null_ _null_ _null_ )); DATA(insert OID = 1052 ( bpcharge PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1042 1042" _null_ _null_ _null_ _null_ bpcharge _null_ _null_ _null_ )); DATA(insert OID = 1053 ( bpcharne PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1042 1042" _null_ _null_ _null_ _null_ bpcharne _null_ _null_ _null_ )); DATA(insert OID = 1063 ( bpchar_larger PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1042 "1042 1042" _null_ _null_ _null_ _null_ bpchar_larger _null_ _null_ _null_ )); DESCR("larger of two"); DATA(insert OID = 1064 ( bpchar_smaller PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1042 "1042 1042" _null_ _null_ _null_ _null_ bpchar_smaller _null_ _null_ _null_ )); DESCR("smaller of two"); DATA(insert OID = 1078 ( bpcharcmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "1042 1042" _null_ _null_ _null_ _null_ bpcharcmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 1080 ( hashbpchar PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "1042" _null_ _null_ _null_ _null_ hashbpchar _null_ _null_ _null_ )); DESCR("hash"); DATA(insert OID = 1081 ( format_type PGNSP PGUID 12 1 0 0 0 f f f f f f s 2 0 25 "26 23" _null_ _null_ _null_ _null_ format_type _null_ _null_ _null_ )); DESCR("format a type oid and atttypmod to canonical SQL"); DATA(insert OID = 1084 ( date_in PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 1082 "2275" _null_ _null_ _null_ _null_ date_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 1085 ( date_out PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 2275 "1082" _null_ _null_ _null_ _null_ date_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 1086 ( date_eq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1082 1082" _null_ _null_ _null_ _null_ date_eq _null_ _null_ _null_ )); DATA(insert OID = 1087 ( date_lt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1082 1082" _null_ _null_ _null_ _null_ date_lt _null_ _null_ _null_ )); DATA(insert OID = 1088 ( date_le PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1082 1082" _null_ _null_ _null_ _null_ date_le _null_ _null_ _null_ )); DATA(insert OID = 1089 ( date_gt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1082 1082" _null_ _null_ _null_ _null_ date_gt _null_ _null_ _null_ )); DATA(insert OID = 1090 ( date_ge PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1082 1082" _null_ _null_ _null_ _null_ date_ge _null_ _null_ _null_ )); DATA(insert OID = 1091 ( date_ne PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1082 1082" _null_ _null_ _null_ _null_ date_ne _null_ _null_ _null_ )); DATA(insert OID = 1092 ( date_cmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "1082 1082" _null_ _null_ _null_ _null_ date_cmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 3136 ( date_sortsupport PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2278 "2281" _null_ _null_ _null_ _null_ date_sortsupport _null_ _null_ _null_ )); DESCR("sort support"); /* OIDS 1100 - 1199 */ DATA(insert OID = 1102 ( time_lt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1083 1083" _null_ _null_ _null_ _null_ time_lt _null_ _null_ _null_ )); DATA(insert OID = 1103 ( time_le PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1083 1083" _null_ _null_ _null_ _null_ time_le _null_ _null_ _null_ )); DATA(insert OID = 1104 ( time_gt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1083 1083" _null_ _null_ _null_ _null_ time_gt _null_ _null_ _null_ )); DATA(insert OID = 1105 ( time_ge PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1083 1083" _null_ _null_ _null_ _null_ time_ge _null_ _null_ _null_ )); DATA(insert OID = 1106 ( time_ne PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1083 1083" _null_ _null_ _null_ _null_ time_ne _null_ _null_ _null_ )); DATA(insert OID = 1107 ( time_cmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "1083 1083" _null_ _null_ _null_ _null_ time_cmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 1138 ( date_larger PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1082 "1082 1082" _null_ _null_ _null_ _null_ date_larger _null_ _null_ _null_ )); DESCR("larger of two"); DATA(insert OID = 1139 ( date_smaller PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1082 "1082 1082" _null_ _null_ _null_ _null_ date_smaller _null_ _null_ _null_ )); DESCR("smaller of two"); DATA(insert OID = 1140 ( date_mi PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "1082 1082" _null_ _null_ _null_ _null_ date_mi _null_ _null_ _null_ )); DATA(insert OID = 1141 ( date_pli PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1082 "1082 23" _null_ _null_ _null_ _null_ date_pli _null_ _null_ _null_ )); DATA(insert OID = 1142 ( date_mii PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1082 "1082 23" _null_ _null_ _null_ _null_ date_mii _null_ _null_ _null_ )); DATA(insert OID = 1143 ( time_in PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 1083 "2275 26 23" _null_ _null_ _null_ _null_ time_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 1144 ( time_out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "1083" _null_ _null_ _null_ _null_ time_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2909 ( timetypmodin PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "1263" _null_ _null_ _null_ _null_ timetypmodin _null_ _null_ _null_ )); DESCR("I/O typmod"); DATA(insert OID = 2910 ( timetypmodout PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "23" _null_ _null_ _null_ _null_ timetypmodout _null_ _null_ _null_ )); DESCR("I/O typmod"); DATA(insert OID = 1145 ( time_eq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1083 1083" _null_ _null_ _null_ _null_ time_eq _null_ _null_ _null_ )); DATA(insert OID = 1146 ( circle_add_pt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 718 "718 600" _null_ _null_ _null_ _null_ circle_add_pt _null_ _null_ _null_ )); DATA(insert OID = 1147 ( circle_sub_pt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 718 "718 600" _null_ _null_ _null_ _null_ circle_sub_pt _null_ _null_ _null_ )); DATA(insert OID = 1148 ( circle_mul_pt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 718 "718 600" _null_ _null_ _null_ _null_ circle_mul_pt _null_ _null_ _null_ )); DATA(insert OID = 1149 ( circle_div_pt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 718 "718 600" _null_ _null_ _null_ _null_ circle_div_pt _null_ _null_ _null_ )); DATA(insert OID = 1150 ( timestamptz_in PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 1184 "2275 26 23" _null_ _null_ _null_ _null_ timestamptz_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 1151 ( timestamptz_out PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 2275 "1184" _null_ _null_ _null_ _null_ timestamptz_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2907 ( timestamptztypmodin PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "1263" _null_ _null_ _null_ _null_ timestamptztypmodin _null_ _null_ _null_ )); DESCR("I/O typmod"); DATA(insert OID = 2908 ( timestamptztypmodout PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "23" _null_ _null_ _null_ _null_ timestamptztypmodout _null_ _null_ _null_ )); DESCR("I/O typmod"); DATA(insert OID = 1152 ( timestamptz_eq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1184 1184" _null_ _null_ _null_ _null_ timestamp_eq _null_ _null_ _null_ )); DATA(insert OID = 1153 ( timestamptz_ne PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1184 1184" _null_ _null_ _null_ _null_ timestamp_ne _null_ _null_ _null_ )); DATA(insert OID = 1154 ( timestamptz_lt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1184 1184" _null_ _null_ _null_ _null_ timestamp_lt _null_ _null_ _null_ )); DATA(insert OID = 1155 ( timestamptz_le PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1184 1184" _null_ _null_ _null_ _null_ timestamp_le _null_ _null_ _null_ )); DATA(insert OID = 1156 ( timestamptz_ge PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1184 1184" _null_ _null_ _null_ _null_ timestamp_ge _null_ _null_ _null_ )); DATA(insert OID = 1157 ( timestamptz_gt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1184 1184" _null_ _null_ _null_ _null_ timestamp_gt _null_ _null_ _null_ )); DATA(insert OID = 1158 ( to_timestamp PGNSP PGUID 14 1 0 0 0 f f f f t f i 1 0 1184 "701" _null_ _null_ _null_ _null_ "select (''epoch''::pg_catalog.timestamptz + $1 * ''1 second''::pg_catalog.interval)" _null_ _null_ _null_ )); DESCR("convert UNIX epoch to timestamptz"); DATA(insert OID = 1159 ( timezone PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1114 "25 1184" _null_ _null_ _null_ _null_ timestamptz_zone _null_ _null_ _null_ )); DESCR("adjust timestamp to new time zone"); DATA(insert OID = 1160 ( interval_in PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 1186 "2275 26 23" _null_ _null_ _null_ _null_ interval_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 1161 ( interval_out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "1186" _null_ _null_ _null_ _null_ interval_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2903 ( intervaltypmodin PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "1263" _null_ _null_ _null_ _null_ intervaltypmodin _null_ _null_ _null_ )); DESCR("I/O typmod"); DATA(insert OID = 2904 ( intervaltypmodout PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "23" _null_ _null_ _null_ _null_ intervaltypmodout _null_ _null_ _null_ )); DESCR("I/O typmod"); DATA(insert OID = 1162 ( interval_eq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1186 1186" _null_ _null_ _null_ _null_ interval_eq _null_ _null_ _null_ )); DATA(insert OID = 1163 ( interval_ne PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1186 1186" _null_ _null_ _null_ _null_ interval_ne _null_ _null_ _null_ )); DATA(insert OID = 1164 ( interval_lt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1186 1186" _null_ _null_ _null_ _null_ interval_lt _null_ _null_ _null_ )); DATA(insert OID = 1165 ( interval_le PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1186 1186" _null_ _null_ _null_ _null_ interval_le _null_ _null_ _null_ )); DATA(insert OID = 1166 ( interval_ge PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1186 1186" _null_ _null_ _null_ _null_ interval_ge _null_ _null_ _null_ )); DATA(insert OID = 1167 ( interval_gt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1186 1186" _null_ _null_ _null_ _null_ interval_gt _null_ _null_ _null_ )); DATA(insert OID = 1168 ( interval_um PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1186 "1186" _null_ _null_ _null_ _null_ interval_um _null_ _null_ _null_ )); DATA(insert OID = 1169 ( interval_pl PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1186 "1186 1186" _null_ _null_ _null_ _null_ interval_pl _null_ _null_ _null_ )); DATA(insert OID = 1170 ( interval_mi PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1186 "1186 1186" _null_ _null_ _null_ _null_ interval_mi _null_ _null_ _null_ )); DATA(insert OID = 1171 ( date_part PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 701 "25 1184" _null_ _null_ _null_ _null_ timestamptz_part _null_ _null_ _null_ )); DESCR("extract field from timestamp with time zone"); DATA(insert OID = 1172 ( date_part PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "25 1186" _null_ _null_ _null_ _null_ interval_part _null_ _null_ _null_ )); DESCR("extract field from interval"); DATA(insert OID = 1173 ( timestamptz PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1184 "702" _null_ _null_ _null_ _null_ abstime_timestamptz _null_ _null_ _null_ )); DESCR("convert abstime to timestamp with time zone"); DATA(insert OID = 1174 ( timestamptz PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 1184 "1082" _null_ _null_ _null_ _null_ date_timestamptz _null_ _null_ _null_ )); DESCR("convert date to timestamp with time zone"); DATA(insert OID = 2711 ( justify_interval PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1186 "1186" _null_ _null_ _null_ _null_ interval_justify_interval _null_ _null_ _null_ )); DESCR("promote groups of 24 hours to numbers of days and promote groups of 30 days to numbers of months"); DATA(insert OID = 1175 ( justify_hours PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1186 "1186" _null_ _null_ _null_ _null_ interval_justify_hours _null_ _null_ _null_ )); DESCR("promote groups of 24 hours to numbers of days"); DATA(insert OID = 1295 ( justify_days PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1186 "1186" _null_ _null_ _null_ _null_ interval_justify_days _null_ _null_ _null_ )); DESCR("promote groups of 30 days to numbers of months"); DATA(insert OID = 1176 ( timestamptz PGNSP PGUID 14 1 0 0 0 f f f f t f s 2 0 1184 "1082 1083" _null_ _null_ _null_ _null_ "select cast(($1 + $2) as timestamp with time zone)" _null_ _null_ _null_ )); DESCR("convert date and time to timestamp with time zone"); DATA(insert OID = 1177 ( interval PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1186 "703" _null_ _null_ _null_ _null_ reltime_interval _null_ _null_ _null_ )); DESCR("convert reltime to interval"); DATA(insert OID = 1178 ( date PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 1082 "1184" _null_ _null_ _null_ _null_ timestamptz_date _null_ _null_ _null_ )); DESCR("convert timestamp with time zone to date"); DATA(insert OID = 1179 ( date PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 1082 "702" _null_ _null_ _null_ _null_ abstime_date _null_ _null_ _null_ )); DESCR("convert abstime to date"); DATA(insert OID = 1180 ( abstime PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 702 "1184" _null_ _null_ _null_ _null_ timestamptz_abstime _null_ _null_ _null_ )); DESCR("convert timestamp with time zone to abstime"); DATA(insert OID = 1181 ( age PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 23 "28" _null_ _null_ _null_ _null_ xid_age _null_ _null_ _null_ )); DESCR("age of a transaction ID, in transactions before current transaction"); DATA(insert OID = 1188 ( timestamptz_mi PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1186 "1184 1184" _null_ _null_ _null_ _null_ timestamp_mi _null_ _null_ _null_ )); DATA(insert OID = 1189 ( timestamptz_pl_interval PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 1184 "1184 1186" _null_ _null_ _null_ _null_ timestamptz_pl_interval _null_ _null_ _null_ )); DATA(insert OID = 1190 ( timestamptz_mi_interval PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 1184 "1184 1186" _null_ _null_ _null_ _null_ timestamptz_mi_interval _null_ _null_ _null_ )); DATA(insert OID = 1194 ( reltime PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 703 "1186" _null_ _null_ _null_ _null_ interval_reltime _null_ _null_ _null_ )); DESCR("convert interval to reltime"); DATA(insert OID = 1195 ( timestamptz_smaller PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1184 "1184 1184" _null_ _null_ _null_ _null_ timestamp_smaller _null_ _null_ _null_ )); DESCR("smaller of two"); DATA(insert OID = 1196 ( timestamptz_larger PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1184 "1184 1184" _null_ _null_ _null_ _null_ timestamp_larger _null_ _null_ _null_ )); DESCR("larger of two"); DATA(insert OID = 1197 ( interval_smaller PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1186 "1186 1186" _null_ _null_ _null_ _null_ interval_smaller _null_ _null_ _null_ )); DESCR("smaller of two"); DATA(insert OID = 1198 ( interval_larger PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1186 "1186 1186" _null_ _null_ _null_ _null_ interval_larger _null_ _null_ _null_ )); DESCR("larger of two"); DATA(insert OID = 1199 ( age PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1186 "1184 1184" _null_ _null_ _null_ _null_ timestamptz_age _null_ _null_ _null_ )); DESCR("date difference preserving months and years"); /* OIDS 1200 - 1299 */ DATA(insert OID = 3918 ( interval_transform PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2281 "2281" _null_ _null_ _null_ _null_ interval_transform _null_ _null_ _null_ )); DESCR("transform an interval length coercion"); DATA(insert OID = 1200 ( interval PGNSP PGUID 12 1 0 0 interval_transform f f f f t f i 2 0 1186 "1186 23" _null_ _null_ _null_ _null_ interval_scale _null_ _null_ _null_ )); DESCR("adjust interval precision"); DATA(insert OID = 1215 ( obj_description PGNSP PGUID 14 100 0 0 0 f f f f t f s 2 0 25 "26 19" _null_ _null_ _null_ _null_ "select description from pg_catalog.pg_description where objoid = $1 and classoid = (select oid from pg_catalog.pg_class where relname = $2 and relnamespace = PGNSP) and objsubid = 0" _null_ _null_ _null_ )); DESCR("get description for object id and catalog name"); DATA(insert OID = 1216 ( col_description PGNSP PGUID 14 100 0 0 0 f f f f t f s 2 0 25 "26 23" _null_ _null_ _null_ _null_ "select description from pg_catalog.pg_description where objoid = $1 and classoid = ''pg_catalog.pg_class''::pg_catalog.regclass and objsubid = $2" _null_ _null_ _null_ )); DESCR("get description for table column"); DATA(insert OID = 1993 ( shobj_description PGNSP PGUID 14 100 0 0 0 f f f f t f s 2 0 25 "26 19" _null_ _null_ _null_ _null_ "select description from pg_catalog.pg_shdescription where objoid = $1 and classoid = (select oid from pg_catalog.pg_class where relname = $2 and relnamespace = PGNSP)" _null_ _null_ _null_ )); DESCR("get description for object id and shared catalog name"); DATA(insert OID = 1217 ( date_trunc PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 1184 "25 1184" _null_ _null_ _null_ _null_ timestamptz_trunc _null_ _null_ _null_ )); DESCR("truncate timestamp with time zone to specified units"); DATA(insert OID = 1218 ( date_trunc PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1186 "25 1186" _null_ _null_ _null_ _null_ interval_trunc _null_ _null_ _null_ )); DESCR("truncate interval to specified units"); DATA(insert OID = 1219 ( int8inc PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 20 "20" _null_ _null_ _null_ _null_ int8inc _null_ _null_ _null_ )); DESCR("increment"); DATA(insert OID = 2804 ( int8inc_any PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 20 "20 2276" _null_ _null_ _null_ _null_ int8inc_any _null_ _null_ _null_ )); DESCR("increment, ignores second argument"); DATA(insert OID = 1230 ( int8abs PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 20 "20" _null_ _null_ _null_ _null_ int8abs _null_ _null_ _null_ )); DATA(insert OID = 1236 ( int8larger PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 20 "20 20" _null_ _null_ _null_ _null_ int8larger _null_ _null_ _null_ )); DESCR("larger of two"); DATA(insert OID = 1237 ( int8smaller PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 20 "20 20" _null_ _null_ _null_ _null_ int8smaller _null_ _null_ _null_ )); DESCR("smaller of two"); DATA(insert OID = 1238 ( texticregexeq PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "25 25" _null_ _null_ _null_ _null_ texticregexeq _null_ _null_ _null_ )); DATA(insert OID = 1239 ( texticregexne PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "25 25" _null_ _null_ _null_ _null_ texticregexne _null_ _null_ _null_ )); DATA(insert OID = 1240 ( nameicregexeq PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "19 25" _null_ _null_ _null_ _null_ nameicregexeq _null_ _null_ _null_ )); DATA(insert OID = 1241 ( nameicregexne PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "19 25" _null_ _null_ _null_ _null_ nameicregexne _null_ _null_ _null_ )); DATA(insert OID = 1251 ( int4abs PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "23" _null_ _null_ _null_ _null_ int4abs _null_ _null_ _null_ )); DATA(insert OID = 1253 ( int2abs PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 21 "21" _null_ _null_ _null_ _null_ int2abs _null_ _null_ _null_ )); DATA(insert OID = 1271 ( overlaps PGNSP PGUID 12 1 0 0 0 f f f f f f i 4 0 16 "1266 1266 1266 1266" _null_ _null_ _null_ _null_ overlaps_timetz _null_ _null_ _null_ )); DESCR("intervals overlap?"); DATA(insert OID = 1272 ( datetime_pl PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1114 "1082 1083" _null_ _null_ _null_ _null_ datetime_timestamp _null_ _null_ _null_ )); DATA(insert OID = 1273 ( date_part PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "25 1266" _null_ _null_ _null_ _null_ timetz_part _null_ _null_ _null_ )); DESCR("extract field from time with time zone"); DATA(insert OID = 1274 ( int84pl PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 20 "20 23" _null_ _null_ _null_ _null_ int84pl _null_ _null_ _null_ )); DATA(insert OID = 1275 ( int84mi PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 20 "20 23" _null_ _null_ _null_ _null_ int84mi _null_ _null_ _null_ )); DATA(insert OID = 1276 ( int84mul PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 20 "20 23" _null_ _null_ _null_ _null_ int84mul _null_ _null_ _null_ )); DATA(insert OID = 1277 ( int84div PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 20 "20 23" _null_ _null_ _null_ _null_ int84div _null_ _null_ _null_ )); DATA(insert OID = 1278 ( int48pl PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 20 "23 20" _null_ _null_ _null_ _null_ int48pl _null_ _null_ _null_ )); DATA(insert OID = 1279 ( int48mi PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 20 "23 20" _null_ _null_ _null_ _null_ int48mi _null_ _null_ _null_ )); DATA(insert OID = 1280 ( int48mul PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 20 "23 20" _null_ _null_ _null_ _null_ int48mul _null_ _null_ _null_ )); DATA(insert OID = 1281 ( int48div PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 20 "23 20" _null_ _null_ _null_ _null_ int48div _null_ _null_ _null_ )); DATA(insert OID = 837 ( int82pl PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 20 "20 21" _null_ _null_ _null_ _null_ int82pl _null_ _null_ _null_ )); DATA(insert OID = 838 ( int82mi PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 20 "20 21" _null_ _null_ _null_ _null_ int82mi _null_ _null_ _null_ )); DATA(insert OID = 839 ( int82mul PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 20 "20 21" _null_ _null_ _null_ _null_ int82mul _null_ _null_ _null_ )); DATA(insert OID = 840 ( int82div PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 20 "20 21" _null_ _null_ _null_ _null_ int82div _null_ _null_ _null_ )); DATA(insert OID = 841 ( int28pl PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 20 "21 20" _null_ _null_ _null_ _null_ int28pl _null_ _null_ _null_ )); DATA(insert OID = 942 ( int28mi PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 20 "21 20" _null_ _null_ _null_ _null_ int28mi _null_ _null_ _null_ )); DATA(insert OID = 943 ( int28mul PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 20 "21 20" _null_ _null_ _null_ _null_ int28mul _null_ _null_ _null_ )); DATA(insert OID = 948 ( int28div PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 20 "21 20" _null_ _null_ _null_ _null_ int28div _null_ _null_ _null_ )); DATA(insert OID = 1287 ( oid PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 26 "20" _null_ _null_ _null_ _null_ i8tooid _null_ _null_ _null_ )); DESCR("convert int8 to oid"); DATA(insert OID = 1288 ( int8 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 20 "26" _null_ _null_ _null_ _null_ oidtoi8 _null_ _null_ _null_ )); DESCR("convert oid to int8"); DATA(insert OID = 1291 ( suppress_redundant_updates_trigger PGNSP PGUID 12 1 0 0 0 f f f f t f v 0 0 2279 "" _null_ _null_ _null_ _null_ suppress_redundant_updates_trigger _null_ _null_ _null_ )); DESCR("trigger to suppress updates when new and old records match"); DATA(insert OID = 1292 ( tideq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "27 27" _null_ _null_ _null_ _null_ tideq _null_ _null_ _null_ )); DATA(insert OID = 1293 ( currtid PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 27 "26 27" _null_ _null_ _null_ _null_ currtid_byreloid _null_ _null_ _null_ )); DESCR("latest tid of a tuple"); DATA(insert OID = 1294 ( currtid2 PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 27 "25 27" _null_ _null_ _null_ _null_ currtid_byrelname _null_ _null_ _null_ )); DESCR("latest tid of a tuple"); DATA(insert OID = 1265 ( tidne PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "27 27" _null_ _null_ _null_ _null_ tidne _null_ _null_ _null_ )); DATA(insert OID = 2790 ( tidgt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "27 27" _null_ _null_ _null_ _null_ tidgt _null_ _null_ _null_ )); DATA(insert OID = 2791 ( tidlt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "27 27" _null_ _null_ _null_ _null_ tidlt _null_ _null_ _null_ )); DATA(insert OID = 2792 ( tidge PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "27 27" _null_ _null_ _null_ _null_ tidge _null_ _null_ _null_ )); DATA(insert OID = 2793 ( tidle PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "27 27" _null_ _null_ _null_ _null_ tidle _null_ _null_ _null_ )); DATA(insert OID = 2794 ( bttidcmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "27 27" _null_ _null_ _null_ _null_ bttidcmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 2795 ( tidlarger PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 27 "27 27" _null_ _null_ _null_ _null_ tidlarger _null_ _null_ _null_ )); DESCR("larger of two"); DATA(insert OID = 2796 ( tidsmaller PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 27 "27 27" _null_ _null_ _null_ _null_ tidsmaller _null_ _null_ _null_ )); DESCR("smaller of two"); DATA(insert OID = 1296 ( timedate_pl PGNSP PGUID 14 1 0 0 0 f f f f t f i 2 0 1114 "1083 1082" _null_ _null_ _null_ _null_ "select ($2 + $1)" _null_ _null_ _null_ )); DATA(insert OID = 1297 ( datetimetz_pl PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1184 "1082 1266" _null_ _null_ _null_ _null_ datetimetz_timestamptz _null_ _null_ _null_ )); DATA(insert OID = 1298 ( timetzdate_pl PGNSP PGUID 14 1 0 0 0 f f f f t f i 2 0 1184 "1266 1082" _null_ _null_ _null_ _null_ "select ($2 + $1)" _null_ _null_ _null_ )); DATA(insert OID = 1299 ( now PGNSP PGUID 12 1 0 0 0 f f f f t f s 0 0 1184 "" _null_ _null_ _null_ _null_ now _null_ _null_ _null_ )); DESCR("current transaction time"); DATA(insert OID = 2647 ( transaction_timestamp PGNSP PGUID 12 1 0 0 0 f f f f t f s 0 0 1184 "" _null_ _null_ _null_ _null_ now _null_ _null_ _null_ )); DESCR("current transaction time"); DATA(insert OID = 2648 ( statement_timestamp PGNSP PGUID 12 1 0 0 0 f f f f t f s 0 0 1184 "" _null_ _null_ _null_ _null_ statement_timestamp _null_ _null_ _null_ )); DESCR("current statement time"); DATA(insert OID = 2649 ( clock_timestamp PGNSP PGUID 12 1 0 0 0 f f f f t f v 0 0 1184 "" _null_ _null_ _null_ _null_ clock_timestamp _null_ _null_ _null_ )); DESCR("current clock time"); /* OIDS 1300 - 1399 */ DATA(insert OID = 1300 ( positionsel PGNSP PGUID 12 1 0 0 0 f f f f t f s 4 0 701 "2281 26 2281 23" _null_ _null_ _null_ _null_ positionsel _null_ _null_ _null_ )); DESCR("restriction selectivity for position-comparison operators"); DATA(insert OID = 1301 ( positionjoinsel PGNSP PGUID 12 1 0 0 0 f f f f t f s 5 0 701 "2281 26 2281 21 2281" _null_ _null_ _null_ _null_ positionjoinsel _null_ _null_ _null_ )); DESCR("join selectivity for position-comparison operators"); DATA(insert OID = 1302 ( contsel PGNSP PGUID 12 1 0 0 0 f f f f t f s 4 0 701 "2281 26 2281 23" _null_ _null_ _null_ _null_ contsel _null_ _null_ _null_ )); DESCR("restriction selectivity for containment comparison operators"); DATA(insert OID = 1303 ( contjoinsel PGNSP PGUID 12 1 0 0 0 f f f f t f s 5 0 701 "2281 26 2281 21 2281" _null_ _null_ _null_ _null_ contjoinsel _null_ _null_ _null_ )); DESCR("join selectivity for containment comparison operators"); DATA(insert OID = 1304 ( overlaps PGNSP PGUID 12 1 0 0 0 f f f f f f i 4 0 16 "1184 1184 1184 1184" _null_ _null_ _null_ _null_ overlaps_timestamp _null_ _null_ _null_ )); DESCR("intervals overlap?"); DATA(insert OID = 1305 ( overlaps PGNSP PGUID 14 1 0 0 0 f f f f f f s 4 0 16 "1184 1186 1184 1186" _null_ _null_ _null_ _null_ "select ($1, ($1 + $2)) overlaps ($3, ($3 + $4))" _null_ _null_ _null_ )); DESCR("intervals overlap?"); DATA(insert OID = 1306 ( overlaps PGNSP PGUID 14 1 0 0 0 f f f f f f s 4 0 16 "1184 1184 1184 1186" _null_ _null_ _null_ _null_ "select ($1, $2) overlaps ($3, ($3 + $4))" _null_ _null_ _null_ )); DESCR("intervals overlap?"); DATA(insert OID = 1307 ( overlaps PGNSP PGUID 14 1 0 0 0 f f f f f f s 4 0 16 "1184 1186 1184 1184" _null_ _null_ _null_ _null_ "select ($1, ($1 + $2)) overlaps ($3, $4)" _null_ _null_ _null_ )); DESCR("intervals overlap?"); DATA(insert OID = 1308 ( overlaps PGNSP PGUID 12 1 0 0 0 f f f f f f i 4 0 16 "1083 1083 1083 1083" _null_ _null_ _null_ _null_ overlaps_time _null_ _null_ _null_ )); DESCR("intervals overlap?"); DATA(insert OID = 1309 ( overlaps PGNSP PGUID 14 1 0 0 0 f f f f f f i 4 0 16 "1083 1186 1083 1186" _null_ _null_ _null_ _null_ "select ($1, ($1 + $2)) overlaps ($3, ($3 + $4))" _null_ _null_ _null_ )); DESCR("intervals overlap?"); DATA(insert OID = 1310 ( overlaps PGNSP PGUID 14 1 0 0 0 f f f f f f i 4 0 16 "1083 1083 1083 1186" _null_ _null_ _null_ _null_ "select ($1, $2) overlaps ($3, ($3 + $4))" _null_ _null_ _null_ )); DESCR("intervals overlap?"); DATA(insert OID = 1311 ( overlaps PGNSP PGUID 14 1 0 0 0 f f f f f f i 4 0 16 "1083 1186 1083 1083" _null_ _null_ _null_ _null_ "select ($1, ($1 + $2)) overlaps ($3, $4)" _null_ _null_ _null_ )); DESCR("intervals overlap?"); DATA(insert OID = 1312 ( timestamp_in PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 1114 "2275 26 23" _null_ _null_ _null_ _null_ timestamp_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 1313 ( timestamp_out PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 2275 "1114" _null_ _null_ _null_ _null_ timestamp_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2905 ( timestamptypmodin PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "1263" _null_ _null_ _null_ _null_ timestamptypmodin _null_ _null_ _null_ )); DESCR("I/O typmod"); DATA(insert OID = 2906 ( timestamptypmodout PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "23" _null_ _null_ _null_ _null_ timestamptypmodout _null_ _null_ _null_ )); DESCR("I/O typmod"); DATA(insert OID = 1314 ( timestamptz_cmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "1184 1184" _null_ _null_ _null_ _null_ timestamp_cmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 1315 ( interval_cmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "1186 1186" _null_ _null_ _null_ _null_ interval_cmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 1316 ( time PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1083 "1114" _null_ _null_ _null_ _null_ timestamp_time _null_ _null_ _null_ )); DESCR("convert timestamp to time"); DATA(insert OID = 1317 ( length PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "25" _null_ _null_ _null_ _null_ textlen _null_ _null_ _null_ )); DESCR("length"); DATA(insert OID = 1318 ( length PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "1042" _null_ _null_ _null_ _null_ bpcharlen _null_ _null_ _null_ )); DESCR("character length"); DATA(insert OID = 1319 ( xideqint4 PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "28 23" _null_ _null_ _null_ _null_ xideq _null_ _null_ _null_ )); DATA(insert OID = 1326 ( interval_div PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1186 "1186 701" _null_ _null_ _null_ _null_ interval_div _null_ _null_ _null_ )); DATA(insert OID = 1339 ( dlog10 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ dlog10 _null_ _null_ _null_ )); DESCR("base 10 logarithm"); DATA(insert OID = 1340 ( log PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ dlog10 _null_ _null_ _null_ )); DESCR("base 10 logarithm"); DATA(insert OID = 1341 ( ln PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ dlog1 _null_ _null_ _null_ )); DESCR("natural logarithm"); DATA(insert OID = 1342 ( round PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ dround _null_ _null_ _null_ )); DESCR("round to nearest integer"); DATA(insert OID = 1343 ( trunc PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ dtrunc _null_ _null_ _null_ )); DESCR("truncate to integer"); DATA(insert OID = 1344 ( sqrt PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ dsqrt _null_ _null_ _null_ )); DESCR("square root"); DATA(insert OID = 1345 ( cbrt PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ dcbrt _null_ _null_ _null_ )); DESCR("cube root"); DATA(insert OID = 1346 ( pow PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "701 701" _null_ _null_ _null_ _null_ dpow _null_ _null_ _null_ )); DESCR("exponentiation"); DATA(insert OID = 1368 ( power PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "701 701" _null_ _null_ _null_ _null_ dpow _null_ _null_ _null_ )); DESCR("exponentiation"); DATA(insert OID = 1347 ( exp PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ dexp _null_ _null_ _null_ )); DESCR("natural exponential (e^x)"); /* * This form of obj_description is now deprecated, since it will fail if * OIDs are not unique across system catalogs. Use the other form instead. */ DATA(insert OID = 1348 ( obj_description PGNSP PGUID 14 100 0 0 0 f f f f t f s 1 0 25 "26" _null_ _null_ _null_ _null_ "select description from pg_catalog.pg_description where objoid = $1 and objsubid = 0" _null_ _null_ _null_ )); DESCR("deprecated, use two-argument form instead"); DATA(insert OID = 1349 ( oidvectortypes PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 25 "30" _null_ _null_ _null_ _null_ oidvectortypes _null_ _null_ _null_ )); DESCR("print type names of oidvector field"); DATA(insert OID = 1350 ( timetz_in PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 1266 "2275 26 23" _null_ _null_ _null_ _null_ timetz_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 1351 ( timetz_out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "1266" _null_ _null_ _null_ _null_ timetz_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2911 ( timetztypmodin PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "1263" _null_ _null_ _null_ _null_ timetztypmodin _null_ _null_ _null_ )); DESCR("I/O typmod"); DATA(insert OID = 2912 ( timetztypmodout PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "23" _null_ _null_ _null_ _null_ timetztypmodout _null_ _null_ _null_ )); DESCR("I/O typmod"); DATA(insert OID = 1352 ( timetz_eq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1266 1266" _null_ _null_ _null_ _null_ timetz_eq _null_ _null_ _null_ )); DATA(insert OID = 1353 ( timetz_ne PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1266 1266" _null_ _null_ _null_ _null_ timetz_ne _null_ _null_ _null_ )); DATA(insert OID = 1354 ( timetz_lt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1266 1266" _null_ _null_ _null_ _null_ timetz_lt _null_ _null_ _null_ )); DATA(insert OID = 1355 ( timetz_le PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1266 1266" _null_ _null_ _null_ _null_ timetz_le _null_ _null_ _null_ )); DATA(insert OID = 1356 ( timetz_ge PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1266 1266" _null_ _null_ _null_ _null_ timetz_ge _null_ _null_ _null_ )); DATA(insert OID = 1357 ( timetz_gt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1266 1266" _null_ _null_ _null_ _null_ timetz_gt _null_ _null_ _null_ )); DATA(insert OID = 1358 ( timetz_cmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "1266 1266" _null_ _null_ _null_ _null_ timetz_cmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 1359 ( timestamptz PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1184 "1082 1266" _null_ _null_ _null_ _null_ datetimetz_timestamptz _null_ _null_ _null_ )); DESCR("convert date and time with time zone to timestamp with time zone"); DATA(insert OID = 1364 ( time PGNSP PGUID 14 1 0 0 0 f f f f t f s 1 0 1083 "702" _null_ _null_ _null_ _null_ "select cast(cast($1 as timestamp without time zone) as pg_catalog.time)" _null_ _null_ _null_ )); DESCR("convert abstime to time"); DATA(insert OID = 1367 ( character_length PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "1042" _null_ _null_ _null_ _null_ bpcharlen _null_ _null_ _null_ )); DESCR("character length"); DATA(insert OID = 1369 ( character_length PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "25" _null_ _null_ _null_ _null_ textlen _null_ _null_ _null_ )); DESCR("character length"); DATA(insert OID = 1370 ( interval PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1186 "1083" _null_ _null_ _null_ _null_ time_interval _null_ _null_ _null_ )); DESCR("convert time to interval"); DATA(insert OID = 1372 ( char_length PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "1042" _null_ _null_ _null_ _null_ bpcharlen _null_ _null_ _null_ )); DESCR("character length"); DATA(insert OID = 1374 ( octet_length PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "25" _null_ _null_ _null_ _null_ textoctetlen _null_ _null_ _null_ )); DESCR("octet length"); DATA(insert OID = 1375 ( octet_length PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "1042" _null_ _null_ _null_ _null_ bpcharoctetlen _null_ _null_ _null_ )); DESCR("octet length"); DATA(insert OID = 1377 ( time_larger PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1083 "1083 1083" _null_ _null_ _null_ _null_ time_larger _null_ _null_ _null_ )); DESCR("larger of two"); DATA(insert OID = 1378 ( time_smaller PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1083 "1083 1083" _null_ _null_ _null_ _null_ time_smaller _null_ _null_ _null_ )); DESCR("smaller of two"); DATA(insert OID = 1379 ( timetz_larger PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1266 "1266 1266" _null_ _null_ _null_ _null_ timetz_larger _null_ _null_ _null_ )); DESCR("larger of two"); DATA(insert OID = 1380 ( timetz_smaller PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1266 "1266 1266" _null_ _null_ _null_ _null_ timetz_smaller _null_ _null_ _null_ )); DESCR("smaller of two"); DATA(insert OID = 1381 ( char_length PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "25" _null_ _null_ _null_ _null_ textlen _null_ _null_ _null_ )); DESCR("character length"); DATA(insert OID = 1382 ( date_part PGNSP PGUID 14 1 0 0 0 f f f f t f s 2 0 701 "25 702" _null_ _null_ _null_ _null_ "select pg_catalog.date_part($1, cast($2 as timestamp with time zone))" _null_ _null_ _null_ )); DESCR("extract field from abstime"); DATA(insert OID = 1383 ( date_part PGNSP PGUID 14 1 0 0 0 f f f f t f s 2 0 701 "25 703" _null_ _null_ _null_ _null_ "select pg_catalog.date_part($1, cast($2 as pg_catalog.interval))" _null_ _null_ _null_ )); DESCR("extract field from reltime"); DATA(insert OID = 1384 ( date_part PGNSP PGUID 14 1 0 0 0 f f f f t f i 2 0 701 "25 1082" _null_ _null_ _null_ _null_ "select pg_catalog.date_part($1, cast($2 as timestamp without time zone))" _null_ _null_ _null_ )); DESCR("extract field from date"); DATA(insert OID = 1385 ( date_part PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "25 1083" _null_ _null_ _null_ _null_ time_part _null_ _null_ _null_ )); DESCR("extract field from time"); DATA(insert OID = 1386 ( age PGNSP PGUID 14 1 0 0 0 f f f f t f s 1 0 1186 "1184" _null_ _null_ _null_ _null_ "select pg_catalog.age(cast(current_date as timestamp with time zone), $1)" _null_ _null_ _null_ )); DESCR("date difference from today preserving months and years"); DATA(insert OID = 1388 ( timetz PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 1266 "1184" _null_ _null_ _null_ _null_ timestamptz_timetz _null_ _null_ _null_ )); DESCR("convert timestamp with time zone to time with time zone"); DATA(insert OID = 1373 ( isfinite PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 16 "1082" _null_ _null_ _null_ _null_ date_finite _null_ _null_ _null_ )); DESCR("finite date?"); DATA(insert OID = 1389 ( isfinite PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 16 "1184" _null_ _null_ _null_ _null_ timestamp_finite _null_ _null_ _null_ )); DESCR("finite timestamp?"); DATA(insert OID = 1390 ( isfinite PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 16 "1186" _null_ _null_ _null_ _null_ interval_finite _null_ _null_ _null_ )); DESCR("finite interval?"); DATA(insert OID = 1376 ( factorial PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1700 "20" _null_ _null_ _null_ _null_ numeric_fac _null_ _null_ _null_ )); DESCR("factorial"); DATA(insert OID = 1394 ( abs PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 700 "700" _null_ _null_ _null_ _null_ float4abs _null_ _null_ _null_ )); DESCR("absolute value"); DATA(insert OID = 1395 ( abs PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ float8abs _null_ _null_ _null_ )); DESCR("absolute value"); DATA(insert OID = 1396 ( abs PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 20 "20" _null_ _null_ _null_ _null_ int8abs _null_ _null_ _null_ )); DESCR("absolute value"); DATA(insert OID = 1397 ( abs PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "23" _null_ _null_ _null_ _null_ int4abs _null_ _null_ _null_ )); DESCR("absolute value"); DATA(insert OID = 1398 ( abs PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 21 "21" _null_ _null_ _null_ _null_ int2abs _null_ _null_ _null_ )); DESCR("absolute value"); /* OIDS 1400 - 1499 */ DATA(insert OID = 1400 ( name PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 19 "1043" _null_ _null_ _null_ _null_ text_name _null_ _null_ _null_ )); DESCR("convert varchar to name"); DATA(insert OID = 1401 ( varchar PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1043 "19" _null_ _null_ _null_ _null_ name_text _null_ _null_ _null_ )); DESCR("convert name to varchar"); DATA(insert OID = 1402 ( current_schema PGNSP PGUID 12 1 0 0 0 f f f f t f s 0 0 19 "" _null_ _null_ _null_ _null_ current_schema _null_ _null_ _null_ )); DESCR("current schema name"); DATA(insert OID = 1403 ( current_schemas PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 1003 "16" _null_ _null_ _null_ _null_ current_schemas _null_ _null_ _null_ )); DESCR("current schema search list"); DATA(insert OID = 1404 ( overlay PGNSP PGUID 12 1 0 0 0 f f f f t f i 4 0 25 "25 25 23 23" _null_ _null_ _null_ _null_ textoverlay _null_ _null_ _null_ )); DESCR("substitute portion of string"); DATA(insert OID = 1405 ( overlay PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 25 "25 25 23" _null_ _null_ _null_ _null_ textoverlay_no_len _null_ _null_ _null_ )); DESCR("substitute portion of string"); DATA(insert OID = 1406 ( isvertical PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "600 600" _null_ _null_ _null_ _null_ point_vert _null_ _null_ _null_ )); DESCR("vertically aligned"); DATA(insert OID = 1407 ( ishorizontal PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "600 600" _null_ _null_ _null_ _null_ point_horiz _null_ _null_ _null_ )); DESCR("horizontally aligned"); DATA(insert OID = 1408 ( isparallel PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "601 601" _null_ _null_ _null_ _null_ lseg_parallel _null_ _null_ _null_ )); DESCR("parallel"); DATA(insert OID = 1409 ( isperp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "601 601" _null_ _null_ _null_ _null_ lseg_perp _null_ _null_ _null_ )); DESCR("perpendicular"); DATA(insert OID = 1410 ( isvertical PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 16 "601" _null_ _null_ _null_ _null_ lseg_vertical _null_ _null_ _null_ )); DESCR("vertical"); DATA(insert OID = 1411 ( ishorizontal PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 16 "601" _null_ _null_ _null_ _null_ lseg_horizontal _null_ _null_ _null_ )); DESCR("horizontal"); DATA(insert OID = 1412 ( isparallel PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "628 628" _null_ _null_ _null_ _null_ line_parallel _null_ _null_ _null_ )); DESCR("parallel"); DATA(insert OID = 1413 ( isperp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "628 628" _null_ _null_ _null_ _null_ line_perp _null_ _null_ _null_ )); DESCR("perpendicular"); DATA(insert OID = 1414 ( isvertical PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 16 "628" _null_ _null_ _null_ _null_ line_vertical _null_ _null_ _null_ )); DESCR("vertical"); DATA(insert OID = 1415 ( ishorizontal PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 16 "628" _null_ _null_ _null_ _null_ line_horizontal _null_ _null_ _null_ )); DESCR("horizontal"); DATA(insert OID = 1416 ( point PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 600 "718" _null_ _null_ _null_ _null_ circle_center _null_ _null_ _null_ )); DESCR("center of"); DATA(insert OID = 1419 ( time PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1083 "1186" _null_ _null_ _null_ _null_ interval_time _null_ _null_ _null_ )); DESCR("convert interval to time"); DATA(insert OID = 1421 ( box PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 603 "600 600" _null_ _null_ _null_ _null_ points_box _null_ _null_ _null_ )); DESCR("convert points to box"); DATA(insert OID = 1422 ( box_add PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 603 "603 600" _null_ _null_ _null_ _null_ box_add _null_ _null_ _null_ )); DATA(insert OID = 1423 ( box_sub PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 603 "603 600" _null_ _null_ _null_ _null_ box_sub _null_ _null_ _null_ )); DATA(insert OID = 1424 ( box_mul PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 603 "603 600" _null_ _null_ _null_ _null_ box_mul _null_ _null_ _null_ )); DATA(insert OID = 1425 ( box_div PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 603 "603 600" _null_ _null_ _null_ _null_ box_div _null_ _null_ _null_ )); DATA(insert OID = 1426 ( path_contain_pt PGNSP PGUID 14 1 0 0 0 f f f f t f i 2 0 16 "602 600" _null_ _null_ _null_ _null_ "select pg_catalog.on_ppath($2, $1)" _null_ _null_ _null_ )); DATA(insert OID = 1428 ( poly_contain_pt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "604 600" _null_ _null_ _null_ _null_ poly_contain_pt _null_ _null_ _null_ )); DATA(insert OID = 1429 ( pt_contained_poly PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "600 604" _null_ _null_ _null_ _null_ pt_contained_poly _null_ _null_ _null_ )); DATA(insert OID = 1430 ( isclosed PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 16 "602" _null_ _null_ _null_ _null_ path_isclosed _null_ _null_ _null_ )); DESCR("path closed?"); DATA(insert OID = 1431 ( isopen PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 16 "602" _null_ _null_ _null_ _null_ path_isopen _null_ _null_ _null_ )); DESCR("path open?"); DATA(insert OID = 1432 ( path_npoints PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "602" _null_ _null_ _null_ _null_ path_npoints _null_ _null_ _null_ )); /* pclose and popen might better be named close and open, but that crashes initdb. * - thomas 97/04/20 */ DATA(insert OID = 1433 ( pclose PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 602 "602" _null_ _null_ _null_ _null_ path_close _null_ _null_ _null_ )); DESCR("close path"); DATA(insert OID = 1434 ( popen PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 602 "602" _null_ _null_ _null_ _null_ path_open _null_ _null_ _null_ )); DESCR("open path"); DATA(insert OID = 1435 ( path_add PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 602 "602 602" _null_ _null_ _null_ _null_ path_add _null_ _null_ _null_ )); DATA(insert OID = 1436 ( path_add_pt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 602 "602 600" _null_ _null_ _null_ _null_ path_add_pt _null_ _null_ _null_ )); DATA(insert OID = 1437 ( path_sub_pt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 602 "602 600" _null_ _null_ _null_ _null_ path_sub_pt _null_ _null_ _null_ )); DATA(insert OID = 1438 ( path_mul_pt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 602 "602 600" _null_ _null_ _null_ _null_ path_mul_pt _null_ _null_ _null_ )); DATA(insert OID = 1439 ( path_div_pt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 602 "602 600" _null_ _null_ _null_ _null_ path_div_pt _null_ _null_ _null_ )); DATA(insert OID = 1440 ( point PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 600 "701 701" _null_ _null_ _null_ _null_ construct_point _null_ _null_ _null_ )); DESCR("convert x, y to point"); DATA(insert OID = 1441 ( point_add PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 600 "600 600" _null_ _null_ _null_ _null_ point_add _null_ _null_ _null_ )); DATA(insert OID = 1442 ( point_sub PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 600 "600 600" _null_ _null_ _null_ _null_ point_sub _null_ _null_ _null_ )); DATA(insert OID = 1443 ( point_mul PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 600 "600 600" _null_ _null_ _null_ _null_ point_mul _null_ _null_ _null_ )); DATA(insert OID = 1444 ( point_div PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 600 "600 600" _null_ _null_ _null_ _null_ point_div _null_ _null_ _null_ )); DATA(insert OID = 1445 ( poly_npoints PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "604" _null_ _null_ _null_ _null_ poly_npoints _null_ _null_ _null_ )); DATA(insert OID = 1446 ( box PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 603 "604" _null_ _null_ _null_ _null_ poly_box _null_ _null_ _null_ )); DESCR("convert polygon to bounding box"); DATA(insert OID = 1447 ( path PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 602 "604" _null_ _null_ _null_ _null_ poly_path _null_ _null_ _null_ )); DESCR("convert polygon to path"); DATA(insert OID = 1448 ( polygon PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 604 "603" _null_ _null_ _null_ _null_ box_poly _null_ _null_ _null_ )); DESCR("convert box to polygon"); DATA(insert OID = 1449 ( polygon PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 604 "602" _null_ _null_ _null_ _null_ path_poly _null_ _null_ _null_ )); DESCR("convert path to polygon"); DATA(insert OID = 1450 ( circle_in PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 718 "2275" _null_ _null_ _null_ _null_ circle_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 1451 ( circle_out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "718" _null_ _null_ _null_ _null_ circle_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 1452 ( circle_same PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "718 718" _null_ _null_ _null_ _null_ circle_same _null_ _null_ _null_ )); DATA(insert OID = 1453 ( circle_contain PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "718 718" _null_ _null_ _null_ _null_ circle_contain _null_ _null_ _null_ )); DATA(insert OID = 1454 ( circle_left PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "718 718" _null_ _null_ _null_ _null_ circle_left _null_ _null_ _null_ )); DATA(insert OID = 1455 ( circle_overleft PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "718 718" _null_ _null_ _null_ _null_ circle_overleft _null_ _null_ _null_ )); DATA(insert OID = 1456 ( circle_overright PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "718 718" _null_ _null_ _null_ _null_ circle_overright _null_ _null_ _null_ )); DATA(insert OID = 1457 ( circle_right PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "718 718" _null_ _null_ _null_ _null_ circle_right _null_ _null_ _null_ )); DATA(insert OID = 1458 ( circle_contained PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "718 718" _null_ _null_ _null_ _null_ circle_contained _null_ _null_ _null_ )); DATA(insert OID = 1459 ( circle_overlap PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "718 718" _null_ _null_ _null_ _null_ circle_overlap _null_ _null_ _null_ )); DATA(insert OID = 1460 ( circle_below PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "718 718" _null_ _null_ _null_ _null_ circle_below _null_ _null_ _null_ )); DATA(insert OID = 1461 ( circle_above PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "718 718" _null_ _null_ _null_ _null_ circle_above _null_ _null_ _null_ )); DATA(insert OID = 1462 ( circle_eq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "718 718" _null_ _null_ _null_ _null_ circle_eq _null_ _null_ _null_ )); DATA(insert OID = 1463 ( circle_ne PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "718 718" _null_ _null_ _null_ _null_ circle_ne _null_ _null_ _null_ )); DATA(insert OID = 1464 ( circle_lt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "718 718" _null_ _null_ _null_ _null_ circle_lt _null_ _null_ _null_ )); DATA(insert OID = 1465 ( circle_gt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "718 718" _null_ _null_ _null_ _null_ circle_gt _null_ _null_ _null_ )); DATA(insert OID = 1466 ( circle_le PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "718 718" _null_ _null_ _null_ _null_ circle_le _null_ _null_ _null_ )); DATA(insert OID = 1467 ( circle_ge PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "718 718" _null_ _null_ _null_ _null_ circle_ge _null_ _null_ _null_ )); DATA(insert OID = 1468 ( area PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "718" _null_ _null_ _null_ _null_ circle_area _null_ _null_ _null_ )); DESCR("area of circle"); DATA(insert OID = 1469 ( diameter PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "718" _null_ _null_ _null_ _null_ circle_diameter _null_ _null_ _null_ )); DESCR("diameter of circle"); DATA(insert OID = 1470 ( radius PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "718" _null_ _null_ _null_ _null_ circle_radius _null_ _null_ _null_ )); DESCR("radius of circle"); DATA(insert OID = 1471 ( circle_distance PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "718 718" _null_ _null_ _null_ _null_ circle_distance _null_ _null_ _null_ )); DATA(insert OID = 1472 ( circle_center PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 600 "718" _null_ _null_ _null_ _null_ circle_center _null_ _null_ _null_ )); DATA(insert OID = 1473 ( circle PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 718 "600 701" _null_ _null_ _null_ _null_ cr_circle _null_ _null_ _null_ )); DESCR("convert point and radius to circle"); DATA(insert OID = 1474 ( circle PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 718 "604" _null_ _null_ _null_ _null_ poly_circle _null_ _null_ _null_ )); DESCR("convert polygon to circle"); DATA(insert OID = 1475 ( polygon PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 604 "23 718" _null_ _null_ _null_ _null_ circle_poly _null_ _null_ _null_ )); DESCR("convert vertex count and circle to polygon"); DATA(insert OID = 1476 ( dist_pc PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "600 718" _null_ _null_ _null_ _null_ dist_pc _null_ _null_ _null_ )); DATA(insert OID = 1477 ( circle_contain_pt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "718 600" _null_ _null_ _null_ _null_ circle_contain_pt _null_ _null_ _null_ )); DATA(insert OID = 1478 ( pt_contained_circle PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "600 718" _null_ _null_ _null_ _null_ pt_contained_circle _null_ _null_ _null_ )); DATA(insert OID = 1479 ( circle PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 718 "603" _null_ _null_ _null_ _null_ box_circle _null_ _null_ _null_ )); DESCR("convert box to circle"); DATA(insert OID = 1480 ( box PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 603 "718" _null_ _null_ _null_ _null_ circle_box _null_ _null_ _null_ )); DESCR("convert circle to box"); DATA(insert OID = 1481 ( tinterval PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 704 "702 702" _null_ _null_ _null_ _null_ mktinterval _null_ _null_ _null_ )); DESCR("convert to tinterval"); DATA(insert OID = 1482 ( lseg_ne PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "601 601" _null_ _null_ _null_ _null_ lseg_ne _null_ _null_ _null_ )); DATA(insert OID = 1483 ( lseg_lt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "601 601" _null_ _null_ _null_ _null_ lseg_lt _null_ _null_ _null_ )); DATA(insert OID = 1484 ( lseg_le PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "601 601" _null_ _null_ _null_ _null_ lseg_le _null_ _null_ _null_ )); DATA(insert OID = 1485 ( lseg_gt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "601 601" _null_ _null_ _null_ _null_ lseg_gt _null_ _null_ _null_ )); DATA(insert OID = 1486 ( lseg_ge PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "601 601" _null_ _null_ _null_ _null_ lseg_ge _null_ _null_ _null_ )); DATA(insert OID = 1487 ( lseg_length PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "601" _null_ _null_ _null_ _null_ lseg_length _null_ _null_ _null_ )); DATA(insert OID = 1488 ( close_ls PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 600 "628 601" _null_ _null_ _null_ _null_ close_ls _null_ _null_ _null_ )); DATA(insert OID = 1489 ( close_lseg PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 600 "601 601" _null_ _null_ _null_ _null_ close_lseg _null_ _null_ _null_ )); DATA(insert OID = 1490 ( line_in PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 628 "2275" _null_ _null_ _null_ _null_ line_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 1491 ( line_out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "628" _null_ _null_ _null_ _null_ line_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 1492 ( line_eq PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "628 628" _null_ _null_ _null_ _null_ line_eq _null_ _null_ _null_ )); DATA(insert OID = 1493 ( line PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 628 "600 600" _null_ _null_ _null_ _null_ line_construct_pp _null_ _null_ _null_ )); DESCR("construct line from points"); DATA(insert OID = 1494 ( line_interpt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 600 "628 628" _null_ _null_ _null_ _null_ line_interpt _null_ _null_ _null_ )); DATA(insert OID = 1495 ( line_intersect PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "628 628" _null_ _null_ _null_ _null_ line_intersect _null_ _null_ _null_ )); DATA(insert OID = 1496 ( line_parallel PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "628 628" _null_ _null_ _null_ _null_ line_parallel _null_ _null_ _null_ )); DATA(insert OID = 1497 ( line_perp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "628 628" _null_ _null_ _null_ _null_ line_perp _null_ _null_ _null_ )); DATA(insert OID = 1498 ( line_vertical PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 16 "628" _null_ _null_ _null_ _null_ line_vertical _null_ _null_ _null_ )); DATA(insert OID = 1499 ( line_horizontal PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 16 "628" _null_ _null_ _null_ _null_ line_horizontal _null_ _null_ _null_ )); /* OIDS 1500 - 1599 */ DATA(insert OID = 1530 ( length PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "601" _null_ _null_ _null_ _null_ lseg_length _null_ _null_ _null_ )); DESCR("distance between endpoints"); DATA(insert OID = 1531 ( length PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "602" _null_ _null_ _null_ _null_ path_length _null_ _null_ _null_ )); DESCR("sum of path segments"); DATA(insert OID = 1532 ( point PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 600 "601" _null_ _null_ _null_ _null_ lseg_center _null_ _null_ _null_ )); DESCR("center of"); DATA(insert OID = 1533 ( point PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 600 "602" _null_ _null_ _null_ _null_ path_center _null_ _null_ _null_ )); DESCR("center of"); DATA(insert OID = 1534 ( point PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 600 "603" _null_ _null_ _null_ _null_ box_center _null_ _null_ _null_ )); DESCR("center of"); DATA(insert OID = 1540 ( point PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 600 "604" _null_ _null_ _null_ _null_ poly_center _null_ _null_ _null_ )); DESCR("center of"); DATA(insert OID = 1541 ( lseg PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 601 "603" _null_ _null_ _null_ _null_ box_diagonal _null_ _null_ _null_ )); DESCR("diagonal of"); DATA(insert OID = 1542 ( center PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 600 "603" _null_ _null_ _null_ _null_ box_center _null_ _null_ _null_ )); DESCR("center of"); DATA(insert OID = 1543 ( center PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 600 "718" _null_ _null_ _null_ _null_ circle_center _null_ _null_ _null_ )); DESCR("center of"); DATA(insert OID = 1544 ( polygon PGNSP PGUID 14 1 0 0 0 f f f f t f i 1 0 604 "718" _null_ _null_ _null_ _null_ "select pg_catalog.polygon(12, $1)" _null_ _null_ _null_ )); DESCR("convert circle to 12-vertex polygon"); DATA(insert OID = 1545 ( npoints PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "602" _null_ _null_ _null_ _null_ path_npoints _null_ _null_ _null_ )); DESCR("number of points"); DATA(insert OID = 1556 ( npoints PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "604" _null_ _null_ _null_ _null_ poly_npoints _null_ _null_ _null_ )); DESCR("number of points"); DATA(insert OID = 1564 ( bit_in PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 1560 "2275 26 23" _null_ _null_ _null_ _null_ bit_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 1565 ( bit_out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "1560" _null_ _null_ _null_ _null_ bit_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2919 ( bittypmodin PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "1263" _null_ _null_ _null_ _null_ bittypmodin _null_ _null_ _null_ )); DESCR("I/O typmod"); DATA(insert OID = 2920 ( bittypmodout PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "23" _null_ _null_ _null_ _null_ bittypmodout _null_ _null_ _null_ )); DESCR("I/O typmod"); DATA(insert OID = 1569 ( like PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "25 25" _null_ _null_ _null_ _null_ textlike _null_ _null_ _null_ )); DESCR("matches LIKE expression"); DATA(insert OID = 1570 ( notlike PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "25 25" _null_ _null_ _null_ _null_ textnlike _null_ _null_ _null_ )); DESCR("does not match LIKE expression"); DATA(insert OID = 1571 ( like PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "19 25" _null_ _null_ _null_ _null_ namelike _null_ _null_ _null_ )); DESCR("matches LIKE expression"); DATA(insert OID = 1572 ( notlike PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "19 25" _null_ _null_ _null_ _null_ namenlike _null_ _null_ _null_ )); DESCR("does not match LIKE expression"); /* SEQUENCE functions */ DATA(insert OID = 1574 ( nextval PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 20 "2205" _null_ _null_ _null_ _null_ nextval_oid _null_ _null_ _null_ )); DESCR("sequence next value"); DATA(insert OID = 1575 ( currval PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 20 "2205" _null_ _null_ _null_ _null_ currval_oid _null_ _null_ _null_ )); DESCR("sequence current value"); DATA(insert OID = 1576 ( setval PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 20 "2205 20" _null_ _null_ _null_ _null_ setval_oid _null_ _null_ _null_ )); DESCR("set sequence value"); DATA(insert OID = 1765 ( setval PGNSP PGUID 12 1 0 0 0 f f f f t f v 3 0 20 "2205 20 16" _null_ _null_ _null_ _null_ setval3_oid _null_ _null_ _null_ )); DESCR("set sequence value and is_called status"); DATA(insert OID = 3078 ( pg_sequence_parameters PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 2249 "26" "{26,20,20,20,20,16}" "{i,o,o,o,o,o}" "{sequence_oid,start_value,minimum_value,maximum_value,increment,cycle_option}" _null_ pg_sequence_parameters _null_ _null_ _null_)); DESCR("sequence parameters, for use by information schema"); DATA(insert OID = 1579 ( varbit_in PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 1562 "2275 26 23" _null_ _null_ _null_ _null_ varbit_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 1580 ( varbit_out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "1562" _null_ _null_ _null_ _null_ varbit_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2902 ( varbittypmodin PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "1263" _null_ _null_ _null_ _null_ varbittypmodin _null_ _null_ _null_ )); DESCR("I/O typmod"); DATA(insert OID = 2921 ( varbittypmodout PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "23" _null_ _null_ _null_ _null_ varbittypmodout _null_ _null_ _null_ )); DESCR("I/O typmod"); DATA(insert OID = 1581 ( biteq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1560 1560" _null_ _null_ _null_ _null_ biteq _null_ _null_ _null_ )); DATA(insert OID = 1582 ( bitne PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1560 1560" _null_ _null_ _null_ _null_ bitne _null_ _null_ _null_ )); DATA(insert OID = 1592 ( bitge PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1560 1560" _null_ _null_ _null_ _null_ bitge _null_ _null_ _null_ )); DATA(insert OID = 1593 ( bitgt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1560 1560" _null_ _null_ _null_ _null_ bitgt _null_ _null_ _null_ )); DATA(insert OID = 1594 ( bitle PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1560 1560" _null_ _null_ _null_ _null_ bitle _null_ _null_ _null_ )); DATA(insert OID = 1595 ( bitlt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1560 1560" _null_ _null_ _null_ _null_ bitlt _null_ _null_ _null_ )); DATA(insert OID = 1596 ( bitcmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "1560 1560" _null_ _null_ _null_ _null_ bitcmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 1598 ( random PGNSP PGUID 12 1 0 0 0 f f f f t f v 0 0 701 "" _null_ _null_ _null_ _null_ drandom _null_ _null_ _null_ )); DESCR("random value"); DATA(insert OID = 1599 ( setseed PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 2278 "701" _null_ _null_ _null_ _null_ setseed _null_ _null_ _null_ )); DESCR("set random seed"); /* OIDS 1600 - 1699 */ DATA(insert OID = 1600 ( asin PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ dasin _null_ _null_ _null_ )); DESCR("arcsine"); DATA(insert OID = 1601 ( acos PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ dacos _null_ _null_ _null_ )); DESCR("arccosine"); DATA(insert OID = 1602 ( atan PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ datan _null_ _null_ _null_ )); DESCR("arctangent"); DATA(insert OID = 1603 ( atan2 PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "701 701" _null_ _null_ _null_ _null_ datan2 _null_ _null_ _null_ )); DESCR("arctangent, two arguments"); DATA(insert OID = 1604 ( sin PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ dsin _null_ _null_ _null_ )); DESCR("sine"); DATA(insert OID = 1605 ( cos PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ dcos _null_ _null_ _null_ )); DESCR("cosine"); DATA(insert OID = 1606 ( tan PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ dtan _null_ _null_ _null_ )); DESCR("tangent"); DATA(insert OID = 1607 ( cot PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ dcot _null_ _null_ _null_ )); DESCR("cotangent"); DATA(insert OID = 1608 ( degrees PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ degrees _null_ _null_ _null_ )); DESCR("radians to degrees"); DATA(insert OID = 1609 ( radians PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ radians _null_ _null_ _null_ )); DESCR("degrees to radians"); DATA(insert OID = 1610 ( pi PGNSP PGUID 12 1 0 0 0 f f f f t f i 0 0 701 "" _null_ _null_ _null_ _null_ dpi _null_ _null_ _null_ )); DESCR("PI"); DATA(insert OID = 1618 ( interval_mul PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1186 "1186 701" _null_ _null_ _null_ _null_ interval_mul _null_ _null_ _null_ )); DATA(insert OID = 1620 ( ascii PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "25" _null_ _null_ _null_ _null_ ascii _null_ _null_ _null_ )); DESCR("convert first char to int4"); DATA(insert OID = 1621 ( chr PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 25 "23" _null_ _null_ _null_ _null_ chr _null_ _null_ _null_ )); DESCR("convert int4 to char"); DATA(insert OID = 1622 ( repeat PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 25 "25 23" _null_ _null_ _null_ _null_ repeat _null_ _null_ _null_ )); DESCR("replicate string n times"); DATA(insert OID = 1623 ( similar_escape PGNSP PGUID 12 1 0 0 0 f f f f f f i 2 0 25 "25 25" _null_ _null_ _null_ _null_ similar_escape _null_ _null_ _null_ )); DESCR("convert SQL99 regexp pattern to POSIX style"); DATA(insert OID = 1624 ( mul_d_interval PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1186 "701 1186" _null_ _null_ _null_ _null_ mul_d_interval _null_ _null_ _null_ )); DATA(insert OID = 1631 ( bpcharlike PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1042 25" _null_ _null_ _null_ _null_ textlike _null_ _null_ _null_ )); DATA(insert OID = 1632 ( bpcharnlike PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1042 25" _null_ _null_ _null_ _null_ textnlike _null_ _null_ _null_ )); DATA(insert OID = 1633 ( texticlike PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "25 25" _null_ _null_ _null_ _null_ texticlike _null_ _null_ _null_ )); DATA(insert OID = 1634 ( texticnlike PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "25 25" _null_ _null_ _null_ _null_ texticnlike _null_ _null_ _null_ )); DATA(insert OID = 1635 ( nameiclike PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "19 25" _null_ _null_ _null_ _null_ nameiclike _null_ _null_ _null_ )); DATA(insert OID = 1636 ( nameicnlike PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "19 25" _null_ _null_ _null_ _null_ nameicnlike _null_ _null_ _null_ )); DATA(insert OID = 1637 ( like_escape PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 25 "25 25" _null_ _null_ _null_ _null_ like_escape _null_ _null_ _null_ )); DESCR("convert LIKE pattern to use backslash escapes"); DATA(insert OID = 1656 ( bpcharicregexeq PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1042 25" _null_ _null_ _null_ _null_ texticregexeq _null_ _null_ _null_ )); DATA(insert OID = 1657 ( bpcharicregexne PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1042 25" _null_ _null_ _null_ _null_ texticregexne _null_ _null_ _null_ )); DATA(insert OID = 1658 ( bpcharregexeq PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1042 25" _null_ _null_ _null_ _null_ textregexeq _null_ _null_ _null_ )); DATA(insert OID = 1659 ( bpcharregexne PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1042 25" _null_ _null_ _null_ _null_ textregexne _null_ _null_ _null_ )); DATA(insert OID = 1660 ( bpchariclike PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1042 25" _null_ _null_ _null_ _null_ texticlike _null_ _null_ _null_ )); DATA(insert OID = 1661 ( bpcharicnlike PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1042 25" _null_ _null_ _null_ _null_ texticnlike _null_ _null_ _null_ )); /* Oracle Compatibility Related Functions - By Edmund Mergl */ DATA(insert OID = 868 ( strpos PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "25 25" _null_ _null_ _null_ _null_ textpos _null_ _null_ _null_ )); DESCR("position of substring"); DATA(insert OID = 870 ( lower PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 25 "25" _null_ _null_ _null_ _null_ lower _null_ _null_ _null_ )); DESCR("lowercase"); DATA(insert OID = 871 ( upper PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 25 "25" _null_ _null_ _null_ _null_ upper _null_ _null_ _null_ )); DESCR("uppercase"); DATA(insert OID = 872 ( initcap PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 25 "25" _null_ _null_ _null_ _null_ initcap _null_ _null_ _null_ )); DESCR("capitalize each word"); DATA(insert OID = 873 ( lpad PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 25 "25 23 25" _null_ _null_ _null_ _null_ lpad _null_ _null_ _null_ )); DESCR("left-pad string to length"); DATA(insert OID = 874 ( rpad PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 25 "25 23 25" _null_ _null_ _null_ _null_ rpad _null_ _null_ _null_ )); DESCR("right-pad string to length"); DATA(insert OID = 875 ( ltrim PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 25 "25 25" _null_ _null_ _null_ _null_ ltrim _null_ _null_ _null_ )); DESCR("trim selected characters from left end of string"); DATA(insert OID = 876 ( rtrim PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 25 "25 25" _null_ _null_ _null_ _null_ rtrim _null_ _null_ _null_ )); DESCR("trim selected characters from right end of string"); DATA(insert OID = 877 ( substr PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 25 "25 23 23" _null_ _null_ _null_ _null_ text_substr _null_ _null_ _null_ )); DESCR("extract portion of string"); DATA(insert OID = 878 ( translate PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 25 "25 25 25" _null_ _null_ _null_ _null_ translate _null_ _null_ _null_ )); DESCR("map a set of characters appearing in string"); DATA(insert OID = 879 ( lpad PGNSP PGUID 14 1 0 0 0 f f f f t f i 2 0 25 "25 23" _null_ _null_ _null_ _null_ "select pg_catalog.lpad($1, $2, '' '')" _null_ _null_ _null_ )); DESCR("left-pad string to length"); DATA(insert OID = 880 ( rpad PGNSP PGUID 14 1 0 0 0 f f f f t f i 2 0 25 "25 23" _null_ _null_ _null_ _null_ "select pg_catalog.rpad($1, $2, '' '')" _null_ _null_ _null_ )); DESCR("right-pad string to length"); DATA(insert OID = 881 ( ltrim PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 25 "25" _null_ _null_ _null_ _null_ ltrim1 _null_ _null_ _null_ )); DESCR("trim spaces from left end of string"); DATA(insert OID = 882 ( rtrim PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 25 "25" _null_ _null_ _null_ _null_ rtrim1 _null_ _null_ _null_ )); DESCR("trim spaces from right end of string"); DATA(insert OID = 883 ( substr PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 25 "25 23" _null_ _null_ _null_ _null_ text_substr_no_len _null_ _null_ _null_ )); DESCR("extract portion of string"); DATA(insert OID = 884 ( btrim PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 25 "25 25" _null_ _null_ _null_ _null_ btrim _null_ _null_ _null_ )); DESCR("trim selected characters from both ends of string"); DATA(insert OID = 885 ( btrim PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 25 "25" _null_ _null_ _null_ _null_ btrim1 _null_ _null_ _null_ )); DESCR("trim spaces from both ends of string"); DATA(insert OID = 936 ( substring PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 25 "25 23 23" _null_ _null_ _null_ _null_ text_substr _null_ _null_ _null_ )); DESCR("extract portion of string"); DATA(insert OID = 937 ( substring PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 25 "25 23" _null_ _null_ _null_ _null_ text_substr_no_len _null_ _null_ _null_ )); DESCR("extract portion of string"); DATA(insert OID = 2087 ( replace PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 25 "25 25 25" _null_ _null_ _null_ _null_ replace_text _null_ _null_ _null_ )); DESCR("replace all occurrences in string of old_substr with new_substr"); DATA(insert OID = 2284 ( regexp_replace PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 25 "25 25 25" _null_ _null_ _null_ _null_ textregexreplace_noopt _null_ _null_ _null_ )); DESCR("replace text using regexp"); DATA(insert OID = 2285 ( regexp_replace PGNSP PGUID 12 1 0 0 0 f f f f t f i 4 0 25 "25 25 25 25" _null_ _null_ _null_ _null_ textregexreplace _null_ _null_ _null_ )); DESCR("replace text using regexp"); DATA(insert OID = 2763 ( regexp_matches PGNSP PGUID 12 1 1 0 0 f f f f t t i 2 0 1009 "25 25" _null_ _null_ _null_ _null_ regexp_matches_no_flags _null_ _null_ _null_ )); DESCR("find all match groups for regexp"); DATA(insert OID = 2764 ( regexp_matches PGNSP PGUID 12 1 10 0 0 f f f f t t i 3 0 1009 "25 25 25" _null_ _null_ _null_ _null_ regexp_matches _null_ _null_ _null_ )); DESCR("find all match groups for regexp"); DATA(insert OID = 2088 ( split_part PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 25 "25 25 23" _null_ _null_ _null_ _null_ split_text _null_ _null_ _null_ )); DESCR("split string by field_sep and return field_num"); DATA(insert OID = 2765 ( regexp_split_to_table PGNSP PGUID 12 1 1000 0 0 f f f f t t i 2 0 25 "25 25" _null_ _null_ _null_ _null_ regexp_split_to_table_no_flags _null_ _null_ _null_ )); DESCR("split string by pattern"); DATA(insert OID = 2766 ( regexp_split_to_table PGNSP PGUID 12 1 1000 0 0 f f f f t t i 3 0 25 "25 25 25" _null_ _null_ _null_ _null_ regexp_split_to_table _null_ _null_ _null_ )); DESCR("split string by pattern"); DATA(insert OID = 2767 ( regexp_split_to_array PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1009 "25 25" _null_ _null_ _null_ _null_ regexp_split_to_array_no_flags _null_ _null_ _null_ )); DESCR("split string by pattern"); DATA(insert OID = 2768 ( regexp_split_to_array PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 1009 "25 25 25" _null_ _null_ _null_ _null_ regexp_split_to_array _null_ _null_ _null_ )); DESCR("split string by pattern"); DATA(insert OID = 2089 ( to_hex PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 25 "23" _null_ _null_ _null_ _null_ to_hex32 _null_ _null_ _null_ )); DESCR("convert int4 number to hex"); DATA(insert OID = 2090 ( to_hex PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 25 "20" _null_ _null_ _null_ _null_ to_hex64 _null_ _null_ _null_ )); DESCR("convert int8 number to hex"); /* for character set encoding support */ /* return database encoding name */ DATA(insert OID = 1039 ( getdatabaseencoding PGNSP PGUID 12 1 0 0 0 f f f f t f s 0 0 19 "" _null_ _null_ _null_ _null_ getdatabaseencoding _null_ _null_ _null_ )); DESCR("encoding name of current database"); /* return client encoding name i.e. session encoding */ DATA(insert OID = 810 ( pg_client_encoding PGNSP PGUID 12 1 0 0 0 f f f f t f s 0 0 19 "" _null_ _null_ _null_ _null_ pg_client_encoding _null_ _null_ _null_ )); DESCR("encoding name of current database"); DATA(insert OID = 1713 ( length PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 23 "17 19" _null_ _null_ _null_ _null_ length_in_encoding _null_ _null_ _null_ )); DESCR("length of string in specified encoding"); DATA(insert OID = 1714 ( convert_from PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 25 "17 19" _null_ _null_ _null_ _null_ pg_convert_from _null_ _null_ _null_ )); DESCR("convert string with specified source encoding name"); DATA(insert OID = 1717 ( convert_to PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 17 "25 19" _null_ _null_ _null_ _null_ pg_convert_to _null_ _null_ _null_ )); DESCR("convert string with specified destination encoding name"); DATA(insert OID = 1813 ( convert PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 17 "17 19 19" _null_ _null_ _null_ _null_ pg_convert _null_ _null_ _null_ )); DESCR("convert string with specified encoding names"); DATA(insert OID = 1264 ( pg_char_to_encoding PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 23 "19" _null_ _null_ _null_ _null_ PG_char_to_encoding _null_ _null_ _null_ )); DESCR("convert encoding name to encoding id"); DATA(insert OID = 1597 ( pg_encoding_to_char PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 19 "23" _null_ _null_ _null_ _null_ PG_encoding_to_char _null_ _null_ _null_ )); DESCR("convert encoding id to encoding name"); DATA(insert OID = 2319 ( pg_encoding_max_length PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "23" _null_ _null_ _null_ _null_ pg_encoding_max_length_sql _null_ _null_ _null_ )); DESCR("maximum octet length of a character in given encoding"); DATA(insert OID = 1638 ( oidgt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "26 26" _null_ _null_ _null_ _null_ oidgt _null_ _null_ _null_ )); DATA(insert OID = 1639 ( oidge PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "26 26" _null_ _null_ _null_ _null_ oidge _null_ _null_ _null_ )); /* System-view support functions */ DATA(insert OID = 1573 ( pg_get_ruledef PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 25 "26" _null_ _null_ _null_ _null_ pg_get_ruledef _null_ _null_ _null_ )); DESCR("source text of a rule"); DATA(insert OID = 1640 ( pg_get_viewdef PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 25 "25" _null_ _null_ _null_ _null_ pg_get_viewdef_name _null_ _null_ _null_ )); DESCR("select statement of a view"); DATA(insert OID = 1641 ( pg_get_viewdef PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 25 "26" _null_ _null_ _null_ _null_ pg_get_viewdef _null_ _null_ _null_ )); DESCR("select statement of a view"); DATA(insert OID = 1642 ( pg_get_userbyid PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 19 "26" _null_ _null_ _null_ _null_ pg_get_userbyid _null_ _null_ _null_ )); DESCR("role name by OID (with fallback)"); DATA(insert OID = 1643 ( pg_get_indexdef PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 25 "26" _null_ _null_ _null_ _null_ pg_get_indexdef _null_ _null_ _null_ )); DESCR("index description"); DATA(insert OID = 1662 ( pg_get_triggerdef PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 25 "26" _null_ _null_ _null_ _null_ pg_get_triggerdef _null_ _null_ _null_ )); DESCR("trigger description"); DATA(insert OID = 1387 ( pg_get_constraintdef PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 25 "26" _null_ _null_ _null_ _null_ pg_get_constraintdef _null_ _null_ _null_ )); DESCR("constraint description"); DATA(insert OID = 1716 ( pg_get_expr PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 25 "194 26" _null_ _null_ _null_ _null_ pg_get_expr _null_ _null_ _null_ )); DESCR("deparse an encoded expression"); DATA(insert OID = 1665 ( pg_get_serial_sequence PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 25 "25 25" _null_ _null_ _null_ _null_ pg_get_serial_sequence _null_ _null_ _null_ )); DESCR("name of sequence for a serial column"); DATA(insert OID = 2098 ( pg_get_functiondef PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 25 "26" _null_ _null_ _null_ _null_ pg_get_functiondef _null_ _null_ _null_ )); DESCR("definition of a function"); DATA(insert OID = 2162 ( pg_get_function_arguments PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 25 "26" _null_ _null_ _null_ _null_ pg_get_function_arguments _null_ _null_ _null_ )); DESCR("argument list of a function"); DATA(insert OID = 2232 ( pg_get_function_identity_arguments PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 25 "26" _null_ _null_ _null_ _null_ pg_get_function_identity_arguments _null_ _null_ _null_ )); DESCR("identity argument list of a function"); DATA(insert OID = 2165 ( pg_get_function_result PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 25 "26" _null_ _null_ _null_ _null_ pg_get_function_result _null_ _null_ _null_ )); DESCR("result type of a function"); DATA(insert OID = 1686 ( pg_get_keywords PGNSP PGUID 12 10 400 0 0 f f f f t t s 0 0 2249 "" "{25,18,25}" "{o,o,o}" "{word,catcode,catdesc}" _null_ pg_get_keywords _null_ _null_ _null_ )); DESCR("list of SQL keywords"); DATA(insert OID = 2289 ( pg_options_to_table PGNSP PGUID 12 1 3 0 0 f f f f t t s 1 0 2249 "1009" "{1009,25,25}" "{i,o,o}" "{options_array,option_name,option_value}" _null_ pg_options_to_table _null_ _null_ _null_ )); DESCR("convert generic options array to name/value table"); DATA(insert OID = 1619 ( pg_typeof PGNSP PGUID 12 1 0 0 0 f f f f f f s 1 0 2206 "2276" _null_ _null_ _null_ _null_ pg_typeof _null_ _null_ _null_ )); DESCR("type of the argument"); DATA(insert OID = 3162 ( pg_collation_for PGNSP PGUID 12 1 0 0 0 f f f f f f s 1 0 25 "2276" _null_ _null_ _null_ _null_ pg_collation_for _null_ _null_ _null_ )); DESCR("collation of the argument; implementation of the COLLATION FOR expression"); /* Deferrable unique constraint trigger */ DATA(insert OID = 1250 ( unique_key_recheck PGNSP PGUID 12 1 0 0 0 f f f f t f v 0 0 2279 "" _null_ _null_ _null_ _null_ unique_key_recheck _null_ _null_ _null_ )); DESCR("deferred UNIQUE constraint check"); /* Generic referential integrity constraint triggers */ DATA(insert OID = 1644 ( RI_FKey_check_ins PGNSP PGUID 12 1 0 0 0 f f f f t f v 0 0 2279 "" _null_ _null_ _null_ _null_ RI_FKey_check_ins _null_ _null_ _null_ )); DESCR("referential integrity FOREIGN KEY ... REFERENCES"); DATA(insert OID = 1645 ( RI_FKey_check_upd PGNSP PGUID 12 1 0 0 0 f f f f t f v 0 0 2279 "" _null_ _null_ _null_ _null_ RI_FKey_check_upd _null_ _null_ _null_ )); DESCR("referential integrity FOREIGN KEY ... REFERENCES"); DATA(insert OID = 1646 ( RI_FKey_cascade_del PGNSP PGUID 12 1 0 0 0 f f f f t f v 0 0 2279 "" _null_ _null_ _null_ _null_ RI_FKey_cascade_del _null_ _null_ _null_ )); DESCR("referential integrity ON DELETE CASCADE"); DATA(insert OID = 1647 ( RI_FKey_cascade_upd PGNSP PGUID 12 1 0 0 0 f f f f t f v 0 0 2279 "" _null_ _null_ _null_ _null_ RI_FKey_cascade_upd _null_ _null_ _null_ )); DESCR("referential integrity ON UPDATE CASCADE"); DATA(insert OID = 1648 ( RI_FKey_restrict_del PGNSP PGUID 12 1 0 0 0 f f f f t f v 0 0 2279 "" _null_ _null_ _null_ _null_ RI_FKey_restrict_del _null_ _null_ _null_ )); DESCR("referential integrity ON DELETE RESTRICT"); DATA(insert OID = 1649 ( RI_FKey_restrict_upd PGNSP PGUID 12 1 0 0 0 f f f f t f v 0 0 2279 "" _null_ _null_ _null_ _null_ RI_FKey_restrict_upd _null_ _null_ _null_ )); DESCR("referential integrity ON UPDATE RESTRICT"); DATA(insert OID = 1650 ( RI_FKey_setnull_del PGNSP PGUID 12 1 0 0 0 f f f f t f v 0 0 2279 "" _null_ _null_ _null_ _null_ RI_FKey_setnull_del _null_ _null_ _null_ )); DESCR("referential integrity ON DELETE SET NULL"); DATA(insert OID = 1651 ( RI_FKey_setnull_upd PGNSP PGUID 12 1 0 0 0 f f f f t f v 0 0 2279 "" _null_ _null_ _null_ _null_ RI_FKey_setnull_upd _null_ _null_ _null_ )); DESCR("referential integrity ON UPDATE SET NULL"); DATA(insert OID = 1652 ( RI_FKey_setdefault_del PGNSP PGUID 12 1 0 0 0 f f f f t f v 0 0 2279 "" _null_ _null_ _null_ _null_ RI_FKey_setdefault_del _null_ _null_ _null_ )); DESCR("referential integrity ON DELETE SET DEFAULT"); DATA(insert OID = 1653 ( RI_FKey_setdefault_upd PGNSP PGUID 12 1 0 0 0 f f f f t f v 0 0 2279 "" _null_ _null_ _null_ _null_ RI_FKey_setdefault_upd _null_ _null_ _null_ )); DESCR("referential integrity ON UPDATE SET DEFAULT"); DATA(insert OID = 1654 ( RI_FKey_noaction_del PGNSP PGUID 12 1 0 0 0 f f f f t f v 0 0 2279 "" _null_ _null_ _null_ _null_ RI_FKey_noaction_del _null_ _null_ _null_ )); DESCR("referential integrity ON DELETE NO ACTION"); DATA(insert OID = 1655 ( RI_FKey_noaction_upd PGNSP PGUID 12 1 0 0 0 f f f f t f v 0 0 2279 "" _null_ _null_ _null_ _null_ RI_FKey_noaction_upd _null_ _null_ _null_ )); DESCR("referential integrity ON UPDATE NO ACTION"); DATA(insert OID = 1666 ( varbiteq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1562 1562" _null_ _null_ _null_ _null_ biteq _null_ _null_ _null_ )); DATA(insert OID = 1667 ( varbitne PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1562 1562" _null_ _null_ _null_ _null_ bitne _null_ _null_ _null_ )); DATA(insert OID = 1668 ( varbitge PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1562 1562" _null_ _null_ _null_ _null_ bitge _null_ _null_ _null_ )); DATA(insert OID = 1669 ( varbitgt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1562 1562" _null_ _null_ _null_ _null_ bitgt _null_ _null_ _null_ )); DATA(insert OID = 1670 ( varbitle PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1562 1562" _null_ _null_ _null_ _null_ bitle _null_ _null_ _null_ )); DATA(insert OID = 1671 ( varbitlt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1562 1562" _null_ _null_ _null_ _null_ bitlt _null_ _null_ _null_ )); DATA(insert OID = 1672 ( varbitcmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "1562 1562" _null_ _null_ _null_ _null_ bitcmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 1673 ( bitand PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1560 "1560 1560" _null_ _null_ _null_ _null_ bit_and _null_ _null_ _null_ )); DATA(insert OID = 1674 ( bitor PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1560 "1560 1560" _null_ _null_ _null_ _null_ bit_or _null_ _null_ _null_ )); DATA(insert OID = 1675 ( bitxor PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1560 "1560 1560" _null_ _null_ _null_ _null_ bitxor _null_ _null_ _null_ )); DATA(insert OID = 1676 ( bitnot PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1560 "1560" _null_ _null_ _null_ _null_ bitnot _null_ _null_ _null_ )); DATA(insert OID = 1677 ( bitshiftleft PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1560 "1560 23" _null_ _null_ _null_ _null_ bitshiftleft _null_ _null_ _null_ )); DATA(insert OID = 1678 ( bitshiftright PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1560 "1560 23" _null_ _null_ _null_ _null_ bitshiftright _null_ _null_ _null_ )); DATA(insert OID = 1679 ( bitcat PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1562 "1562 1562" _null_ _null_ _null_ _null_ bitcat _null_ _null_ _null_ )); DATA(insert OID = 1680 ( substring PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 1560 "1560 23 23" _null_ _null_ _null_ _null_ bitsubstr _null_ _null_ _null_ )); DESCR("extract portion of bitstring"); DATA(insert OID = 1681 ( length PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "1560" _null_ _null_ _null_ _null_ bitlength _null_ _null_ _null_ )); DESCR("bitstring length"); DATA(insert OID = 1682 ( octet_length PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "1560" _null_ _null_ _null_ _null_ bitoctetlength _null_ _null_ _null_ )); DESCR("octet length"); DATA(insert OID = 1683 ( bit PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1560 "23 23" _null_ _null_ _null_ _null_ bitfromint4 _null_ _null_ _null_ )); DESCR("convert int4 to bitstring"); DATA(insert OID = 1684 ( int4 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "1560" _null_ _null_ _null_ _null_ bittoint4 _null_ _null_ _null_ )); DESCR("convert bitstring to int4"); DATA(insert OID = 1685 ( bit PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 1560 "1560 23 16" _null_ _null_ _null_ _null_ bit _null_ _null_ _null_ )); DESCR("adjust bit() to typmod length"); DATA(insert OID = 3158 ( varbit_transform PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2281 "2281" _null_ _null_ _null_ _null_ varbit_transform _null_ _null_ _null_ )); DESCR("transform a varbit length coercion"); DATA(insert OID = 1687 ( varbit PGNSP PGUID 12 1 0 0 varbit_transform f f f f t f i 3 0 1562 "1562 23 16" _null_ _null_ _null_ _null_ varbit _null_ _null_ _null_ )); DESCR("adjust varbit() to typmod length"); DATA(insert OID = 1698 ( position PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "1560 1560" _null_ _null_ _null_ _null_ bitposition _null_ _null_ _null_ )); DESCR("position of sub-bitstring"); DATA(insert OID = 1699 ( substring PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1560 "1560 23" _null_ _null_ _null_ _null_ bitsubstr_no_len _null_ _null_ _null_ )); DESCR("extract portion of bitstring"); DATA(insert OID = 3030 ( overlay PGNSP PGUID 12 1 0 0 0 f f f f t f i 4 0 1560 "1560 1560 23 23" _null_ _null_ _null_ _null_ bitoverlay _null_ _null_ _null_ )); DESCR("substitute portion of bitstring"); DATA(insert OID = 3031 ( overlay PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 1560 "1560 1560 23" _null_ _null_ _null_ _null_ bitoverlay_no_len _null_ _null_ _null_ )); DESCR("substitute portion of bitstring"); DATA(insert OID = 3032 ( get_bit PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "1560 23" _null_ _null_ _null_ _null_ bitgetbit _null_ _null_ _null_ )); DESCR("get bit"); DATA(insert OID = 3033 ( set_bit PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 1560 "1560 23 23" _null_ _null_ _null_ _null_ bitsetbit _null_ _null_ _null_ )); DESCR("set bit"); /* for mac type support */ DATA(insert OID = 436 ( macaddr_in PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 829 "2275" _null_ _null_ _null_ _null_ macaddr_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 437 ( macaddr_out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "829" _null_ _null_ _null_ _null_ macaddr_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 753 ( trunc PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 829 "829" _null_ _null_ _null_ _null_ macaddr_trunc _null_ _null_ _null_ )); DESCR("MAC manufacturer fields"); DATA(insert OID = 830 ( macaddr_eq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "829 829" _null_ _null_ _null_ _null_ macaddr_eq _null_ _null_ _null_ )); DATA(insert OID = 831 ( macaddr_lt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "829 829" _null_ _null_ _null_ _null_ macaddr_lt _null_ _null_ _null_ )); DATA(insert OID = 832 ( macaddr_le PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "829 829" _null_ _null_ _null_ _null_ macaddr_le _null_ _null_ _null_ )); DATA(insert OID = 833 ( macaddr_gt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "829 829" _null_ _null_ _null_ _null_ macaddr_gt _null_ _null_ _null_ )); DATA(insert OID = 834 ( macaddr_ge PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "829 829" _null_ _null_ _null_ _null_ macaddr_ge _null_ _null_ _null_ )); DATA(insert OID = 835 ( macaddr_ne PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "829 829" _null_ _null_ _null_ _null_ macaddr_ne _null_ _null_ _null_ )); DATA(insert OID = 836 ( macaddr_cmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "829 829" _null_ _null_ _null_ _null_ macaddr_cmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 3144 ( macaddr_not PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 829 "829" _null_ _null_ _null_ _null_ macaddr_not _null_ _null_ _null_ )); DATA(insert OID = 3145 ( macaddr_and PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 829 "829 829" _null_ _null_ _null_ _null_ macaddr_and _null_ _null_ _null_ )); DATA(insert OID = 3146 ( macaddr_or PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 829 "829 829" _null_ _null_ _null_ _null_ macaddr_or _null_ _null_ _null_ )); /* for inet type support */ DATA(insert OID = 910 ( inet_in PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 869 "2275" _null_ _null_ _null_ _null_ inet_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 911 ( inet_out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "869" _null_ _null_ _null_ _null_ inet_out _null_ _null_ _null_ )); DESCR("I/O"); /* for cidr type support */ DATA(insert OID = 1267 ( cidr_in PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 650 "2275" _null_ _null_ _null_ _null_ cidr_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 1427 ( cidr_out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "650" _null_ _null_ _null_ _null_ cidr_out _null_ _null_ _null_ )); DESCR("I/O"); /* these are used for both inet and cidr */ DATA(insert OID = 920 ( network_eq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "869 869" _null_ _null_ _null_ _null_ network_eq _null_ _null_ _null_ )); DATA(insert OID = 921 ( network_lt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "869 869" _null_ _null_ _null_ _null_ network_lt _null_ _null_ _null_ )); DATA(insert OID = 922 ( network_le PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "869 869" _null_ _null_ _null_ _null_ network_le _null_ _null_ _null_ )); DATA(insert OID = 923 ( network_gt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "869 869" _null_ _null_ _null_ _null_ network_gt _null_ _null_ _null_ )); DATA(insert OID = 924 ( network_ge PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "869 869" _null_ _null_ _null_ _null_ network_ge _null_ _null_ _null_ )); DATA(insert OID = 925 ( network_ne PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "869 869" _null_ _null_ _null_ _null_ network_ne _null_ _null_ _null_ )); DATA(insert OID = 926 ( network_cmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "869 869" _null_ _null_ _null_ _null_ network_cmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 927 ( network_sub PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "869 869" _null_ _null_ _null_ _null_ network_sub _null_ _null_ _null_ )); DATA(insert OID = 928 ( network_subeq PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "869 869" _null_ _null_ _null_ _null_ network_subeq _null_ _null_ _null_ )); DATA(insert OID = 929 ( network_sup PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "869 869" _null_ _null_ _null_ _null_ network_sup _null_ _null_ _null_ )); DATA(insert OID = 930 ( network_supeq PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "869 869" _null_ _null_ _null_ _null_ network_supeq _null_ _null_ _null_ )); /* inet/cidr functions */ DATA(insert OID = 598 ( abbrev PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 25 "869" _null_ _null_ _null_ _null_ inet_abbrev _null_ _null_ _null_ )); DESCR("abbreviated display of inet value"); DATA(insert OID = 599 ( abbrev PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 25 "650" _null_ _null_ _null_ _null_ cidr_abbrev _null_ _null_ _null_ )); DESCR("abbreviated display of cidr value"); DATA(insert OID = 605 ( set_masklen PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 869 "869 23" _null_ _null_ _null_ _null_ inet_set_masklen _null_ _null_ _null_ )); DESCR("change netmask of inet"); DATA(insert OID = 635 ( set_masklen PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 650 "650 23" _null_ _null_ _null_ _null_ cidr_set_masklen _null_ _null_ _null_ )); DESCR("change netmask of cidr"); DATA(insert OID = 711 ( family PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "869" _null_ _null_ _null_ _null_ network_family _null_ _null_ _null_ )); DESCR("address family (4 for IPv4, 6 for IPv6)"); DATA(insert OID = 683 ( network PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 650 "869" _null_ _null_ _null_ _null_ network_network _null_ _null_ _null_ )); DESCR("network part of address"); DATA(insert OID = 696 ( netmask PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 869 "869" _null_ _null_ _null_ _null_ network_netmask _null_ _null_ _null_ )); DESCR("netmask of address"); DATA(insert OID = 697 ( masklen PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "869" _null_ _null_ _null_ _null_ network_masklen _null_ _null_ _null_ )); DESCR("netmask length"); DATA(insert OID = 698 ( broadcast PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 869 "869" _null_ _null_ _null_ _null_ network_broadcast _null_ _null_ _null_ )); DESCR("broadcast address of network"); DATA(insert OID = 699 ( host PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 25 "869" _null_ _null_ _null_ _null_ network_host _null_ _null_ _null_ )); DESCR("show address octets only"); DATA(insert OID = 730 ( text PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 25 "869" _null_ _null_ _null_ _null_ network_show _null_ _null_ _null_ )); DESCR("show all parts of inet/cidr value"); DATA(insert OID = 1362 ( hostmask PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 869 "869" _null_ _null_ _null_ _null_ network_hostmask _null_ _null_ _null_ )); DESCR("hostmask of address"); DATA(insert OID = 1715 ( cidr PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 650 "869" _null_ _null_ _null_ _null_ inet_to_cidr _null_ _null_ _null_ )); DESCR("convert inet to cidr"); DATA(insert OID = 2196 ( inet_client_addr PGNSP PGUID 12 1 0 0 0 f f f f f f s 0 0 869 "" _null_ _null_ _null_ _null_ inet_client_addr _null_ _null_ _null_ )); DESCR("inet address of the client"); DATA(insert OID = 2197 ( inet_client_port PGNSP PGUID 12 1 0 0 0 f f f f f f s 0 0 23 "" _null_ _null_ _null_ _null_ inet_client_port _null_ _null_ _null_ )); DESCR("client's port number for this connection"); DATA(insert OID = 2198 ( inet_server_addr PGNSP PGUID 12 1 0 0 0 f f f f f f s 0 0 869 "" _null_ _null_ _null_ _null_ inet_server_addr _null_ _null_ _null_ )); DESCR("inet address of the server"); DATA(insert OID = 2199 ( inet_server_port PGNSP PGUID 12 1 0 0 0 f f f f f f s 0 0 23 "" _null_ _null_ _null_ _null_ inet_server_port _null_ _null_ _null_ )); DESCR("server's port number for this connection"); DATA(insert OID = 2627 ( inetnot PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 869 "869" _null_ _null_ _null_ _null_ inetnot _null_ _null_ _null_ )); DATA(insert OID = 2628 ( inetand PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 869 "869 869" _null_ _null_ _null_ _null_ inetand _null_ _null_ _null_ )); DATA(insert OID = 2629 ( inetor PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 869 "869 869" _null_ _null_ _null_ _null_ inetor _null_ _null_ _null_ )); DATA(insert OID = 2630 ( inetpl PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 869 "869 20" _null_ _null_ _null_ _null_ inetpl _null_ _null_ _null_ )); DATA(insert OID = 2631 ( int8pl_inet PGNSP PGUID 14 1 0 0 0 f f f f t f i 2 0 869 "20 869" _null_ _null_ _null_ _null_ "select $2 + $1" _null_ _null_ _null_ )); DATA(insert OID = 2632 ( inetmi_int8 PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 869 "869 20" _null_ _null_ _null_ _null_ inetmi_int8 _null_ _null_ _null_ )); DATA(insert OID = 2633 ( inetmi PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 20 "869 869" _null_ _null_ _null_ _null_ inetmi _null_ _null_ _null_ )); DATA(insert OID = 1690 ( time_mi_time PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1186 "1083 1083" _null_ _null_ _null_ _null_ time_mi_time _null_ _null_ _null_ )); DATA(insert OID = 1691 ( boolle PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "16 16" _null_ _null_ _null_ _null_ boolle _null_ _null_ _null_ )); DATA(insert OID = 1692 ( boolge PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "16 16" _null_ _null_ _null_ _null_ boolge _null_ _null_ _null_ )); DATA(insert OID = 1693 ( btboolcmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "16 16" _null_ _null_ _null_ _null_ btboolcmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 1688 ( time_hash PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "1083" _null_ _null_ _null_ _null_ time_hash _null_ _null_ _null_ )); DESCR("hash"); DATA(insert OID = 1696 ( timetz_hash PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "1266" _null_ _null_ _null_ _null_ timetz_hash _null_ _null_ _null_ )); DESCR("hash"); DATA(insert OID = 1697 ( interval_hash PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "1186" _null_ _null_ _null_ _null_ interval_hash _null_ _null_ _null_ )); DESCR("hash"); /* OID's 1700 - 1799 NUMERIC data type */ DATA(insert OID = 1701 ( numeric_in PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 1700 "2275 26 23" _null_ _null_ _null_ _null_ numeric_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 1702 ( numeric_out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "1700" _null_ _null_ _null_ _null_ numeric_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2917 ( numerictypmodin PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "1263" _null_ _null_ _null_ _null_ numerictypmodin _null_ _null_ _null_ )); DESCR("I/O typmod"); DATA(insert OID = 2918 ( numerictypmodout PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "23" _null_ _null_ _null_ _null_ numerictypmodout _null_ _null_ _null_ )); DESCR("I/O typmod"); DATA(insert OID = 3157 ( numeric_transform PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2281 "2281" _null_ _null_ _null_ _null_ numeric_transform _null_ _null_ _null_ )); DESCR("transform a numeric length coercion"); DATA(insert OID = 1703 ( numeric PGNSP PGUID 12 1 0 0 numeric_transform f f f f t f i 2 0 1700 "1700 23" _null_ _null_ _null_ _null_ numeric _null_ _null_ _null_ )); DESCR("adjust numeric to typmod precision/scale"); DATA(insert OID = 1704 ( numeric_abs PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1700 "1700" _null_ _null_ _null_ _null_ numeric_abs _null_ _null_ _null_ )); DATA(insert OID = 1705 ( abs PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1700 "1700" _null_ _null_ _null_ _null_ numeric_abs _null_ _null_ _null_ )); DESCR("absolute value"); DATA(insert OID = 1706 ( sign PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1700 "1700" _null_ _null_ _null_ _null_ numeric_sign _null_ _null_ _null_ )); DESCR("sign of value"); DATA(insert OID = 1707 ( round PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1700 "1700 23" _null_ _null_ _null_ _null_ numeric_round _null_ _null_ _null_ )); DESCR("value rounded to 'scale'"); DATA(insert OID = 1708 ( round PGNSP PGUID 14 1 0 0 0 f f f f t f i 1 0 1700 "1700" _null_ _null_ _null_ _null_ "select pg_catalog.round($1,0)" _null_ _null_ _null_ )); DESCR("value rounded to 'scale' of zero"); DATA(insert OID = 1709 ( trunc PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1700 "1700 23" _null_ _null_ _null_ _null_ numeric_trunc _null_ _null_ _null_ )); DESCR("value truncated to 'scale'"); DATA(insert OID = 1710 ( trunc PGNSP PGUID 14 1 0 0 0 f f f f t f i 1 0 1700 "1700" _null_ _null_ _null_ _null_ "select pg_catalog.trunc($1,0)" _null_ _null_ _null_ )); DESCR("value truncated to 'scale' of zero"); DATA(insert OID = 1711 ( ceil PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1700 "1700" _null_ _null_ _null_ _null_ numeric_ceil _null_ _null_ _null_ )); DESCR("nearest integer >= value"); DATA(insert OID = 2167 ( ceiling PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1700 "1700" _null_ _null_ _null_ _null_ numeric_ceil _null_ _null_ _null_ )); DESCR("nearest integer >= value"); DATA(insert OID = 1712 ( floor PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1700 "1700" _null_ _null_ _null_ _null_ numeric_floor _null_ _null_ _null_ )); DESCR("nearest integer <= value"); DATA(insert OID = 1718 ( numeric_eq PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1700 1700" _null_ _null_ _null_ _null_ numeric_eq _null_ _null_ _null_ )); DATA(insert OID = 1719 ( numeric_ne PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1700 1700" _null_ _null_ _null_ _null_ numeric_ne _null_ _null_ _null_ )); DATA(insert OID = 1720 ( numeric_gt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1700 1700" _null_ _null_ _null_ _null_ numeric_gt _null_ _null_ _null_ )); DATA(insert OID = 1721 ( numeric_ge PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1700 1700" _null_ _null_ _null_ _null_ numeric_ge _null_ _null_ _null_ )); DATA(insert OID = 1722 ( numeric_lt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1700 1700" _null_ _null_ _null_ _null_ numeric_lt _null_ _null_ _null_ )); DATA(insert OID = 1723 ( numeric_le PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1700 1700" _null_ _null_ _null_ _null_ numeric_le _null_ _null_ _null_ )); DATA(insert OID = 1724 ( numeric_add PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1700 "1700 1700" _null_ _null_ _null_ _null_ numeric_add _null_ _null_ _null_ )); DATA(insert OID = 1725 ( numeric_sub PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1700 "1700 1700" _null_ _null_ _null_ _null_ numeric_sub _null_ _null_ _null_ )); DATA(insert OID = 1726 ( numeric_mul PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1700 "1700 1700" _null_ _null_ _null_ _null_ numeric_mul _null_ _null_ _null_ )); DATA(insert OID = 1727 ( numeric_div PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1700 "1700 1700" _null_ _null_ _null_ _null_ numeric_div _null_ _null_ _null_ )); DATA(insert OID = 1728 ( mod PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1700 "1700 1700" _null_ _null_ _null_ _null_ numeric_mod _null_ _null_ _null_ )); DESCR("modulus"); DATA(insert OID = 1729 ( numeric_mod PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1700 "1700 1700" _null_ _null_ _null_ _null_ numeric_mod _null_ _null_ _null_ )); DATA(insert OID = 1730 ( sqrt PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1700 "1700" _null_ _null_ _null_ _null_ numeric_sqrt _null_ _null_ _null_ )); DESCR("square root"); DATA(insert OID = 1731 ( numeric_sqrt PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1700 "1700" _null_ _null_ _null_ _null_ numeric_sqrt _null_ _null_ _null_ )); DESCR("square root"); DATA(insert OID = 1732 ( exp PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1700 "1700" _null_ _null_ _null_ _null_ numeric_exp _null_ _null_ _null_ )); DESCR("natural exponential (e^x)"); DATA(insert OID = 1733 ( numeric_exp PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1700 "1700" _null_ _null_ _null_ _null_ numeric_exp _null_ _null_ _null_ )); DESCR("natural exponential (e^x)"); DATA(insert OID = 1734 ( ln PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1700 "1700" _null_ _null_ _null_ _null_ numeric_ln _null_ _null_ _null_ )); DESCR("natural logarithm"); DATA(insert OID = 1735 ( numeric_ln PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1700 "1700" _null_ _null_ _null_ _null_ numeric_ln _null_ _null_ _null_ )); DESCR("natural logarithm"); DATA(insert OID = 1736 ( log PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1700 "1700 1700" _null_ _null_ _null_ _null_ numeric_log _null_ _null_ _null_ )); DESCR("logarithm base m of n"); DATA(insert OID = 1737 ( numeric_log PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1700 "1700 1700" _null_ _null_ _null_ _null_ numeric_log _null_ _null_ _null_ )); DESCR("logarithm base m of n"); DATA(insert OID = 1738 ( pow PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1700 "1700 1700" _null_ _null_ _null_ _null_ numeric_power _null_ _null_ _null_ )); DESCR("exponentiation"); DATA(insert OID = 2169 ( power PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1700 "1700 1700" _null_ _null_ _null_ _null_ numeric_power _null_ _null_ _null_ )); DESCR("exponentiation"); DATA(insert OID = 1739 ( numeric_power PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1700 "1700 1700" _null_ _null_ _null_ _null_ numeric_power _null_ _null_ _null_ )); DATA(insert OID = 1740 ( numeric PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1700 "23" _null_ _null_ _null_ _null_ int4_numeric _null_ _null_ _null_ )); DESCR("convert int4 to numeric"); DATA(insert OID = 1741 ( log PGNSP PGUID 14 1 0 0 0 f f f f t f i 1 0 1700 "1700" _null_ _null_ _null_ _null_ "select pg_catalog.log(10, $1)" _null_ _null_ _null_ )); DESCR("base 10 logarithm"); DATA(insert OID = 1742 ( numeric PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1700 "700" _null_ _null_ _null_ _null_ float4_numeric _null_ _null_ _null_ )); DESCR("convert float4 to numeric"); DATA(insert OID = 1743 ( numeric PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1700 "701" _null_ _null_ _null_ _null_ float8_numeric _null_ _null_ _null_ )); DESCR("convert float8 to numeric"); DATA(insert OID = 1744 ( int4 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "1700" _null_ _null_ _null_ _null_ numeric_int4 _null_ _null_ _null_ )); DESCR("convert numeric to int4"); DATA(insert OID = 1745 ( float4 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 700 "1700" _null_ _null_ _null_ _null_ numeric_float4 _null_ _null_ _null_ )); DESCR("convert numeric to float4"); DATA(insert OID = 1746 ( float8 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "1700" _null_ _null_ _null_ _null_ numeric_float8 _null_ _null_ _null_ )); DESCR("convert numeric to float8"); DATA(insert OID = 1973 ( div PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1700 "1700 1700" _null_ _null_ _null_ _null_ numeric_div_trunc _null_ _null_ _null_ )); DESCR("trunc(x/y)"); DATA(insert OID = 1980 ( numeric_div_trunc PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1700 "1700 1700" _null_ _null_ _null_ _null_ numeric_div_trunc _null_ _null_ _null_ )); DESCR("trunc(x/y)"); DATA(insert OID = 2170 ( width_bucket PGNSP PGUID 12 1 0 0 0 f f f f t f i 4 0 23 "1700 1700 1700 23" _null_ _null_ _null_ _null_ width_bucket_numeric _null_ _null_ _null_ )); DESCR("bucket number of operand in equidepth histogram"); DATA(insert OID = 1747 ( time_pl_interval PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1083 "1083 1186" _null_ _null_ _null_ _null_ time_pl_interval _null_ _null_ _null_ )); DATA(insert OID = 1748 ( time_mi_interval PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1083 "1083 1186" _null_ _null_ _null_ _null_ time_mi_interval _null_ _null_ _null_ )); DATA(insert OID = 1749 ( timetz_pl_interval PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1266 "1266 1186" _null_ _null_ _null_ _null_ timetz_pl_interval _null_ _null_ _null_ )); DATA(insert OID = 1750 ( timetz_mi_interval PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1266 "1266 1186" _null_ _null_ _null_ _null_ timetz_mi_interval _null_ _null_ _null_ )); DATA(insert OID = 1764 ( numeric_inc PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1700 "1700" _null_ _null_ _null_ _null_ numeric_inc _null_ _null_ _null_ )); DESCR("increment by one"); DATA(insert OID = 1766 ( numeric_smaller PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1700 "1700 1700" _null_ _null_ _null_ _null_ numeric_smaller _null_ _null_ _null_ )); DESCR("smaller of two"); DATA(insert OID = 1767 ( numeric_larger PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1700 "1700 1700" _null_ _null_ _null_ _null_ numeric_larger _null_ _null_ _null_ )); DESCR("larger of two"); DATA(insert OID = 1769 ( numeric_cmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "1700 1700" _null_ _null_ _null_ _null_ numeric_cmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 1771 ( numeric_uminus PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1700 "1700" _null_ _null_ _null_ _null_ numeric_uminus _null_ _null_ _null_ )); DATA(insert OID = 1779 ( int8 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 20 "1700" _null_ _null_ _null_ _null_ numeric_int8 _null_ _null_ _null_ )); DESCR("convert numeric to int8"); DATA(insert OID = 1781 ( numeric PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1700 "20" _null_ _null_ _null_ _null_ int8_numeric _null_ _null_ _null_ )); DESCR("convert int8 to numeric"); DATA(insert OID = 1782 ( numeric PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1700 "21" _null_ _null_ _null_ _null_ int2_numeric _null_ _null_ _null_ )); DESCR("convert int2 to numeric"); DATA(insert OID = 1783 ( int2 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 21 "1700" _null_ _null_ _null_ _null_ numeric_int2 _null_ _null_ _null_ )); DESCR("convert numeric to int2"); /* formatting */ DATA(insert OID = 1770 ( to_char PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 25 "1184 25" _null_ _null_ _null_ _null_ timestamptz_to_char _null_ _null_ _null_ )); DESCR("format timestamp with time zone to text"); DATA(insert OID = 1772 ( to_char PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 25 "1700 25" _null_ _null_ _null_ _null_ numeric_to_char _null_ _null_ _null_ )); DESCR("format numeric to text"); DATA(insert OID = 1773 ( to_char PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 25 "23 25" _null_ _null_ _null_ _null_ int4_to_char _null_ _null_ _null_ )); DESCR("format int4 to text"); DATA(insert OID = 1774 ( to_char PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 25 "20 25" _null_ _null_ _null_ _null_ int8_to_char _null_ _null_ _null_ )); DESCR("format int8 to text"); DATA(insert OID = 1775 ( to_char PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 25 "700 25" _null_ _null_ _null_ _null_ float4_to_char _null_ _null_ _null_ )); DESCR("format float4 to text"); DATA(insert OID = 1776 ( to_char PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 25 "701 25" _null_ _null_ _null_ _null_ float8_to_char _null_ _null_ _null_ )); DESCR("format float8 to text"); DATA(insert OID = 1777 ( to_number PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 1700 "25 25" _null_ _null_ _null_ _null_ numeric_to_number _null_ _null_ _null_ )); DESCR("convert text to numeric"); DATA(insert OID = 1778 ( to_timestamp PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 1184 "25 25" _null_ _null_ _null_ _null_ to_timestamp _null_ _null_ _null_ )); DESCR("convert text to timestamp with time zone"); DATA(insert OID = 1780 ( to_date PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 1082 "25 25" _null_ _null_ _null_ _null_ to_date _null_ _null_ _null_ )); DESCR("convert text to date"); DATA(insert OID = 1768 ( to_char PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 25 "1186 25" _null_ _null_ _null_ _null_ interval_to_char _null_ _null_ _null_ )); DESCR("format interval to text"); DATA(insert OID = 1282 ( quote_ident PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 25 "25" _null_ _null_ _null_ _null_ quote_ident _null_ _null_ _null_ )); DESCR("quote an identifier for usage in a querystring"); DATA(insert OID = 1283 ( quote_literal PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 25 "25" _null_ _null_ _null_ _null_ quote_literal _null_ _null_ _null_ )); DESCR("quote a literal for usage in a querystring"); DATA(insert OID = 1285 ( quote_literal PGNSP PGUID 14 1 0 0 0 f f f f t f s 1 0 25 "2283" _null_ _null_ _null_ _null_ "select pg_catalog.quote_literal($1::pg_catalog.text)" _null_ _null_ _null_ )); DESCR("quote a data value for usage in a querystring"); DATA(insert OID = 1289 ( quote_nullable PGNSP PGUID 12 1 0 0 0 f f f f f f i 1 0 25 "25" _null_ _null_ _null_ _null_ quote_nullable _null_ _null_ _null_ )); DESCR("quote a possibly-null literal for usage in a querystring"); DATA(insert OID = 1290 ( quote_nullable PGNSP PGUID 14 1 0 0 0 f f f f f f s 1 0 25 "2283" _null_ _null_ _null_ _null_ "select pg_catalog.quote_nullable($1::pg_catalog.text)" _null_ _null_ _null_ )); DESCR("quote a possibly-null data value for usage in a querystring"); DATA(insert OID = 1798 ( oidin PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 26 "2275" _null_ _null_ _null_ _null_ oidin _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 1799 ( oidout PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "26" _null_ _null_ _null_ _null_ oidout _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 3058 ( concat PGNSP PGUID 12 1 0 2276 0 f f f f f f s 1 0 25 "2276" "{2276}" "{v}" _null_ _null_ text_concat _null_ _null_ _null_ )); DESCR("concatenate values"); DATA(insert OID = 3059 ( concat_ws PGNSP PGUID 12 1 0 2276 0 f f f f f f s 2 0 25 "25 2276" "{25,2276}" "{i,v}" _null_ _null_ text_concat_ws _null_ _null_ _null_ )); DESCR("concatenate values with separators"); DATA(insert OID = 3060 ( left PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 25 "25 23" _null_ _null_ _null_ _null_ text_left _null_ _null_ _null_ )); DESCR("extract the first n characters"); DATA(insert OID = 3061 ( right PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 25 "25 23" _null_ _null_ _null_ _null_ text_right _null_ _null_ _null_ )); DESCR("extract the last n characters"); DATA(insert OID = 3062 ( reverse PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 25 "25" _null_ _null_ _null_ _null_ text_reverse _null_ _null_ _null_ )); DESCR("reverse text"); DATA(insert OID = 3539 ( format PGNSP PGUID 12 1 0 2276 0 f f f f f f s 2 0 25 "25 2276" "{25,2276}" "{i,v}" _null_ _null_ text_format _null_ _null_ _null_ )); DESCR("format text message"); DATA(insert OID = 3540 ( format PGNSP PGUID 12 1 0 0 0 f f f f f f s 1 0 25 "25" _null_ _null_ _null_ _null_ text_format_nv _null_ _null_ _null_ )); DESCR("format text message"); DATA(insert OID = 1810 ( bit_length PGNSP PGUID 14 1 0 0 0 f f f f t f i 1 0 23 "17" _null_ _null_ _null_ _null_ "select pg_catalog.octet_length($1) * 8" _null_ _null_ _null_ )); DESCR("length in bits"); DATA(insert OID = 1811 ( bit_length PGNSP PGUID 14 1 0 0 0 f f f f t f i 1 0 23 "25" _null_ _null_ _null_ _null_ "select pg_catalog.octet_length($1) * 8" _null_ _null_ _null_ )); DESCR("length in bits"); DATA(insert OID = 1812 ( bit_length PGNSP PGUID 14 1 0 0 0 f f f f t f i 1 0 23 "1560" _null_ _null_ _null_ _null_ "select pg_catalog.length($1)" _null_ _null_ _null_ )); DESCR("length in bits"); /* Selectivity estimators for LIKE and related operators */ DATA(insert OID = 1814 ( iclikesel PGNSP PGUID 12 1 0 0 0 f f f f t f s 4 0 701 "2281 26 2281 23" _null_ _null_ _null_ _null_ iclikesel _null_ _null_ _null_ )); DESCR("restriction selectivity of ILIKE"); DATA(insert OID = 1815 ( icnlikesel PGNSP PGUID 12 1 0 0 0 f f f f t f s 4 0 701 "2281 26 2281 23" _null_ _null_ _null_ _null_ icnlikesel _null_ _null_ _null_ )); DESCR("restriction selectivity of NOT ILIKE"); DATA(insert OID = 1816 ( iclikejoinsel PGNSP PGUID 12 1 0 0 0 f f f f t f s 5 0 701 "2281 26 2281 21 2281" _null_ _null_ _null_ _null_ iclikejoinsel _null_ _null_ _null_ )); DESCR("join selectivity of ILIKE"); DATA(insert OID = 1817 ( icnlikejoinsel PGNSP PGUID 12 1 0 0 0 f f f f t f s 5 0 701 "2281 26 2281 21 2281" _null_ _null_ _null_ _null_ icnlikejoinsel _null_ _null_ _null_ )); DESCR("join selectivity of NOT ILIKE"); DATA(insert OID = 1818 ( regexeqsel PGNSP PGUID 12 1 0 0 0 f f f f t f s 4 0 701 "2281 26 2281 23" _null_ _null_ _null_ _null_ regexeqsel _null_ _null_ _null_ )); DESCR("restriction selectivity of regex match"); DATA(insert OID = 1819 ( likesel PGNSP PGUID 12 1 0 0 0 f f f f t f s 4 0 701 "2281 26 2281 23" _null_ _null_ _null_ _null_ likesel _null_ _null_ _null_ )); DESCR("restriction selectivity of LIKE"); DATA(insert OID = 1820 ( icregexeqsel PGNSP PGUID 12 1 0 0 0 f f f f t f s 4 0 701 "2281 26 2281 23" _null_ _null_ _null_ _null_ icregexeqsel _null_ _null_ _null_ )); DESCR("restriction selectivity of case-insensitive regex match"); DATA(insert OID = 1821 ( regexnesel PGNSP PGUID 12 1 0 0 0 f f f f t f s 4 0 701 "2281 26 2281 23" _null_ _null_ _null_ _null_ regexnesel _null_ _null_ _null_ )); DESCR("restriction selectivity of regex non-match"); DATA(insert OID = 1822 ( nlikesel PGNSP PGUID 12 1 0 0 0 f f f f t f s 4 0 701 "2281 26 2281 23" _null_ _null_ _null_ _null_ nlikesel _null_ _null_ _null_ )); DESCR("restriction selectivity of NOT LIKE"); DATA(insert OID = 1823 ( icregexnesel PGNSP PGUID 12 1 0 0 0 f f f f t f s 4 0 701 "2281 26 2281 23" _null_ _null_ _null_ _null_ icregexnesel _null_ _null_ _null_ )); DESCR("restriction selectivity of case-insensitive regex non-match"); DATA(insert OID = 1824 ( regexeqjoinsel PGNSP PGUID 12 1 0 0 0 f f f f t f s 5 0 701 "2281 26 2281 21 2281" _null_ _null_ _null_ _null_ regexeqjoinsel _null_ _null_ _null_ )); DESCR("join selectivity of regex match"); DATA(insert OID = 1825 ( likejoinsel PGNSP PGUID 12 1 0 0 0 f f f f t f s 5 0 701 "2281 26 2281 21 2281" _null_ _null_ _null_ _null_ likejoinsel _null_ _null_ _null_ )); DESCR("join selectivity of LIKE"); DATA(insert OID = 1826 ( icregexeqjoinsel PGNSP PGUID 12 1 0 0 0 f f f f t f s 5 0 701 "2281 26 2281 21 2281" _null_ _null_ _null_ _null_ icregexeqjoinsel _null_ _null_ _null_ )); DESCR("join selectivity of case-insensitive regex match"); DATA(insert OID = 1827 ( regexnejoinsel PGNSP PGUID 12 1 0 0 0 f f f f t f s 5 0 701 "2281 26 2281 21 2281" _null_ _null_ _null_ _null_ regexnejoinsel _null_ _null_ _null_ )); DESCR("join selectivity of regex non-match"); DATA(insert OID = 1828 ( nlikejoinsel PGNSP PGUID 12 1 0 0 0 f f f f t f s 5 0 701 "2281 26 2281 21 2281" _null_ _null_ _null_ _null_ nlikejoinsel _null_ _null_ _null_ )); DESCR("join selectivity of NOT LIKE"); DATA(insert OID = 1829 ( icregexnejoinsel PGNSP PGUID 12 1 0 0 0 f f f f t f s 5 0 701 "2281 26 2281 21 2281" _null_ _null_ _null_ _null_ icregexnejoinsel _null_ _null_ _null_ )); DESCR("join selectivity of case-insensitive regex non-match"); /* Aggregate-related functions */ DATA(insert OID = 1830 ( float8_avg PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "1022" _null_ _null_ _null_ _null_ float8_avg _null_ _null_ _null_ )); DESCR("aggregate final function"); DATA(insert OID = 2512 ( float8_var_pop PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "1022" _null_ _null_ _null_ _null_ float8_var_pop _null_ _null_ _null_ )); DESCR("aggregate final function"); DATA(insert OID = 1831 ( float8_var_samp PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "1022" _null_ _null_ _null_ _null_ float8_var_samp _null_ _null_ _null_ )); DESCR("aggregate final function"); DATA(insert OID = 2513 ( float8_stddev_pop PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "1022" _null_ _null_ _null_ _null_ float8_stddev_pop _null_ _null_ _null_ )); DESCR("aggregate final function"); DATA(insert OID = 1832 ( float8_stddev_samp PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "1022" _null_ _null_ _null_ _null_ float8_stddev_samp _null_ _null_ _null_ )); DESCR("aggregate final function"); DATA(insert OID = 1833 ( numeric_accum PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1231 "1231 1700" _null_ _null_ _null_ _null_ numeric_accum _null_ _null_ _null_ )); DESCR("aggregate transition function"); DATA(insert OID = 2858 ( numeric_avg_accum PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1231 "1231 1700" _null_ _null_ _null_ _null_ numeric_avg_accum _null_ _null_ _null_ )); DESCR("aggregate transition function"); DATA(insert OID = 1834 ( int2_accum PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1231 "1231 21" _null_ _null_ _null_ _null_ int2_accum _null_ _null_ _null_ )); DESCR("aggregate transition function"); DATA(insert OID = 1835 ( int4_accum PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1231 "1231 23" _null_ _null_ _null_ _null_ int4_accum _null_ _null_ _null_ )); DESCR("aggregate transition function"); DATA(insert OID = 1836 ( int8_accum PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1231 "1231 20" _null_ _null_ _null_ _null_ int8_accum _null_ _null_ _null_ )); DESCR("aggregate transition function"); DATA(insert OID = 2746 ( int8_avg_accum PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1231 "1231 20" _null_ _null_ _null_ _null_ int8_avg_accum _null_ _null_ _null_ )); DESCR("aggregate transition function"); DATA(insert OID = 1837 ( numeric_avg PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1700 "1231" _null_ _null_ _null_ _null_ numeric_avg _null_ _null_ _null_ )); DESCR("aggregate final function"); DATA(insert OID = 2514 ( numeric_var_pop PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1700 "1231" _null_ _null_ _null_ _null_ numeric_var_pop _null_ _null_ _null_ )); DESCR("aggregate final function"); DATA(insert OID = 1838 ( numeric_var_samp PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1700 "1231" _null_ _null_ _null_ _null_ numeric_var_samp _null_ _null_ _null_ )); DESCR("aggregate final function"); DATA(insert OID = 2596 ( numeric_stddev_pop PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1700 "1231" _null_ _null_ _null_ _null_ numeric_stddev_pop _null_ _null_ _null_ )); DESCR("aggregate final function"); DATA(insert OID = 1839 ( numeric_stddev_samp PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1700 "1231" _null_ _null_ _null_ _null_ numeric_stddev_samp _null_ _null_ _null_ )); DESCR("aggregate final function"); DATA(insert OID = 1840 ( int2_sum PGNSP PGUID 12 1 0 0 0 f f f f f f i 2 0 20 "20 21" _null_ _null_ _null_ _null_ int2_sum _null_ _null_ _null_ )); DESCR("aggregate transition function"); DATA(insert OID = 1841 ( int4_sum PGNSP PGUID 12 1 0 0 0 f f f f f f i 2 0 20 "20 23" _null_ _null_ _null_ _null_ int4_sum _null_ _null_ _null_ )); DESCR("aggregate transition function"); DATA(insert OID = 1842 ( int8_sum PGNSP PGUID 12 1 0 0 0 f f f f f f i 2 0 1700 "1700 20" _null_ _null_ _null_ _null_ int8_sum _null_ _null_ _null_ )); DESCR("aggregate transition function"); DATA(insert OID = 1843 ( interval_accum PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1187 "1187 1186" _null_ _null_ _null_ _null_ interval_accum _null_ _null_ _null_ )); DESCR("aggregate transition function"); DATA(insert OID = 1844 ( interval_avg PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1186 "1187" _null_ _null_ _null_ _null_ interval_avg _null_ _null_ _null_ )); DESCR("aggregate final function"); DATA(insert OID = 1962 ( int2_avg_accum PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1016 "1016 21" _null_ _null_ _null_ _null_ int2_avg_accum _null_ _null_ _null_ )); DESCR("aggregate transition function"); DATA(insert OID = 1963 ( int4_avg_accum PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1016 "1016 23" _null_ _null_ _null_ _null_ int4_avg_accum _null_ _null_ _null_ )); DESCR("aggregate transition function"); DATA(insert OID = 1964 ( int8_avg PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1700 "1016" _null_ _null_ _null_ _null_ int8_avg _null_ _null_ _null_ )); DESCR("aggregate final function"); DATA(insert OID = 2805 ( int8inc_float8_float8 PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 20 "20 701 701" _null_ _null_ _null_ _null_ int8inc_float8_float8 _null_ _null_ _null_ )); DESCR("aggregate transition function"); DATA(insert OID = 2806 ( float8_regr_accum PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 1022 "1022 701 701" _null_ _null_ _null_ _null_ float8_regr_accum _null_ _null_ _null_ )); DESCR("aggregate transition function"); DATA(insert OID = 2807 ( float8_regr_sxx PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "1022" _null_ _null_ _null_ _null_ float8_regr_sxx _null_ _null_ _null_ )); DESCR("aggregate final function"); DATA(insert OID = 2808 ( float8_regr_syy PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "1022" _null_ _null_ _null_ _null_ float8_regr_syy _null_ _null_ _null_ )); DESCR("aggregate final function"); DATA(insert OID = 2809 ( float8_regr_sxy PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "1022" _null_ _null_ _null_ _null_ float8_regr_sxy _null_ _null_ _null_ )); DESCR("aggregate final function"); DATA(insert OID = 2810 ( float8_regr_avgx PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "1022" _null_ _null_ _null_ _null_ float8_regr_avgx _null_ _null_ _null_ )); DESCR("aggregate final function"); DATA(insert OID = 2811 ( float8_regr_avgy PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "1022" _null_ _null_ _null_ _null_ float8_regr_avgy _null_ _null_ _null_ )); DESCR("aggregate final function"); DATA(insert OID = 2812 ( float8_regr_r2 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "1022" _null_ _null_ _null_ _null_ float8_regr_r2 _null_ _null_ _null_ )); DESCR("aggregate final function"); DATA(insert OID = 2813 ( float8_regr_slope PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "1022" _null_ _null_ _null_ _null_ float8_regr_slope _null_ _null_ _null_ )); DESCR("aggregate final function"); DATA(insert OID = 2814 ( float8_regr_intercept PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "1022" _null_ _null_ _null_ _null_ float8_regr_intercept _null_ _null_ _null_ )); DESCR("aggregate final function"); DATA(insert OID = 2815 ( float8_covar_pop PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "1022" _null_ _null_ _null_ _null_ float8_covar_pop _null_ _null_ _null_ )); DESCR("aggregate final function"); DATA(insert OID = 2816 ( float8_covar_samp PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "1022" _null_ _null_ _null_ _null_ float8_covar_samp _null_ _null_ _null_ )); DESCR("aggregate final function"); DATA(insert OID = 2817 ( float8_corr PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "1022" _null_ _null_ _null_ _null_ float8_corr _null_ _null_ _null_ )); DESCR("aggregate final function"); DATA(insert OID = 3535 ( string_agg_transfn PGNSP PGUID 12 1 0 0 0 f f f f f f i 3 0 2281 "2281 25 25" _null_ _null_ _null_ _null_ string_agg_transfn _null_ _null_ _null_ )); DESCR("aggregate transition function"); DATA(insert OID = 3536 ( string_agg_finalfn PGNSP PGUID 12 1 0 0 0 f f f f f f i 1 0 25 "2281" _null_ _null_ _null_ _null_ string_agg_finalfn _null_ _null_ _null_ )); DESCR("aggregate final function"); DATA(insert OID = 3538 ( string_agg PGNSP PGUID 12 1 0 0 0 t f f f f f i 2 0 25 "25 25" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("concatenate aggregate input into a string"); DATA(insert OID = 3543 ( bytea_string_agg_transfn PGNSP PGUID 12 1 0 0 0 f f f f f f i 3 0 2281 "2281 17 17" _null_ _null_ _null_ _null_ bytea_string_agg_transfn _null_ _null_ _null_ )); DESCR("aggregate transition function"); DATA(insert OID = 3544 ( bytea_string_agg_finalfn PGNSP PGUID 12 1 0 0 0 f f f f f f i 1 0 17 "2281" _null_ _null_ _null_ _null_ bytea_string_agg_finalfn _null_ _null_ _null_ )); DESCR("aggregate final function"); DATA(insert OID = 3545 ( string_agg PGNSP PGUID 12 1 0 0 0 t f f f f f i 2 0 17 "17 17" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("concatenate aggregate input into a bytea"); /* To ASCII conversion */ DATA(insert OID = 1845 ( to_ascii PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 25 "25" _null_ _null_ _null_ _null_ to_ascii_default _null_ _null_ _null_ )); DESCR("encode text from DB encoding to ASCII text"); DATA(insert OID = 1846 ( to_ascii PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 25 "25 23" _null_ _null_ _null_ _null_ to_ascii_enc _null_ _null_ _null_ )); DESCR("encode text from encoding to ASCII text"); DATA(insert OID = 1847 ( to_ascii PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 25 "25 19" _null_ _null_ _null_ _null_ to_ascii_encname _null_ _null_ _null_ )); DESCR("encode text from encoding to ASCII text"); DATA(insert OID = 1848 ( interval_pl_time PGNSP PGUID 14 1 0 0 0 f f f f t f i 2 0 1083 "1186 1083" _null_ _null_ _null_ _null_ "select $2 + $1" _null_ _null_ _null_ )); DATA(insert OID = 1850 ( int28eq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "21 20" _null_ _null_ _null_ _null_ int28eq _null_ _null_ _null_ )); DATA(insert OID = 1851 ( int28ne PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "21 20" _null_ _null_ _null_ _null_ int28ne _null_ _null_ _null_ )); DATA(insert OID = 1852 ( int28lt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "21 20" _null_ _null_ _null_ _null_ int28lt _null_ _null_ _null_ )); DATA(insert OID = 1853 ( int28gt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "21 20" _null_ _null_ _null_ _null_ int28gt _null_ _null_ _null_ )); DATA(insert OID = 1854 ( int28le PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "21 20" _null_ _null_ _null_ _null_ int28le _null_ _null_ _null_ )); DATA(insert OID = 1855 ( int28ge PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "21 20" _null_ _null_ _null_ _null_ int28ge _null_ _null_ _null_ )); DATA(insert OID = 1856 ( int82eq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "20 21" _null_ _null_ _null_ _null_ int82eq _null_ _null_ _null_ )); DATA(insert OID = 1857 ( int82ne PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "20 21" _null_ _null_ _null_ _null_ int82ne _null_ _null_ _null_ )); DATA(insert OID = 1858 ( int82lt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "20 21" _null_ _null_ _null_ _null_ int82lt _null_ _null_ _null_ )); DATA(insert OID = 1859 ( int82gt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "20 21" _null_ _null_ _null_ _null_ int82gt _null_ _null_ _null_ )); DATA(insert OID = 1860 ( int82le PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "20 21" _null_ _null_ _null_ _null_ int82le _null_ _null_ _null_ )); DATA(insert OID = 1861 ( int82ge PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "20 21" _null_ _null_ _null_ _null_ int82ge _null_ _null_ _null_ )); DATA(insert OID = 1892 ( int2and PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 21 "21 21" _null_ _null_ _null_ _null_ int2and _null_ _null_ _null_ )); DATA(insert OID = 1893 ( int2or PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 21 "21 21" _null_ _null_ _null_ _null_ int2or _null_ _null_ _null_ )); DATA(insert OID = 1894 ( int2xor PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 21 "21 21" _null_ _null_ _null_ _null_ int2xor _null_ _null_ _null_ )); DATA(insert OID = 1895 ( int2not PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 21 "21" _null_ _null_ _null_ _null_ int2not _null_ _null_ _null_ )); DATA(insert OID = 1896 ( int2shl PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 21 "21 23" _null_ _null_ _null_ _null_ int2shl _null_ _null_ _null_ )); DATA(insert OID = 1897 ( int2shr PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 21 "21 23" _null_ _null_ _null_ _null_ int2shr _null_ _null_ _null_ )); DATA(insert OID = 1898 ( int4and PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "23 23" _null_ _null_ _null_ _null_ int4and _null_ _null_ _null_ )); DATA(insert OID = 1899 ( int4or PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "23 23" _null_ _null_ _null_ _null_ int4or _null_ _null_ _null_ )); DATA(insert OID = 1900 ( int4xor PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "23 23" _null_ _null_ _null_ _null_ int4xor _null_ _null_ _null_ )); DATA(insert OID = 1901 ( int4not PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "23" _null_ _null_ _null_ _null_ int4not _null_ _null_ _null_ )); DATA(insert OID = 1902 ( int4shl PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "23 23" _null_ _null_ _null_ _null_ int4shl _null_ _null_ _null_ )); DATA(insert OID = 1903 ( int4shr PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "23 23" _null_ _null_ _null_ _null_ int4shr _null_ _null_ _null_ )); DATA(insert OID = 1904 ( int8and PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 20 "20 20" _null_ _null_ _null_ _null_ int8and _null_ _null_ _null_ )); DATA(insert OID = 1905 ( int8or PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 20 "20 20" _null_ _null_ _null_ _null_ int8or _null_ _null_ _null_ )); DATA(insert OID = 1906 ( int8xor PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 20 "20 20" _null_ _null_ _null_ _null_ int8xor _null_ _null_ _null_ )); DATA(insert OID = 1907 ( int8not PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 20 "20" _null_ _null_ _null_ _null_ int8not _null_ _null_ _null_ )); DATA(insert OID = 1908 ( int8shl PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 20 "20 23" _null_ _null_ _null_ _null_ int8shl _null_ _null_ _null_ )); DATA(insert OID = 1909 ( int8shr PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 20 "20 23" _null_ _null_ _null_ _null_ int8shr _null_ _null_ _null_ )); DATA(insert OID = 1910 ( int8up PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 20 "20" _null_ _null_ _null_ _null_ int8up _null_ _null_ _null_ )); DATA(insert OID = 1911 ( int2up PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 21 "21" _null_ _null_ _null_ _null_ int2up _null_ _null_ _null_ )); DATA(insert OID = 1912 ( int4up PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "23" _null_ _null_ _null_ _null_ int4up _null_ _null_ _null_ )); DATA(insert OID = 1913 ( float4up PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 700 "700" _null_ _null_ _null_ _null_ float4up _null_ _null_ _null_ )); DATA(insert OID = 1914 ( float8up PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "701" _null_ _null_ _null_ _null_ float8up _null_ _null_ _null_ )); DATA(insert OID = 1915 ( numeric_uplus PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1700 "1700" _null_ _null_ _null_ _null_ numeric_uplus _null_ _null_ _null_ )); DATA(insert OID = 1922 ( has_table_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "19 25 25" _null_ _null_ _null_ _null_ has_table_privilege_name_name _null_ _null_ _null_ )); DESCR("user privilege on relation by username, rel name"); DATA(insert OID = 1923 ( has_table_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "19 26 25" _null_ _null_ _null_ _null_ has_table_privilege_name_id _null_ _null_ _null_ )); DESCR("user privilege on relation by username, rel oid"); DATA(insert OID = 1924 ( has_table_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "26 25 25" _null_ _null_ _null_ _null_ has_table_privilege_id_name _null_ _null_ _null_ )); DESCR("user privilege on relation by user oid, rel name"); DATA(insert OID = 1925 ( has_table_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "26 26 25" _null_ _null_ _null_ _null_ has_table_privilege_id_id _null_ _null_ _null_ )); DESCR("user privilege on relation by user oid, rel oid"); DATA(insert OID = 1926 ( has_table_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "25 25" _null_ _null_ _null_ _null_ has_table_privilege_name _null_ _null_ _null_ )); DESCR("current user privilege on relation by rel name"); DATA(insert OID = 1927 ( has_table_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "26 25" _null_ _null_ _null_ _null_ has_table_privilege_id _null_ _null_ _null_ )); DESCR("current user privilege on relation by rel oid"); DATA(insert OID = 2181 ( has_sequence_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "19 25 25" _null_ _null_ _null_ _null_ has_sequence_privilege_name_name _null_ _null_ _null_ )); DESCR("user privilege on sequence by username, seq name"); DATA(insert OID = 2182 ( has_sequence_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "19 26 25" _null_ _null_ _null_ _null_ has_sequence_privilege_name_id _null_ _null_ _null_ )); DESCR("user privilege on sequence by username, seq oid"); DATA(insert OID = 2183 ( has_sequence_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "26 25 25" _null_ _null_ _null_ _null_ has_sequence_privilege_id_name _null_ _null_ _null_ )); DESCR("user privilege on sequence by user oid, seq name"); DATA(insert OID = 2184 ( has_sequence_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "26 26 25" _null_ _null_ _null_ _null_ has_sequence_privilege_id_id _null_ _null_ _null_ )); DESCR("user privilege on sequence by user oid, seq oid"); DATA(insert OID = 2185 ( has_sequence_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "25 25" _null_ _null_ _null_ _null_ has_sequence_privilege_name _null_ _null_ _null_ )); DESCR("current user privilege on sequence by seq name"); DATA(insert OID = 2186 ( has_sequence_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "26 25" _null_ _null_ _null_ _null_ has_sequence_privilege_id _null_ _null_ _null_ )); DESCR("current user privilege on sequence by seq oid"); DATA(insert OID = 3012 ( has_column_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 4 0 16 "19 25 25 25" _null_ _null_ _null_ _null_ has_column_privilege_name_name_name _null_ _null_ _null_ )); DESCR("user privilege on column by username, rel name, col name"); DATA(insert OID = 3013 ( has_column_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 4 0 16 "19 25 21 25" _null_ _null_ _null_ _null_ has_column_privilege_name_name_attnum _null_ _null_ _null_ )); DESCR("user privilege on column by username, rel name, col attnum"); DATA(insert OID = 3014 ( has_column_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 4 0 16 "19 26 25 25" _null_ _null_ _null_ _null_ has_column_privilege_name_id_name _null_ _null_ _null_ )); DESCR("user privilege on column by username, rel oid, col name"); DATA(insert OID = 3015 ( has_column_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 4 0 16 "19 26 21 25" _null_ _null_ _null_ _null_ has_column_privilege_name_id_attnum _null_ _null_ _null_ )); DESCR("user privilege on column by username, rel oid, col attnum"); DATA(insert OID = 3016 ( has_column_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 4 0 16 "26 25 25 25" _null_ _null_ _null_ _null_ has_column_privilege_id_name_name _null_ _null_ _null_ )); DESCR("user privilege on column by user oid, rel name, col name"); DATA(insert OID = 3017 ( has_column_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 4 0 16 "26 25 21 25" _null_ _null_ _null_ _null_ has_column_privilege_id_name_attnum _null_ _null_ _null_ )); DESCR("user privilege on column by user oid, rel name, col attnum"); DATA(insert OID = 3018 ( has_column_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 4 0 16 "26 26 25 25" _null_ _null_ _null_ _null_ has_column_privilege_id_id_name _null_ _null_ _null_ )); DESCR("user privilege on column by user oid, rel oid, col name"); DATA(insert OID = 3019 ( has_column_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 4 0 16 "26 26 21 25" _null_ _null_ _null_ _null_ has_column_privilege_id_id_attnum _null_ _null_ _null_ )); DESCR("user privilege on column by user oid, rel oid, col attnum"); DATA(insert OID = 3020 ( has_column_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "25 25 25" _null_ _null_ _null_ _null_ has_column_privilege_name_name _null_ _null_ _null_ )); DESCR("current user privilege on column by rel name, col name"); DATA(insert OID = 3021 ( has_column_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "25 21 25" _null_ _null_ _null_ _null_ has_column_privilege_name_attnum _null_ _null_ _null_ )); DESCR("current user privilege on column by rel name, col attnum"); DATA(insert OID = 3022 ( has_column_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "26 25 25" _null_ _null_ _null_ _null_ has_column_privilege_id_name _null_ _null_ _null_ )); DESCR("current user privilege on column by rel oid, col name"); DATA(insert OID = 3023 ( has_column_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "26 21 25" _null_ _null_ _null_ _null_ has_column_privilege_id_attnum _null_ _null_ _null_ )); DESCR("current user privilege on column by rel oid, col attnum"); DATA(insert OID = 3024 ( has_any_column_privilege PGNSP PGUID 12 10 0 0 0 f f f f t f s 3 0 16 "19 25 25" _null_ _null_ _null_ _null_ has_any_column_privilege_name_name _null_ _null_ _null_ )); DESCR("user privilege on any column by username, rel name"); DATA(insert OID = 3025 ( has_any_column_privilege PGNSP PGUID 12 10 0 0 0 f f f f t f s 3 0 16 "19 26 25" _null_ _null_ _null_ _null_ has_any_column_privilege_name_id _null_ _null_ _null_ )); DESCR("user privilege on any column by username, rel oid"); DATA(insert OID = 3026 ( has_any_column_privilege PGNSP PGUID 12 10 0 0 0 f f f f t f s 3 0 16 "26 25 25" _null_ _null_ _null_ _null_ has_any_column_privilege_id_name _null_ _null_ _null_ )); DESCR("user privilege on any column by user oid, rel name"); DATA(insert OID = 3027 ( has_any_column_privilege PGNSP PGUID 12 10 0 0 0 f f f f t f s 3 0 16 "26 26 25" _null_ _null_ _null_ _null_ has_any_column_privilege_id_id _null_ _null_ _null_ )); DESCR("user privilege on any column by user oid, rel oid"); DATA(insert OID = 3028 ( has_any_column_privilege PGNSP PGUID 12 10 0 0 0 f f f f t f s 2 0 16 "25 25" _null_ _null_ _null_ _null_ has_any_column_privilege_name _null_ _null_ _null_ )); DESCR("current user privilege on any column by rel name"); DATA(insert OID = 3029 ( has_any_column_privilege PGNSP PGUID 12 10 0 0 0 f f f f t f s 2 0 16 "26 25" _null_ _null_ _null_ _null_ has_any_column_privilege_id _null_ _null_ _null_ )); DESCR("current user privilege on any column by rel oid"); DATA(insert OID = 1928 ( pg_stat_get_numscans PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_numscans _null_ _null_ _null_ )); DESCR("statistics: number of scans done for table/index"); DATA(insert OID = 1929 ( pg_stat_get_tuples_returned PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_tuples_returned _null_ _null_ _null_ )); DESCR("statistics: number of tuples read by seqscan"); DATA(insert OID = 1930 ( pg_stat_get_tuples_fetched PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_tuples_fetched _null_ _null_ _null_ )); DESCR("statistics: number of tuples fetched by idxscan"); DATA(insert OID = 1931 ( pg_stat_get_tuples_inserted PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_tuples_inserted _null_ _null_ _null_ )); DESCR("statistics: number of tuples inserted"); DATA(insert OID = 1932 ( pg_stat_get_tuples_updated PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_tuples_updated _null_ _null_ _null_ )); DESCR("statistics: number of tuples updated"); DATA(insert OID = 1933 ( pg_stat_get_tuples_deleted PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_tuples_deleted _null_ _null_ _null_ )); DESCR("statistics: number of tuples deleted"); DATA(insert OID = 1972 ( pg_stat_get_tuples_hot_updated PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_tuples_hot_updated _null_ _null_ _null_ )); DESCR("statistics: number of tuples hot updated"); DATA(insert OID = 2878 ( pg_stat_get_live_tuples PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_live_tuples _null_ _null_ _null_ )); DESCR("statistics: number of live tuples"); DATA(insert OID = 2879 ( pg_stat_get_dead_tuples PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_dead_tuples _null_ _null_ _null_ )); DESCR("statistics: number of dead tuples"); DATA(insert OID = 1934 ( pg_stat_get_blocks_fetched PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_blocks_fetched _null_ _null_ _null_ )); DESCR("statistics: number of blocks fetched"); DATA(insert OID = 1935 ( pg_stat_get_blocks_hit PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_blocks_hit _null_ _null_ _null_ )); DESCR("statistics: number of blocks found in cache"); DATA(insert OID = 2781 ( pg_stat_get_last_vacuum_time PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 1184 "26" _null_ _null_ _null_ _null_ pg_stat_get_last_vacuum_time _null_ _null_ _null_ )); DESCR("statistics: last manual vacuum time for a table"); DATA(insert OID = 2782 ( pg_stat_get_last_autovacuum_time PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 1184 "26" _null_ _null_ _null_ _null_ pg_stat_get_last_autovacuum_time _null_ _null_ _null_ )); DESCR("statistics: last auto vacuum time for a table"); DATA(insert OID = 2783 ( pg_stat_get_last_analyze_time PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 1184 "26" _null_ _null_ _null_ _null_ pg_stat_get_last_analyze_time _null_ _null_ _null_ )); DESCR("statistics: last manual analyze time for a table"); DATA(insert OID = 2784 ( pg_stat_get_last_autoanalyze_time PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 1184 "26" _null_ _null_ _null_ _null_ pg_stat_get_last_autoanalyze_time _null_ _null_ _null_ )); DESCR("statistics: last auto analyze time for a table"); DATA(insert OID = 3054 ( pg_stat_get_vacuum_count PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_vacuum_count _null_ _null_ _null_ )); DESCR("statistics: number of manual vacuums for a table"); DATA(insert OID = 3055 ( pg_stat_get_autovacuum_count PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_autovacuum_count _null_ _null_ _null_ )); DESCR("statistics: number of auto vacuums for a table"); DATA(insert OID = 3056 ( pg_stat_get_analyze_count PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_analyze_count _null_ _null_ _null_ )); DESCR("statistics: number of manual analyzes for a table"); DATA(insert OID = 3057 ( pg_stat_get_autoanalyze_count PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_autoanalyze_count _null_ _null_ _null_ )); DESCR("statistics: number of auto analyzes for a table"); DATA(insert OID = 1936 ( pg_stat_get_backend_idset PGNSP PGUID 12 1 100 0 0 f f f f t t s 0 0 23 "" _null_ _null_ _null_ _null_ pg_stat_get_backend_idset _null_ _null_ _null_ )); DESCR("statistics: currently active backend IDs"); DATA(insert OID = 2022 ( pg_stat_get_activity PGNSP PGUID 12 1 100 0 0 f f f f f t s 1 0 2249 "23" "{23,26,23,26,25,25,25,16,1184,1184,1184,1184,869,25,23}" "{i,o,o,o,o,o,o,o,o,o,o,o,o,o,o}" "{pid,datid,pid,usesysid,application_name,state,query,waiting,xact_start,query_start,backend_start,state_change,client_addr,client_hostname,client_port}" _null_ pg_stat_get_activity _null_ _null_ _null_ )); DESCR("statistics: information about currently active backends"); DATA(insert OID = 3099 ( pg_stat_get_wal_senders PGNSP PGUID 12 1 10 0 0 f f f f f t s 0 0 2249 "" "{23,25,25,25,25,25,23,25}" "{o,o,o,o,o,o,o,o}" "{pid,state,sent_location,write_location,flush_location,replay_location,sync_priority,sync_state}" _null_ pg_stat_get_wal_senders _null_ _null_ _null_ )); DESCR("statistics: information about currently active replication"); DATA(insert OID = 2026 ( pg_backend_pid PGNSP PGUID 12 1 0 0 0 f f f f t f s 0 0 23 "" _null_ _null_ _null_ _null_ pg_backend_pid _null_ _null_ _null_ )); DESCR("statistics: current backend PID"); DATA(insert OID = 1937 ( pg_stat_get_backend_pid PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 23 "23" _null_ _null_ _null_ _null_ pg_stat_get_backend_pid _null_ _null_ _null_ )); DESCR("statistics: PID of backend"); DATA(insert OID = 1938 ( pg_stat_get_backend_dbid PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 26 "23" _null_ _null_ _null_ _null_ pg_stat_get_backend_dbid _null_ _null_ _null_ )); DESCR("statistics: database ID of backend"); DATA(insert OID = 1939 ( pg_stat_get_backend_userid PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 26 "23" _null_ _null_ _null_ _null_ pg_stat_get_backend_userid _null_ _null_ _null_ )); DESCR("statistics: user ID of backend"); DATA(insert OID = 1940 ( pg_stat_get_backend_activity PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 25 "23" _null_ _null_ _null_ _null_ pg_stat_get_backend_activity _null_ _null_ _null_ )); DESCR("statistics: current query of backend"); DATA(insert OID = 2853 ( pg_stat_get_backend_waiting PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 16 "23" _null_ _null_ _null_ _null_ pg_stat_get_backend_waiting _null_ _null_ _null_ )); DESCR("statistics: is backend currently waiting for a lock"); DATA(insert OID = 2094 ( pg_stat_get_backend_activity_start PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 1184 "23" _null_ _null_ _null_ _null_ pg_stat_get_backend_activity_start _null_ _null_ _null_ )); DESCR("statistics: start time for current query of backend"); DATA(insert OID = 2857 ( pg_stat_get_backend_xact_start PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 1184 "23" _null_ _null_ _null_ _null_ pg_stat_get_backend_xact_start _null_ _null_ _null_ )); DESCR("statistics: start time for backend's current transaction"); DATA(insert OID = 1391 ( pg_stat_get_backend_start PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 1184 "23" _null_ _null_ _null_ _null_ pg_stat_get_backend_start _null_ _null_ _null_ )); DESCR("statistics: start time for current backend session"); DATA(insert OID = 1392 ( pg_stat_get_backend_client_addr PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 869 "23" _null_ _null_ _null_ _null_ pg_stat_get_backend_client_addr _null_ _null_ _null_ )); DESCR("statistics: address of client connected to backend"); DATA(insert OID = 1393 ( pg_stat_get_backend_client_port PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 23 "23" _null_ _null_ _null_ _null_ pg_stat_get_backend_client_port _null_ _null_ _null_ )); DESCR("statistics: port number of client connected to backend"); DATA(insert OID = 1941 ( pg_stat_get_db_numbackends PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 23 "26" _null_ _null_ _null_ _null_ pg_stat_get_db_numbackends _null_ _null_ _null_ )); DESCR("statistics: number of backends in database"); DATA(insert OID = 1942 ( pg_stat_get_db_xact_commit PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_db_xact_commit _null_ _null_ _null_ )); DESCR("statistics: transactions committed"); DATA(insert OID = 1943 ( pg_stat_get_db_xact_rollback PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_db_xact_rollback _null_ _null_ _null_ )); DESCR("statistics: transactions rolled back"); DATA(insert OID = 1944 ( pg_stat_get_db_blocks_fetched PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_db_blocks_fetched _null_ _null_ _null_ )); DESCR("statistics: blocks fetched for database"); DATA(insert OID = 1945 ( pg_stat_get_db_blocks_hit PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_db_blocks_hit _null_ _null_ _null_ )); DESCR("statistics: blocks found in cache for database"); DATA(insert OID = 2758 ( pg_stat_get_db_tuples_returned PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_db_tuples_returned _null_ _null_ _null_ )); DESCR("statistics: tuples returned for database"); DATA(insert OID = 2759 ( pg_stat_get_db_tuples_fetched PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_db_tuples_fetched _null_ _null_ _null_ )); DESCR("statistics: tuples fetched for database"); DATA(insert OID = 2760 ( pg_stat_get_db_tuples_inserted PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_db_tuples_inserted _null_ _null_ _null_ )); DESCR("statistics: tuples inserted in database"); DATA(insert OID = 2761 ( pg_stat_get_db_tuples_updated PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_db_tuples_updated _null_ _null_ _null_ )); DESCR("statistics: tuples updated in database"); DATA(insert OID = 2762 ( pg_stat_get_db_tuples_deleted PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_db_tuples_deleted _null_ _null_ _null_ )); DESCR("statistics: tuples deleted in database"); DATA(insert OID = 3065 ( pg_stat_get_db_conflict_tablespace PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_db_conflict_tablespace _null_ _null_ _null_ )); DESCR("statistics: recovery conflicts in database caused by drop tablespace"); DATA(insert OID = 3066 ( pg_stat_get_db_conflict_lock PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_db_conflict_lock _null_ _null_ _null_ )); DESCR("statistics: recovery conflicts in database caused by relation lock"); DATA(insert OID = 3067 ( pg_stat_get_db_conflict_snapshot PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_db_conflict_snapshot _null_ _null_ _null_ )); DESCR("statistics: recovery conflicts in database caused by snapshot expiry"); DATA(insert OID = 3068 ( pg_stat_get_db_conflict_bufferpin PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_db_conflict_bufferpin _null_ _null_ _null_ )); DESCR("statistics: recovery conflicts in database caused by shared buffer pin"); DATA(insert OID = 3069 ( pg_stat_get_db_conflict_startup_deadlock PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_db_conflict_startup_deadlock _null_ _null_ _null_ )); DESCR("statistics: recovery conflicts in database caused by buffer deadlock"); DATA(insert OID = 3070 ( pg_stat_get_db_conflict_all PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_db_conflict_all _null_ _null_ _null_ )); DESCR("statistics: recovery conflicts in database"); DATA(insert OID = 3152 ( pg_stat_get_db_deadlocks PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_db_deadlocks _null_ _null_ _null_ )); DESCR("statistics: deadlocks detected in database"); DATA(insert OID = 3074 ( pg_stat_get_db_stat_reset_time PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 1184 "26" _null_ _null_ _null_ _null_ pg_stat_get_db_stat_reset_time _null_ _null_ _null_ )); DESCR("statistics: last reset for a database"); DATA(insert OID = 3150 ( pg_stat_get_db_temp_files PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_db_temp_files _null_ _null_ _null_ )); DESCR("statistics: number of temporary files written"); DATA(insert OID = 3151 ( pg_stat_get_db_temp_bytes PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_db_temp_bytes _null_ _null_ _null_ )); DESCR("statistics: number of bytes in temporary files written"); DATA(insert OID = 2844 ( pg_stat_get_db_blk_read_time PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 701 "26" _null_ _null_ _null_ _null_ pg_stat_get_db_blk_read_time _null_ _null_ _null_ )); DESCR("statistics: block read time, in msec"); DATA(insert OID = 2845 ( pg_stat_get_db_blk_write_time PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 701 "26" _null_ _null_ _null_ _null_ pg_stat_get_db_blk_write_time _null_ _null_ _null_ )); DESCR("statistics: block write time, in msec"); DATA(insert OID = 2769 ( pg_stat_get_bgwriter_timed_checkpoints PGNSP PGUID 12 1 0 0 0 f f f f t f s 0 0 20 "" _null_ _null_ _null_ _null_ pg_stat_get_bgwriter_timed_checkpoints _null_ _null_ _null_ )); DESCR("statistics: number of timed checkpoints started by the bgwriter"); DATA(insert OID = 2770 ( pg_stat_get_bgwriter_requested_checkpoints PGNSP PGUID 12 1 0 0 0 f f f f t f s 0 0 20 "" _null_ _null_ _null_ _null_ pg_stat_get_bgwriter_requested_checkpoints _null_ _null_ _null_ )); DESCR("statistics: number of backend requested checkpoints started by the bgwriter"); DATA(insert OID = 2771 ( pg_stat_get_bgwriter_buf_written_checkpoints PGNSP PGUID 12 1 0 0 0 f f f f t f s 0 0 20 "" _null_ _null_ _null_ _null_ pg_stat_get_bgwriter_buf_written_checkpoints _null_ _null_ _null_ )); DESCR("statistics: number of buffers written by the bgwriter during checkpoints"); DATA(insert OID = 2772 ( pg_stat_get_bgwriter_buf_written_clean PGNSP PGUID 12 1 0 0 0 f f f f t f s 0 0 20 "" _null_ _null_ _null_ _null_ pg_stat_get_bgwriter_buf_written_clean _null_ _null_ _null_ )); DESCR("statistics: number of buffers written by the bgwriter for cleaning dirty buffers"); DATA(insert OID = 2773 ( pg_stat_get_bgwriter_maxwritten_clean PGNSP PGUID 12 1 0 0 0 f f f f t f s 0 0 20 "" _null_ _null_ _null_ _null_ pg_stat_get_bgwriter_maxwritten_clean _null_ _null_ _null_ )); DESCR("statistics: number of times the bgwriter stopped processing when it had written too many buffers while cleaning"); DATA(insert OID = 3075 ( pg_stat_get_bgwriter_stat_reset_time PGNSP PGUID 12 1 0 0 0 f f f f t f s 0 0 1184 "" _null_ _null_ _null_ _null_ pg_stat_get_bgwriter_stat_reset_time _null_ _null_ _null_ )); DESCR("statistics: last reset for the bgwriter"); DATA(insert OID = 3160 ( pg_stat_get_checkpoint_write_time PGNSP PGUID 12 1 0 0 0 f f f f t f s 0 0 701 "" _null_ _null_ _null_ _null_ pg_stat_get_checkpoint_write_time _null_ _null_ _null_ )); DESCR("statistics: checkpoint time spent writing buffers to disk, in msec"); DATA(insert OID = 3161 ( pg_stat_get_checkpoint_sync_time PGNSP PGUID 12 1 0 0 0 f f f f t f s 0 0 701 "" _null_ _null_ _null_ _null_ pg_stat_get_checkpoint_sync_time _null_ _null_ _null_ )); DESCR("statistics: checkpoint time spent synchronizing buffers to disk, in msec"); DATA(insert OID = 2775 ( pg_stat_get_buf_written_backend PGNSP PGUID 12 1 0 0 0 f f f f t f s 0 0 20 "" _null_ _null_ _null_ _null_ pg_stat_get_buf_written_backend _null_ _null_ _null_ )); DESCR("statistics: number of buffers written by backends"); DATA(insert OID = 3063 ( pg_stat_get_buf_fsync_backend PGNSP PGUID 12 1 0 0 0 f f f f t f s 0 0 20 "" _null_ _null_ _null_ _null_ pg_stat_get_buf_fsync_backend _null_ _null_ _null_ )); DESCR("statistics: number of backend buffer writes that did their own fsync"); DATA(insert OID = 2859 ( pg_stat_get_buf_alloc PGNSP PGUID 12 1 0 0 0 f f f f t f s 0 0 20 "" _null_ _null_ _null_ _null_ pg_stat_get_buf_alloc _null_ _null_ _null_ )); DESCR("statistics: number of buffer allocations"); DATA(insert OID = 2978 ( pg_stat_get_function_calls PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_function_calls _null_ _null_ _null_ )); DESCR("statistics: number of function calls"); DATA(insert OID = 2979 ( pg_stat_get_function_total_time PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 701 "26" _null_ _null_ _null_ _null_ pg_stat_get_function_total_time _null_ _null_ _null_ )); DESCR("statistics: total execution time of function, in msec"); DATA(insert OID = 2980 ( pg_stat_get_function_self_time PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 701 "26" _null_ _null_ _null_ _null_ pg_stat_get_function_self_time _null_ _null_ _null_ )); DESCR("statistics: self execution time of function, in msec"); DATA(insert OID = 3037 ( pg_stat_get_xact_numscans PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_xact_numscans _null_ _null_ _null_ )); DESCR("statistics: number of scans done for table/index in current transaction"); DATA(insert OID = 3038 ( pg_stat_get_xact_tuples_returned PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_xact_tuples_returned _null_ _null_ _null_ )); DESCR("statistics: number of tuples read by seqscan in current transaction"); DATA(insert OID = 3039 ( pg_stat_get_xact_tuples_fetched PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_xact_tuples_fetched _null_ _null_ _null_ )); DESCR("statistics: number of tuples fetched by idxscan in current transaction"); DATA(insert OID = 3040 ( pg_stat_get_xact_tuples_inserted PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_xact_tuples_inserted _null_ _null_ _null_ )); DESCR("statistics: number of tuples inserted in current transaction"); DATA(insert OID = 3041 ( pg_stat_get_xact_tuples_updated PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_xact_tuples_updated _null_ _null_ _null_ )); DESCR("statistics: number of tuples updated in current transaction"); DATA(insert OID = 3042 ( pg_stat_get_xact_tuples_deleted PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_xact_tuples_deleted _null_ _null_ _null_ )); DESCR("statistics: number of tuples deleted in current transaction"); DATA(insert OID = 3043 ( pg_stat_get_xact_tuples_hot_updated PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_xact_tuples_hot_updated _null_ _null_ _null_ )); DESCR("statistics: number of tuples hot updated in current transaction"); DATA(insert OID = 3044 ( pg_stat_get_xact_blocks_fetched PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_xact_blocks_fetched _null_ _null_ _null_ )); DESCR("statistics: number of blocks fetched in current transaction"); DATA(insert OID = 3045 ( pg_stat_get_xact_blocks_hit PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_xact_blocks_hit _null_ _null_ _null_ )); DESCR("statistics: number of blocks found in cache in current transaction"); DATA(insert OID = 3046 ( pg_stat_get_xact_function_calls PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 20 "26" _null_ _null_ _null_ _null_ pg_stat_get_xact_function_calls _null_ _null_ _null_ )); DESCR("statistics: number of function calls in current transaction"); DATA(insert OID = 3047 ( pg_stat_get_xact_function_total_time PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 701 "26" _null_ _null_ _null_ _null_ pg_stat_get_xact_function_total_time _null_ _null_ _null_ )); DESCR("statistics: total execution time of function in current transaction, in msec"); DATA(insert OID = 3048 ( pg_stat_get_xact_function_self_time PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 701 "26" _null_ _null_ _null_ _null_ pg_stat_get_xact_function_self_time _null_ _null_ _null_ )); DESCR("statistics: self execution time of function in current transaction, in msec"); DATA(insert OID = 2230 ( pg_stat_clear_snapshot PGNSP PGUID 12 1 0 0 0 f f f f f f v 0 0 2278 "" _null_ _null_ _null_ _null_ pg_stat_clear_snapshot _null_ _null_ _null_ )); DESCR("statistics: discard current transaction's statistics snapshot"); DATA(insert OID = 2274 ( pg_stat_reset PGNSP PGUID 12 1 0 0 0 f f f f f f v 0 0 2278 "" _null_ _null_ _null_ _null_ pg_stat_reset _null_ _null_ _null_ )); DESCR("statistics: reset collected statistics for current database"); DATA(insert OID = 3775 ( pg_stat_reset_shared PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 2278 "25" _null_ _null_ _null_ _null_ pg_stat_reset_shared _null_ _null_ _null_ )); DESCR("statistics: reset collected statistics shared across the cluster"); DATA(insert OID = 3776 ( pg_stat_reset_single_table_counters PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 2278 "26" _null_ _null_ _null_ _null_ pg_stat_reset_single_table_counters _null_ _null_ _null_ )); DESCR("statistics: reset collected statistics for a single table or index in the current database"); DATA(insert OID = 3777 ( pg_stat_reset_single_function_counters PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 2278 "26" _null_ _null_ _null_ _null_ pg_stat_reset_single_function_counters _null_ _null_ _null_ )); DESCR("statistics: reset collected statistics for a single function in the current database"); DATA(insert OID = 3163 ( pg_trigger_depth PGNSP PGUID 12 1 0 0 0 f f f f t f s 0 0 23 "" _null_ _null_ _null_ _null_ pg_trigger_depth _null_ _null_ _null_ )); DESCR("current trigger depth"); DATA(insert OID = 3778 ( pg_tablespace_location PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 25 "26" _null_ _null_ _null_ _null_ pg_tablespace_location _null_ _null_ _null_ )); DESCR("tablespace location"); DATA(insert OID = 1946 ( encode PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 25 "17 25" _null_ _null_ _null_ _null_ binary_encode _null_ _null_ _null_ )); DESCR("convert bytea value into some ascii-only text string"); DATA(insert OID = 1947 ( decode PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 17 "25 25" _null_ _null_ _null_ _null_ binary_decode _null_ _null_ _null_ )); DESCR("convert ascii-encoded text string into bytea value"); DATA(insert OID = 1948 ( byteaeq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "17 17" _null_ _null_ _null_ _null_ byteaeq _null_ _null_ _null_ )); DATA(insert OID = 1949 ( bytealt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "17 17" _null_ _null_ _null_ _null_ bytealt _null_ _null_ _null_ )); DATA(insert OID = 1950 ( byteale PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "17 17" _null_ _null_ _null_ _null_ byteale _null_ _null_ _null_ )); DATA(insert OID = 1951 ( byteagt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "17 17" _null_ _null_ _null_ _null_ byteagt _null_ _null_ _null_ )); DATA(insert OID = 1952 ( byteage PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "17 17" _null_ _null_ _null_ _null_ byteage _null_ _null_ _null_ )); DATA(insert OID = 1953 ( byteane PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "17 17" _null_ _null_ _null_ _null_ byteane _null_ _null_ _null_ )); DATA(insert OID = 1954 ( byteacmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "17 17" _null_ _null_ _null_ _null_ byteacmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 3917 ( timestamp_transform PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2281 "2281" _null_ _null_ _null_ _null_ timestamp_transform _null_ _null_ _null_ )); DESCR("transform a timestamp length coercion"); DATA(insert OID = 3944 ( time_transform PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2281 "2281" _null_ _null_ _null_ _null_ time_transform _null_ _null_ _null_ )); DESCR("transform a time length coercion"); DATA(insert OID = 1961 ( timestamp PGNSP PGUID 12 1 0 0 timestamp_transform f f f f t f i 2 0 1114 "1114 23" _null_ _null_ _null_ _null_ timestamp_scale _null_ _null_ _null_ )); DESCR("adjust timestamp precision"); DATA(insert OID = 1965 ( oidlarger PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 26 "26 26" _null_ _null_ _null_ _null_ oidlarger _null_ _null_ _null_ )); DESCR("larger of two"); DATA(insert OID = 1966 ( oidsmaller PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 26 "26 26" _null_ _null_ _null_ _null_ oidsmaller _null_ _null_ _null_ )); DESCR("smaller of two"); DATA(insert OID = 1967 ( timestamptz PGNSP PGUID 12 1 0 0 timestamp_transform f f f f t f i 2 0 1184 "1184 23" _null_ _null_ _null_ _null_ timestamptz_scale _null_ _null_ _null_ )); DESCR("adjust timestamptz precision"); DATA(insert OID = 1968 ( time PGNSP PGUID 12 1 0 0 time_transform f f f f t f i 2 0 1083 "1083 23" _null_ _null_ _null_ _null_ time_scale _null_ _null_ _null_ )); DESCR("adjust time precision"); DATA(insert OID = 1969 ( timetz PGNSP PGUID 12 1 0 0 time_transform f f f f t f i 2 0 1266 "1266 23" _null_ _null_ _null_ _null_ timetz_scale _null_ _null_ _null_ )); DESCR("adjust time with time zone precision"); DATA(insert OID = 2003 ( textanycat PGNSP PGUID 14 1 0 0 0 f f f f t f s 2 0 25 "25 2776" _null_ _null_ _null_ _null_ "select $1 || $2::pg_catalog.text" _null_ _null_ _null_ )); DATA(insert OID = 2004 ( anytextcat PGNSP PGUID 14 1 0 0 0 f f f f t f s 2 0 25 "2776 25" _null_ _null_ _null_ _null_ "select $1::pg_catalog.text || $2" _null_ _null_ _null_ )); DATA(insert OID = 2005 ( bytealike PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "17 17" _null_ _null_ _null_ _null_ bytealike _null_ _null_ _null_ )); DATA(insert OID = 2006 ( byteanlike PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "17 17" _null_ _null_ _null_ _null_ byteanlike _null_ _null_ _null_ )); DATA(insert OID = 2007 ( like PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "17 17" _null_ _null_ _null_ _null_ bytealike _null_ _null_ _null_ )); DESCR("matches LIKE expression"); DATA(insert OID = 2008 ( notlike PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "17 17" _null_ _null_ _null_ _null_ byteanlike _null_ _null_ _null_ )); DESCR("does not match LIKE expression"); DATA(insert OID = 2009 ( like_escape PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 17 "17 17" _null_ _null_ _null_ _null_ like_escape_bytea _null_ _null_ _null_ )); DESCR("convert LIKE pattern to use backslash escapes"); DATA(insert OID = 2010 ( length PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "17" _null_ _null_ _null_ _null_ byteaoctetlen _null_ _null_ _null_ )); DESCR("octet length"); DATA(insert OID = 2011 ( byteacat PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 17 "17 17" _null_ _null_ _null_ _null_ byteacat _null_ _null_ _null_ )); DATA(insert OID = 2012 ( substring PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 17 "17 23 23" _null_ _null_ _null_ _null_ bytea_substr _null_ _null_ _null_ )); DESCR("extract portion of string"); DATA(insert OID = 2013 ( substring PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 17 "17 23" _null_ _null_ _null_ _null_ bytea_substr_no_len _null_ _null_ _null_ )); DESCR("extract portion of string"); DATA(insert OID = 2085 ( substr PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 17 "17 23 23" _null_ _null_ _null_ _null_ bytea_substr _null_ _null_ _null_ )); DESCR("extract portion of string"); DATA(insert OID = 2086 ( substr PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 17 "17 23" _null_ _null_ _null_ _null_ bytea_substr_no_len _null_ _null_ _null_ )); DESCR("extract portion of string"); DATA(insert OID = 2014 ( position PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "17 17" _null_ _null_ _null_ _null_ byteapos _null_ _null_ _null_ )); DESCR("position of substring"); DATA(insert OID = 2015 ( btrim PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 17 "17 17" _null_ _null_ _null_ _null_ byteatrim _null_ _null_ _null_ )); DESCR("trim both ends of string"); DATA(insert OID = 2019 ( time PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 1083 "1184" _null_ _null_ _null_ _null_ timestamptz_time _null_ _null_ _null_ )); DESCR("convert timestamp with time zone to time"); DATA(insert OID = 2020 ( date_trunc PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1114 "25 1114" _null_ _null_ _null_ _null_ timestamp_trunc _null_ _null_ _null_ )); DESCR("truncate timestamp to specified units"); DATA(insert OID = 2021 ( date_part PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "25 1114" _null_ _null_ _null_ _null_ timestamp_part _null_ _null_ _null_ )); DESCR("extract field from timestamp"); DATA(insert OID = 2023 ( timestamp PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 1114 "702" _null_ _null_ _null_ _null_ abstime_timestamp _null_ _null_ _null_ )); DESCR("convert abstime to timestamp"); DATA(insert OID = 2024 ( timestamp PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1114 "1082" _null_ _null_ _null_ _null_ date_timestamp _null_ _null_ _null_ )); DESCR("convert date to timestamp"); DATA(insert OID = 2025 ( timestamp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1114 "1082 1083" _null_ _null_ _null_ _null_ datetime_timestamp _null_ _null_ _null_ )); DESCR("convert date and time to timestamp"); DATA(insert OID = 2027 ( timestamp PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 1114 "1184" _null_ _null_ _null_ _null_ timestamptz_timestamp _null_ _null_ _null_ )); DESCR("convert timestamp with time zone to timestamp"); DATA(insert OID = 2028 ( timestamptz PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 1184 "1114" _null_ _null_ _null_ _null_ timestamp_timestamptz _null_ _null_ _null_ )); DESCR("convert timestamp to timestamp with time zone"); DATA(insert OID = 2029 ( date PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1082 "1114" _null_ _null_ _null_ _null_ timestamp_date _null_ _null_ _null_ )); DESCR("convert timestamp to date"); DATA(insert OID = 2030 ( abstime PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 702 "1114" _null_ _null_ _null_ _null_ timestamp_abstime _null_ _null_ _null_ )); DESCR("convert timestamp to abstime"); DATA(insert OID = 2031 ( timestamp_mi PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1186 "1114 1114" _null_ _null_ _null_ _null_ timestamp_mi _null_ _null_ _null_ )); DATA(insert OID = 2032 ( timestamp_pl_interval PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1114 "1114 1186" _null_ _null_ _null_ _null_ timestamp_pl_interval _null_ _null_ _null_ )); DATA(insert OID = 2033 ( timestamp_mi_interval PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1114 "1114 1186" _null_ _null_ _null_ _null_ timestamp_mi_interval _null_ _null_ _null_ )); DATA(insert OID = 2035 ( timestamp_smaller PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1114 "1114 1114" _null_ _null_ _null_ _null_ timestamp_smaller _null_ _null_ _null_ )); DESCR("smaller of two"); DATA(insert OID = 2036 ( timestamp_larger PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1114 "1114 1114" _null_ _null_ _null_ _null_ timestamp_larger _null_ _null_ _null_ )); DESCR("larger of two"); DATA(insert OID = 2037 ( timezone PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 1266 "25 1266" _null_ _null_ _null_ _null_ timetz_zone _null_ _null_ _null_ )); DESCR("adjust time with time zone to new zone"); DATA(insert OID = 2038 ( timezone PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1266 "1186 1266" _null_ _null_ _null_ _null_ timetz_izone _null_ _null_ _null_ )); DESCR("adjust time with time zone to new zone"); DATA(insert OID = 2039 ( timestamp_hash PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "1114" _null_ _null_ _null_ _null_ timestamp_hash _null_ _null_ _null_ )); DESCR("hash"); DATA(insert OID = 2041 ( overlaps PGNSP PGUID 12 1 0 0 0 f f f f f f i 4 0 16 "1114 1114 1114 1114" _null_ _null_ _null_ _null_ overlaps_timestamp _null_ _null_ _null_ )); DESCR("intervals overlap?"); DATA(insert OID = 2042 ( overlaps PGNSP PGUID 14 1 0 0 0 f f f f f f i 4 0 16 "1114 1186 1114 1186" _null_ _null_ _null_ _null_ "select ($1, ($1 + $2)) overlaps ($3, ($3 + $4))" _null_ _null_ _null_ )); DESCR("intervals overlap?"); DATA(insert OID = 2043 ( overlaps PGNSP PGUID 14 1 0 0 0 f f f f f f i 4 0 16 "1114 1114 1114 1186" _null_ _null_ _null_ _null_ "select ($1, $2) overlaps ($3, ($3 + $4))" _null_ _null_ _null_ )); DESCR("intervals overlap?"); DATA(insert OID = 2044 ( overlaps PGNSP PGUID 14 1 0 0 0 f f f f f f i 4 0 16 "1114 1186 1114 1114" _null_ _null_ _null_ _null_ "select ($1, ($1 + $2)) overlaps ($3, $4)" _null_ _null_ _null_ )); DESCR("intervals overlap?"); DATA(insert OID = 2045 ( timestamp_cmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "1114 1114" _null_ _null_ _null_ _null_ timestamp_cmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 3137 ( timestamp_sortsupport PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2278 "2281" _null_ _null_ _null_ _null_ timestamp_sortsupport _null_ _null_ _null_ )); DESCR("sort support"); DATA(insert OID = 2046 ( time PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1083 "1266" _null_ _null_ _null_ _null_ timetz_time _null_ _null_ _null_ )); DESCR("convert time with time zone to time"); DATA(insert OID = 2047 ( timetz PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 1266 "1083" _null_ _null_ _null_ _null_ time_timetz _null_ _null_ _null_ )); DESCR("convert time to time with time zone"); DATA(insert OID = 2048 ( isfinite PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 16 "1114" _null_ _null_ _null_ _null_ timestamp_finite _null_ _null_ _null_ )); DESCR("finite timestamp?"); DATA(insert OID = 2049 ( to_char PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 25 "1114 25" _null_ _null_ _null_ _null_ timestamp_to_char _null_ _null_ _null_ )); DESCR("format timestamp to text"); DATA(insert OID = 2052 ( timestamp_eq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1114 1114" _null_ _null_ _null_ _null_ timestamp_eq _null_ _null_ _null_ )); DATA(insert OID = 2053 ( timestamp_ne PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1114 1114" _null_ _null_ _null_ _null_ timestamp_ne _null_ _null_ _null_ )); DATA(insert OID = 2054 ( timestamp_lt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1114 1114" _null_ _null_ _null_ _null_ timestamp_lt _null_ _null_ _null_ )); DATA(insert OID = 2055 ( timestamp_le PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1114 1114" _null_ _null_ _null_ _null_ timestamp_le _null_ _null_ _null_ )); DATA(insert OID = 2056 ( timestamp_ge PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1114 1114" _null_ _null_ _null_ _null_ timestamp_ge _null_ _null_ _null_ )); DATA(insert OID = 2057 ( timestamp_gt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1114 1114" _null_ _null_ _null_ _null_ timestamp_gt _null_ _null_ _null_ )); DATA(insert OID = 2058 ( age PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1186 "1114 1114" _null_ _null_ _null_ _null_ timestamp_age _null_ _null_ _null_ )); DESCR("date difference preserving months and years"); DATA(insert OID = 2059 ( age PGNSP PGUID 14 1 0 0 0 f f f f t f s 1 0 1186 "1114" _null_ _null_ _null_ _null_ "select pg_catalog.age(cast(current_date as timestamp without time zone), $1)" _null_ _null_ _null_ )); DESCR("date difference from today preserving months and years"); DATA(insert OID = 2069 ( timezone PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1184 "25 1114" _null_ _null_ _null_ _null_ timestamp_zone _null_ _null_ _null_ )); DESCR("adjust timestamp to new time zone"); DATA(insert OID = 2070 ( timezone PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1184 "1186 1114" _null_ _null_ _null_ _null_ timestamp_izone _null_ _null_ _null_ )); DESCR("adjust timestamp to new time zone"); DATA(insert OID = 2071 ( date_pl_interval PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1114 "1082 1186" _null_ _null_ _null_ _null_ date_pl_interval _null_ _null_ _null_ )); DATA(insert OID = 2072 ( date_mi_interval PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1114 "1082 1186" _null_ _null_ _null_ _null_ date_mi_interval _null_ _null_ _null_ )); DATA(insert OID = 2073 ( substring PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 25 "25 25" _null_ _null_ _null_ _null_ textregexsubstr _null_ _null_ _null_ )); DESCR("extract text matching regular expression"); DATA(insert OID = 2074 ( substring PGNSP PGUID 14 1 0 0 0 f f f f t f i 3 0 25 "25 25 25" _null_ _null_ _null_ _null_ "select pg_catalog.substring($1, pg_catalog.similar_escape($2, $3))" _null_ _null_ _null_ )); DESCR("extract text matching SQL99 regular expression"); DATA(insert OID = 2075 ( bit PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1560 "20 23" _null_ _null_ _null_ _null_ bitfromint8 _null_ _null_ _null_ )); DESCR("convert int8 to bitstring"); DATA(insert OID = 2076 ( int8 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 20 "1560" _null_ _null_ _null_ _null_ bittoint8 _null_ _null_ _null_ )); DESCR("convert bitstring to int8"); DATA(insert OID = 2077 ( current_setting PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 25 "25" _null_ _null_ _null_ _null_ show_config_by_name _null_ _null_ _null_ )); DESCR("SHOW X as a function"); DATA(insert OID = 2078 ( set_config PGNSP PGUID 12 1 0 0 0 f f f f f f v 3 0 25 "25 25 16" _null_ _null_ _null_ _null_ set_config_by_name _null_ _null_ _null_ )); DESCR("SET X as a function"); DATA(insert OID = 2084 ( pg_show_all_settings PGNSP PGUID 12 1 1000 0 0 f f f f t t s 0 0 2249 "" "{25,25,25,25,25,25,25,25,25,25,25,1009,25,25,25,23}" "{o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o}" "{name,setting,unit,category,short_desc,extra_desc,context,vartype,source,min_val,max_val,enumvals,boot_val,reset_val,sourcefile,sourceline}" _null_ show_all_settings _null_ _null_ _null_ )); DESCR("SHOW ALL as a function"); DATA(insert OID = 1371 ( pg_lock_status PGNSP PGUID 12 1 1000 0 0 f f f f t t v 0 0 2249 "" "{25,26,26,23,21,25,28,26,26,21,25,23,25,16,16}" "{o,o,o,o,o,o,o,o,o,o,o,o,o,o,o}" "{locktype,database,relation,page,tuple,virtualxid,transactionid,classid,objid,objsubid,virtualtransaction,pid,mode,granted,fastpath}" _null_ pg_lock_status _null_ _null_ _null_ )); DESCR("view system lock information"); DATA(insert OID = 1065 ( pg_prepared_xact PGNSP PGUID 12 1 1000 0 0 f f f f t t v 0 0 2249 "" "{28,25,1184,26,26}" "{o,o,o,o,o}" "{transaction,gid,prepared,ownerid,dbid}" _null_ pg_prepared_xact _null_ _null_ _null_ )); DESCR("view two-phase transactions"); DATA(insert OID = 3537 ( pg_describe_object PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 25 "26 26 23" _null_ _null_ _null_ _null_ pg_describe_object _null_ _null_ _null_ )); DESCR("get identification of SQL object"); DATA(insert OID = 2079 ( pg_table_is_visible PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 16 "26" _null_ _null_ _null_ _null_ pg_table_is_visible _null_ _null_ _null_ )); DESCR("is table visible in search path?"); DATA(insert OID = 2080 ( pg_type_is_visible PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 16 "26" _null_ _null_ _null_ _null_ pg_type_is_visible _null_ _null_ _null_ )); DESCR("is type visible in search path?"); DATA(insert OID = 2081 ( pg_function_is_visible PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 16 "26" _null_ _null_ _null_ _null_ pg_function_is_visible _null_ _null_ _null_ )); DESCR("is function visible in search path?"); DATA(insert OID = 2082 ( pg_operator_is_visible PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 16 "26" _null_ _null_ _null_ _null_ pg_operator_is_visible _null_ _null_ _null_ )); DESCR("is operator visible in search path?"); DATA(insert OID = 2083 ( pg_opclass_is_visible PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 16 "26" _null_ _null_ _null_ _null_ pg_opclass_is_visible _null_ _null_ _null_ )); DESCR("is opclass visible in search path?"); DATA(insert OID = 3829 ( pg_opfamily_is_visible PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 16 "26" _null_ _null_ _null_ _null_ pg_opfamily_is_visible _null_ _null_ _null_ )); DESCR("is opfamily visible in search path?"); DATA(insert OID = 2093 ( pg_conversion_is_visible PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 16 "26" _null_ _null_ _null_ _null_ pg_conversion_is_visible _null_ _null_ _null_ )); DESCR("is conversion visible in search path?"); DATA(insert OID = 3756 ( pg_ts_parser_is_visible PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 16 "26" _null_ _null_ _null_ _null_ pg_ts_parser_is_visible _null_ _null_ _null_ )); DESCR("is text search parser visible in search path?"); DATA(insert OID = 3757 ( pg_ts_dict_is_visible PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 16 "26" _null_ _null_ _null_ _null_ pg_ts_dict_is_visible _null_ _null_ _null_ )); DESCR("is text search dictionary visible in search path?"); DATA(insert OID = 3768 ( pg_ts_template_is_visible PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 16 "26" _null_ _null_ _null_ _null_ pg_ts_template_is_visible _null_ _null_ _null_ )); DESCR("is text search template visible in search path?"); DATA(insert OID = 3758 ( pg_ts_config_is_visible PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 16 "26" _null_ _null_ _null_ _null_ pg_ts_config_is_visible _null_ _null_ _null_ )); DESCR("is text search configuration visible in search path?"); DATA(insert OID = 3815 ( pg_collation_is_visible PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 16 "26" _null_ _null_ _null_ _null_ pg_collation_is_visible _null_ _null_ _null_ )); DESCR("is collation visible in search path?"); DATA(insert OID = 2854 ( pg_my_temp_schema PGNSP PGUID 12 1 0 0 0 f f f f t f s 0 0 26 "" _null_ _null_ _null_ _null_ pg_my_temp_schema _null_ _null_ _null_ )); DESCR("get OID of current session's temp schema, if any"); DATA(insert OID = 2855 ( pg_is_other_temp_schema PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 16 "26" _null_ _null_ _null_ _null_ pg_is_other_temp_schema _null_ _null_ _null_ )); DESCR("is schema another session's temp schema?"); DATA(insert OID = 2171 ( pg_cancel_backend PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 16 "23" _null_ _null_ _null_ _null_ pg_cancel_backend _null_ _null_ _null_ )); DESCR("cancel a server process' current query"); DATA(insert OID = 2096 ( pg_terminate_backend PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 16 "23" _null_ _null_ _null_ _null_ pg_terminate_backend _null_ _null_ _null_ )); DESCR("terminate a server process"); DATA(insert OID = 2172 ( pg_start_backup PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 25 "25 16" _null_ _null_ _null_ _null_ pg_start_backup _null_ _null_ _null_ )); DESCR("prepare for taking an online backup"); DATA(insert OID = 2173 ( pg_stop_backup PGNSP PGUID 12 1 0 0 0 f f f f t f v 0 0 25 "" _null_ _null_ _null_ _null_ pg_stop_backup _null_ _null_ _null_ )); DESCR("finish taking an online backup"); DATA(insert OID = 2848 ( pg_switch_xlog PGNSP PGUID 12 1 0 0 0 f f f f t f v 0 0 25 "" _null_ _null_ _null_ _null_ pg_switch_xlog _null_ _null_ _null_ )); DESCR("switch to new xlog file"); DATA(insert OID = 3098 ( pg_create_restore_point PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 25 "25" _null_ _null_ _null_ _null_ pg_create_restore_point _null_ _null_ _null_ )); DESCR("create a named restore point"); DATA(insert OID = 2849 ( pg_current_xlog_location PGNSP PGUID 12 1 0 0 0 f f f f t f v 0 0 25 "" _null_ _null_ _null_ _null_ pg_current_xlog_location _null_ _null_ _null_ )); DESCR("current xlog write location"); DATA(insert OID = 2852 ( pg_current_xlog_insert_location PGNSP PGUID 12 1 0 0 0 f f f f t f v 0 0 25 "" _null_ _null_ _null_ _null_ pg_current_xlog_insert_location _null_ _null_ _null_ )); DESCR("current xlog insert location"); DATA(insert OID = 2850 ( pg_xlogfile_name_offset PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2249 "25" "{25,25,23}" "{i,o,o}" "{wal_location,file_name,file_offset}" _null_ pg_xlogfile_name_offset _null_ _null_ _null_ )); DESCR("xlog filename and byte offset, given an xlog location"); DATA(insert OID = 2851 ( pg_xlogfile_name PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 25 "25" _null_ _null_ _null_ _null_ pg_xlogfile_name _null_ _null_ _null_ )); DESCR("xlog filename, given an xlog location"); DATA(insert OID = 3165 ( pg_xlog_location_diff PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1700 "25 25" _null_ _null_ _null_ _null_ pg_xlog_location_diff _null_ _null_ _null_ )); DESCR("difference in bytes, given two xlog locations"); DATA(insert OID = 3809 ( pg_export_snapshot PGNSP PGUID 12 1 0 0 0 f f f f t f v 0 0 25 "" _null_ _null_ _null_ _null_ pg_export_snapshot _null_ _null_ _null_ )); DESCR("export a snapshot"); DATA(insert OID = 3810 ( pg_is_in_recovery PGNSP PGUID 12 1 0 0 0 f f f f t f v 0 0 16 "" _null_ _null_ _null_ _null_ pg_is_in_recovery _null_ _null_ _null_ )); DESCR("true if server is in recovery"); DATA(insert OID = 3820 ( pg_last_xlog_receive_location PGNSP PGUID 12 1 0 0 0 f f f f t f v 0 0 25 "" _null_ _null_ _null_ _null_ pg_last_xlog_receive_location _null_ _null_ _null_ )); DESCR("current xlog flush location"); DATA(insert OID = 3821 ( pg_last_xlog_replay_location PGNSP PGUID 12 1 0 0 0 f f f f t f v 0 0 25 "" _null_ _null_ _null_ _null_ pg_last_xlog_replay_location _null_ _null_ _null_ )); DESCR("last xlog replay location"); DATA(insert OID = 3830 ( pg_last_xact_replay_timestamp PGNSP PGUID 12 1 0 0 0 f f f f t f v 0 0 1184 "" _null_ _null_ _null_ _null_ pg_last_xact_replay_timestamp _null_ _null_ _null_ )); DESCR("timestamp of last replay xact"); DATA(insert OID = 3071 ( pg_xlog_replay_pause PGNSP PGUID 12 1 0 0 0 f f f f t f v 0 0 2278 "" _null_ _null_ _null_ _null_ pg_xlog_replay_pause _null_ _null_ _null_ )); DESCR("pause xlog replay"); DATA(insert OID = 3072 ( pg_xlog_replay_resume PGNSP PGUID 12 1 0 0 0 f f f f t f v 0 0 2278 "" _null_ _null_ _null_ _null_ pg_xlog_replay_resume _null_ _null_ _null_ )); DESCR("resume xlog replay, if it was paused"); DATA(insert OID = 3073 ( pg_is_xlog_replay_paused PGNSP PGUID 12 1 0 0 0 f f f f t f v 0 0 16 "" _null_ _null_ _null_ _null_ pg_is_xlog_replay_paused _null_ _null_ _null_ )); DESCR("true if xlog replay is paused"); DATA(insert OID = 2621 ( pg_reload_conf PGNSP PGUID 12 1 0 0 0 f f f f t f v 0 0 16 "" _null_ _null_ _null_ _null_ pg_reload_conf _null_ _null_ _null_ )); DESCR("reload configuration files"); DATA(insert OID = 2622 ( pg_rotate_logfile PGNSP PGUID 12 1 0 0 0 f f f f t f v 0 0 16 "" _null_ _null_ _null_ _null_ pg_rotate_logfile _null_ _null_ _null_ )); DESCR("rotate log file"); DATA(insert OID = 2623 ( pg_stat_file PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 2249 "25" "{25,20,1184,1184,1184,1184,16}" "{i,o,o,o,o,o,o}" "{filename,size,access,modification,change,creation,isdir}" _null_ pg_stat_file _null_ _null_ _null_ )); DESCR("get information about file"); DATA(insert OID = 2624 ( pg_read_file PGNSP PGUID 12 1 0 0 0 f f f f t f v 3 0 25 "25 20 20" _null_ _null_ _null_ _null_ pg_read_file _null_ _null_ _null_ )); DESCR("read text from a file"); DATA(insert OID = 3826 ( pg_read_file PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 25 "25" _null_ _null_ _null_ _null_ pg_read_file_all _null_ _null_ _null_ )); DESCR("read text from a file"); DATA(insert OID = 3827 ( pg_read_binary_file PGNSP PGUID 12 1 0 0 0 f f f f t f v 3 0 17 "25 20 20" _null_ _null_ _null_ _null_ pg_read_binary_file _null_ _null_ _null_ )); DESCR("read bytea from a file"); DATA(insert OID = 3828 ( pg_read_binary_file PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 17 "25" _null_ _null_ _null_ _null_ pg_read_binary_file_all _null_ _null_ _null_ )); DESCR("read bytea from a file"); DATA(insert OID = 2625 ( pg_ls_dir PGNSP PGUID 12 1 1000 0 0 f f f f t t v 1 0 25 "25" _null_ _null_ _null_ _null_ pg_ls_dir _null_ _null_ _null_ )); DESCR("list all files in a directory"); DATA(insert OID = 2626 ( pg_sleep PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 2278 "701" _null_ _null_ _null_ _null_ pg_sleep _null_ _null_ _null_ )); DESCR("sleep for the specified time in seconds"); DATA(insert OID = 2971 ( text PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 25 "16" _null_ _null_ _null_ _null_ booltext _null_ _null_ _null_ )); DESCR("convert boolean to text"); /* Aggregates (moved here from pg_aggregate for 7.3) */ DATA(insert OID = 2100 ( avg PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1700 "20" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("the average (arithmetic mean) as numeric of all bigint values"); DATA(insert OID = 2101 ( avg PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1700 "23" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("the average (arithmetic mean) as numeric of all integer values"); DATA(insert OID = 2102 ( avg PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1700 "21" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("the average (arithmetic mean) as numeric of all smallint values"); DATA(insert OID = 2103 ( avg PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1700 "1700" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("the average (arithmetic mean) as numeric of all numeric values"); DATA(insert OID = 2104 ( avg PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 701 "700" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("the average (arithmetic mean) as float8 of all float4 values"); DATA(insert OID = 2105 ( avg PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 701 "701" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("the average (arithmetic mean) as float8 of all float8 values"); DATA(insert OID = 2106 ( avg PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1186 "1186" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("the average (arithmetic mean) as interval of all interval values"); DATA(insert OID = 2107 ( sum PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1700 "20" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("sum as numeric across all bigint input values"); DATA(insert OID = 2108 ( sum PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 20 "23" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("sum as bigint across all integer input values"); DATA(insert OID = 2109 ( sum PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 20 "21" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("sum as bigint across all smallint input values"); DATA(insert OID = 2110 ( sum PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 700 "700" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("sum as float4 across all float4 input values"); DATA(insert OID = 2111 ( sum PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 701 "701" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("sum as float8 across all float8 input values"); DATA(insert OID = 2112 ( sum PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 790 "790" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("sum as money across all money input values"); DATA(insert OID = 2113 ( sum PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1186 "1186" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("sum as interval across all interval input values"); DATA(insert OID = 2114 ( sum PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1700 "1700" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("sum as numeric across all numeric input values"); DATA(insert OID = 2115 ( max PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 20 "20" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("maximum value of all bigint input values"); DATA(insert OID = 2116 ( max PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 23 "23" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("maximum value of all integer input values"); DATA(insert OID = 2117 ( max PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 21 "21" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("maximum value of all smallint input values"); DATA(insert OID = 2118 ( max PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 26 "26" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("maximum value of all oid input values"); DATA(insert OID = 2119 ( max PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 700 "700" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("maximum value of all float4 input values"); DATA(insert OID = 2120 ( max PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 701 "701" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("maximum value of all float8 input values"); DATA(insert OID = 2121 ( max PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 702 "702" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("maximum value of all abstime input values"); DATA(insert OID = 2122 ( max PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1082 "1082" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("maximum value of all date input values"); DATA(insert OID = 2123 ( max PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1083 "1083" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("maximum value of all time input values"); DATA(insert OID = 2124 ( max PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1266 "1266" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("maximum value of all time with time zone input values"); DATA(insert OID = 2125 ( max PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 790 "790" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("maximum value of all money input values"); DATA(insert OID = 2126 ( max PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1114 "1114" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("maximum value of all timestamp input values"); DATA(insert OID = 2127 ( max PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1184 "1184" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("maximum value of all timestamp with time zone input values"); DATA(insert OID = 2128 ( max PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1186 "1186" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("maximum value of all interval input values"); DATA(insert OID = 2129 ( max PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 25 "25" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("maximum value of all text input values"); DATA(insert OID = 2130 ( max PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1700 "1700" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("maximum value of all numeric input values"); DATA(insert OID = 2050 ( max PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 2277 "2277" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("maximum value of all anyarray input values"); DATA(insert OID = 2244 ( max PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1042 "1042" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("maximum value of all bpchar input values"); DATA(insert OID = 2797 ( max PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 27 "27" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("maximum value of all tid input values"); DATA(insert OID = 2131 ( min PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 20 "20" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("minimum value of all bigint input values"); DATA(insert OID = 2132 ( min PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 23 "23" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("minimum value of all integer input values"); DATA(insert OID = 2133 ( min PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 21 "21" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("minimum value of all smallint input values"); DATA(insert OID = 2134 ( min PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 26 "26" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("minimum value of all oid input values"); DATA(insert OID = 2135 ( min PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 700 "700" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("minimum value of all float4 input values"); DATA(insert OID = 2136 ( min PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 701 "701" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("minimum value of all float8 input values"); DATA(insert OID = 2137 ( min PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 702 "702" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("minimum value of all abstime input values"); DATA(insert OID = 2138 ( min PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1082 "1082" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("minimum value of all date input values"); DATA(insert OID = 2139 ( min PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1083 "1083" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("minimum value of all time input values"); DATA(insert OID = 2140 ( min PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1266 "1266" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("minimum value of all time with time zone input values"); DATA(insert OID = 2141 ( min PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 790 "790" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("minimum value of all money input values"); DATA(insert OID = 2142 ( min PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1114 "1114" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("minimum value of all timestamp input values"); DATA(insert OID = 2143 ( min PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1184 "1184" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("minimum value of all timestamp with time zone input values"); DATA(insert OID = 2144 ( min PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1186 "1186" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("minimum value of all interval input values"); DATA(insert OID = 2145 ( min PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 25 "25" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("minimum value of all text values"); DATA(insert OID = 2146 ( min PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1700 "1700" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("minimum value of all numeric input values"); DATA(insert OID = 2051 ( min PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 2277 "2277" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("minimum value of all anyarray input values"); DATA(insert OID = 2245 ( min PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1042 "1042" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("minimum value of all bpchar input values"); DATA(insert OID = 2798 ( min PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 27 "27" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("minimum value of all tid input values"); /* count has two forms: count(any) and count(*) */ DATA(insert OID = 2147 ( count PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 20 "2276" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("number of input rows for which the input expression is not null"); DATA(insert OID = 2803 ( count PGNSP PGUID 12 1 0 0 0 t f f f f f i 0 0 20 "" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("number of input rows"); DATA(insert OID = 2718 ( var_pop PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1700 "20" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("population variance of bigint input values (square of the population standard deviation)"); DATA(insert OID = 2719 ( var_pop PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1700 "23" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("population variance of integer input values (square of the population standard deviation)"); DATA(insert OID = 2720 ( var_pop PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1700 "21" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("population variance of smallint input values (square of the population standard deviation)"); DATA(insert OID = 2721 ( var_pop PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 701 "700" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("population variance of float4 input values (square of the population standard deviation)"); DATA(insert OID = 2722 ( var_pop PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 701 "701" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("population variance of float8 input values (square of the population standard deviation)"); DATA(insert OID = 2723 ( var_pop PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1700 "1700" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("population variance of numeric input values (square of the population standard deviation)"); DATA(insert OID = 2641 ( var_samp PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1700 "20" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("sample variance of bigint input values (square of the sample standard deviation)"); DATA(insert OID = 2642 ( var_samp PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1700 "23" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("sample variance of integer input values (square of the sample standard deviation)"); DATA(insert OID = 2643 ( var_samp PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1700 "21" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("sample variance of smallint input values (square of the sample standard deviation)"); DATA(insert OID = 2644 ( var_samp PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 701 "700" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("sample variance of float4 input values (square of the sample standard deviation)"); DATA(insert OID = 2645 ( var_samp PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 701 "701" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("sample variance of float8 input values (square of the sample standard deviation)"); DATA(insert OID = 2646 ( var_samp PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1700 "1700" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("sample variance of numeric input values (square of the sample standard deviation)"); DATA(insert OID = 2148 ( variance PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1700 "20" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("historical alias for var_samp"); DATA(insert OID = 2149 ( variance PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1700 "23" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("historical alias for var_samp"); DATA(insert OID = 2150 ( variance PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1700 "21" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("historical alias for var_samp"); DATA(insert OID = 2151 ( variance PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 701 "700" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("historical alias for var_samp"); DATA(insert OID = 2152 ( variance PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 701 "701" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("historical alias for var_samp"); DATA(insert OID = 2153 ( variance PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1700 "1700" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("historical alias for var_samp"); DATA(insert OID = 2724 ( stddev_pop PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1700 "20" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("population standard deviation of bigint input values"); DATA(insert OID = 2725 ( stddev_pop PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1700 "23" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("population standard deviation of integer input values"); DATA(insert OID = 2726 ( stddev_pop PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1700 "21" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("population standard deviation of smallint input values"); DATA(insert OID = 2727 ( stddev_pop PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 701 "700" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("population standard deviation of float4 input values"); DATA(insert OID = 2728 ( stddev_pop PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 701 "701" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("population standard deviation of float8 input values"); DATA(insert OID = 2729 ( stddev_pop PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1700 "1700" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("population standard deviation of numeric input values"); DATA(insert OID = 2712 ( stddev_samp PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1700 "20" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("sample standard deviation of bigint input values"); DATA(insert OID = 2713 ( stddev_samp PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1700 "23" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("sample standard deviation of integer input values"); DATA(insert OID = 2714 ( stddev_samp PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1700 "21" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("sample standard deviation of smallint input values"); DATA(insert OID = 2715 ( stddev_samp PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 701 "700" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("sample standard deviation of float4 input values"); DATA(insert OID = 2716 ( stddev_samp PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 701 "701" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("sample standard deviation of float8 input values"); DATA(insert OID = 2717 ( stddev_samp PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1700 "1700" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("sample standard deviation of numeric input values"); DATA(insert OID = 2154 ( stddev PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1700 "20" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("historical alias for stddev_samp"); DATA(insert OID = 2155 ( stddev PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1700 "23" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("historical alias for stddev_samp"); DATA(insert OID = 2156 ( stddev PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1700 "21" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("historical alias for stddev_samp"); DATA(insert OID = 2157 ( stddev PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 701 "700" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("historical alias for stddev_samp"); DATA(insert OID = 2158 ( stddev PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 701 "701" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("historical alias for stddev_samp"); DATA(insert OID = 2159 ( stddev PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1700 "1700" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("historical alias for stddev_samp"); DATA(insert OID = 2818 ( regr_count PGNSP PGUID 12 1 0 0 0 t f f f f f i 2 0 20 "701 701" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("number of input rows in which both expressions are not null"); DATA(insert OID = 2819 ( regr_sxx PGNSP PGUID 12 1 0 0 0 t f f f f f i 2 0 701 "701 701" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("sum of squares of the independent variable (sum(X^2) - sum(X)^2/N)"); DATA(insert OID = 2820 ( regr_syy PGNSP PGUID 12 1 0 0 0 t f f f f f i 2 0 701 "701 701" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("sum of squares of the dependent variable (sum(Y^2) - sum(Y)^2/N)"); DATA(insert OID = 2821 ( regr_sxy PGNSP PGUID 12 1 0 0 0 t f f f f f i 2 0 701 "701 701" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("sum of products of independent times dependent variable (sum(X*Y) - sum(X) * sum(Y)/N)"); DATA(insert OID = 2822 ( regr_avgx PGNSP PGUID 12 1 0 0 0 t f f f f f i 2 0 701 "701 701" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("average of the independent variable (sum(X)/N)"); DATA(insert OID = 2823 ( regr_avgy PGNSP PGUID 12 1 0 0 0 t f f f f f i 2 0 701 "701 701" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("average of the dependent variable (sum(Y)/N)"); DATA(insert OID = 2824 ( regr_r2 PGNSP PGUID 12 1 0 0 0 t f f f f f i 2 0 701 "701 701" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("square of the correlation coefficient"); DATA(insert OID = 2825 ( regr_slope PGNSP PGUID 12 1 0 0 0 t f f f f f i 2 0 701 "701 701" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("slope of the least-squares-fit linear equation determined by the (X, Y) pairs"); DATA(insert OID = 2826 ( regr_intercept PGNSP PGUID 12 1 0 0 0 t f f f f f i 2 0 701 "701 701" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("y-intercept of the least-squares-fit linear equation determined by the (X, Y) pairs"); DATA(insert OID = 2827 ( covar_pop PGNSP PGUID 12 1 0 0 0 t f f f f f i 2 0 701 "701 701" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("population covariance"); DATA(insert OID = 2828 ( covar_samp PGNSP PGUID 12 1 0 0 0 t f f f f f i 2 0 701 "701 701" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("sample covariance"); DATA(insert OID = 2829 ( corr PGNSP PGUID 12 1 0 0 0 t f f f f f i 2 0 701 "701 701" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("correlation coefficient"); DATA(insert OID = 2160 ( text_pattern_lt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "25 25" _null_ _null_ _null_ _null_ text_pattern_lt _null_ _null_ _null_ )); DATA(insert OID = 2161 ( text_pattern_le PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "25 25" _null_ _null_ _null_ _null_ text_pattern_le _null_ _null_ _null_ )); DATA(insert OID = 2163 ( text_pattern_ge PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "25 25" _null_ _null_ _null_ _null_ text_pattern_ge _null_ _null_ _null_ )); DATA(insert OID = 2164 ( text_pattern_gt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "25 25" _null_ _null_ _null_ _null_ text_pattern_gt _null_ _null_ _null_ )); DATA(insert OID = 2166 ( bttext_pattern_cmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "25 25" _null_ _null_ _null_ _null_ bttext_pattern_cmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 2174 ( bpchar_pattern_lt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1042 1042" _null_ _null_ _null_ _null_ bpchar_pattern_lt _null_ _null_ _null_ )); DATA(insert OID = 2175 ( bpchar_pattern_le PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1042 1042" _null_ _null_ _null_ _null_ bpchar_pattern_le _null_ _null_ _null_ )); DATA(insert OID = 2177 ( bpchar_pattern_ge PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1042 1042" _null_ _null_ _null_ _null_ bpchar_pattern_ge _null_ _null_ _null_ )); DATA(insert OID = 2178 ( bpchar_pattern_gt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1042 1042" _null_ _null_ _null_ _null_ bpchar_pattern_gt _null_ _null_ _null_ )); DATA(insert OID = 2180 ( btbpchar_pattern_cmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "1042 1042" _null_ _null_ _null_ _null_ btbpchar_pattern_cmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 2188 ( btint48cmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "23 20" _null_ _null_ _null_ _null_ btint48cmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 2189 ( btint84cmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "20 23" _null_ _null_ _null_ _null_ btint84cmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 2190 ( btint24cmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "21 23" _null_ _null_ _null_ _null_ btint24cmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 2191 ( btint42cmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "23 21" _null_ _null_ _null_ _null_ btint42cmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 2192 ( btint28cmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "21 20" _null_ _null_ _null_ _null_ btint28cmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 2193 ( btint82cmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "20 21" _null_ _null_ _null_ _null_ btint82cmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 2194 ( btfloat48cmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "700 701" _null_ _null_ _null_ _null_ btfloat48cmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 2195 ( btfloat84cmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "701 700" _null_ _null_ _null_ _null_ btfloat84cmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 2212 ( regprocedurein PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 2202 "2275" _null_ _null_ _null_ _null_ regprocedurein _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2213 ( regprocedureout PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 2275 "2202" _null_ _null_ _null_ _null_ regprocedureout _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2214 ( regoperin PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 2203 "2275" _null_ _null_ _null_ _null_ regoperin _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2215 ( regoperout PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 2275 "2203" _null_ _null_ _null_ _null_ regoperout _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2216 ( regoperatorin PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 2204 "2275" _null_ _null_ _null_ _null_ regoperatorin _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2217 ( regoperatorout PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 2275 "2204" _null_ _null_ _null_ _null_ regoperatorout _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2218 ( regclassin PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 2205 "2275" _null_ _null_ _null_ _null_ regclassin _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2219 ( regclassout PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 2275 "2205" _null_ _null_ _null_ _null_ regclassout _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2220 ( regtypein PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 2206 "2275" _null_ _null_ _null_ _null_ regtypein _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2221 ( regtypeout PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 2275 "2206" _null_ _null_ _null_ _null_ regtypeout _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 1079 ( regclass PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 2205 "25" _null_ _null_ _null_ _null_ text_regclass _null_ _null_ _null_ )); DESCR("convert text to regclass"); DATA(insert OID = 2246 ( fmgr_internal_validator PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 2278 "26" _null_ _null_ _null_ _null_ fmgr_internal_validator _null_ _null_ _null_ )); DESCR("(internal)"); DATA(insert OID = 2247 ( fmgr_c_validator PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 2278 "26" _null_ _null_ _null_ _null_ fmgr_c_validator _null_ _null_ _null_ )); DESCR("(internal)"); DATA(insert OID = 2248 ( fmgr_sql_validator PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 2278 "26" _null_ _null_ _null_ _null_ fmgr_sql_validator _null_ _null_ _null_ )); DESCR("(internal)"); DATA(insert OID = 2250 ( has_database_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "19 25 25" _null_ _null_ _null_ _null_ has_database_privilege_name_name _null_ _null_ _null_ )); DESCR("user privilege on database by username, database name"); DATA(insert OID = 2251 ( has_database_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "19 26 25" _null_ _null_ _null_ _null_ has_database_privilege_name_id _null_ _null_ _null_ )); DESCR("user privilege on database by username, database oid"); DATA(insert OID = 2252 ( has_database_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "26 25 25" _null_ _null_ _null_ _null_ has_database_privilege_id_name _null_ _null_ _null_ )); DESCR("user privilege on database by user oid, database name"); DATA(insert OID = 2253 ( has_database_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "26 26 25" _null_ _null_ _null_ _null_ has_database_privilege_id_id _null_ _null_ _null_ )); DESCR("user privilege on database by user oid, database oid"); DATA(insert OID = 2254 ( has_database_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "25 25" _null_ _null_ _null_ _null_ has_database_privilege_name _null_ _null_ _null_ )); DESCR("current user privilege on database by database name"); DATA(insert OID = 2255 ( has_database_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "26 25" _null_ _null_ _null_ _null_ has_database_privilege_id _null_ _null_ _null_ )); DESCR("current user privilege on database by database oid"); DATA(insert OID = 2256 ( has_function_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "19 25 25" _null_ _null_ _null_ _null_ has_function_privilege_name_name _null_ _null_ _null_ )); DESCR("user privilege on function by username, function name"); DATA(insert OID = 2257 ( has_function_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "19 26 25" _null_ _null_ _null_ _null_ has_function_privilege_name_id _null_ _null_ _null_ )); DESCR("user privilege on function by username, function oid"); DATA(insert OID = 2258 ( has_function_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "26 25 25" _null_ _null_ _null_ _null_ has_function_privilege_id_name _null_ _null_ _null_ )); DESCR("user privilege on function by user oid, function name"); DATA(insert OID = 2259 ( has_function_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "26 26 25" _null_ _null_ _null_ _null_ has_function_privilege_id_id _null_ _null_ _null_ )); DESCR("user privilege on function by user oid, function oid"); DATA(insert OID = 2260 ( has_function_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "25 25" _null_ _null_ _null_ _null_ has_function_privilege_name _null_ _null_ _null_ )); DESCR("current user privilege on function by function name"); DATA(insert OID = 2261 ( has_function_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "26 25" _null_ _null_ _null_ _null_ has_function_privilege_id _null_ _null_ _null_ )); DESCR("current user privilege on function by function oid"); DATA(insert OID = 2262 ( has_language_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "19 25 25" _null_ _null_ _null_ _null_ has_language_privilege_name_name _null_ _null_ _null_ )); DESCR("user privilege on language by username, language name"); DATA(insert OID = 2263 ( has_language_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "19 26 25" _null_ _null_ _null_ _null_ has_language_privilege_name_id _null_ _null_ _null_ )); DESCR("user privilege on language by username, language oid"); DATA(insert OID = 2264 ( has_language_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "26 25 25" _null_ _null_ _null_ _null_ has_language_privilege_id_name _null_ _null_ _null_ )); DESCR("user privilege on language by user oid, language name"); DATA(insert OID = 2265 ( has_language_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "26 26 25" _null_ _null_ _null_ _null_ has_language_privilege_id_id _null_ _null_ _null_ )); DESCR("user privilege on language by user oid, language oid"); DATA(insert OID = 2266 ( has_language_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "25 25" _null_ _null_ _null_ _null_ has_language_privilege_name _null_ _null_ _null_ )); DESCR("current user privilege on language by language name"); DATA(insert OID = 2267 ( has_language_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "26 25" _null_ _null_ _null_ _null_ has_language_privilege_id _null_ _null_ _null_ )); DESCR("current user privilege on language by language oid"); DATA(insert OID = 2268 ( has_schema_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "19 25 25" _null_ _null_ _null_ _null_ has_schema_privilege_name_name _null_ _null_ _null_ )); DESCR("user privilege on schema by username, schema name"); DATA(insert OID = 2269 ( has_schema_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "19 26 25" _null_ _null_ _null_ _null_ has_schema_privilege_name_id _null_ _null_ _null_ )); DESCR("user privilege on schema by username, schema oid"); DATA(insert OID = 2270 ( has_schema_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "26 25 25" _null_ _null_ _null_ _null_ has_schema_privilege_id_name _null_ _null_ _null_ )); DESCR("user privilege on schema by user oid, schema name"); DATA(insert OID = 2271 ( has_schema_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "26 26 25" _null_ _null_ _null_ _null_ has_schema_privilege_id_id _null_ _null_ _null_ )); DESCR("user privilege on schema by user oid, schema oid"); DATA(insert OID = 2272 ( has_schema_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "25 25" _null_ _null_ _null_ _null_ has_schema_privilege_name _null_ _null_ _null_ )); DESCR("current user privilege on schema by schema name"); DATA(insert OID = 2273 ( has_schema_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "26 25" _null_ _null_ _null_ _null_ has_schema_privilege_id _null_ _null_ _null_ )); DESCR("current user privilege on schema by schema oid"); DATA(insert OID = 2390 ( has_tablespace_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "19 25 25" _null_ _null_ _null_ _null_ has_tablespace_privilege_name_name _null_ _null_ _null_ )); DESCR("user privilege on tablespace by username, tablespace name"); DATA(insert OID = 2391 ( has_tablespace_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "19 26 25" _null_ _null_ _null_ _null_ has_tablespace_privilege_name_id _null_ _null_ _null_ )); DESCR("user privilege on tablespace by username, tablespace oid"); DATA(insert OID = 2392 ( has_tablespace_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "26 25 25" _null_ _null_ _null_ _null_ has_tablespace_privilege_id_name _null_ _null_ _null_ )); DESCR("user privilege on tablespace by user oid, tablespace name"); DATA(insert OID = 2393 ( has_tablespace_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "26 26 25" _null_ _null_ _null_ _null_ has_tablespace_privilege_id_id _null_ _null_ _null_ )); DESCR("user privilege on tablespace by user oid, tablespace oid"); DATA(insert OID = 2394 ( has_tablespace_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "25 25" _null_ _null_ _null_ _null_ has_tablespace_privilege_name _null_ _null_ _null_ )); DESCR("current user privilege on tablespace by tablespace name"); DATA(insert OID = 2395 ( has_tablespace_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "26 25" _null_ _null_ _null_ _null_ has_tablespace_privilege_id _null_ _null_ _null_ )); DESCR("current user privilege on tablespace by tablespace oid"); DATA(insert OID = 3000 ( has_foreign_data_wrapper_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "19 25 25" _null_ _null_ _null_ _null_ has_foreign_data_wrapper_privilege_name_name _null_ _null_ _null_ )); DESCR("user privilege on foreign data wrapper by username, foreign data wrapper name"); DATA(insert OID = 3001 ( has_foreign_data_wrapper_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "19 26 25" _null_ _null_ _null_ _null_ has_foreign_data_wrapper_privilege_name_id _null_ _null_ _null_ )); DESCR("user privilege on foreign data wrapper by username, foreign data wrapper oid"); DATA(insert OID = 3002 ( has_foreign_data_wrapper_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "26 25 25" _null_ _null_ _null_ _null_ has_foreign_data_wrapper_privilege_id_name _null_ _null_ _null_ )); DESCR("user privilege on foreign data wrapper by user oid, foreign data wrapper name"); DATA(insert OID = 3003 ( has_foreign_data_wrapper_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "26 26 25" _null_ _null_ _null_ _null_ has_foreign_data_wrapper_privilege_id_id _null_ _null_ _null_ )); DESCR("user privilege on foreign data wrapper by user oid, foreign data wrapper oid"); DATA(insert OID = 3004 ( has_foreign_data_wrapper_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "25 25" _null_ _null_ _null_ _null_ has_foreign_data_wrapper_privilege_name _null_ _null_ _null_ )); DESCR("current user privilege on foreign data wrapper by foreign data wrapper name"); DATA(insert OID = 3005 ( has_foreign_data_wrapper_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "26 25" _null_ _null_ _null_ _null_ has_foreign_data_wrapper_privilege_id _null_ _null_ _null_ )); DESCR("current user privilege on foreign data wrapper by foreign data wrapper oid"); DATA(insert OID = 3006 ( has_server_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "19 25 25" _null_ _null_ _null_ _null_ has_server_privilege_name_name _null_ _null_ _null_ )); DESCR("user privilege on server by username, server name"); DATA(insert OID = 3007 ( has_server_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "19 26 25" _null_ _null_ _null_ _null_ has_server_privilege_name_id _null_ _null_ _null_ )); DESCR("user privilege on server by username, server oid"); DATA(insert OID = 3008 ( has_server_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "26 25 25" _null_ _null_ _null_ _null_ has_server_privilege_id_name _null_ _null_ _null_ )); DESCR("user privilege on server by user oid, server name"); DATA(insert OID = 3009 ( has_server_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "26 26 25" _null_ _null_ _null_ _null_ has_server_privilege_id_id _null_ _null_ _null_ )); DESCR("user privilege on server by user oid, server oid"); DATA(insert OID = 3010 ( has_server_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "25 25" _null_ _null_ _null_ _null_ has_server_privilege_name _null_ _null_ _null_ )); DESCR("current user privilege on server by server name"); DATA(insert OID = 3011 ( has_server_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "26 25" _null_ _null_ _null_ _null_ has_server_privilege_id _null_ _null_ _null_ )); DESCR("current user privilege on server by server oid"); DATA(insert OID = 3138 ( has_type_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "19 25 25" _null_ _null_ _null_ _null_ has_type_privilege_name_name _null_ _null_ _null_ )); DESCR("user privilege on type by username, type name"); DATA(insert OID = 3139 ( has_type_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "19 26 25" _null_ _null_ _null_ _null_ has_type_privilege_name_id _null_ _null_ _null_ )); DESCR("user privilege on type by username, type oid"); DATA(insert OID = 3140 ( has_type_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "26 25 25" _null_ _null_ _null_ _null_ has_type_privilege_id_name _null_ _null_ _null_ )); DESCR("user privilege on type by user oid, type name"); DATA(insert OID = 3141 ( has_type_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "26 26 25" _null_ _null_ _null_ _null_ has_type_privilege_id_id _null_ _null_ _null_ )); DESCR("user privilege on type by user oid, type oid"); DATA(insert OID = 3142 ( has_type_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "25 25" _null_ _null_ _null_ _null_ has_type_privilege_name _null_ _null_ _null_ )); DESCR("current user privilege on type by type name"); DATA(insert OID = 3143 ( has_type_privilege PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "26 25" _null_ _null_ _null_ _null_ has_type_privilege_id _null_ _null_ _null_ )); DESCR("current user privilege on type by type oid"); DATA(insert OID = 2705 ( pg_has_role PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "19 19 25" _null_ _null_ _null_ _null_ pg_has_role_name_name _null_ _null_ _null_ )); DESCR("user privilege on role by username, role name"); DATA(insert OID = 2706 ( pg_has_role PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "19 26 25" _null_ _null_ _null_ _null_ pg_has_role_name_id _null_ _null_ _null_ )); DESCR("user privilege on role by username, role oid"); DATA(insert OID = 2707 ( pg_has_role PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "26 19 25" _null_ _null_ _null_ _null_ pg_has_role_id_name _null_ _null_ _null_ )); DESCR("user privilege on role by user oid, role name"); DATA(insert OID = 2708 ( pg_has_role PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 16 "26 26 25" _null_ _null_ _null_ _null_ pg_has_role_id_id _null_ _null_ _null_ )); DESCR("user privilege on role by user oid, role oid"); DATA(insert OID = 2709 ( pg_has_role PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "19 25" _null_ _null_ _null_ _null_ pg_has_role_name _null_ _null_ _null_ )); DESCR("current user privilege on role by role name"); DATA(insert OID = 2710 ( pg_has_role PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "26 25" _null_ _null_ _null_ _null_ pg_has_role_id _null_ _null_ _null_ )); DESCR("current user privilege on role by role oid"); DATA(insert OID = 1269 ( pg_column_size PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 23 "2276" _null_ _null_ _null_ _null_ pg_column_size _null_ _null_ _null_ )); DESCR("bytes required to store the value, perhaps with compression"); DATA(insert OID = 2322 ( pg_tablespace_size PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 20 "26" _null_ _null_ _null_ _null_ pg_tablespace_size_oid _null_ _null_ _null_ )); DESCR("total disk space usage for the specified tablespace"); DATA(insert OID = 2323 ( pg_tablespace_size PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 20 "19" _null_ _null_ _null_ _null_ pg_tablespace_size_name _null_ _null_ _null_ )); DESCR("total disk space usage for the specified tablespace"); DATA(insert OID = 2324 ( pg_database_size PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 20 "26" _null_ _null_ _null_ _null_ pg_database_size_oid _null_ _null_ _null_ )); DESCR("total disk space usage for the specified database"); DATA(insert OID = 2168 ( pg_database_size PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 20 "19" _null_ _null_ _null_ _null_ pg_database_size_name _null_ _null_ _null_ )); DESCR("total disk space usage for the specified database"); DATA(insert OID = 2325 ( pg_relation_size PGNSP PGUID 14 1 0 0 0 f f f f t f v 1 0 20 "2205" _null_ _null_ _null_ _null_ "select pg_catalog.pg_relation_size($1, ''main'')" _null_ _null_ _null_ )); DESCR("disk space usage for the main fork of the specified table or index"); DATA(insert OID = 2332 ( pg_relation_size PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 20 "2205 25" _null_ _null_ _null_ _null_ pg_relation_size _null_ _null_ _null_ )); DESCR("disk space usage for the specified fork of a table or index"); DATA(insert OID = 2286 ( pg_total_relation_size PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 20 "2205" _null_ _null_ _null_ _null_ pg_total_relation_size _null_ _null_ _null_ )); DESCR("total disk space usage for the specified table and associated indexes"); DATA(insert OID = 2288 ( pg_size_pretty PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 25 "20" _null_ _null_ _null_ _null_ pg_size_pretty _null_ _null_ _null_ )); DESCR("convert a long int to a human readable text using size units"); DATA(insert OID = 3166 ( pg_size_pretty PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 25 "1700" _null_ _null_ _null_ _null_ pg_size_pretty_numeric _null_ _null_ _null_ )); DESCR("convert a numeric to a human readable text using size units"); DATA(insert OID = 2997 ( pg_table_size PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 20 "2205" _null_ _null_ _null_ _null_ pg_table_size _null_ _null_ _null_ )); DESCR("disk space usage for the specified table, including TOAST, free space and visibility map"); DATA(insert OID = 2998 ( pg_indexes_size PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 20 "2205" _null_ _null_ _null_ _null_ pg_indexes_size _null_ _null_ _null_ )); DESCR("disk space usage for all indexes attached to the specified table"); DATA(insert OID = 2999 ( pg_relation_filenode PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 26 "2205" _null_ _null_ _null_ _null_ pg_relation_filenode _null_ _null_ _null_ )); DESCR("filenode identifier of relation"); DATA(insert OID = 3034 ( pg_relation_filepath PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 25 "2205" _null_ _null_ _null_ _null_ pg_relation_filepath _null_ _null_ _null_ )); DESCR("file path of relation"); DATA(insert OID = 2316 ( postgresql_fdw_validator PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1009 26" _null_ _null_ _null_ _null_ postgresql_fdw_validator _null_ _null_ _null_)); DESCR("(internal)"); DATA(insert OID = 2290 ( record_in PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 2249 "2275 26 23" _null_ _null_ _null_ _null_ record_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2291 ( record_out PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 2275 "2249" _null_ _null_ _null_ _null_ record_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2292 ( cstring_in PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "2275" _null_ _null_ _null_ _null_ cstring_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2293 ( cstring_out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "2275" _null_ _null_ _null_ _null_ cstring_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2294 ( any_in PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2276 "2275" _null_ _null_ _null_ _null_ any_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2295 ( any_out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "2276" _null_ _null_ _null_ _null_ any_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2296 ( anyarray_in PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2277 "2275" _null_ _null_ _null_ _null_ anyarray_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2297 ( anyarray_out PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 2275 "2277" _null_ _null_ _null_ _null_ anyarray_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2298 ( void_in PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2278 "2275" _null_ _null_ _null_ _null_ void_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2299 ( void_out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "2278" _null_ _null_ _null_ _null_ void_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2300 ( trigger_in PGNSP PGUID 12 1 0 0 0 f f f f f f i 1 0 2279 "2275" _null_ _null_ _null_ _null_ trigger_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2301 ( trigger_out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "2279" _null_ _null_ _null_ _null_ trigger_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2302 ( language_handler_in PGNSP PGUID 12 1 0 0 0 f f f f f f i 1 0 2280 "2275" _null_ _null_ _null_ _null_ language_handler_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2303 ( language_handler_out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "2280" _null_ _null_ _null_ _null_ language_handler_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2304 ( internal_in PGNSP PGUID 12 1 0 0 0 f f f f f f i 1 0 2281 "2275" _null_ _null_ _null_ _null_ internal_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2305 ( internal_out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "2281" _null_ _null_ _null_ _null_ internal_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2306 ( opaque_in PGNSP PGUID 12 1 0 0 0 f f f f f f i 1 0 2282 "2275" _null_ _null_ _null_ _null_ opaque_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2307 ( opaque_out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "2282" _null_ _null_ _null_ _null_ opaque_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2312 ( anyelement_in PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2283 "2275" _null_ _null_ _null_ _null_ anyelement_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2313 ( anyelement_out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "2283" _null_ _null_ _null_ _null_ anyelement_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2398 ( shell_in PGNSP PGUID 12 1 0 0 0 f f f f f f i 1 0 2282 "2275" _null_ _null_ _null_ _null_ shell_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2399 ( shell_out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "2282" _null_ _null_ _null_ _null_ shell_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2597 ( domain_in PGNSP PGUID 12 1 0 0 0 f f f f f f s 3 0 2276 "2275 26 23" _null_ _null_ _null_ _null_ domain_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2598 ( domain_recv PGNSP PGUID 12 1 0 0 0 f f f f f f s 3 0 2276 "2281 26 23" _null_ _null_ _null_ _null_ domain_recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2777 ( anynonarray_in PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2776 "2275" _null_ _null_ _null_ _null_ anynonarray_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2778 ( anynonarray_out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "2776" _null_ _null_ _null_ _null_ anynonarray_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 3116 ( fdw_handler_in PGNSP PGUID 12 1 0 0 0 f f f f f f i 1 0 3115 "2275" _null_ _null_ _null_ _null_ fdw_handler_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 3117 ( fdw_handler_out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "3115" _null_ _null_ _null_ _null_ fdw_handler_out _null_ _null_ _null_ )); DESCR("I/O"); /* cryptographic */ DATA(insert OID = 2311 ( md5 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 25 "25" _null_ _null_ _null_ _null_ md5_text _null_ _null_ _null_ )); DESCR("MD5 hash"); DATA(insert OID = 2321 ( md5 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 25 "17" _null_ _null_ _null_ _null_ md5_bytea _null_ _null_ _null_ )); DESCR("MD5 hash"); /* crosstype operations for date vs. timestamp and timestamptz */ DATA(insert OID = 2338 ( date_lt_timestamp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1082 1114" _null_ _null_ _null_ _null_ date_lt_timestamp _null_ _null_ _null_ )); DATA(insert OID = 2339 ( date_le_timestamp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1082 1114" _null_ _null_ _null_ _null_ date_le_timestamp _null_ _null_ _null_ )); DATA(insert OID = 2340 ( date_eq_timestamp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1082 1114" _null_ _null_ _null_ _null_ date_eq_timestamp _null_ _null_ _null_ )); DATA(insert OID = 2341 ( date_gt_timestamp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1082 1114" _null_ _null_ _null_ _null_ date_gt_timestamp _null_ _null_ _null_ )); DATA(insert OID = 2342 ( date_ge_timestamp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1082 1114" _null_ _null_ _null_ _null_ date_ge_timestamp _null_ _null_ _null_ )); DATA(insert OID = 2343 ( date_ne_timestamp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1082 1114" _null_ _null_ _null_ _null_ date_ne_timestamp _null_ _null_ _null_ )); DATA(insert OID = 2344 ( date_cmp_timestamp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "1082 1114" _null_ _null_ _null_ _null_ date_cmp_timestamp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 2351 ( date_lt_timestamptz PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "1082 1184" _null_ _null_ _null_ _null_ date_lt_timestamptz _null_ _null_ _null_ )); DATA(insert OID = 2352 ( date_le_timestamptz PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "1082 1184" _null_ _null_ _null_ _null_ date_le_timestamptz _null_ _null_ _null_ )); DATA(insert OID = 2353 ( date_eq_timestamptz PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "1082 1184" _null_ _null_ _null_ _null_ date_eq_timestamptz _null_ _null_ _null_ )); DATA(insert OID = 2354 ( date_gt_timestamptz PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "1082 1184" _null_ _null_ _null_ _null_ date_gt_timestamptz _null_ _null_ _null_ )); DATA(insert OID = 2355 ( date_ge_timestamptz PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "1082 1184" _null_ _null_ _null_ _null_ date_ge_timestamptz _null_ _null_ _null_ )); DATA(insert OID = 2356 ( date_ne_timestamptz PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "1082 1184" _null_ _null_ _null_ _null_ date_ne_timestamptz _null_ _null_ _null_ )); DATA(insert OID = 2357 ( date_cmp_timestamptz PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 23 "1082 1184" _null_ _null_ _null_ _null_ date_cmp_timestamptz _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 2364 ( timestamp_lt_date PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1114 1082" _null_ _null_ _null_ _null_ timestamp_lt_date _null_ _null_ _null_ )); DATA(insert OID = 2365 ( timestamp_le_date PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1114 1082" _null_ _null_ _null_ _null_ timestamp_le_date _null_ _null_ _null_ )); DATA(insert OID = 2366 ( timestamp_eq_date PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1114 1082" _null_ _null_ _null_ _null_ timestamp_eq_date _null_ _null_ _null_ )); DATA(insert OID = 2367 ( timestamp_gt_date PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1114 1082" _null_ _null_ _null_ _null_ timestamp_gt_date _null_ _null_ _null_ )); DATA(insert OID = 2368 ( timestamp_ge_date PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1114 1082" _null_ _null_ _null_ _null_ timestamp_ge_date _null_ _null_ _null_ )); DATA(insert OID = 2369 ( timestamp_ne_date PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "1114 1082" _null_ _null_ _null_ _null_ timestamp_ne_date _null_ _null_ _null_ )); DATA(insert OID = 2370 ( timestamp_cmp_date PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "1114 1082" _null_ _null_ _null_ _null_ timestamp_cmp_date _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 2377 ( timestamptz_lt_date PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "1184 1082" _null_ _null_ _null_ _null_ timestamptz_lt_date _null_ _null_ _null_ )); DATA(insert OID = 2378 ( timestamptz_le_date PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "1184 1082" _null_ _null_ _null_ _null_ timestamptz_le_date _null_ _null_ _null_ )); DATA(insert OID = 2379 ( timestamptz_eq_date PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "1184 1082" _null_ _null_ _null_ _null_ timestamptz_eq_date _null_ _null_ _null_ )); DATA(insert OID = 2380 ( timestamptz_gt_date PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "1184 1082" _null_ _null_ _null_ _null_ timestamptz_gt_date _null_ _null_ _null_ )); DATA(insert OID = 2381 ( timestamptz_ge_date PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "1184 1082" _null_ _null_ _null_ _null_ timestamptz_ge_date _null_ _null_ _null_ )); DATA(insert OID = 2382 ( timestamptz_ne_date PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "1184 1082" _null_ _null_ _null_ _null_ timestamptz_ne_date _null_ _null_ _null_ )); DATA(insert OID = 2383 ( timestamptz_cmp_date PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 23 "1184 1082" _null_ _null_ _null_ _null_ timestamptz_cmp_date _null_ _null_ _null_ )); DESCR("less-equal-greater"); /* crosstype operations for timestamp vs. timestamptz */ DATA(insert OID = 2520 ( timestamp_lt_timestamptz PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "1114 1184" _null_ _null_ _null_ _null_ timestamp_lt_timestamptz _null_ _null_ _null_ )); DATA(insert OID = 2521 ( timestamp_le_timestamptz PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "1114 1184" _null_ _null_ _null_ _null_ timestamp_le_timestamptz _null_ _null_ _null_ )); DATA(insert OID = 2522 ( timestamp_eq_timestamptz PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "1114 1184" _null_ _null_ _null_ _null_ timestamp_eq_timestamptz _null_ _null_ _null_ )); DATA(insert OID = 2523 ( timestamp_gt_timestamptz PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "1114 1184" _null_ _null_ _null_ _null_ timestamp_gt_timestamptz _null_ _null_ _null_ )); DATA(insert OID = 2524 ( timestamp_ge_timestamptz PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "1114 1184" _null_ _null_ _null_ _null_ timestamp_ge_timestamptz _null_ _null_ _null_ )); DATA(insert OID = 2525 ( timestamp_ne_timestamptz PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "1114 1184" _null_ _null_ _null_ _null_ timestamp_ne_timestamptz _null_ _null_ _null_ )); DATA(insert OID = 2526 ( timestamp_cmp_timestamptz PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 23 "1114 1184" _null_ _null_ _null_ _null_ timestamp_cmp_timestamptz _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 2527 ( timestamptz_lt_timestamp PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "1184 1114" _null_ _null_ _null_ _null_ timestamptz_lt_timestamp _null_ _null_ _null_ )); DATA(insert OID = 2528 ( timestamptz_le_timestamp PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "1184 1114" _null_ _null_ _null_ _null_ timestamptz_le_timestamp _null_ _null_ _null_ )); DATA(insert OID = 2529 ( timestamptz_eq_timestamp PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "1184 1114" _null_ _null_ _null_ _null_ timestamptz_eq_timestamp _null_ _null_ _null_ )); DATA(insert OID = 2530 ( timestamptz_gt_timestamp PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "1184 1114" _null_ _null_ _null_ _null_ timestamptz_gt_timestamp _null_ _null_ _null_ )); DATA(insert OID = 2531 ( timestamptz_ge_timestamp PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "1184 1114" _null_ _null_ _null_ _null_ timestamptz_ge_timestamp _null_ _null_ _null_ )); DATA(insert OID = 2532 ( timestamptz_ne_timestamp PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 16 "1184 1114" _null_ _null_ _null_ _null_ timestamptz_ne_timestamp _null_ _null_ _null_ )); DATA(insert OID = 2533 ( timestamptz_cmp_timestamp PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 23 "1184 1114" _null_ _null_ _null_ _null_ timestamptz_cmp_timestamp _null_ _null_ _null_ )); DESCR("less-equal-greater"); /* send/receive functions */ DATA(insert OID = 2400 ( array_recv PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 2277 "2281 26 23" _null_ _null_ _null_ _null_ array_recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2401 ( array_send PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 17 "2277" _null_ _null_ _null_ _null_ array_send _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2402 ( record_recv PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 2249 "2281 26 23" _null_ _null_ _null_ _null_ record_recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2403 ( record_send PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 17 "2249" _null_ _null_ _null_ _null_ record_send _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2404 ( int2recv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 21 "2281" _null_ _null_ _null_ _null_ int2recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2405 ( int2send PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "21" _null_ _null_ _null_ _null_ int2send _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2406 ( int4recv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "2281" _null_ _null_ _null_ _null_ int4recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2407 ( int4send PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "23" _null_ _null_ _null_ _null_ int4send _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2408 ( int8recv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 20 "2281" _null_ _null_ _null_ _null_ int8recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2409 ( int8send PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "20" _null_ _null_ _null_ _null_ int8send _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2410 ( int2vectorrecv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 22 "2281" _null_ _null_ _null_ _null_ int2vectorrecv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2411 ( int2vectorsend PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "22" _null_ _null_ _null_ _null_ int2vectorsend _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2412 ( bytearecv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "2281" _null_ _null_ _null_ _null_ bytearecv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2413 ( byteasend PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "17" _null_ _null_ _null_ _null_ byteasend _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2414 ( textrecv PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 25 "2281" _null_ _null_ _null_ _null_ textrecv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2415 ( textsend PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 17 "25" _null_ _null_ _null_ _null_ textsend _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2416 ( unknownrecv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 705 "2281" _null_ _null_ _null_ _null_ unknownrecv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2417 ( unknownsend PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "705" _null_ _null_ _null_ _null_ unknownsend _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2418 ( oidrecv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 26 "2281" _null_ _null_ _null_ _null_ oidrecv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2419 ( oidsend PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "26" _null_ _null_ _null_ _null_ oidsend _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2420 ( oidvectorrecv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 30 "2281" _null_ _null_ _null_ _null_ oidvectorrecv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2421 ( oidvectorsend PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "30" _null_ _null_ _null_ _null_ oidvectorsend _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2422 ( namerecv PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 19 "2281" _null_ _null_ _null_ _null_ namerecv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2423 ( namesend PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 17 "19" _null_ _null_ _null_ _null_ namesend _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2424 ( float4recv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 700 "2281" _null_ _null_ _null_ _null_ float4recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2425 ( float4send PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "700" _null_ _null_ _null_ _null_ float4send _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2426 ( float8recv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 701 "2281" _null_ _null_ _null_ _null_ float8recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2427 ( float8send PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "701" _null_ _null_ _null_ _null_ float8send _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2428 ( point_recv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 600 "2281" _null_ _null_ _null_ _null_ point_recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2429 ( point_send PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "600" _null_ _null_ _null_ _null_ point_send _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2430 ( bpcharrecv PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 1042 "2281 26 23" _null_ _null_ _null_ _null_ bpcharrecv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2431 ( bpcharsend PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 17 "1042" _null_ _null_ _null_ _null_ bpcharsend _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2432 ( varcharrecv PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 1043 "2281 26 23" _null_ _null_ _null_ _null_ varcharrecv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2433 ( varcharsend PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 17 "1043" _null_ _null_ _null_ _null_ varcharsend _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2434 ( charrecv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 18 "2281" _null_ _null_ _null_ _null_ charrecv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2435 ( charsend PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "18" _null_ _null_ _null_ _null_ charsend _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2436 ( boolrecv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 16 "2281" _null_ _null_ _null_ _null_ boolrecv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2437 ( boolsend PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "16" _null_ _null_ _null_ _null_ boolsend _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2438 ( tidrecv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 27 "2281" _null_ _null_ _null_ _null_ tidrecv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2439 ( tidsend PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "27" _null_ _null_ _null_ _null_ tidsend _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2440 ( xidrecv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 28 "2281" _null_ _null_ _null_ _null_ xidrecv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2441 ( xidsend PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "28" _null_ _null_ _null_ _null_ xidsend _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2442 ( cidrecv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 29 "2281" _null_ _null_ _null_ _null_ cidrecv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2443 ( cidsend PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "29" _null_ _null_ _null_ _null_ cidsend _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2444 ( regprocrecv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 24 "2281" _null_ _null_ _null_ _null_ regprocrecv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2445 ( regprocsend PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "24" _null_ _null_ _null_ _null_ regprocsend _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2446 ( regprocedurerecv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2202 "2281" _null_ _null_ _null_ _null_ regprocedurerecv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2447 ( regproceduresend PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "2202" _null_ _null_ _null_ _null_ regproceduresend _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2448 ( regoperrecv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2203 "2281" _null_ _null_ _null_ _null_ regoperrecv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2449 ( regopersend PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "2203" _null_ _null_ _null_ _null_ regopersend _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2450 ( regoperatorrecv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2204 "2281" _null_ _null_ _null_ _null_ regoperatorrecv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2451 ( regoperatorsend PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "2204" _null_ _null_ _null_ _null_ regoperatorsend _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2452 ( regclassrecv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2205 "2281" _null_ _null_ _null_ _null_ regclassrecv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2453 ( regclasssend PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "2205" _null_ _null_ _null_ _null_ regclasssend _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2454 ( regtyperecv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2206 "2281" _null_ _null_ _null_ _null_ regtyperecv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2455 ( regtypesend PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "2206" _null_ _null_ _null_ _null_ regtypesend _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2456 ( bit_recv PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 1560 "2281 26 23" _null_ _null_ _null_ _null_ bit_recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2457 ( bit_send PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "1560" _null_ _null_ _null_ _null_ bit_send _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2458 ( varbit_recv PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 1562 "2281 26 23" _null_ _null_ _null_ _null_ varbit_recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2459 ( varbit_send PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "1562" _null_ _null_ _null_ _null_ varbit_send _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2460 ( numeric_recv PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 1700 "2281 26 23" _null_ _null_ _null_ _null_ numeric_recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2461 ( numeric_send PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "1700" _null_ _null_ _null_ _null_ numeric_send _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2462 ( abstimerecv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 702 "2281" _null_ _null_ _null_ _null_ abstimerecv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2463 ( abstimesend PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "702" _null_ _null_ _null_ _null_ abstimesend _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2464 ( reltimerecv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 703 "2281" _null_ _null_ _null_ _null_ reltimerecv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2465 ( reltimesend PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "703" _null_ _null_ _null_ _null_ reltimesend _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2466 ( tintervalrecv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 704 "2281" _null_ _null_ _null_ _null_ tintervalrecv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2467 ( tintervalsend PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "704" _null_ _null_ _null_ _null_ tintervalsend _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2468 ( date_recv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 1082 "2281" _null_ _null_ _null_ _null_ date_recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2469 ( date_send PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "1082" _null_ _null_ _null_ _null_ date_send _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2470 ( time_recv PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 1083 "2281 26 23" _null_ _null_ _null_ _null_ time_recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2471 ( time_send PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "1083" _null_ _null_ _null_ _null_ time_send _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2472 ( timetz_recv PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 1266 "2281 26 23" _null_ _null_ _null_ _null_ timetz_recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2473 ( timetz_send PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "1266" _null_ _null_ _null_ _null_ timetz_send _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2474 ( timestamp_recv PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 1114 "2281 26 23" _null_ _null_ _null_ _null_ timestamp_recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2475 ( timestamp_send PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "1114" _null_ _null_ _null_ _null_ timestamp_send _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2476 ( timestamptz_recv PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 1184 "2281 26 23" _null_ _null_ _null_ _null_ timestamptz_recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2477 ( timestamptz_send PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "1184" _null_ _null_ _null_ _null_ timestamptz_send _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2478 ( interval_recv PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 1186 "2281 26 23" _null_ _null_ _null_ _null_ interval_recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2479 ( interval_send PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "1186" _null_ _null_ _null_ _null_ interval_send _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2480 ( lseg_recv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 601 "2281" _null_ _null_ _null_ _null_ lseg_recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2481 ( lseg_send PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "601" _null_ _null_ _null_ _null_ lseg_send _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2482 ( path_recv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 602 "2281" _null_ _null_ _null_ _null_ path_recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2483 ( path_send PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "602" _null_ _null_ _null_ _null_ path_send _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2484 ( box_recv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 603 "2281" _null_ _null_ _null_ _null_ box_recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2485 ( box_send PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "603" _null_ _null_ _null_ _null_ box_send _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2486 ( poly_recv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 604 "2281" _null_ _null_ _null_ _null_ poly_recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2487 ( poly_send PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "604" _null_ _null_ _null_ _null_ poly_send _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2488 ( line_recv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 628 "2281" _null_ _null_ _null_ _null_ line_recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2489 ( line_send PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "628" _null_ _null_ _null_ _null_ line_send _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2490 ( circle_recv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 718 "2281" _null_ _null_ _null_ _null_ circle_recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2491 ( circle_send PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "718" _null_ _null_ _null_ _null_ circle_send _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2492 ( cash_recv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 790 "2281" _null_ _null_ _null_ _null_ cash_recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2493 ( cash_send PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "790" _null_ _null_ _null_ _null_ cash_send _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2494 ( macaddr_recv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 829 "2281" _null_ _null_ _null_ _null_ macaddr_recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2495 ( macaddr_send PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "829" _null_ _null_ _null_ _null_ macaddr_send _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2496 ( inet_recv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 869 "2281" _null_ _null_ _null_ _null_ inet_recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2497 ( inet_send PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "869" _null_ _null_ _null_ _null_ inet_send _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2498 ( cidr_recv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 650 "2281" _null_ _null_ _null_ _null_ cidr_recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2499 ( cidr_send PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "650" _null_ _null_ _null_ _null_ cidr_send _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2500 ( cstring_recv PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 2275 "2281" _null_ _null_ _null_ _null_ cstring_recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2501 ( cstring_send PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 17 "2275" _null_ _null_ _null_ _null_ cstring_send _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2502 ( anyarray_recv PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 2277 "2281" _null_ _null_ _null_ _null_ anyarray_recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2503 ( anyarray_send PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 17 "2277" _null_ _null_ _null_ _null_ anyarray_send _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 3120 ( void_recv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2278 "2281" _null_ _null_ _null_ _null_ void_recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 3121 ( void_send PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "2278" _null_ _null_ _null_ _null_ void_send _null_ _null_ _null_ )); DESCR("I/O"); /* System-view support functions with pretty-print option */ DATA(insert OID = 2504 ( pg_get_ruledef PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 25 "26 16" _null_ _null_ _null_ _null_ pg_get_ruledef_ext _null_ _null_ _null_ )); DESCR("source text of a rule with pretty-print option"); DATA(insert OID = 2505 ( pg_get_viewdef PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 25 "25 16" _null_ _null_ _null_ _null_ pg_get_viewdef_name_ext _null_ _null_ _null_ )); DESCR("select statement of a view with pretty-print option"); DATA(insert OID = 2506 ( pg_get_viewdef PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 25 "26 16" _null_ _null_ _null_ _null_ pg_get_viewdef_ext _null_ _null_ _null_ )); DESCR("select statement of a view with pretty-print option"); DATA(insert OID = 3159 ( pg_get_viewdef PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 25 "26 23" _null_ _null_ _null_ _null_ pg_get_viewdef_wrap _null_ _null_ _null_ )); DESCR("select statement of a view with pretty-printing and specified line wrapping"); DATA(insert OID = 2507 ( pg_get_indexdef PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 25 "26 23 16" _null_ _null_ _null_ _null_ pg_get_indexdef_ext _null_ _null_ _null_ )); DESCR("index description (full create statement or single expression) with pretty-print option"); DATA(insert OID = 2508 ( pg_get_constraintdef PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 25 "26 16" _null_ _null_ _null_ _null_ pg_get_constraintdef_ext _null_ _null_ _null_ )); DESCR("constraint description with pretty-print option"); DATA(insert OID = 2509 ( pg_get_expr PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 25 "194 26 16" _null_ _null_ _null_ _null_ pg_get_expr_ext _null_ _null_ _null_ )); DESCR("deparse an encoded expression with pretty-print option"); DATA(insert OID = 2510 ( pg_prepared_statement PGNSP PGUID 12 1 1000 0 0 f f f f t t s 0 0 2249 "" "{25,25,1184,2211,16}" "{o,o,o,o,o}" "{name,statement,prepare_time,parameter_types,from_sql}" _null_ pg_prepared_statement _null_ _null_ _null_ )); DESCR("get the prepared statements for this session"); DATA(insert OID = 2511 ( pg_cursor PGNSP PGUID 12 1 1000 0 0 f f f f t t s 0 0 2249 "" "{25,25,16,16,16,1184}" "{o,o,o,o,o,o}" "{name,statement,is_holdable,is_binary,is_scrollable,creation_time}" _null_ pg_cursor _null_ _null_ _null_ )); DESCR("get the open cursors for this session"); DATA(insert OID = 2599 ( pg_timezone_abbrevs PGNSP PGUID 12 1 1000 0 0 f f f f t t s 0 0 2249 "" "{25,1186,16}" "{o,o,o}" "{abbrev,utc_offset,is_dst}" _null_ pg_timezone_abbrevs _null_ _null_ _null_ )); DESCR("get the available time zone abbreviations"); DATA(insert OID = 2856 ( pg_timezone_names PGNSP PGUID 12 1 1000 0 0 f f f f t t s 0 0 2249 "" "{25,25,1186,16}" "{o,o,o,o}" "{name,abbrev,utc_offset,is_dst}" _null_ pg_timezone_names _null_ _null_ _null_ )); DESCR("get the available time zone names"); DATA(insert OID = 2730 ( pg_get_triggerdef PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 25 "26 16" _null_ _null_ _null_ _null_ pg_get_triggerdef_ext _null_ _null_ _null_ )); DESCR("trigger description with pretty-print option"); DATA(insert OID = 3035 ( pg_listening_channels PGNSP PGUID 12 1 10 0 0 f f f f t t s 0 0 25 "" _null_ _null_ _null_ _null_ pg_listening_channels _null_ _null_ _null_ )); DESCR("get the channels that the current backend listens to"); DATA(insert OID = 3036 ( pg_notify PGNSP PGUID 12 1 0 0 0 f f f f f f v 2 0 2278 "25 25" _null_ _null_ _null_ _null_ pg_notify _null_ _null_ _null_ )); DESCR("send a notification event"); /* non-persistent series generator */ DATA(insert OID = 1066 ( generate_series PGNSP PGUID 12 1 1000 0 0 f f f f t t i 3 0 23 "23 23 23" _null_ _null_ _null_ _null_ generate_series_step_int4 _null_ _null_ _null_ )); DESCR("non-persistent series generator"); DATA(insert OID = 1067 ( generate_series PGNSP PGUID 12 1 1000 0 0 f f f f t t i 2 0 23 "23 23" _null_ _null_ _null_ _null_ generate_series_int4 _null_ _null_ _null_ )); DESCR("non-persistent series generator"); DATA(insert OID = 1068 ( generate_series PGNSP PGUID 12 1 1000 0 0 f f f f t t i 3 0 20 "20 20 20" _null_ _null_ _null_ _null_ generate_series_step_int8 _null_ _null_ _null_ )); DESCR("non-persistent series generator"); DATA(insert OID = 1069 ( generate_series PGNSP PGUID 12 1 1000 0 0 f f f f t t i 2 0 20 "20 20" _null_ _null_ _null_ _null_ generate_series_int8 _null_ _null_ _null_ )); DESCR("non-persistent series generator"); DATA(insert OID = 938 ( generate_series PGNSP PGUID 12 1 1000 0 0 f f f f t t i 3 0 1114 "1114 1114 1186" _null_ _null_ _null_ _null_ generate_series_timestamp _null_ _null_ _null_ )); DESCR("non-persistent series generator"); DATA(insert OID = 939 ( generate_series PGNSP PGUID 12 1 1000 0 0 f f f f t t s 3 0 1184 "1184 1184 1186" _null_ _null_ _null_ _null_ generate_series_timestamptz _null_ _null_ _null_ )); DESCR("non-persistent series generator"); /* boolean aggregates */ DATA(insert OID = 2515 ( booland_statefunc PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "16 16" _null_ _null_ _null_ _null_ booland_statefunc _null_ _null_ _null_ )); DESCR("aggregate transition function"); DATA(insert OID = 2516 ( boolor_statefunc PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "16 16" _null_ _null_ _null_ _null_ boolor_statefunc _null_ _null_ _null_ )); DESCR("aggregate transition function"); DATA(insert OID = 2517 ( bool_and PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 16 "16" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("boolean-and aggregate"); /* ANY, SOME? These names conflict with subquery operators. See doc. */ DATA(insert OID = 2518 ( bool_or PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 16 "16" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("boolean-or aggregate"); DATA(insert OID = 2519 ( every PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 16 "16" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("boolean-and aggregate"); /* bitwise integer aggregates */ DATA(insert OID = 2236 ( bit_and PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 21 "21" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("bitwise-and smallint aggregate"); DATA(insert OID = 2237 ( bit_or PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 21 "21" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("bitwise-or smallint aggregate"); DATA(insert OID = 2238 ( bit_and PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 23 "23" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("bitwise-and integer aggregate"); DATA(insert OID = 2239 ( bit_or PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 23 "23" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("bitwise-or integer aggregate"); DATA(insert OID = 2240 ( bit_and PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 20 "20" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("bitwise-and bigint aggregate"); DATA(insert OID = 2241 ( bit_or PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 20 "20" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("bitwise-or bigint aggregate"); DATA(insert OID = 2242 ( bit_and PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1560 "1560" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("bitwise-and bit aggregate"); DATA(insert OID = 2243 ( bit_or PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 1560 "1560" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("bitwise-or bit aggregate"); /* formerly-missing interval + datetime operators */ DATA(insert OID = 2546 ( interval_pl_date PGNSP PGUID 14 1 0 0 0 f f f f t f i 2 0 1114 "1186 1082" _null_ _null_ _null_ _null_ "select $2 + $1" _null_ _null_ _null_ )); DATA(insert OID = 2547 ( interval_pl_timetz PGNSP PGUID 14 1 0 0 0 f f f f t f i 2 0 1266 "1186 1266" _null_ _null_ _null_ _null_ "select $2 + $1" _null_ _null_ _null_ )); DATA(insert OID = 2548 ( interval_pl_timestamp PGNSP PGUID 14 1 0 0 0 f f f f t f i 2 0 1114 "1186 1114" _null_ _null_ _null_ _null_ "select $2 + $1" _null_ _null_ _null_ )); DATA(insert OID = 2549 ( interval_pl_timestamptz PGNSP PGUID 14 1 0 0 0 f f f f t f s 2 0 1184 "1186 1184" _null_ _null_ _null_ _null_ "select $2 + $1" _null_ _null_ _null_ )); DATA(insert OID = 2550 ( integer_pl_date PGNSP PGUID 14 1 0 0 0 f f f f t f i 2 0 1082 "23 1082" _null_ _null_ _null_ _null_ "select $2 + $1" _null_ _null_ _null_ )); DATA(insert OID = 2556 ( pg_tablespace_databases PGNSP PGUID 12 1 1000 0 0 f f f f t t s 1 0 26 "26" _null_ _null_ _null_ _null_ pg_tablespace_databases _null_ _null_ _null_ )); DESCR("get OIDs of databases in a tablespace"); DATA(insert OID = 2557 ( bool PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 16 "23" _null_ _null_ _null_ _null_ int4_bool _null_ _null_ _null_ )); DESCR("convert int4 to boolean"); DATA(insert OID = 2558 ( int4 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "16" _null_ _null_ _null_ _null_ bool_int4 _null_ _null_ _null_ )); DESCR("convert boolean to int4"); DATA(insert OID = 2559 ( lastval PGNSP PGUID 12 1 0 0 0 f f f f t f v 0 0 20 "" _null_ _null_ _null_ _null_ lastval _null_ _null_ _null_ )); DESCR("current value from last used sequence"); /* start time function */ DATA(insert OID = 2560 ( pg_postmaster_start_time PGNSP PGUID 12 1 0 0 0 f f f f t f s 0 0 1184 "" _null_ _null_ _null_ _null_ pg_postmaster_start_time _null_ _null_ _null_ )); DESCR("postmaster start time"); /* config reload time function */ DATA(insert OID = 2034 ( pg_conf_load_time PGNSP PGUID 12 1 0 0 0 f f f f t f s 0 0 1184 "" _null_ _null_ _null_ _null_ pg_conf_load_time _null_ _null_ _null_ )); DESCR("configuration load time"); /* new functions for Y-direction rtree opclasses */ DATA(insert OID = 2562 ( box_below PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "603 603" _null_ _null_ _null_ _null_ box_below _null_ _null_ _null_ )); DATA(insert OID = 2563 ( box_overbelow PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "603 603" _null_ _null_ _null_ _null_ box_overbelow _null_ _null_ _null_ )); DATA(insert OID = 2564 ( box_overabove PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "603 603" _null_ _null_ _null_ _null_ box_overabove _null_ _null_ _null_ )); DATA(insert OID = 2565 ( box_above PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "603 603" _null_ _null_ _null_ _null_ box_above _null_ _null_ _null_ )); DATA(insert OID = 2566 ( poly_below PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "604 604" _null_ _null_ _null_ _null_ poly_below _null_ _null_ _null_ )); DATA(insert OID = 2567 ( poly_overbelow PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "604 604" _null_ _null_ _null_ _null_ poly_overbelow _null_ _null_ _null_ )); DATA(insert OID = 2568 ( poly_overabove PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "604 604" _null_ _null_ _null_ _null_ poly_overabove _null_ _null_ _null_ )); DATA(insert OID = 2569 ( poly_above PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "604 604" _null_ _null_ _null_ _null_ poly_above _null_ _null_ _null_ )); DATA(insert OID = 2587 ( circle_overbelow PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "718 718" _null_ _null_ _null_ _null_ circle_overbelow _null_ _null_ _null_ )); DATA(insert OID = 2588 ( circle_overabove PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "718 718" _null_ _null_ _null_ _null_ circle_overabove _null_ _null_ _null_ )); /* support functions for GiST r-tree emulation */ DATA(insert OID = 2578 ( gist_box_consistent PGNSP PGUID 12 1 0 0 0 f f f f t f i 5 0 16 "2281 603 23 26 2281" _null_ _null_ _null_ _null_ gist_box_consistent _null_ _null_ _null_ )); DESCR("GiST support"); DATA(insert OID = 2579 ( gist_box_compress PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2281 "2281" _null_ _null_ _null_ _null_ gist_box_compress _null_ _null_ _null_ )); DESCR("GiST support"); DATA(insert OID = 2580 ( gist_box_decompress PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2281 "2281" _null_ _null_ _null_ _null_ gist_box_decompress _null_ _null_ _null_ )); DESCR("GiST support"); DATA(insert OID = 2581 ( gist_box_penalty PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 2281 "2281 2281 2281" _null_ _null_ _null_ _null_ gist_box_penalty _null_ _null_ _null_ )); DESCR("GiST support"); DATA(insert OID = 2582 ( gist_box_picksplit PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 2281 "2281 2281" _null_ _null_ _null_ _null_ gist_box_picksplit _null_ _null_ _null_ )); DESCR("GiST support"); DATA(insert OID = 2583 ( gist_box_union PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 603 "2281 2281" _null_ _null_ _null_ _null_ gist_box_union _null_ _null_ _null_ )); DESCR("GiST support"); DATA(insert OID = 2584 ( gist_box_same PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 2281 "603 603 2281" _null_ _null_ _null_ _null_ gist_box_same _null_ _null_ _null_ )); DESCR("GiST support"); DATA(insert OID = 2585 ( gist_poly_consistent PGNSP PGUID 12 1 0 0 0 f f f f t f i 5 0 16 "2281 604 23 26 2281" _null_ _null_ _null_ _null_ gist_poly_consistent _null_ _null_ _null_ )); DESCR("GiST support"); DATA(insert OID = 2586 ( gist_poly_compress PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2281 "2281" _null_ _null_ _null_ _null_ gist_poly_compress _null_ _null_ _null_ )); DESCR("GiST support"); DATA(insert OID = 2591 ( gist_circle_consistent PGNSP PGUID 12 1 0 0 0 f f f f t f i 5 0 16 "2281 718 23 26 2281" _null_ _null_ _null_ _null_ gist_circle_consistent _null_ _null_ _null_ )); DESCR("GiST support"); DATA(insert OID = 2592 ( gist_circle_compress PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2281 "2281" _null_ _null_ _null_ _null_ gist_circle_compress _null_ _null_ _null_ )); DESCR("GiST support"); DATA(insert OID = 1030 ( gist_point_compress PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2281 "2281" _null_ _null_ _null_ _null_ gist_point_compress _null_ _null_ _null_ )); DESCR("GiST support"); DATA(insert OID = 2179 ( gist_point_consistent PGNSP PGUID 12 1 0 0 0 f f f f t f i 5 0 16 "2281 600 23 26 2281" _null_ _null_ _null_ _null_ gist_point_consistent _null_ _null_ _null_ )); DESCR("GiST support"); DATA(insert OID = 3064 ( gist_point_distance PGNSP PGUID 12 1 0 0 0 f f f f t f i 4 0 701 "2281 600 23 26" _null_ _null_ _null_ _null_ gist_point_distance _null_ _null_ _null_ )); DESCR("GiST support"); /* GIN */ DATA(insert OID = 2731 ( gingetbitmap PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 20 "2281 2281" _null_ _null_ _null_ _null_ gingetbitmap _null_ _null_ _null_ )); DESCR("gin(internal)"); DATA(insert OID = 2732 ( gininsert PGNSP PGUID 12 1 0 0 0 f f f f t f v 6 0 16 "2281 2281 2281 2281 2281 2281" _null_ _null_ _null_ _null_ gininsert _null_ _null_ _null_ )); DESCR("gin(internal)"); DATA(insert OID = 2733 ( ginbeginscan PGNSP PGUID 12 1 0 0 0 f f f f t f v 3 0 2281 "2281 2281 2281" _null_ _null_ _null_ _null_ ginbeginscan _null_ _null_ _null_ )); DESCR("gin(internal)"); DATA(insert OID = 2734 ( ginrescan PGNSP PGUID 12 1 0 0 0 f f f f t f v 5 0 2278 "2281 2281 2281 2281 2281" _null_ _null_ _null_ _null_ ginrescan _null_ _null_ _null_ )); DESCR("gin(internal)"); DATA(insert OID = 2735 ( ginendscan PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 2278 "2281" _null_ _null_ _null_ _null_ ginendscan _null_ _null_ _null_ )); DESCR("gin(internal)"); DATA(insert OID = 2736 ( ginmarkpos PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 2278 "2281" _null_ _null_ _null_ _null_ ginmarkpos _null_ _null_ _null_ )); DESCR("gin(internal)"); DATA(insert OID = 2737 ( ginrestrpos PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 2278 "2281" _null_ _null_ _null_ _null_ ginrestrpos _null_ _null_ _null_ )); DESCR("gin(internal)"); DATA(insert OID = 2738 ( ginbuild PGNSP PGUID 12 1 0 0 0 f f f f t f v 3 0 2281 "2281 2281 2281" _null_ _null_ _null_ _null_ ginbuild _null_ _null_ _null_ )); DESCR("gin(internal)"); DATA(insert OID = 325 ( ginbuildempty PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 2278 "2281" _null_ _null_ _null_ _null_ ginbuildempty _null_ _null_ _null_ )); DESCR("gin(internal)"); DATA(insert OID = 2739 ( ginbulkdelete PGNSP PGUID 12 1 0 0 0 f f f f t f v 4 0 2281 "2281 2281 2281 2281" _null_ _null_ _null_ _null_ ginbulkdelete _null_ _null_ _null_ )); DESCR("gin(internal)"); DATA(insert OID = 2740 ( ginvacuumcleanup PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 2281 "2281 2281" _null_ _null_ _null_ _null_ ginvacuumcleanup _null_ _null_ _null_ )); DESCR("gin(internal)"); DATA(insert OID = 2741 ( gincostestimate PGNSP PGUID 12 1 0 0 0 f f f f t f v 7 0 2278 "2281 2281 2281 2281 2281 2281 2281" _null_ _null_ _null_ _null_ gincostestimate _null_ _null_ _null_ )); DESCR("gin(internal)"); DATA(insert OID = 2788 ( ginoptions PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 17 "1009 16" _null_ _null_ _null_ _null_ ginoptions _null_ _null_ _null_ )); DESCR("gin(internal)"); /* GIN array support */ DATA(insert OID = 2743 ( ginarrayextract PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 2281 "2277 2281 2281" _null_ _null_ _null_ _null_ ginarrayextract _null_ _null_ _null_ )); DESCR("GIN array support"); DATA(insert OID = 2774 ( ginqueryarrayextract PGNSP PGUID 12 1 0 0 0 f f f f t f i 7 0 2281 "2277 2281 21 2281 2281 2281 2281" _null_ _null_ _null_ _null_ ginqueryarrayextract _null_ _null_ _null_ )); DESCR("GIN array support"); DATA(insert OID = 2744 ( ginarrayconsistent PGNSP PGUID 12 1 0 0 0 f f f f t f i 8 0 16 "2281 21 2277 23 2281 2281 2281 2281" _null_ _null_ _null_ _null_ ginarrayconsistent _null_ _null_ _null_ )); DESCR("GIN array support"); DATA(insert OID = 3076 ( ginarrayextract PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 2281 "2277 2281" _null_ _null_ _null_ _null_ ginarrayextract_2args _null_ _null_ _null_ )); DESCR("GIN array support (obsolete)"); /* overlap/contains/contained */ DATA(insert OID = 2747 ( arrayoverlap PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "2277 2277" _null_ _null_ _null_ _null_ arrayoverlap _null_ _null_ _null_ )); DATA(insert OID = 2748 ( arraycontains PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "2277 2277" _null_ _null_ _null_ _null_ arraycontains _null_ _null_ _null_ )); DATA(insert OID = 2749 ( arraycontained PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "2277 2277" _null_ _null_ _null_ _null_ arraycontained _null_ _null_ _null_ )); /* userlock replacements */ DATA(insert OID = 2880 ( pg_advisory_lock PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 2278 "20" _null_ _null_ _null_ _null_ pg_advisory_lock_int8 _null_ _null_ _null_ )); DESCR("obtain exclusive advisory lock"); DATA(insert OID = 3089 ( pg_advisory_xact_lock PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 2278 "20" _null_ _null_ _null_ _null_ pg_advisory_xact_lock_int8 _null_ _null_ _null_ )); DESCR("obtain exclusive advisory lock"); DATA(insert OID = 2881 ( pg_advisory_lock_shared PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 2278 "20" _null_ _null_ _null_ _null_ pg_advisory_lock_shared_int8 _null_ _null_ _null_ )); DESCR("obtain shared advisory lock"); DATA(insert OID = 3090 ( pg_advisory_xact_lock_shared PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 2278 "20" _null_ _null_ _null_ _null_ pg_advisory_xact_lock_shared_int8 _null_ _null_ _null_ )); DESCR("obtain shared advisory lock"); DATA(insert OID = 2882 ( pg_try_advisory_lock PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 16 "20" _null_ _null_ _null_ _null_ pg_try_advisory_lock_int8 _null_ _null_ _null_ )); DESCR("obtain exclusive advisory lock if available"); DATA(insert OID = 3091 ( pg_try_advisory_xact_lock PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 16 "20" _null_ _null_ _null_ _null_ pg_try_advisory_xact_lock_int8 _null_ _null_ _null_ )); DESCR("obtain exclusive advisory lock if available"); DATA(insert OID = 2883 ( pg_try_advisory_lock_shared PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 16 "20" _null_ _null_ _null_ _null_ pg_try_advisory_lock_shared_int8 _null_ _null_ _null_ )); DESCR("obtain shared advisory lock if available"); DATA(insert OID = 3092 ( pg_try_advisory_xact_lock_shared PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 16 "20" _null_ _null_ _null_ _null_ pg_try_advisory_xact_lock_shared_int8 _null_ _null_ _null_ )); DESCR("obtain shared advisory lock if available"); DATA(insert OID = 2884 ( pg_advisory_unlock PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 16 "20" _null_ _null_ _null_ _null_ pg_advisory_unlock_int8 _null_ _null_ _null_ )); DESCR("release exclusive advisory lock"); DATA(insert OID = 2885 ( pg_advisory_unlock_shared PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 16 "20" _null_ _null_ _null_ _null_ pg_advisory_unlock_shared_int8 _null_ _null_ _null_ )); DESCR("release shared advisory lock"); DATA(insert OID = 2886 ( pg_advisory_lock PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 2278 "23 23" _null_ _null_ _null_ _null_ pg_advisory_lock_int4 _null_ _null_ _null_ )); DESCR("obtain exclusive advisory lock"); DATA(insert OID = 3093 ( pg_advisory_xact_lock PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 2278 "23 23" _null_ _null_ _null_ _null_ pg_advisory_xact_lock_int4 _null_ _null_ _null_ )); DESCR("obtain exclusive advisory lock"); DATA(insert OID = 2887 ( pg_advisory_lock_shared PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 2278 "23 23" _null_ _null_ _null_ _null_ pg_advisory_lock_shared_int4 _null_ _null_ _null_ )); DESCR("obtain shared advisory lock"); DATA(insert OID = 3094 ( pg_advisory_xact_lock_shared PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 2278 "23 23" _null_ _null_ _null_ _null_ pg_advisory_xact_lock_shared_int4 _null_ _null_ _null_ )); DESCR("obtain shared advisory lock"); DATA(insert OID = 2888 ( pg_try_advisory_lock PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 16 "23 23" _null_ _null_ _null_ _null_ pg_try_advisory_lock_int4 _null_ _null_ _null_ )); DESCR("obtain exclusive advisory lock if available"); DATA(insert OID = 3095 ( pg_try_advisory_xact_lock PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 16 "23 23" _null_ _null_ _null_ _null_ pg_try_advisory_xact_lock_int4 _null_ _null_ _null_ )); DESCR("obtain exclusive advisory lock if available"); DATA(insert OID = 2889 ( pg_try_advisory_lock_shared PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 16 "23 23" _null_ _null_ _null_ _null_ pg_try_advisory_lock_shared_int4 _null_ _null_ _null_ )); DESCR("obtain shared advisory lock if available"); DATA(insert OID = 3096 ( pg_try_advisory_xact_lock_shared PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 16 "23 23" _null_ _null_ _null_ _null_ pg_try_advisory_xact_lock_shared_int4 _null_ _null_ _null_ )); DESCR("obtain shared advisory lock if available"); DATA(insert OID = 2890 ( pg_advisory_unlock PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 16 "23 23" _null_ _null_ _null_ _null_ pg_advisory_unlock_int4 _null_ _null_ _null_ )); DESCR("release exclusive advisory lock"); DATA(insert OID = 2891 ( pg_advisory_unlock_shared PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 16 "23 23" _null_ _null_ _null_ _null_ pg_advisory_unlock_shared_int4 _null_ _null_ _null_ )); DESCR("release shared advisory lock"); DATA(insert OID = 2892 ( pg_advisory_unlock_all PGNSP PGUID 12 1 0 0 0 f f f f t f v 0 0 2278 "" _null_ _null_ _null_ _null_ pg_advisory_unlock_all _null_ _null_ _null_ )); DESCR("release all advisory locks"); /* XML support */ DATA(insert OID = 2893 ( xml_in PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 142 "2275" _null_ _null_ _null_ _null_ xml_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2894 ( xml_out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "142" _null_ _null_ _null_ _null_ xml_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2895 ( xmlcomment PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 142 "25" _null_ _null_ _null_ _null_ xmlcomment _null_ _null_ _null_ )); DESCR("generate XML comment"); DATA(insert OID = 2896 ( xml PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 142 "25" _null_ _null_ _null_ _null_ texttoxml _null_ _null_ _null_ )); DESCR("perform a non-validating parse of a character string to produce an XML value"); DATA(insert OID = 2897 ( xmlvalidate PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "142 25" _null_ _null_ _null_ _null_ xmlvalidate _null_ _null_ _null_ )); DESCR("validate an XML value"); DATA(insert OID = 2898 ( xml_recv PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 142 "2281" _null_ _null_ _null_ _null_ xml_recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2899 ( xml_send PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 17 "142" _null_ _null_ _null_ _null_ xml_send _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2900 ( xmlconcat2 PGNSP PGUID 12 1 0 0 0 f f f f f f i 2 0 142 "142 142" _null_ _null_ _null_ _null_ xmlconcat2 _null_ _null_ _null_ )); DESCR("aggregate transition function"); DATA(insert OID = 2901 ( xmlagg PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 142 "142" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("concatenate XML values"); DATA(insert OID = 2922 ( text PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 25 "142" _null_ _null_ _null_ _null_ xmltotext _null_ _null_ _null_ )); DESCR("serialize an XML value to a character string"); DATA(insert OID = 2923 ( table_to_xml PGNSP PGUID 12 100 0 0 0 f f f f t f s 4 0 142 "2205 16 16 25" _null_ _null_ "{tbl,nulls,tableforest,targetns}" _null_ table_to_xml _null_ _null_ _null_ )); DESCR("map table contents to XML"); DATA(insert OID = 2924 ( query_to_xml PGNSP PGUID 12 100 0 0 0 f f f f t f s 4 0 142 "25 16 16 25" _null_ _null_ "{query,nulls,tableforest,targetns}" _null_ query_to_xml _null_ _null_ _null_ )); DESCR("map query result to XML"); DATA(insert OID = 2925 ( cursor_to_xml PGNSP PGUID 12 100 0 0 0 f f f f t f s 5 0 142 "1790 23 16 16 25" _null_ _null_ "{cursor,count,nulls,tableforest,targetns}" _null_ cursor_to_xml _null_ _null_ _null_ )); DESCR("map rows from cursor to XML"); DATA(insert OID = 2926 ( table_to_xmlschema PGNSP PGUID 12 100 0 0 0 f f f f t f s 4 0 142 "2205 16 16 25" _null_ _null_ "{tbl,nulls,tableforest,targetns}" _null_ table_to_xmlschema _null_ _null_ _null_ )); DESCR("map table structure to XML Schema"); DATA(insert OID = 2927 ( query_to_xmlschema PGNSP PGUID 12 100 0 0 0 f f f f t f s 4 0 142 "25 16 16 25" _null_ _null_ "{query,nulls,tableforest,targetns}" _null_ query_to_xmlschema _null_ _null_ _null_ )); DESCR("map query result structure to XML Schema"); DATA(insert OID = 2928 ( cursor_to_xmlschema PGNSP PGUID 12 100 0 0 0 f f f f t f s 4 0 142 "1790 16 16 25" _null_ _null_ "{cursor,nulls,tableforest,targetns}" _null_ cursor_to_xmlschema _null_ _null_ _null_ )); DESCR("map cursor structure to XML Schema"); DATA(insert OID = 2929 ( table_to_xml_and_xmlschema PGNSP PGUID 12 100 0 0 0 f f f f t f s 4 0 142 "2205 16 16 25" _null_ _null_ "{tbl,nulls,tableforest,targetns}" _null_ table_to_xml_and_xmlschema _null_ _null_ _null_ )); DESCR("map table contents and structure to XML and XML Schema"); DATA(insert OID = 2930 ( query_to_xml_and_xmlschema PGNSP PGUID 12 100 0 0 0 f f f f t f s 4 0 142 "25 16 16 25" _null_ _null_ "{query,nulls,tableforest,targetns}" _null_ query_to_xml_and_xmlschema _null_ _null_ _null_ )); DESCR("map query result and structure to XML and XML Schema"); DATA(insert OID = 2933 ( schema_to_xml PGNSP PGUID 12 100 0 0 0 f f f f t f s 4 0 142 "19 16 16 25" _null_ _null_ "{schema,nulls,tableforest,targetns}" _null_ schema_to_xml _null_ _null_ _null_ )); DESCR("map schema contents to XML"); DATA(insert OID = 2934 ( schema_to_xmlschema PGNSP PGUID 12 100 0 0 0 f f f f t f s 4 0 142 "19 16 16 25" _null_ _null_ "{schema,nulls,tableforest,targetns}" _null_ schema_to_xmlschema _null_ _null_ _null_ )); DESCR("map schema structure to XML Schema"); DATA(insert OID = 2935 ( schema_to_xml_and_xmlschema PGNSP PGUID 12 100 0 0 0 f f f f t f s 4 0 142 "19 16 16 25" _null_ _null_ "{schema,nulls,tableforest,targetns}" _null_ schema_to_xml_and_xmlschema _null_ _null_ _null_ )); DESCR("map schema contents and structure to XML and XML Schema"); DATA(insert OID = 2936 ( database_to_xml PGNSP PGUID 12 100 0 0 0 f f f f t f s 3 0 142 "16 16 25" _null_ _null_ "{nulls,tableforest,targetns}" _null_ database_to_xml _null_ _null_ _null_ )); DESCR("map database contents to XML"); DATA(insert OID = 2937 ( database_to_xmlschema PGNSP PGUID 12 100 0 0 0 f f f f t f s 3 0 142 "16 16 25" _null_ _null_ "{nulls,tableforest,targetns}" _null_ database_to_xmlschema _null_ _null_ _null_ )); DESCR("map database structure to XML Schema"); DATA(insert OID = 2938 ( database_to_xml_and_xmlschema PGNSP PGUID 12 100 0 0 0 f f f f t f s 3 0 142 "16 16 25" _null_ _null_ "{nulls,tableforest,targetns}" _null_ database_to_xml_and_xmlschema _null_ _null_ _null_ )); DESCR("map database contents and structure to XML and XML Schema"); DATA(insert OID = 2931 ( xpath PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 143 "25 142 1009" _null_ _null_ _null_ _null_ xpath _null_ _null_ _null_ )); DESCR("evaluate XPath expression, with namespaces support"); DATA(insert OID = 2932 ( xpath PGNSP PGUID 14 1 0 0 0 f f f f t f i 2 0 143 "25 142" _null_ _null_ _null_ _null_ "select pg_catalog.xpath($1, $2, ''{}''::pg_catalog.text[])" _null_ _null_ _null_ )); DESCR("evaluate XPath expression"); DATA(insert OID = 2614 ( xmlexists PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "25 142" _null_ _null_ _null_ _null_ xmlexists _null_ _null_ _null_ )); DESCR("test XML value against XPath expression"); DATA(insert OID = 3049 ( xpath_exists PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 16 "25 142 1009" _null_ _null_ _null_ _null_ xpath_exists _null_ _null_ _null_ )); DESCR("test XML value against XPath expression, with namespace support"); DATA(insert OID = 3050 ( xpath_exists PGNSP PGUID 14 1 0 0 0 f f f f t f i 2 0 16 "25 142" _null_ _null_ _null_ _null_ "select pg_catalog.xpath_exists($1, $2, ''{}''::pg_catalog.text[])" _null_ _null_ _null_ )); DESCR("test XML value against XPath expression"); DATA(insert OID = 3051 ( xml_is_well_formed PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 16 "25" _null_ _null_ _null_ _null_ xml_is_well_formed _null_ _null_ _null_ )); DESCR("determine if a string is well formed XML"); DATA(insert OID = 3052 ( xml_is_well_formed_document PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 16 "25" _null_ _null_ _null_ _null_ xml_is_well_formed_document _null_ _null_ _null_ )); DESCR("determine if a string is well formed XML document"); DATA(insert OID = 3053 ( xml_is_well_formed_content PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 16 "25" _null_ _null_ _null_ _null_ xml_is_well_formed_content _null_ _null_ _null_ )); DESCR("determine if a string is well formed XML content"); /* json */ DATA(insert OID = 321 ( json_in PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 114 "2275" _null_ _null_ _null_ _null_ json_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 322 ( json_out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "114" _null_ _null_ _null_ _null_ json_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 323 ( json_recv PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 114 "2281" _null_ _null_ _null_ _null_ json_recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 324 ( json_send PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 17 "114" _null_ _null_ _null_ _null_ json_send _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 3153 ( array_to_json PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 114 "2277" _null_ _null_ _null_ _null_ array_to_json _null_ _null_ _null_ )); DESCR("map array to json"); DATA(insert OID = 3154 ( array_to_json PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 114 "2277 16" _null_ _null_ _null_ _null_ array_to_json_pretty _null_ _null_ _null_ )); DESCR("map array to json with optional pretty printing"); DATA(insert OID = 3155 ( row_to_json PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 114 "2249" _null_ _null_ _null_ _null_ row_to_json _null_ _null_ _null_ )); DESCR("map row to json"); DATA(insert OID = 3156 ( row_to_json PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 114 "2249 16" _null_ _null_ _null_ _null_ row_to_json_pretty _null_ _null_ _null_ )); DESCR("map row to json with optional pretty printing"); /* uuid */ DATA(insert OID = 2952 ( uuid_in PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2950 "2275" _null_ _null_ _null_ _null_ uuid_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2953 ( uuid_out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "2950" _null_ _null_ _null_ _null_ uuid_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2954 ( uuid_lt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "2950 2950" _null_ _null_ _null_ _null_ uuid_lt _null_ _null_ _null_ )); DATA(insert OID = 2955 ( uuid_le PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "2950 2950" _null_ _null_ _null_ _null_ uuid_le _null_ _null_ _null_ )); DATA(insert OID = 2956 ( uuid_eq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "2950 2950" _null_ _null_ _null_ _null_ uuid_eq _null_ _null_ _null_ )); DATA(insert OID = 2957 ( uuid_ge PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "2950 2950" _null_ _null_ _null_ _null_ uuid_ge _null_ _null_ _null_ )); DATA(insert OID = 2958 ( uuid_gt PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "2950 2950" _null_ _null_ _null_ _null_ uuid_gt _null_ _null_ _null_ )); DATA(insert OID = 2959 ( uuid_ne PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "2950 2950" _null_ _null_ _null_ _null_ uuid_ne _null_ _null_ _null_ )); DATA(insert OID = 2960 ( uuid_cmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "2950 2950" _null_ _null_ _null_ _null_ uuid_cmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 2961 ( uuid_recv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2950 "2281" _null_ _null_ _null_ _null_ uuid_recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2962 ( uuid_send PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "2950" _null_ _null_ _null_ _null_ uuid_send _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2963 ( uuid_hash PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "2950" _null_ _null_ _null_ _null_ uuid_hash _null_ _null_ _null_ )); DESCR("hash"); /* enum related procs */ DATA(insert OID = 3504 ( anyenum_in PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 3500 "2275" _null_ _null_ _null_ _null_ anyenum_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 3505 ( anyenum_out PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 2275 "3500" _null_ _null_ _null_ _null_ anyenum_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 3506 ( enum_in PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 3500 "2275 26" _null_ _null_ _null_ _null_ enum_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 3507 ( enum_out PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 2275 "3500" _null_ _null_ _null_ _null_ enum_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 3508 ( enum_eq PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3500 3500" _null_ _null_ _null_ _null_ enum_eq _null_ _null_ _null_ )); DATA(insert OID = 3509 ( enum_ne PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3500 3500" _null_ _null_ _null_ _null_ enum_ne _null_ _null_ _null_ )); DATA(insert OID = 3510 ( enum_lt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3500 3500" _null_ _null_ _null_ _null_ enum_lt _null_ _null_ _null_ )); DATA(insert OID = 3511 ( enum_gt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3500 3500" _null_ _null_ _null_ _null_ enum_gt _null_ _null_ _null_ )); DATA(insert OID = 3512 ( enum_le PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3500 3500" _null_ _null_ _null_ _null_ enum_le _null_ _null_ _null_ )); DATA(insert OID = 3513 ( enum_ge PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3500 3500" _null_ _null_ _null_ _null_ enum_ge _null_ _null_ _null_ )); DATA(insert OID = 3514 ( enum_cmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "3500 3500" _null_ _null_ _null_ _null_ enum_cmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 3515 ( hashenum PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "3500" _null_ _null_ _null_ _null_ hashenum _null_ _null_ _null_ )); DESCR("hash"); DATA(insert OID = 3524 ( enum_smaller PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 3500 "3500 3500" _null_ _null_ _null_ _null_ enum_smaller _null_ _null_ _null_ )); DESCR("smaller of two"); DATA(insert OID = 3525 ( enum_larger PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 3500 "3500 3500" _null_ _null_ _null_ _null_ enum_larger _null_ _null_ _null_ )); DESCR("larger of two"); DATA(insert OID = 3526 ( max PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 3500 "3500" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("maximum value of all enum input values"); DATA(insert OID = 3527 ( min PGNSP PGUID 12 1 0 0 0 t f f f f f i 1 0 3500 "3500" _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); DESCR("minimum value of all enum input values"); DATA(insert OID = 3528 ( enum_first PGNSP PGUID 12 1 0 0 0 f f f f f f s 1 0 3500 "3500" _null_ _null_ _null_ _null_ enum_first _null_ _null_ _null_ )); DESCR("first value of the input enum type"); DATA(insert OID = 3529 ( enum_last PGNSP PGUID 12 1 0 0 0 f f f f f f s 1 0 3500 "3500" _null_ _null_ _null_ _null_ enum_last _null_ _null_ _null_ )); DESCR("last value of the input enum type"); DATA(insert OID = 3530 ( enum_range PGNSP PGUID 12 1 0 0 0 f f f f f f s 2 0 2277 "3500 3500" _null_ _null_ _null_ _null_ enum_range_bounds _null_ _null_ _null_ )); DESCR("range between the two given enum values, as an ordered array"); DATA(insert OID = 3531 ( enum_range PGNSP PGUID 12 1 0 0 0 f f f f f f s 1 0 2277 "3500" _null_ _null_ _null_ _null_ enum_range_all _null_ _null_ _null_ )); DESCR("range of the given enum type, as an ordered array"); DATA(insert OID = 3532 ( enum_recv PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 3500 "2275 26" _null_ _null_ _null_ _null_ enum_recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 3533 ( enum_send PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 17 "3500" _null_ _null_ _null_ _null_ enum_send _null_ _null_ _null_ )); DESCR("I/O"); /* text search stuff */ DATA(insert OID = 3610 ( tsvectorin PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 3614 "2275" _null_ _null_ _null_ _null_ tsvectorin _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 3639 ( tsvectorrecv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 3614 "2281" _null_ _null_ _null_ _null_ tsvectorrecv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 3611 ( tsvectorout PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "3614" _null_ _null_ _null_ _null_ tsvectorout _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 3638 ( tsvectorsend PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "3614" _null_ _null_ _null_ _null_ tsvectorsend _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 3612 ( tsqueryin PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 3615 "2275" _null_ _null_ _null_ _null_ tsqueryin _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 3641 ( tsqueryrecv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 3615 "2281" _null_ _null_ _null_ _null_ tsqueryrecv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 3613 ( tsqueryout PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "3615" _null_ _null_ _null_ _null_ tsqueryout _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 3640 ( tsquerysend PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "3615" _null_ _null_ _null_ _null_ tsquerysend _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 3646 ( gtsvectorin PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 3642 "2275" _null_ _null_ _null_ _null_ gtsvectorin _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 3647 ( gtsvectorout PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "3642" _null_ _null_ _null_ _null_ gtsvectorout _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 3616 ( tsvector_lt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3614 3614" _null_ _null_ _null_ _null_ tsvector_lt _null_ _null_ _null_ )); DATA(insert OID = 3617 ( tsvector_le PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3614 3614" _null_ _null_ _null_ _null_ tsvector_le _null_ _null_ _null_ )); DATA(insert OID = 3618 ( tsvector_eq PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3614 3614" _null_ _null_ _null_ _null_ tsvector_eq _null_ _null_ _null_ )); DATA(insert OID = 3619 ( tsvector_ne PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3614 3614" _null_ _null_ _null_ _null_ tsvector_ne _null_ _null_ _null_ )); DATA(insert OID = 3620 ( tsvector_ge PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3614 3614" _null_ _null_ _null_ _null_ tsvector_ge _null_ _null_ _null_ )); DATA(insert OID = 3621 ( tsvector_gt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3614 3614" _null_ _null_ _null_ _null_ tsvector_gt _null_ _null_ _null_ )); DATA(insert OID = 3622 ( tsvector_cmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "3614 3614" _null_ _null_ _null_ _null_ tsvector_cmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 3711 ( length PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "3614" _null_ _null_ _null_ _null_ tsvector_length _null_ _null_ _null_ )); DESCR("number of lexemes"); DATA(insert OID = 3623 ( strip PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 3614 "3614" _null_ _null_ _null_ _null_ tsvector_strip _null_ _null_ _null_ )); DESCR("strip position information"); DATA(insert OID = 3624 ( setweight PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 3614 "3614 18" _null_ _null_ _null_ _null_ tsvector_setweight _null_ _null_ _null_ )); DESCR("set weight of lexeme's entries"); DATA(insert OID = 3625 ( tsvector_concat PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 3614 "3614 3614" _null_ _null_ _null_ _null_ tsvector_concat _null_ _null_ _null_ )); DATA(insert OID = 3634 ( ts_match_vq PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3614 3615" _null_ _null_ _null_ _null_ ts_match_vq _null_ _null_ _null_ )); DATA(insert OID = 3635 ( ts_match_qv PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3615 3614" _null_ _null_ _null_ _null_ ts_match_qv _null_ _null_ _null_ )); DATA(insert OID = 3760 ( ts_match_tt PGNSP PGUID 12 3 0 0 0 f f f f t f s 2 0 16 "25 25" _null_ _null_ _null_ _null_ ts_match_tt _null_ _null_ _null_ )); DATA(insert OID = 3761 ( ts_match_tq PGNSP PGUID 12 2 0 0 0 f f f f t f s 2 0 16 "25 3615" _null_ _null_ _null_ _null_ ts_match_tq _null_ _null_ _null_ )); DATA(insert OID = 3648 ( gtsvector_compress PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2281 "2281" _null_ _null_ _null_ _null_ gtsvector_compress _null_ _null_ _null_ )); DESCR("GiST tsvector support"); DATA(insert OID = 3649 ( gtsvector_decompress PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2281 "2281" _null_ _null_ _null_ _null_ gtsvector_decompress _null_ _null_ _null_ )); DESCR("GiST tsvector support"); DATA(insert OID = 3650 ( gtsvector_picksplit PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 2281 "2281 2281" _null_ _null_ _null_ _null_ gtsvector_picksplit _null_ _null_ _null_ )); DESCR("GiST tsvector support"); DATA(insert OID = 3651 ( gtsvector_union PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 2281 "2281 2281" _null_ _null_ _null_ _null_ gtsvector_union _null_ _null_ _null_ )); DESCR("GiST tsvector support"); DATA(insert OID = 3652 ( gtsvector_same PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 2281 "3642 3642 2281" _null_ _null_ _null_ _null_ gtsvector_same _null_ _null_ _null_ )); DESCR("GiST tsvector support"); DATA(insert OID = 3653 ( gtsvector_penalty PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 2281 "2281 2281 2281" _null_ _null_ _null_ _null_ gtsvector_penalty _null_ _null_ _null_ )); DESCR("GiST tsvector support"); DATA(insert OID = 3654 ( gtsvector_consistent PGNSP PGUID 12 1 0 0 0 f f f f t f i 5 0 16 "2281 3642 23 26 2281" _null_ _null_ _null_ _null_ gtsvector_consistent _null_ _null_ _null_ )); DESCR("GiST tsvector support"); DATA(insert OID = 3656 ( gin_extract_tsvector PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 2281 "3614 2281 2281" _null_ _null_ _null_ _null_ gin_extract_tsvector _null_ _null_ _null_ )); DESCR("GIN tsvector support"); DATA(insert OID = 3657 ( gin_extract_tsquery PGNSP PGUID 12 1 0 0 0 f f f f t f i 7 0 2281 "3615 2281 21 2281 2281 2281 2281" _null_ _null_ _null_ _null_ gin_extract_tsquery _null_ _null_ _null_ )); DESCR("GIN tsvector support"); DATA(insert OID = 3658 ( gin_tsquery_consistent PGNSP PGUID 12 1 0 0 0 f f f f t f i 8 0 16 "2281 21 3615 23 2281 2281 2281 2281" _null_ _null_ _null_ _null_ gin_tsquery_consistent _null_ _null_ _null_ )); DESCR("GIN tsvector support"); DATA(insert OID = 3724 ( gin_cmp_tslexeme PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "25 25" _null_ _null_ _null_ _null_ gin_cmp_tslexeme _null_ _null_ _null_ )); DESCR("GIN tsvector support"); DATA(insert OID = 2700 ( gin_cmp_prefix PGNSP PGUID 12 1 0 0 0 f f f f t f i 4 0 23 "25 25 21 2281" _null_ _null_ _null_ _null_ gin_cmp_prefix _null_ _null_ _null_ )); DESCR("GIN tsvector support"); DATA(insert OID = 3077 ( gin_extract_tsvector PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 2281 "3614 2281" _null_ _null_ _null_ _null_ gin_extract_tsvector_2args _null_ _null_ _null_ )); DESCR("GIN tsvector support (obsolete)"); DATA(insert OID = 3087 ( gin_extract_tsquery PGNSP PGUID 12 1 0 0 0 f f f f t f i 5 0 2281 "3615 2281 21 2281 2281" _null_ _null_ _null_ _null_ gin_extract_tsquery_5args _null_ _null_ _null_ )); DESCR("GIN tsvector support (obsolete)"); DATA(insert OID = 3088 ( gin_tsquery_consistent PGNSP PGUID 12 1 0 0 0 f f f f t f i 6 0 16 "2281 21 3615 23 2281 2281" _null_ _null_ _null_ _null_ gin_tsquery_consistent_6args _null_ _null_ _null_ )); DESCR("GIN tsvector support (obsolete)"); DATA(insert OID = 3662 ( tsquery_lt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3615 3615" _null_ _null_ _null_ _null_ tsquery_lt _null_ _null_ _null_ )); DATA(insert OID = 3663 ( tsquery_le PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3615 3615" _null_ _null_ _null_ _null_ tsquery_le _null_ _null_ _null_ )); DATA(insert OID = 3664 ( tsquery_eq PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3615 3615" _null_ _null_ _null_ _null_ tsquery_eq _null_ _null_ _null_ )); DATA(insert OID = 3665 ( tsquery_ne PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3615 3615" _null_ _null_ _null_ _null_ tsquery_ne _null_ _null_ _null_ )); DATA(insert OID = 3666 ( tsquery_ge PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3615 3615" _null_ _null_ _null_ _null_ tsquery_ge _null_ _null_ _null_ )); DATA(insert OID = 3667 ( tsquery_gt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3615 3615" _null_ _null_ _null_ _null_ tsquery_gt _null_ _null_ _null_ )); DATA(insert OID = 3668 ( tsquery_cmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "3615 3615" _null_ _null_ _null_ _null_ tsquery_cmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 3669 ( tsquery_and PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 3615 "3615 3615" _null_ _null_ _null_ _null_ tsquery_and _null_ _null_ _null_ )); DATA(insert OID = 3670 ( tsquery_or PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 3615 "3615 3615" _null_ _null_ _null_ _null_ tsquery_or _null_ _null_ _null_ )); DATA(insert OID = 3671 ( tsquery_not PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 3615 "3615" _null_ _null_ _null_ _null_ tsquery_not _null_ _null_ _null_ )); DATA(insert OID = 3691 ( tsq_mcontains PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3615 3615" _null_ _null_ _null_ _null_ tsq_mcontains _null_ _null_ _null_ )); DATA(insert OID = 3692 ( tsq_mcontained PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3615 3615" _null_ _null_ _null_ _null_ tsq_mcontained _null_ _null_ _null_ )); DATA(insert OID = 3672 ( numnode PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "3615" _null_ _null_ _null_ _null_ tsquery_numnode _null_ _null_ _null_ )); DESCR("number of nodes"); DATA(insert OID = 3673 ( querytree PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 25 "3615" _null_ _null_ _null_ _null_ tsquerytree _null_ _null_ _null_ )); DESCR("show real useful query for GiST index"); DATA(insert OID = 3684 ( ts_rewrite PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 3615 "3615 3615 3615" _null_ _null_ _null_ _null_ tsquery_rewrite _null_ _null_ _null_ )); DESCR("rewrite tsquery"); DATA(insert OID = 3685 ( ts_rewrite PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 3615 "3615 25" _null_ _null_ _null_ _null_ tsquery_rewrite_query _null_ _null_ _null_ )); DESCR("rewrite tsquery"); DATA(insert OID = 3695 ( gtsquery_compress PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2281 "2281" _null_ _null_ _null_ _null_ gtsquery_compress _null_ _null_ _null_ )); DESCR("GiST tsquery support"); DATA(insert OID = 3696 ( gtsquery_decompress PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2281 "2281" _null_ _null_ _null_ _null_ gtsquery_decompress _null_ _null_ _null_ )); DESCR("GiST tsquery support"); DATA(insert OID = 3697 ( gtsquery_picksplit PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 2281 "2281 2281" _null_ _null_ _null_ _null_ gtsquery_picksplit _null_ _null_ _null_ )); DESCR("GiST tsquery support"); DATA(insert OID = 3698 ( gtsquery_union PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 2281 "2281 2281" _null_ _null_ _null_ _null_ gtsquery_union _null_ _null_ _null_ )); DESCR("GiST tsquery support"); DATA(insert OID = 3699 ( gtsquery_same PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 2281 "20 20 2281" _null_ _null_ _null_ _null_ gtsquery_same _null_ _null_ _null_ )); DESCR("GiST tsquery support"); DATA(insert OID = 3700 ( gtsquery_penalty PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 2281 "2281 2281 2281" _null_ _null_ _null_ _null_ gtsquery_penalty _null_ _null_ _null_ )); DESCR("GiST tsquery support"); DATA(insert OID = 3701 ( gtsquery_consistent PGNSP PGUID 12 1 0 0 0 f f f f t f i 5 0 16 "2281 2281 23 26 2281" _null_ _null_ _null_ _null_ gtsquery_consistent _null_ _null_ _null_ )); DESCR("GiST tsquery support"); DATA(insert OID = 3686 ( tsmatchsel PGNSP PGUID 12 1 0 0 0 f f f f t f s 4 0 701 "2281 26 2281 23" _null_ _null_ _null_ _null_ tsmatchsel _null_ _null_ _null_ )); DESCR("restriction selectivity of tsvector @@ tsquery"); DATA(insert OID = 3687 ( tsmatchjoinsel PGNSP PGUID 12 1 0 0 0 f f f f t f s 5 0 701 "2281 26 2281 21 2281" _null_ _null_ _null_ _null_ tsmatchjoinsel _null_ _null_ _null_ )); DESCR("join selectivity of tsvector @@ tsquery"); DATA(insert OID = 3688 ( ts_typanalyze PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 16 "2281" _null_ _null_ _null_ _null_ ts_typanalyze _null_ _null_ _null_ )); DESCR("tsvector typanalyze"); DATA(insert OID = 3689 ( ts_stat PGNSP PGUID 12 10 10000 0 0 f f f f t t v 1 0 2249 "25" "{25,25,23,23}" "{i,o,o,o}" "{query,word,ndoc,nentry}" _null_ ts_stat1 _null_ _null_ _null_ )); DESCR("statistics of tsvector column"); DATA(insert OID = 3690 ( ts_stat PGNSP PGUID 12 10 10000 0 0 f f f f t t v 2 0 2249 "25 25" "{25,25,25,23,23}" "{i,i,o,o,o}" "{query,weights,word,ndoc,nentry}" _null_ ts_stat2 _null_ _null_ _null_ )); DESCR("statistics of tsvector column"); DATA(insert OID = 3703 ( ts_rank PGNSP PGUID 12 1 0 0 0 f f f f t f i 4 0 700 "1021 3614 3615 23" _null_ _null_ _null_ _null_ ts_rank_wttf _null_ _null_ _null_ )); DESCR("relevance"); DATA(insert OID = 3704 ( ts_rank PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 700 "1021 3614 3615" _null_ _null_ _null_ _null_ ts_rank_wtt _null_ _null_ _null_ )); DESCR("relevance"); DATA(insert OID = 3705 ( ts_rank PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 700 "3614 3615 23" _null_ _null_ _null_ _null_ ts_rank_ttf _null_ _null_ _null_ )); DESCR("relevance"); DATA(insert OID = 3706 ( ts_rank PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 700 "3614 3615" _null_ _null_ _null_ _null_ ts_rank_tt _null_ _null_ _null_ )); DESCR("relevance"); DATA(insert OID = 3707 ( ts_rank_cd PGNSP PGUID 12 1 0 0 0 f f f f t f i 4 0 700 "1021 3614 3615 23" _null_ _null_ _null_ _null_ ts_rankcd_wttf _null_ _null_ _null_ )); DESCR("relevance"); DATA(insert OID = 3708 ( ts_rank_cd PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 700 "1021 3614 3615" _null_ _null_ _null_ _null_ ts_rankcd_wtt _null_ _null_ _null_ )); DESCR("relevance"); DATA(insert OID = 3709 ( ts_rank_cd PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 700 "3614 3615 23" _null_ _null_ _null_ _null_ ts_rankcd_ttf _null_ _null_ _null_ )); DESCR("relevance"); DATA(insert OID = 3710 ( ts_rank_cd PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 700 "3614 3615" _null_ _null_ _null_ _null_ ts_rankcd_tt _null_ _null_ _null_ )); DESCR("relevance"); DATA(insert OID = 3713 ( ts_token_type PGNSP PGUID 12 1 16 0 0 f f f f t t i 1 0 2249 "26" "{26,23,25,25}" "{i,o,o,o}" "{parser_oid,tokid,alias,description}" _null_ ts_token_type_byid _null_ _null_ _null_ )); DESCR("get parser's token types"); DATA(insert OID = 3714 ( ts_token_type PGNSP PGUID 12 1 16 0 0 f f f f t t s 1 0 2249 "25" "{25,23,25,25}" "{i,o,o,o}" "{parser_name,tokid,alias,description}" _null_ ts_token_type_byname _null_ _null_ _null_ )); DESCR("get parser's token types"); DATA(insert OID = 3715 ( ts_parse PGNSP PGUID 12 1 1000 0 0 f f f f t t i 2 0 2249 "26 25" "{26,25,23,25}" "{i,i,o,o}" "{parser_oid,txt,tokid,token}" _null_ ts_parse_byid _null_ _null_ _null_ )); DESCR("parse text to tokens"); DATA(insert OID = 3716 ( ts_parse PGNSP PGUID 12 1 1000 0 0 f f f f t t s 2 0 2249 "25 25" "{25,25,23,25}" "{i,i,o,o}" "{parser_name,txt,tokid,token}" _null_ ts_parse_byname _null_ _null_ _null_ )); DESCR("parse text to tokens"); DATA(insert OID = 3717 ( prsd_start PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 2281 "2281 23" _null_ _null_ _null_ _null_ prsd_start _null_ _null_ _null_ )); DESCR("(internal)"); DATA(insert OID = 3718 ( prsd_nexttoken PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 2281 "2281 2281 2281" _null_ _null_ _null_ _null_ prsd_nexttoken _null_ _null_ _null_ )); DESCR("(internal)"); DATA(insert OID = 3719 ( prsd_end PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2278 "2281" _null_ _null_ _null_ _null_ prsd_end _null_ _null_ _null_ )); DESCR("(internal)"); DATA(insert OID = 3720 ( prsd_headline PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 2281 "2281 2281 3615" _null_ _null_ _null_ _null_ prsd_headline _null_ _null_ _null_ )); DESCR("(internal)"); DATA(insert OID = 3721 ( prsd_lextype PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2281 "2281" _null_ _null_ _null_ _null_ prsd_lextype _null_ _null_ _null_ )); DESCR("(internal)"); DATA(insert OID = 3723 ( ts_lexize PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 1009 "3769 25" _null_ _null_ _null_ _null_ ts_lexize _null_ _null_ _null_ )); DESCR("normalize one word by dictionary"); DATA(insert OID = 3725 ( dsimple_init PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2281 "2281" _null_ _null_ _null_ _null_ dsimple_init _null_ _null_ _null_ )); DESCR("(internal)"); DATA(insert OID = 3726 ( dsimple_lexize PGNSP PGUID 12 1 0 0 0 f f f f t f i 4 0 2281 "2281 2281 2281 2281" _null_ _null_ _null_ _null_ dsimple_lexize _null_ _null_ _null_ )); DESCR("(internal)"); DATA(insert OID = 3728 ( dsynonym_init PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2281 "2281" _null_ _null_ _null_ _null_ dsynonym_init _null_ _null_ _null_ )); DESCR("(internal)"); DATA(insert OID = 3729 ( dsynonym_lexize PGNSP PGUID 12 1 0 0 0 f f f f t f i 4 0 2281 "2281 2281 2281 2281" _null_ _null_ _null_ _null_ dsynonym_lexize _null_ _null_ _null_ )); DESCR("(internal)"); DATA(insert OID = 3731 ( dispell_init PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2281 "2281" _null_ _null_ _null_ _null_ dispell_init _null_ _null_ _null_ )); DESCR("(internal)"); DATA(insert OID = 3732 ( dispell_lexize PGNSP PGUID 12 1 0 0 0 f f f f t f i 4 0 2281 "2281 2281 2281 2281" _null_ _null_ _null_ _null_ dispell_lexize _null_ _null_ _null_ )); DESCR("(internal)"); DATA(insert OID = 3740 ( thesaurus_init PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2281 "2281" _null_ _null_ _null_ _null_ thesaurus_init _null_ _null_ _null_ )); DESCR("(internal)"); DATA(insert OID = 3741 ( thesaurus_lexize PGNSP PGUID 12 1 0 0 0 f f f f t f i 4 0 2281 "2281 2281 2281 2281" _null_ _null_ _null_ _null_ thesaurus_lexize _null_ _null_ _null_ )); DESCR("(internal)"); DATA(insert OID = 3743 ( ts_headline PGNSP PGUID 12 1 0 0 0 f f f f t f i 4 0 25 "3734 25 3615 25" _null_ _null_ _null_ _null_ ts_headline_byid_opt _null_ _null_ _null_ )); DESCR("generate headline"); DATA(insert OID = 3744 ( ts_headline PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 25 "3734 25 3615" _null_ _null_ _null_ _null_ ts_headline_byid _null_ _null_ _null_ )); DESCR("generate headline"); DATA(insert OID = 3754 ( ts_headline PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 25 "25 3615 25" _null_ _null_ _null_ _null_ ts_headline_opt _null_ _null_ _null_ )); DESCR("generate headline"); DATA(insert OID = 3755 ( ts_headline PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 25 "25 3615" _null_ _null_ _null_ _null_ ts_headline _null_ _null_ _null_ )); DESCR("generate headline"); DATA(insert OID = 3745 ( to_tsvector PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 3614 "3734 25" _null_ _null_ _null_ _null_ to_tsvector_byid _null_ _null_ _null_ )); DESCR("transform to tsvector"); DATA(insert OID = 3746 ( to_tsquery PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 3615 "3734 25" _null_ _null_ _null_ _null_ to_tsquery_byid _null_ _null_ _null_ )); DESCR("make tsquery"); DATA(insert OID = 3747 ( plainto_tsquery PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 3615 "3734 25" _null_ _null_ _null_ _null_ plainto_tsquery_byid _null_ _null_ _null_ )); DESCR("transform to tsquery"); DATA(insert OID = 3749 ( to_tsvector PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 3614 "25" _null_ _null_ _null_ _null_ to_tsvector _null_ _null_ _null_ )); DESCR("transform to tsvector"); DATA(insert OID = 3750 ( to_tsquery PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 3615 "25" _null_ _null_ _null_ _null_ to_tsquery _null_ _null_ _null_ )); DESCR("make tsquery"); DATA(insert OID = 3751 ( plainto_tsquery PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 3615 "25" _null_ _null_ _null_ _null_ plainto_tsquery _null_ _null_ _null_ )); DESCR("transform to tsquery"); DATA(insert OID = 3752 ( tsvector_update_trigger PGNSP PGUID 12 1 0 0 0 f f f f f f v 0 0 2279 "" _null_ _null_ _null_ _null_ tsvector_update_trigger_byid _null_ _null_ _null_ )); DESCR("trigger for automatic update of tsvector column"); DATA(insert OID = 3753 ( tsvector_update_trigger_column PGNSP PGUID 12 1 0 0 0 f f f f f f v 0 0 2279 "" _null_ _null_ _null_ _null_ tsvector_update_trigger_bycolumn _null_ _null_ _null_ )); DESCR("trigger for automatic update of tsvector column"); DATA(insert OID = 3759 ( get_current_ts_config PGNSP PGUID 12 1 0 0 0 f f f f t f s 0 0 3734 "" _null_ _null_ _null_ _null_ get_current_ts_config _null_ _null_ _null_ )); DESCR("get current tsearch configuration"); DATA(insert OID = 3736 ( regconfigin PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 3734 "2275" _null_ _null_ _null_ _null_ regconfigin _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 3737 ( regconfigout PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 2275 "3734" _null_ _null_ _null_ _null_ regconfigout _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 3738 ( regconfigrecv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 3734 "2281" _null_ _null_ _null_ _null_ regconfigrecv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 3739 ( regconfigsend PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "3734" _null_ _null_ _null_ _null_ regconfigsend _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 3771 ( regdictionaryin PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 3769 "2275" _null_ _null_ _null_ _null_ regdictionaryin _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 3772 ( regdictionaryout PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 2275 "3769" _null_ _null_ _null_ _null_ regdictionaryout _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 3773 ( regdictionaryrecv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 3769 "2281" _null_ _null_ _null_ _null_ regdictionaryrecv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 3774 ( regdictionarysend PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "3769" _null_ _null_ _null_ _null_ regdictionarysend _null_ _null_ _null_ )); DESCR("I/O"); /* txid */ DATA(insert OID = 2939 ( txid_snapshot_in PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2970 "2275" _null_ _null_ _null_ _null_ txid_snapshot_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2940 ( txid_snapshot_out PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "2970" _null_ _null_ _null_ _null_ txid_snapshot_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2941 ( txid_snapshot_recv PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2970 "2281" _null_ _null_ _null_ _null_ txid_snapshot_recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2942 ( txid_snapshot_send PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 17 "2970" _null_ _null_ _null_ _null_ txid_snapshot_send _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2943 ( txid_current PGNSP PGUID 12 1 0 0 0 f f f f t f s 0 0 20 "" _null_ _null_ _null_ _null_ txid_current _null_ _null_ _null_ )); DESCR("get current transaction ID"); DATA(insert OID = 2944 ( txid_current_snapshot PGNSP PGUID 12 1 0 0 0 f f f f t f s 0 0 2970 "" _null_ _null_ _null_ _null_ txid_current_snapshot _null_ _null_ _null_ )); DESCR("get current snapshot"); DATA(insert OID = 2945 ( txid_snapshot_xmin PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 20 "2970" _null_ _null_ _null_ _null_ txid_snapshot_xmin _null_ _null_ _null_ )); DESCR("get xmin of snapshot"); DATA(insert OID = 2946 ( txid_snapshot_xmax PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 20 "2970" _null_ _null_ _null_ _null_ txid_snapshot_xmax _null_ _null_ _null_ )); DESCR("get xmax of snapshot"); DATA(insert OID = 2947 ( txid_snapshot_xip PGNSP PGUID 12 1 50 0 0 f f f f t t i 1 0 20 "2970" _null_ _null_ _null_ _null_ txid_snapshot_xip _null_ _null_ _null_ )); DESCR("get set of in-progress txids in snapshot"); DATA(insert OID = 2948 ( txid_visible_in_snapshot PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "20 2970" _null_ _null_ _null_ _null_ txid_visible_in_snapshot _null_ _null_ _null_ )); DESCR("is txid visible in snapshot?"); /* record comparison */ DATA(insert OID = 2981 ( record_eq PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "2249 2249" _null_ _null_ _null_ _null_ record_eq _null_ _null_ _null_ )); DATA(insert OID = 2982 ( record_ne PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "2249 2249" _null_ _null_ _null_ _null_ record_ne _null_ _null_ _null_ )); DATA(insert OID = 2983 ( record_lt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "2249 2249" _null_ _null_ _null_ _null_ record_lt _null_ _null_ _null_ )); DATA(insert OID = 2984 ( record_gt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "2249 2249" _null_ _null_ _null_ _null_ record_gt _null_ _null_ _null_ )); DATA(insert OID = 2985 ( record_le PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "2249 2249" _null_ _null_ _null_ _null_ record_le _null_ _null_ _null_ )); DATA(insert OID = 2986 ( record_ge PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "2249 2249" _null_ _null_ _null_ _null_ record_ge _null_ _null_ _null_ )); DATA(insert OID = 2987 ( btrecordcmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "2249 2249" _null_ _null_ _null_ _null_ btrecordcmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); /* Extensions */ DATA(insert OID = 3082 ( pg_available_extensions PGNSP PGUID 12 10 100 0 0 f f f f t t s 0 0 2249 "" "{19,25,25}" "{o,o,o}" "{name,default_version,comment}" _null_ pg_available_extensions _null_ _null_ _null_ )); DESCR("list available extensions"); DATA(insert OID = 3083 ( pg_available_extension_versions PGNSP PGUID 12 10 100 0 0 f f f f t t s 0 0 2249 "" "{19,25,16,16,19,1003,25}" "{o,o,o,o,o,o,o}" "{name,version,superuser,relocatable,schema,requires,comment}" _null_ pg_available_extension_versions _null_ _null_ _null_ )); DESCR("list available extension versions"); DATA(insert OID = 3084 ( pg_extension_update_paths PGNSP PGUID 12 10 100 0 0 f f f f t t s 1 0 2249 "19" "{19,25,25,25}" "{i,o,o,o}" "{name,source,target,path}" _null_ pg_extension_update_paths _null_ _null_ _null_ )); DESCR("list an extension's version update paths"); DATA(insert OID = 3086 ( pg_extension_config_dump PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 2278 "2205 25" _null_ _null_ _null_ _null_ pg_extension_config_dump _null_ _null_ _null_ )); DESCR("flag an extension's table contents to be emitted by pg_dump"); /* SQL-spec window functions */ DATA(insert OID = 3100 ( row_number PGNSP PGUID 12 1 0 0 0 f t f f f f i 0 0 20 "" _null_ _null_ _null_ _null_ window_row_number _null_ _null_ _null_ )); DESCR("row number within partition"); DATA(insert OID = 3101 ( rank PGNSP PGUID 12 1 0 0 0 f t f f f f i 0 0 20 "" _null_ _null_ _null_ _null_ window_rank _null_ _null_ _null_ )); DESCR("integer rank with gaps"); DATA(insert OID = 3102 ( dense_rank PGNSP PGUID 12 1 0 0 0 f t f f f f i 0 0 20 "" _null_ _null_ _null_ _null_ window_dense_rank _null_ _null_ _null_ )); DESCR("integer rank without gaps"); DATA(insert OID = 3103 ( percent_rank PGNSP PGUID 12 1 0 0 0 f t f f f f i 0 0 701 "" _null_ _null_ _null_ _null_ window_percent_rank _null_ _null_ _null_ )); DESCR("fractional rank within partition"); DATA(insert OID = 3104 ( cume_dist PGNSP PGUID 12 1 0 0 0 f t f f f f i 0 0 701 "" _null_ _null_ _null_ _null_ window_cume_dist _null_ _null_ _null_ )); DESCR("fractional row number within partition"); DATA(insert OID = 3105 ( ntile PGNSP PGUID 12 1 0 0 0 f t f f t f i 1 0 23 "23" _null_ _null_ _null_ _null_ window_ntile _null_ _null_ _null_ )); DESCR("split rows into N groups"); DATA(insert OID = 3106 ( lag PGNSP PGUID 12 1 0 0 0 f t f f t f i 1 0 2283 "2283" _null_ _null_ _null_ _null_ window_lag _null_ _null_ _null_ )); DESCR("fetch the preceding row value"); DATA(insert OID = 3107 ( lag PGNSP PGUID 12 1 0 0 0 f t f f t f i 2 0 2283 "2283 23" _null_ _null_ _null_ _null_ window_lag_with_offset _null_ _null_ _null_ )); DESCR("fetch the Nth preceding row value"); DATA(insert OID = 3108 ( lag PGNSP PGUID 12 1 0 0 0 f t f f t f i 3 0 2283 "2283 23 2283" _null_ _null_ _null_ _null_ window_lag_with_offset_and_default _null_ _null_ _null_ )); DESCR("fetch the Nth preceding row value with default"); DATA(insert OID = 3109 ( lead PGNSP PGUID 12 1 0 0 0 f t f f t f i 1 0 2283 "2283" _null_ _null_ _null_ _null_ window_lead _null_ _null_ _null_ )); DESCR("fetch the following row value"); DATA(insert OID = 3110 ( lead PGNSP PGUID 12 1 0 0 0 f t f f t f i 2 0 2283 "2283 23" _null_ _null_ _null_ _null_ window_lead_with_offset _null_ _null_ _null_ )); DESCR("fetch the Nth following row value"); DATA(insert OID = 3111 ( lead PGNSP PGUID 12 1 0 0 0 f t f f t f i 3 0 2283 "2283 23 2283" _null_ _null_ _null_ _null_ window_lead_with_offset_and_default _null_ _null_ _null_ )); DESCR("fetch the Nth following row value with default"); DATA(insert OID = 3112 ( first_value PGNSP PGUID 12 1 0 0 0 f t f f t f i 1 0 2283 "2283" _null_ _null_ _null_ _null_ window_first_value _null_ _null_ _null_ )); DESCR("fetch the first row value"); DATA(insert OID = 3113 ( last_value PGNSP PGUID 12 1 0 0 0 f t f f t f i 1 0 2283 "2283" _null_ _null_ _null_ _null_ window_last_value _null_ _null_ _null_ )); DESCR("fetch the last row value"); DATA(insert OID = 3114 ( nth_value PGNSP PGUID 12 1 0 0 0 f t f f t f i 2 0 2283 "2283 23" _null_ _null_ _null_ _null_ window_nth_value _null_ _null_ _null_ )); DESCR("fetch the Nth row value"); /* functions for range types */ DATA(insert OID = 3832 ( anyrange_in PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 3831 "2275 26 23" _null_ _null_ _null_ _null_ anyrange_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 3833 ( anyrange_out PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 2275 "3831" _null_ _null_ _null_ _null_ anyrange_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 3834 ( range_in PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 3831 "2275 26 23" _null_ _null_ _null_ _null_ range_in _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 3835 ( range_out PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 2275 "3831" _null_ _null_ _null_ _null_ range_out _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 3836 ( range_recv PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 3831 "2281 26 23" _null_ _null_ _null_ _null_ range_recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 3837 ( range_send PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 17 "3831" _null_ _null_ _null_ _null_ range_send _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 3848 ( lower PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2283 "3831" _null_ _null_ _null_ _null_ range_lower _null_ _null_ _null_ )); DESCR("lower bound of range"); DATA(insert OID = 3849 ( upper PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2283 "3831" _null_ _null_ _null_ _null_ range_upper _null_ _null_ _null_ )); DESCR("upper bound of range"); DATA(insert OID = 3850 ( isempty PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 16 "3831" _null_ _null_ _null_ _null_ range_empty _null_ _null_ _null_ )); DESCR("is the range empty?"); DATA(insert OID = 3851 ( lower_inc PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 16 "3831" _null_ _null_ _null_ _null_ range_lower_inc _null_ _null_ _null_ )); DESCR("is the range's lower bound inclusive?"); DATA(insert OID = 3852 ( upper_inc PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 16 "3831" _null_ _null_ _null_ _null_ range_upper_inc _null_ _null_ _null_ )); DESCR("is the range's upper bound inclusive?"); DATA(insert OID = 3853 ( lower_inf PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 16 "3831" _null_ _null_ _null_ _null_ range_lower_inf _null_ _null_ _null_ )); DESCR("is the range's lower bound infinite?"); DATA(insert OID = 3854 ( upper_inf PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 16 "3831" _null_ _null_ _null_ _null_ range_upper_inf _null_ _null_ _null_ )); DESCR("is the range's upper bound infinite?"); DATA(insert OID = 3855 ( range_eq PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3831 3831" _null_ _null_ _null_ _null_ range_eq _null_ _null_ _null_ )); DESCR("implementation of = operator"); DATA(insert OID = 3856 ( range_ne PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3831 3831" _null_ _null_ _null_ _null_ range_ne _null_ _null_ _null_ )); DESCR("implementation of <> operator"); DATA(insert OID = 3857 ( range_overlaps PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3831 3831" _null_ _null_ _null_ _null_ range_overlaps _null_ _null_ _null_ )); DESCR("implementation of && operator"); DATA(insert OID = 3858 ( range_contains_elem PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3831 2283" _null_ _null_ _null_ _null_ range_contains_elem _null_ _null_ _null_ )); DESCR("implementation of @> operator"); DATA(insert OID = 3859 ( range_contains PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3831 3831" _null_ _null_ _null_ _null_ range_contains _null_ _null_ _null_ )); DESCR("implementation of @> operator"); DATA(insert OID = 3860 ( elem_contained_by_range PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "2283 3831" _null_ _null_ _null_ _null_ elem_contained_by_range _null_ _null_ _null_ )); DESCR("implementation of <@ operator"); DATA(insert OID = 3861 ( range_contained_by PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3831 3831" _null_ _null_ _null_ _null_ range_contained_by _null_ _null_ _null_ )); DESCR("implementation of <@ operator"); DATA(insert OID = 3862 ( range_adjacent PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3831 3831" _null_ _null_ _null_ _null_ range_adjacent _null_ _null_ _null_ )); DESCR("implementation of -|- operator"); DATA(insert OID = 3863 ( range_before PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3831 3831" _null_ _null_ _null_ _null_ range_before _null_ _null_ _null_ )); DESCR("implementation of << operator"); DATA(insert OID = 3864 ( range_after PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3831 3831" _null_ _null_ _null_ _null_ range_after _null_ _null_ _null_ )); DESCR("implementation of >> operator"); DATA(insert OID = 3865 ( range_overleft PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3831 3831" _null_ _null_ _null_ _null_ range_overleft _null_ _null_ _null_ )); DESCR("implementation of &< operator"); DATA(insert OID = 3866 ( range_overright PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3831 3831" _null_ _null_ _null_ _null_ range_overright _null_ _null_ _null_ )); DESCR("implementation of &> operator"); DATA(insert OID = 3867 ( range_union PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 3831 "3831 3831" _null_ _null_ _null_ _null_ range_union _null_ _null_ _null_ )); DESCR("implementation of + operator"); DATA(insert OID = 3868 ( range_intersect PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 3831 "3831 3831" _null_ _null_ _null_ _null_ range_intersect _null_ _null_ _null_ )); DESCR("implementation of * operator"); DATA(insert OID = 3869 ( range_minus PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 3831 "3831 3831" _null_ _null_ _null_ _null_ range_minus _null_ _null_ _null_ )); DESCR("implementation of - operator"); DATA(insert OID = 3870 ( range_cmp PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 23 "3831 3831" _null_ _null_ _null_ _null_ range_cmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); DATA(insert OID = 3871 ( range_lt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3831 3831" _null_ _null_ _null_ _null_ range_lt _null_ _null_ _null_ )); DATA(insert OID = 3872 ( range_le PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3831 3831" _null_ _null_ _null_ _null_ range_le _null_ _null_ _null_ )); DATA(insert OID = 3873 ( range_ge PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3831 3831" _null_ _null_ _null_ _null_ range_ge _null_ _null_ _null_ )); DATA(insert OID = 3874 ( range_gt PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3831 3831" _null_ _null_ _null_ _null_ range_gt _null_ _null_ _null_ )); DATA(insert OID = 3875 ( range_gist_consistent PGNSP PGUID 12 1 0 0 0 f f f f t f i 5 0 16 "2281 3831 23 26 2281" _null_ _null_ _null_ _null_ range_gist_consistent _null_ _null_ _null_ )); DESCR("GiST support"); DATA(insert OID = 3876 ( range_gist_union PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 2281 "2281 2281" _null_ _null_ _null_ _null_ range_gist_union _null_ _null_ _null_ )); DESCR("GiST support"); DATA(insert OID = 3877 ( range_gist_compress PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2281 "2281" _null_ _null_ _null_ _null_ range_gist_compress _null_ _null_ _null_ )); DESCR("GiST support"); DATA(insert OID = 3878 ( range_gist_decompress PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2281 "2281" _null_ _null_ _null_ _null_ range_gist_decompress _null_ _null_ _null_ )); DESCR("GiST support"); DATA(insert OID = 3879 ( range_gist_penalty PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 2281 "2281 2281 2281" _null_ _null_ _null_ _null_ range_gist_penalty _null_ _null_ _null_ )); DESCR("GiST support"); DATA(insert OID = 3880 ( range_gist_picksplit PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 2281 "2281 2281" _null_ _null_ _null_ _null_ range_gist_picksplit _null_ _null_ _null_ )); DESCR("GiST support"); DATA(insert OID = 3881 ( range_gist_same PGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 2281 "3831 3831 2281" _null_ _null_ _null_ _null_ range_gist_same _null_ _null_ _null_ )); DESCR("GiST support"); DATA(insert OID = 3902 ( hash_range PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 23 "3831" _null_ _null_ _null_ _null_ hash_range _null_ _null_ _null_ )); DESCR("hash a range"); DATA(insert OID = 3916 ( range_typanalyze PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 16 "2281" _null_ _null_ _null_ _null_ range_typanalyze _null_ _null_ _null_ )); DESCR("range typanalyze"); DATA(insert OID = 3914 ( int4range_canonical PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 3904 "3904" _null_ _null_ _null_ _null_ int4range_canonical _null_ _null_ _null_ )); DESCR("convert an int4 range to canonical form"); DATA(insert OID = 3928 ( int8range_canonical PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 3926 "3926" _null_ _null_ _null_ _null_ int8range_canonical _null_ _null_ _null_ )); DESCR("convert an int8 range to canonical form"); DATA(insert OID = 3915 ( daterange_canonical PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 3912 "3912" _null_ _null_ _null_ _null_ daterange_canonical _null_ _null_ _null_ )); DESCR("convert a date range to canonical form"); DATA(insert OID = 3922 ( int4range_subdiff PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "23 23" _null_ _null_ _null_ _null_ int4range_subdiff _null_ _null_ _null_ )); DESCR("float8 difference of two int4 values"); DATA(insert OID = 3923 ( int8range_subdiff PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "20 20" _null_ _null_ _null_ _null_ int8range_subdiff _null_ _null_ _null_ )); DESCR("float8 difference of two int8 values"); DATA(insert OID = 3924 ( numrange_subdiff PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "1700 1700" _null_ _null_ _null_ _null_ numrange_subdiff _null_ _null_ _null_ )); DESCR("float8 difference of two numeric values"); DATA(insert OID = 3925 ( daterange_subdiff PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "1082 1082" _null_ _null_ _null_ _null_ daterange_subdiff _null_ _null_ _null_ )); DESCR("float8 difference of two date values"); DATA(insert OID = 3929 ( tsrange_subdiff PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "1114 1114" _null_ _null_ _null_ _null_ tsrange_subdiff _null_ _null_ _null_ )); DESCR("float8 difference of two timestamp values"); DATA(insert OID = 3930 ( tstzrange_subdiff PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 701 "1184 1184" _null_ _null_ _null_ _null_ tstzrange_subdiff _null_ _null_ _null_ )); DESCR("float8 difference of two timestamp with time zone values"); DATA(insert OID = 3840 ( int4range PGNSP PGUID 12 1 0 0 0 f f f f f f i 2 0 3904 "23 23" _null_ _null_ _null_ _null_ range_constructor2 _null_ _null_ _null_ )); DESCR("int4range constructor"); DATA(insert OID = 3841 ( int4range PGNSP PGUID 12 1 0 0 0 f f f f f f i 3 0 3904 "23 23 25" _null_ _null_ _null_ _null_ range_constructor3 _null_ _null_ _null_ )); DESCR("int4range constructor"); DATA(insert OID = 3844 ( numrange PGNSP PGUID 12 1 0 0 0 f f f f f f i 2 0 3906 "1700 1700" _null_ _null_ _null_ _null_ range_constructor2 _null_ _null_ _null_ )); DESCR("numrange constructor"); DATA(insert OID = 3845 ( numrange PGNSP PGUID 12 1 0 0 0 f f f f f f i 3 0 3906 "1700 1700 25" _null_ _null_ _null_ _null_ range_constructor3 _null_ _null_ _null_ )); DESCR("numrange constructor"); DATA(insert OID = 3933 ( tsrange PGNSP PGUID 12 1 0 0 0 f f f f f f i 2 0 3908 "1114 1114" _null_ _null_ _null_ _null_ range_constructor2 _null_ _null_ _null_ )); DESCR("tsrange constructor"); DATA(insert OID = 3934 ( tsrange PGNSP PGUID 12 1 0 0 0 f f f f f f i 3 0 3908 "1114 1114 25" _null_ _null_ _null_ _null_ range_constructor3 _null_ _null_ _null_ )); DESCR("tsrange constructor"); DATA(insert OID = 3937 ( tstzrange PGNSP PGUID 12 1 0 0 0 f f f f f f i 2 0 3910 "1184 1184" _null_ _null_ _null_ _null_ range_constructor2 _null_ _null_ _null_ )); DESCR("tstzrange constructor"); DATA(insert OID = 3938 ( tstzrange PGNSP PGUID 12 1 0 0 0 f f f f f f i 3 0 3910 "1184 1184 25" _null_ _null_ _null_ _null_ range_constructor3 _null_ _null_ _null_ )); DESCR("tstzrange constructor"); DATA(insert OID = 3941 ( daterange PGNSP PGUID 12 1 0 0 0 f f f f f f i 2 0 3912 "1082 1082" _null_ _null_ _null_ _null_ range_constructor2 _null_ _null_ _null_ )); DESCR("daterange constructor"); DATA(insert OID = 3942 ( daterange PGNSP PGUID 12 1 0 0 0 f f f f f f i 3 0 3912 "1082 1082 25" _null_ _null_ _null_ _null_ range_constructor3 _null_ _null_ _null_ )); DESCR("daterange constructor"); DATA(insert OID = 3945 ( int8range PGNSP PGUID 12 1 0 0 0 f f f f f f i 2 0 3926 "20 20" _null_ _null_ _null_ _null_ range_constructor2 _null_ _null_ _null_ )); DESCR("int8range constructor"); DATA(insert OID = 3946 ( int8range PGNSP PGUID 12 1 0 0 0 f f f f f f i 3 0 3926 "20 20 25" _null_ _null_ _null_ _null_ range_constructor3 _null_ _null_ _null_ )); DESCR("int8range constructor"); /* spgist support functions */ DATA(insert OID = 4001 ( spggettuple PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 16 "2281 2281" _null_ _null_ _null_ _null_ spggettuple _null_ _null_ _null_ )); DESCR("spgist(internal)"); DATA(insert OID = 4002 ( spggetbitmap PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 20 "2281 2281" _null_ _null_ _null_ _null_ spggetbitmap _null_ _null_ _null_ )); DESCR("spgist(internal)"); DATA(insert OID = 4003 ( spginsert PGNSP PGUID 12 1 0 0 0 f f f f t f v 6 0 16 "2281 2281 2281 2281 2281 2281" _null_ _null_ _null_ _null_ spginsert _null_ _null_ _null_ )); DESCR("spgist(internal)"); DATA(insert OID = 4004 ( spgbeginscan PGNSP PGUID 12 1 0 0 0 f f f f t f v 3 0 2281 "2281 2281 2281" _null_ _null_ _null_ _null_ spgbeginscan _null_ _null_ _null_ )); DESCR("spgist(internal)"); DATA(insert OID = 4005 ( spgrescan PGNSP PGUID 12 1 0 0 0 f f f f t f v 5 0 2278 "2281 2281 2281 2281 2281" _null_ _null_ _null_ _null_ spgrescan _null_ _null_ _null_ )); DESCR("spgist(internal)"); DATA(insert OID = 4006 ( spgendscan PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 2278 "2281" _null_ _null_ _null_ _null_ spgendscan _null_ _null_ _null_ )); DESCR("spgist(internal)"); DATA(insert OID = 4007 ( spgmarkpos PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 2278 "2281" _null_ _null_ _null_ _null_ spgmarkpos _null_ _null_ _null_ )); DESCR("spgist(internal)"); DATA(insert OID = 4008 ( spgrestrpos PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 2278 "2281" _null_ _null_ _null_ _null_ spgrestrpos _null_ _null_ _null_ )); DESCR("spgist(internal)"); DATA(insert OID = 4009 ( spgbuild PGNSP PGUID 12 1 0 0 0 f f f f t f v 3 0 2281 "2281 2281 2281" _null_ _null_ _null_ _null_ spgbuild _null_ _null_ _null_ )); DESCR("spgist(internal)"); DATA(insert OID = 4010 ( spgbuildempty PGNSP PGUID 12 1 0 0 0 f f f f t f v 1 0 2278 "2281" _null_ _null_ _null_ _null_ spgbuildempty _null_ _null_ _null_ )); DESCR("spgist(internal)"); DATA(insert OID = 4011 ( spgbulkdelete PGNSP PGUID 12 1 0 0 0 f f f f t f v 4 0 2281 "2281 2281 2281 2281" _null_ _null_ _null_ _null_ spgbulkdelete _null_ _null_ _null_ )); DESCR("spgist(internal)"); DATA(insert OID = 4012 ( spgvacuumcleanup PGNSP PGUID 12 1 0 0 0 f f f f t f v 2 0 2281 "2281 2281" _null_ _null_ _null_ _null_ spgvacuumcleanup _null_ _null_ _null_ )); DESCR("spgist(internal)"); DATA(insert OID = 4032 ( spgcanreturn PGNSP PGUID 12 1 0 0 0 f f f f t f s 1 0 16 "2281" _null_ _null_ _null_ _null_ spgcanreturn _null_ _null_ _null_ )); DESCR("spgist(internal)"); DATA(insert OID = 4013 ( spgcostestimate PGNSP PGUID 12 1 0 0 0 f f f f t f v 7 0 2278 "2281 2281 2281 2281 2281 2281 2281" _null_ _null_ _null_ _null_ spgcostestimate _null_ _null_ _null_ )); DESCR("spgist(internal)"); DATA(insert OID = 4014 ( spgoptions PGNSP PGUID 12 1 0 0 0 f f f f t f s 2 0 17 "1009 16" _null_ _null_ _null_ _null_ spgoptions _null_ _null_ _null_ )); DESCR("spgist(internal)"); /* spgist opclasses */ DATA(insert OID = 4018 ( spg_quad_config PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 2278 "2281 2281" _null_ _null_ _null_ _null_ spg_quad_config _null_ _null_ _null_ )); DESCR("SP-GiST support for quad tree over point"); DATA(insert OID = 4019 ( spg_quad_choose PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 2278 "2281 2281" _null_ _null_ _null_ _null_ spg_quad_choose _null_ _null_ _null_ )); DESCR("SP-GiST support for quad tree over point"); DATA(insert OID = 4020 ( spg_quad_picksplit PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 2278 "2281 2281" _null_ _null_ _null_ _null_ spg_quad_picksplit _null_ _null_ _null_ )); DESCR("SP-GiST support for quad tree over point"); DATA(insert OID = 4021 ( spg_quad_inner_consistent PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 2278 "2281 2281" _null_ _null_ _null_ _null_ spg_quad_inner_consistent _null_ _null_ _null_ )); DESCR("SP-GiST support for quad tree over point"); DATA(insert OID = 4022 ( spg_quad_leaf_consistent PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "2281 2281" _null_ _null_ _null_ _null_ spg_quad_leaf_consistent _null_ _null_ _null_ )); DESCR("SP-GiST support for quad tree and k-d tree over point"); DATA(insert OID = 4023 ( spg_kd_config PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 2278 "2281 2281" _null_ _null_ _null_ _null_ spg_kd_config _null_ _null_ _null_ )); DESCR("SP-GiST support for k-d tree over point"); DATA(insert OID = 4024 ( spg_kd_choose PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 2278 "2281 2281" _null_ _null_ _null_ _null_ spg_kd_choose _null_ _null_ _null_ )); DESCR("SP-GiST support for k-d tree over point"); DATA(insert OID = 4025 ( spg_kd_picksplit PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 2278 "2281 2281" _null_ _null_ _null_ _null_ spg_kd_picksplit _null_ _null_ _null_ )); DESCR("SP-GiST support for k-d tree over point"); DATA(insert OID = 4026 ( spg_kd_inner_consistent PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 2278 "2281 2281" _null_ _null_ _null_ _null_ spg_kd_inner_consistent _null_ _null_ _null_ )); DESCR("SP-GiST support for k-d tree over point"); DATA(insert OID = 4027 ( spg_text_config PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 2278 "2281 2281" _null_ _null_ _null_ _null_ spg_text_config _null_ _null_ _null_ )); DESCR("SP-GiST support for suffix tree over text"); DATA(insert OID = 4028 ( spg_text_choose PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 2278 "2281 2281" _null_ _null_ _null_ _null_ spg_text_choose _null_ _null_ _null_ )); DESCR("SP-GiST support for suffix tree over text"); DATA(insert OID = 4029 ( spg_text_picksplit PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 2278 "2281 2281" _null_ _null_ _null_ _null_ spg_text_picksplit _null_ _null_ _null_ )); DESCR("SP-GiST support for suffix tree over text"); DATA(insert OID = 4030 ( spg_text_inner_consistent PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 2278 "2281 2281" _null_ _null_ _null_ _null_ spg_text_inner_consistent _null_ _null_ _null_ )); DESCR("SP-GiST support for suffix tree over text"); DATA(insert OID = 4031 ( spg_text_leaf_consistent PGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "2281 2281" _null_ _null_ _null_ _null_ spg_text_leaf_consistent _null_ _null_ _null_ )); DESCR("SP-GiST support for suffix tree over text"); /* * Symbolic values for provolatile column: these indicate whether the result * of a function is dependent *only* on the values of its explicit arguments, * or can change due to outside factors (such as parameter variables or * table contents). NOTE: functions having side-effects, such as setval(), * must be labeled volatile to ensure they will not get optimized away, * even if the actual return value is not changeable. */ #define PROVOLATILE_IMMUTABLE 'i' /* never changes for given input */ #define PROVOLATILE_STABLE 's' /* does not change within a scan */ #define PROVOLATILE_VOLATILE 'v' /* can change even within a scan */ /* * Symbolic values for proargmodes column. Note that these must agree with * the FunctionParameterMode enum in parsenodes.h; we declare them here to * be accessible from either header. */ #define PROARGMODE_IN 'i' #define PROARGMODE_OUT 'o' #define PROARGMODE_INOUT 'b' #define PROARGMODE_VARIADIC 'v' #define PROARGMODE_TABLE 't' #endif /* PG_PROC_H */ PKBiZӌserver/catalog/pg_class.hnu[/*------------------------------------------------------------------------- * * pg_class.h * definition of the system "relation" relation (pg_class) * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_class.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * *------------------------------------------------------------------------- */ #ifndef PG_CLASS_H #define PG_CLASS_H #include "catalog/genbki.h" /* ---------------- * pg_class definition. cpp turns this into * typedef struct FormData_pg_class * ---------------- */ #define RelationRelationId 1259 #define RelationRelation_Rowtype_Id 83 CATALOG(pg_class,1259) BKI_BOOTSTRAP BKI_ROWTYPE_OID(83) BKI_SCHEMA_MACRO { NameData relname; /* class name */ Oid relnamespace; /* OID of namespace containing this class */ Oid reltype; /* OID of entry in pg_type for table's * implicit row type */ Oid reloftype; /* OID of entry in pg_type for underlying * composite type */ Oid relowner; /* class owner */ Oid relam; /* index access method; 0 if not an index */ Oid relfilenode; /* identifier of physical storage file */ /* relfilenode == 0 means it is a "mapped" relation, see relmapper.c */ Oid reltablespace; /* identifier of table space for relation */ int4 relpages; /* # of blocks (not always up-to-date) */ float4 reltuples; /* # of tuples (not always up-to-date) */ int4 relallvisible; /* # of all-visible blocks (not always * up-to-date) */ Oid reltoastrelid; /* OID of toast table; 0 if none */ Oid reltoastidxid; /* if toast table, OID of chunk_id index */ bool relhasindex; /* T if has (or has had) any indexes */ bool relisshared; /* T if shared across databases */ char relpersistence; /* see RELPERSISTENCE_xxx constants below */ char relkind; /* see RELKIND_xxx constants below */ int2 relnatts; /* number of user attributes */ /* * Class pg_attribute must contain exactly "relnatts" user attributes * (with attnums ranging from 1 to relnatts) for this class. It may also * contain entries with negative attnums for system attributes. */ int2 relchecks; /* # of CHECK constraints for class */ bool relhasoids; /* T if we generate OIDs for rows of rel */ bool relhaspkey; /* has (or has had) PRIMARY KEY index */ bool relhasrules; /* has (or has had) any rules */ bool relhastriggers; /* has (or has had) any TRIGGERs */ bool relhassubclass; /* has (or has had) derived classes */ TransactionId relfrozenxid; /* all Xids < this are frozen in this rel */ #ifdef CATALOG_VARLEN /* variable-length fields start here */ /* NOTE: These fields are not present in a relcache entry's rd_rel field. */ aclitem relacl[1]; /* access permissions */ text reloptions[1]; /* access-method-specific options */ #endif } FormData_pg_class; /* Size of fixed part of pg_class tuples, not counting var-length fields */ #define CLASS_TUPLE_SIZE \ (offsetof(FormData_pg_class,relfrozenxid) + sizeof(TransactionId)) /* ---------------- * Form_pg_class corresponds to a pointer to a tuple with * the format of pg_class relation. * ---------------- */ typedef FormData_pg_class *Form_pg_class; /* ---------------- * compiler constants for pg_class * ---------------- */ #define Natts_pg_class 27 #define Anum_pg_class_relname 1 #define Anum_pg_class_relnamespace 2 #define Anum_pg_class_reltype 3 #define Anum_pg_class_reloftype 4 #define Anum_pg_class_relowner 5 #define Anum_pg_class_relam 6 #define Anum_pg_class_relfilenode 7 #define Anum_pg_class_reltablespace 8 #define Anum_pg_class_relpages 9 #define Anum_pg_class_reltuples 10 #define Anum_pg_class_relallvisible 11 #define Anum_pg_class_reltoastrelid 12 #define Anum_pg_class_reltoastidxid 13 #define Anum_pg_class_relhasindex 14 #define Anum_pg_class_relisshared 15 #define Anum_pg_class_relpersistence 16 #define Anum_pg_class_relkind 17 #define Anum_pg_class_relnatts 18 #define Anum_pg_class_relchecks 19 #define Anum_pg_class_relhasoids 20 #define Anum_pg_class_relhaspkey 21 #define Anum_pg_class_relhasrules 22 #define Anum_pg_class_relhastriggers 23 #define Anum_pg_class_relhassubclass 24 #define Anum_pg_class_relfrozenxid 25 #define Anum_pg_class_relacl 26 #define Anum_pg_class_reloptions 27 /* ---------------- * initial contents of pg_class * * NOTE: only "bootstrapped" relations need to be declared here. Be sure that * the OIDs listed here match those given in their CATALOG macros, and that * the relnatts values are correct. * ---------------- */ /* Note: "3" in the relfrozenxid column stands for FirstNormalTransactionId */ DATA(insert OID = 1247 ( pg_type PGNSP 71 0 PGUID 0 0 0 0 0 0 0 0 f f p r 30 0 t f f f f 3 _null_ _null_ )); DESCR(""); DATA(insert OID = 1249 ( pg_attribute PGNSP 75 0 PGUID 0 0 0 0 0 0 0 0 f f p r 21 0 f f f f f 3 _null_ _null_ )); DESCR(""); DATA(insert OID = 1255 ( pg_proc PGNSP 81 0 PGUID 0 0 0 0 0 0 0 0 f f p r 27 0 t f f f f 3 _null_ _null_ )); DESCR(""); DATA(insert OID = 1259 ( pg_class PGNSP 83 0 PGUID 0 0 0 0 0 0 0 0 f f p r 27 0 t f f f f 3 _null_ _null_ )); DESCR(""); #define RELKIND_RELATION 'r' /* ordinary table */ #define RELKIND_INDEX 'i' /* secondary index */ #define RELKIND_SEQUENCE 'S' /* sequence object */ #define RELKIND_TOASTVALUE 't' /* for out-of-line values */ #define RELKIND_VIEW 'v' /* view */ #define RELKIND_COMPOSITE_TYPE 'c' /* composite type */ #define RELKIND_FOREIGN_TABLE 'f' /* foreign table */ #define RELKIND_UNCATALOGED 'u' /* not yet cataloged */ #define RELPERSISTENCE_PERMANENT 'p' /* regular table */ #define RELPERSISTENCE_UNLOGGED 'u' /* unlogged permanent table */ #define RELPERSISTENCE_TEMP 't' /* temporary table */ #endif /* PG_CLASS_H */ PKBiZAiiserver/catalog/pg_ts_template.hnu[/*------------------------------------------------------------------------- * * pg_ts_template.h * definition of dictionary templates for tsearch * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_ts_template.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * * XXX do NOT break up DATA() statements into multiple lines! * the scripts are not as smart as you might think... * *------------------------------------------------------------------------- */ #ifndef PG_TS_TEMPLATE_H #define PG_TS_TEMPLATE_H #include "catalog/genbki.h" /* ---------------- * pg_ts_template definition. cpp turns this into * typedef struct FormData_pg_ts_template * ---------------- */ #define TSTemplateRelationId 3764 CATALOG(pg_ts_template,3764) { NameData tmplname; /* template name */ Oid tmplnamespace; /* name space */ regproc tmplinit; /* initialization method of dict (may be 0) */ regproc tmpllexize; /* base method of dictionary */ } FormData_pg_ts_template; typedef FormData_pg_ts_template *Form_pg_ts_template; /* ---------------- * compiler constants for pg_ts_template * ---------------- */ #define Natts_pg_ts_template 4 #define Anum_pg_ts_template_tmplname 1 #define Anum_pg_ts_template_tmplnamespace 2 #define Anum_pg_ts_template_tmplinit 3 #define Anum_pg_ts_template_tmpllexize 4 /* ---------------- * initial contents of pg_ts_template * ---------------- */ DATA(insert OID = 3727 ( "simple" PGNSP dsimple_init dsimple_lexize )); DESCR("simple dictionary: just lower case and check for stopword"); DATA(insert OID = 3730 ( "synonym" PGNSP dsynonym_init dsynonym_lexize )); DESCR("synonym dictionary: replace word by its synonym"); DATA(insert OID = 3733 ( "ispell" PGNSP dispell_init dispell_lexize )); DESCR("ispell dictionary"); DATA(insert OID = 3742 ( "thesaurus" PGNSP thesaurus_init thesaurus_lexize )); DESCR("thesaurus dictionary: phrase by phrase substitution"); #endif /* PG_TS_TEMPLATE_H */ PKBiZ7--server/catalog/pg_cast.hnu[/*------------------------------------------------------------------------- * * pg_cast.h * definition of the system "type casts" relation (pg_cast) * along with the relation's initial contents. * * As of Postgres 8.0, pg_cast describes not only type coercion functions * but also length coercion functions. * * * Copyright (c) 2002-2012, PostgreSQL Global Development Group * * src/include/catalog/pg_cast.h * * NOTES * the genbki.pl script reads this file and generates .bki * information from the DATA() statements. * *------------------------------------------------------------------------- */ #ifndef PG_CAST_H #define PG_CAST_H #include "catalog/genbki.h" /* ---------------- * pg_cast definition. cpp turns this into * typedef struct FormData_pg_cast * ---------------- */ #define CastRelationId 2605 CATALOG(pg_cast,2605) { Oid castsource; /* source datatype for cast */ Oid casttarget; /* destination datatype for cast */ Oid castfunc; /* cast function; 0 = binary coercible */ char castcontext; /* contexts in which cast can be used */ char castmethod; /* cast method */ } FormData_pg_cast; typedef FormData_pg_cast *Form_pg_cast; /* * The allowable values for pg_cast.castcontext are specified by this enum. * Since castcontext is stored as a "char", we use ASCII codes for human * convenience in reading the table. Note that internally to the backend, * these values are converted to the CoercionContext enum (see primnodes.h), * which is defined to sort in a convenient order; the ASCII codes don't * have to sort in any special order. */ typedef enum CoercionCodes { COERCION_CODE_IMPLICIT = 'i', /* coercion in context of expression */ COERCION_CODE_ASSIGNMENT = 'a', /* coercion in context of assignment */ COERCION_CODE_EXPLICIT = 'e' /* explicit cast operation */ } CoercionCodes; /* * The allowable values for pg_cast.castmethod are specified by this enum. * Since castmethod is stored as a "char", we use ASCII codes for human * convenience in reading the table. */ typedef enum CoercionMethod { COERCION_METHOD_FUNCTION = 'f', /* use a function */ COERCION_METHOD_BINARY = 'b', /* types are binary-compatible */ COERCION_METHOD_INOUT = 'i' /* use input/output functions */ } CoercionMethod; /* ---------------- * compiler constants for pg_cast * ---------------- */ #define Natts_pg_cast 5 #define Anum_pg_cast_castsource 1 #define Anum_pg_cast_casttarget 2 #define Anum_pg_cast_castfunc 3 #define Anum_pg_cast_castcontext 4 #define Anum_pg_cast_castmethod 5 /* ---------------- * initial contents of pg_cast * * Note: this table has OIDs, but we don't bother to assign them manually, * since nothing needs to know the specific OID of any built-in cast. * ---------------- */ /* * Numeric category: implicit casts are allowed in the direction * int2->int4->int8->numeric->float4->float8, while casts in the * reverse direction are assignment-only. */ DATA(insert ( 20 21 714 a f )); DATA(insert ( 20 23 480 a f )); DATA(insert ( 20 700 652 i f )); DATA(insert ( 20 701 482 i f )); DATA(insert ( 20 1700 1781 i f )); DATA(insert ( 21 20 754 i f )); DATA(insert ( 21 23 313 i f )); DATA(insert ( 21 700 236 i f )); DATA(insert ( 21 701 235 i f )); DATA(insert ( 21 1700 1782 i f )); DATA(insert ( 23 20 481 i f )); DATA(insert ( 23 21 314 a f )); DATA(insert ( 23 700 318 i f )); DATA(insert ( 23 701 316 i f )); DATA(insert ( 23 1700 1740 i f )); DATA(insert ( 700 20 653 a f )); DATA(insert ( 700 21 238 a f )); DATA(insert ( 700 23 319 a f )); DATA(insert ( 700 701 311 i f )); DATA(insert ( 700 1700 1742 a f )); DATA(insert ( 701 20 483 a f )); DATA(insert ( 701 21 237 a f )); DATA(insert ( 701 23 317 a f )); DATA(insert ( 701 700 312 a f )); DATA(insert ( 701 1700 1743 a f )); DATA(insert ( 1700 20 1779 a f )); DATA(insert ( 1700 21 1783 a f )); DATA(insert ( 1700 23 1744 a f )); DATA(insert ( 1700 700 1745 i f )); DATA(insert ( 1700 701 1746 i f )); DATA(insert ( 790 1700 3823 a f )); DATA(insert ( 1700 790 3824 a f )); DATA(insert ( 23 790 3811 a f )); DATA(insert ( 20 790 3812 a f )); /* Allow explicit coercions between int4 and bool */ DATA(insert ( 23 16 2557 e f )); DATA(insert ( 16 23 2558 e f )); /* * OID category: allow implicit conversion from any integral type (including * int8, to support OID literals > 2G) to OID, as well as assignment coercion * from OID to int4 or int8. Similarly for each OID-alias type. Also allow * implicit coercions between OID and each OID-alias type, as well as * regproc<->regprocedure and regoper<->regoperator. (Other coercions * between alias types must pass through OID.) Lastly, there are implicit * casts from text and varchar to regclass, which exist mainly to support * legacy forms of nextval() and related functions. */ DATA(insert ( 20 26 1287 i f )); DATA(insert ( 21 26 313 i f )); DATA(insert ( 23 26 0 i b )); DATA(insert ( 26 20 1288 a f )); DATA(insert ( 26 23 0 a b )); DATA(insert ( 26 24 0 i b )); DATA(insert ( 24 26 0 i b )); DATA(insert ( 20 24 1287 i f )); DATA(insert ( 21 24 313 i f )); DATA(insert ( 23 24 0 i b )); DATA(insert ( 24 20 1288 a f )); DATA(insert ( 24 23 0 a b )); DATA(insert ( 24 2202 0 i b )); DATA(insert ( 2202 24 0 i b )); DATA(insert ( 26 2202 0 i b )); DATA(insert ( 2202 26 0 i b )); DATA(insert ( 20 2202 1287 i f )); DATA(insert ( 21 2202 313 i f )); DATA(insert ( 23 2202 0 i b )); DATA(insert ( 2202 20 1288 a f )); DATA(insert ( 2202 23 0 a b )); DATA(insert ( 26 2203 0 i b )); DATA(insert ( 2203 26 0 i b )); DATA(insert ( 20 2203 1287 i f )); DATA(insert ( 21 2203 313 i f )); DATA(insert ( 23 2203 0 i b )); DATA(insert ( 2203 20 1288 a f )); DATA(insert ( 2203 23 0 a b )); DATA(insert ( 2203 2204 0 i b )); DATA(insert ( 2204 2203 0 i b )); DATA(insert ( 26 2204 0 i b )); DATA(insert ( 2204 26 0 i b )); DATA(insert ( 20 2204 1287 i f )); DATA(insert ( 21 2204 313 i f )); DATA(insert ( 23 2204 0 i b )); DATA(insert ( 2204 20 1288 a f )); DATA(insert ( 2204 23 0 a b )); DATA(insert ( 26 2205 0 i b )); DATA(insert ( 2205 26 0 i b )); DATA(insert ( 20 2205 1287 i f )); DATA(insert ( 21 2205 313 i f )); DATA(insert ( 23 2205 0 i b )); DATA(insert ( 2205 20 1288 a f )); DATA(insert ( 2205 23 0 a b )); DATA(insert ( 26 2206 0 i b )); DATA(insert ( 2206 26 0 i b )); DATA(insert ( 20 2206 1287 i f )); DATA(insert ( 21 2206 313 i f )); DATA(insert ( 23 2206 0 i b )); DATA(insert ( 2206 20 1288 a f )); DATA(insert ( 2206 23 0 a b )); DATA(insert ( 26 3734 0 i b )); DATA(insert ( 3734 26 0 i b )); DATA(insert ( 20 3734 1287 i f )); DATA(insert ( 21 3734 313 i f )); DATA(insert ( 23 3734 0 i b )); DATA(insert ( 3734 20 1288 a f )); DATA(insert ( 3734 23 0 a b )); DATA(insert ( 26 3769 0 i b )); DATA(insert ( 3769 26 0 i b )); DATA(insert ( 20 3769 1287 i f )); DATA(insert ( 21 3769 313 i f )); DATA(insert ( 23 3769 0 i b )); DATA(insert ( 3769 20 1288 a f )); DATA(insert ( 3769 23 0 a b )); DATA(insert ( 25 2205 1079 i f )); DATA(insert ( 1043 2205 1079 i f )); /* * String category */ DATA(insert ( 25 1042 0 i b )); DATA(insert ( 25 1043 0 i b )); DATA(insert ( 1042 25 401 i f )); DATA(insert ( 1042 1043 401 i f )); DATA(insert ( 1043 25 0 i b )); DATA(insert ( 1043 1042 0 i b )); DATA(insert ( 18 25 946 i f )); DATA(insert ( 18 1042 860 a f )); DATA(insert ( 18 1043 946 a f )); DATA(insert ( 19 25 406 i f )); DATA(insert ( 19 1042 408 a f )); DATA(insert ( 19 1043 1401 a f )); DATA(insert ( 25 18 944 a f )); DATA(insert ( 1042 18 944 a f )); DATA(insert ( 1043 18 944 a f )); DATA(insert ( 25 19 407 i f )); DATA(insert ( 1042 19 409 i f )); DATA(insert ( 1043 19 1400 i f )); /* Allow explicit coercions between int4 and "char" */ DATA(insert ( 18 23 77 e f )); DATA(insert ( 23 18 78 e f )); /* pg_node_tree can be coerced to, but not from, text */ DATA(insert ( 194 25 0 i b )); /* * Datetime category */ DATA(insert ( 702 1082 1179 a f )); DATA(insert ( 702 1083 1364 a f )); DATA(insert ( 702 1114 2023 i f )); DATA(insert ( 702 1184 1173 i f )); DATA(insert ( 703 1186 1177 i f )); DATA(insert ( 1082 1114 2024 i f )); DATA(insert ( 1082 1184 1174 i f )); DATA(insert ( 1083 1186 1370 i f )); DATA(insert ( 1083 1266 2047 i f )); DATA(insert ( 1114 702 2030 a f )); DATA(insert ( 1114 1082 2029 a f )); DATA(insert ( 1114 1083 1316 a f )); DATA(insert ( 1114 1184 2028 i f )); DATA(insert ( 1184 702 1180 a f )); DATA(insert ( 1184 1082 1178 a f )); DATA(insert ( 1184 1083 2019 a f )); DATA(insert ( 1184 1114 2027 a f )); DATA(insert ( 1184 1266 1388 a f )); DATA(insert ( 1186 703 1194 a f )); DATA(insert ( 1186 1083 1419 a f )); DATA(insert ( 1266 1083 2046 a f )); /* Cross-category casts between int4 and abstime, reltime */ DATA(insert ( 23 702 0 e b )); DATA(insert ( 702 23 0 e b )); DATA(insert ( 23 703 0 e b )); DATA(insert ( 703 23 0 e b )); /* * Geometric category */ DATA(insert ( 601 600 1532 e f )); DATA(insert ( 602 600 1533 e f )); DATA(insert ( 602 604 1449 a f )); DATA(insert ( 603 600 1534 e f )); DATA(insert ( 603 601 1541 e f )); DATA(insert ( 603 604 1448 a f )); DATA(insert ( 603 718 1479 e f )); DATA(insert ( 604 600 1540 e f )); DATA(insert ( 604 602 1447 a f )); DATA(insert ( 604 603 1446 e f )); DATA(insert ( 604 718 1474 e f )); DATA(insert ( 718 600 1416 e f )); DATA(insert ( 718 603 1480 e f )); DATA(insert ( 718 604 1544 e f )); /* * INET category */ DATA(insert ( 650 869 0 i b )); DATA(insert ( 869 650 1715 a f )); /* * BitString category */ DATA(insert ( 1560 1562 0 i b )); DATA(insert ( 1562 1560 0 i b )); /* Cross-category casts between bit and int4, int8 */ DATA(insert ( 20 1560 2075 e f )); DATA(insert ( 23 1560 1683 e f )); DATA(insert ( 1560 20 2076 e f )); DATA(insert ( 1560 23 1684 e f )); /* * Cross-category casts to and from TEXT * * We need entries here only for a few specialized cases where the behavior * of the cast function differs from the datatype's I/O functions. Otherwise, * parse_coerce.c will generate CoerceViaIO operations without any prompting. * * Note that the castcontext values specified here should be no stronger than * parse_coerce.c's automatic casts ('a' to text, 'e' from text) else odd * behavior will ensue when the automatic cast is applied instead of the * pg_cast entry! */ DATA(insert ( 650 25 730 a f )); DATA(insert ( 869 25 730 a f )); DATA(insert ( 16 25 2971 a f )); DATA(insert ( 142 25 0 a b )); DATA(insert ( 25 142 2896 e f )); /* * Cross-category casts to and from VARCHAR * * We support all the same casts as for TEXT. */ DATA(insert ( 650 1043 730 a f )); DATA(insert ( 869 1043 730 a f )); DATA(insert ( 16 1043 2971 a f )); DATA(insert ( 142 1043 0 a b )); DATA(insert ( 1043 142 2896 e f )); /* * Cross-category casts to and from BPCHAR * * We support all the same casts as for TEXT. */ DATA(insert ( 650 1042 730 a f )); DATA(insert ( 869 1042 730 a f )); DATA(insert ( 16 1042 2971 a f )); DATA(insert ( 142 1042 0 a b )); DATA(insert ( 1042 142 2896 e f )); /* * Length-coercion functions */ DATA(insert ( 1042 1042 668 i f )); DATA(insert ( 1043 1043 669 i f )); DATA(insert ( 1083 1083 1968 i f )); DATA(insert ( 1114 1114 1961 i f )); DATA(insert ( 1184 1184 1967 i f )); DATA(insert ( 1186 1186 1200 i f )); DATA(insert ( 1266 1266 1969 i f )); DATA(insert ( 1560 1560 1685 i f )); DATA(insert ( 1562 1562 1687 i f )); DATA(insert ( 1700 1700 1703 i f )); #endif /* PG_CAST_H */ PKBiZpFserver/catalog/genbki.hnu[/*------------------------------------------------------------------------- * * genbki.h * Required include file for all POSTGRES catalog header files * * genbki.h defines CATALOG(), DATA(), BKI_BOOTSTRAP and related macros * so that the catalog header files can be read by the C compiler. * (These same words are recognized by genbki.pl to build the BKI * bootstrap file from these header files.) * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/genbki.h * *------------------------------------------------------------------------- */ #ifndef GENBKI_H #define GENBKI_H /* Introduces a catalog's structure definition */ #define CATALOG(name,oid) typedef struct CppConcat(FormData_,name) /* * This is never defined; it's here only for documentation. * * Variable-length catalog fields (except possibly the first not nullable one) * should not be visible in C structures, so they are made invisible by #ifdefs * of an undefined symbol. See also MARKNOTNULL in bootstrap.c for how this is * handled. */ #undef CATALOG_VARLEN /* Options that may appear after CATALOG (on the same line) */ #define BKI_BOOTSTRAP #define BKI_SHARED_RELATION #define BKI_WITHOUT_OIDS #define BKI_ROWTYPE_OID(oid) #define BKI_SCHEMA_MACRO /* Declarations that provide the initial content of a catalog */ /* In C, these need to expand into some harmless, repeatable declaration */ #define DATA(x) extern int no_such_variable #define DESCR(x) extern int no_such_variable #define SHDESCR(x) extern int no_such_variable /* PHONY type definitions for use in catalog structure definitions only */ typedef int aclitem; typedef int pg_node_tree; #endif /* GENBKI_H */ PKBiZ h((server/funcapi.hnu[/*------------------------------------------------------------------------- * * funcapi.h * Definitions for functions which return composite type and/or sets * * This file must be included by all Postgres modules that either define * or call FUNCAPI-callable functions or macros. * * * Copyright (c) 2002-2012, PostgreSQL Global Development Group * * src/include/funcapi.h * *------------------------------------------------------------------------- */ #ifndef FUNCAPI_H #define FUNCAPI_H #include "fmgr.h" #include "access/tupdesc.h" #include "executor/executor.h" #include "executor/tuptable.h" /*------------------------------------------------------------------------- * Support to ease writing Functions returning composite types *------------------------------------------------------------------------- * * This struct holds arrays of individual attribute information * needed to create a tuple from raw C strings. It also requires * a copy of the TupleDesc. The information carried here * is derived from the TupleDesc, but it is stored here to * avoid redundant cpu cycles on each call to an SRF. */ typedef struct AttInMetadata { /* full TupleDesc */ TupleDesc tupdesc; /* array of attribute type input function finfo */ FmgrInfo *attinfuncs; /* array of attribute type i/o parameter OIDs */ Oid *attioparams; /* array of attribute typmod */ int32 *atttypmods; } AttInMetadata; /*------------------------------------------------------------------------- * Support struct to ease writing Set Returning Functions (SRFs) *------------------------------------------------------------------------- * * This struct holds function context for Set Returning Functions. * Use fn_extra to hold a pointer to it across calls */ typedef struct FuncCallContext { /* * Number of times we've been called before * * call_cntr is initialized to 0 for you by SRF_FIRSTCALL_INIT(), and * incremented for you every time SRF_RETURN_NEXT() is called. */ uint32 call_cntr; /* * OPTIONAL maximum number of calls * * max_calls is here for convenience only and setting it is optional. If * not set, you must provide alternative means to know when the function * is done. */ uint32 max_calls; /* * OPTIONAL pointer to result slot * * This is obsolete and only present for backwards compatibility, viz, * user-defined SRFs that use the deprecated TupleDescGetSlot(). */ TupleTableSlot *slot; /* * OPTIONAL pointer to miscellaneous user-provided context information * * user_fctx is for use as a pointer to your own struct to retain * arbitrary context information between calls of your function. */ void *user_fctx; /* * OPTIONAL pointer to struct containing attribute type input metadata * * attinmeta is for use when returning tuples (i.e. composite data types) * and is not used when returning base data types. It is only needed if * you intend to use BuildTupleFromCStrings() to create the return tuple. */ AttInMetadata *attinmeta; /* * memory context used for structures that must live for multiple calls * * multi_call_memory_ctx is set by SRF_FIRSTCALL_INIT() for you, and used * by SRF_RETURN_DONE() for cleanup. It is the most appropriate memory * context for any memory that is to be reused across multiple calls of * the SRF. */ MemoryContext multi_call_memory_ctx; /* * OPTIONAL pointer to struct containing tuple description * * tuple_desc is for use when returning tuples (i.e. composite data types) * and is only needed if you are going to build the tuples with * heap_form_tuple() rather than with BuildTupleFromCStrings(). Note that * the TupleDesc pointer stored here should usually have been run through * BlessTupleDesc() first. */ TupleDesc tuple_desc; } FuncCallContext; /*---------- * Support to ease writing functions returning composite types * * External declarations: * get_call_result_type: * Given a function's call info record, determine the kind of datatype * it is supposed to return. If resultTypeId isn't NULL, *resultTypeId * receives the actual datatype OID (this is mainly useful for scalar * result types). If resultTupleDesc isn't NULL, *resultTupleDesc * receives a pointer to a TupleDesc when the result is of a composite * type, or NULL when it's a scalar result or the rowtype could not be * determined. NB: the tupledesc should be copied if it is to be * accessed over a long period. * get_expr_result_type: * Given an expression node, return the same info as for * get_call_result_type. Note: the cases in which rowtypes cannot be * determined are different from the cases for get_call_result_type. * get_func_result_type: * Given only a function's OID, return the same info as for * get_call_result_type. Note: the cases in which rowtypes cannot be * determined are different from the cases for get_call_result_type. * Do *not* use this if you can use one of the others. *---------- */ /* Type categories for get_call_result_type and siblings */ typedef enum TypeFuncClass { TYPEFUNC_SCALAR, /* scalar result type */ TYPEFUNC_COMPOSITE, /* determinable rowtype result */ TYPEFUNC_RECORD, /* indeterminate rowtype result */ TYPEFUNC_OTHER /* bogus type, eg pseudotype */ } TypeFuncClass; extern TypeFuncClass get_call_result_type(FunctionCallInfo fcinfo, Oid *resultTypeId, TupleDesc *resultTupleDesc); extern TypeFuncClass get_expr_result_type(Node *expr, Oid *resultTypeId, TupleDesc *resultTupleDesc); extern TypeFuncClass get_func_result_type(Oid functionId, Oid *resultTypeId, TupleDesc *resultTupleDesc); extern bool resolve_polymorphic_argtypes(int numargs, Oid *argtypes, char *argmodes, Node *call_expr); extern int get_func_arg_info(HeapTuple procTup, Oid **p_argtypes, char ***p_argnames, char **p_argmodes); extern int get_func_input_arg_names(Datum proargnames, Datum proargmodes, char ***arg_names); extern char *get_func_result_name(Oid functionId); extern TupleDesc build_function_result_tupdesc_d(Datum proallargtypes, Datum proargmodes, Datum proargnames); extern TupleDesc build_function_result_tupdesc_t(HeapTuple procTuple); /*---------- * Support to ease writing functions returning composite types * * External declarations: * TupleDesc BlessTupleDesc(TupleDesc tupdesc) - "Bless" a completed tuple * descriptor so that it can be used to return properly labeled tuples. * You need to call this if you are going to use heap_form_tuple directly. * TupleDescGetAttInMetadata does it for you, however, so no need to call * it if you call TupleDescGetAttInMetadata. * AttInMetadata *TupleDescGetAttInMetadata(TupleDesc tupdesc) - Build an * AttInMetadata struct based on the given TupleDesc. AttInMetadata can * be used in conjunction with C strings to produce a properly formed * tuple. * HeapTuple BuildTupleFromCStrings(AttInMetadata *attinmeta, char **values) - * build a HeapTuple given user data in C string form. values is an array * of C strings, one for each attribute of the return tuple. * Datum HeapTupleHeaderGetDatum(HeapTupleHeader tuple) - convert a * HeapTupleHeader to a Datum. * * Macro declarations: * HeapTupleGetDatum(HeapTuple tuple) - convert a HeapTuple to a Datum. * * Obsolete routines and macros: * TupleDesc RelationNameGetTupleDesc(const char *relname) - Use to get a * TupleDesc based on a named relation. * TupleDesc TypeGetTupleDesc(Oid typeoid, List *colaliases) - Use to get a * TupleDesc based on a type OID. * TupleTableSlot *TupleDescGetSlot(TupleDesc tupdesc) - Builds a * TupleTableSlot, which is not needed anymore. * TupleGetDatum(TupleTableSlot *slot, HeapTuple tuple) - get a Datum * given a tuple and a slot. *---------- */ #define HeapTupleGetDatum(tuple) HeapTupleHeaderGetDatum((tuple)->t_data) /* obsolete version of above */ #define TupleGetDatum(_slot, _tuple) HeapTupleGetDatum(_tuple) extern TupleDesc RelationNameGetTupleDesc(const char *relname); extern TupleDesc TypeGetTupleDesc(Oid typeoid, List *colaliases); /* from execTuples.c */ extern TupleDesc BlessTupleDesc(TupleDesc tupdesc); extern AttInMetadata *TupleDescGetAttInMetadata(TupleDesc tupdesc); extern HeapTuple BuildTupleFromCStrings(AttInMetadata *attinmeta, char **values); extern Datum HeapTupleHeaderGetDatum(HeapTupleHeader tuple); extern TupleTableSlot *TupleDescGetSlot(TupleDesc tupdesc); /*---------- * Support for Set Returning Functions (SRFs) * * The basic API for SRFs looks something like: * * Datum * my_Set_Returning_Function(PG_FUNCTION_ARGS) * { * FuncCallContext *funcctx; * Datum result; * MemoryContext oldcontext; * * * if (SRF_IS_FIRSTCALL()) * { * funcctx = SRF_FIRSTCALL_INIT(); * // switch context when allocating stuff to be used in later calls * oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx); * * * * * * // return to original context when allocating transient memory * MemoryContextSwitchTo(oldcontext); * } * * funcctx = SRF_PERCALL_SETUP(); * * * if (funcctx->call_cntr < funcctx->max_calls) * { * * * SRF_RETURN_NEXT(funcctx, result); * } * else * SRF_RETURN_DONE(funcctx); * } * *---------- */ /* from funcapi.c */ extern FuncCallContext *init_MultiFuncCall(PG_FUNCTION_ARGS); extern FuncCallContext *per_MultiFuncCall(PG_FUNCTION_ARGS); extern void end_MultiFuncCall(PG_FUNCTION_ARGS, FuncCallContext *funcctx); #define SRF_IS_FIRSTCALL() (fcinfo->flinfo->fn_extra == NULL) #define SRF_FIRSTCALL_INIT() init_MultiFuncCall(fcinfo) #define SRF_PERCALL_SETUP() per_MultiFuncCall(fcinfo) #define SRF_RETURN_NEXT(_funcctx, _result) \ do { \ ReturnSetInfo *rsi; \ (_funcctx)->call_cntr++; \ rsi = (ReturnSetInfo *) fcinfo->resultinfo; \ rsi->isDone = ExprMultipleResult; \ PG_RETURN_DATUM(_result); \ } while (0) #define SRF_RETURN_DONE(_funcctx) \ do { \ ReturnSetInfo *rsi; \ end_MultiFuncCall(fcinfo, _funcctx); \ rsi = (ReturnSetInfo *) fcinfo->resultinfo; \ rsi->isDone = ExprEndResult; \ PG_RETURN_NULL(); \ } while (0) #endif /* FUNCAPI_H */ PKBiZ`~==server/miscadmin.hnu[/*------------------------------------------------------------------------- * * miscadmin.h * This file contains general postgres administration and initialization * stuff that used to be spread out between the following files: * globals.h global variables * pdir.h directory path crud * pinit.h postgres initialization * pmod.h processing modes * 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-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/miscadmin.h * * NOTES * some of the information in this file should be moved to other files. * *------------------------------------------------------------------------- */ #ifndef MISCADMIN_H #define MISCADMIN_H #include #include "pgtime.h" /* for pg_time_t */ #define PG_BACKEND_VERSIONSTR "postgres (PostgreSQL) " PG_VERSION "\n" /***************************************************************************** * System interrupt and critical section handling * * There are two types of interrupts that a running backend needs to accept * without messing up its state: QueryCancel (SIGINT) and ProcDie (SIGTERM). * In both cases, we need to be able to clean up the current transaction * gracefully, so we can't respond to the interrupt instantaneously --- * there's no guarantee that internal data structures would be self-consistent * if the code is interrupted at an arbitrary instant. Instead, the signal * handlers set flags that are checked periodically during execution. * * The CHECK_FOR_INTERRUPTS() macro is called at strategically located spots * where it is normally safe to accept a cancel or die interrupt. In some * cases, we invoke CHECK_FOR_INTERRUPTS() inside low-level subroutines that * might sometimes be called in contexts that do *not* want to allow a cancel * or die interrupt. The HOLD_INTERRUPTS() and RESUME_INTERRUPTS() macros * allow code to ensure that no cancel or die interrupt will be accepted, * even if CHECK_FOR_INTERRUPTS() gets called in a subroutine. The interrupt * will be held off until CHECK_FOR_INTERRUPTS() is done outside any * HOLD_INTERRUPTS() ... RESUME_INTERRUPTS() section. * * There is also a mechanism to prevent query cancel interrupts, while still * allowing die interrupts: HOLD_CANCEL_INTERRUPTS() and * RESUME_CANCEL_INTERRUPTS(). * * Special mechanisms are used to let an interrupt be accepted when we are * waiting for a lock or when we are waiting for command input (but, of * course, only if the interrupt holdoff counter is zero). See the * related code for details. * * A lost connection is handled similarly, although the loss of connection * does not raise a signal, but is detected when we fail to write to the * socket. If there was a signal for a broken connection, we could make use of * it by setting ClientConnectionLost in the signal handler. * * A related, but conceptually distinct, mechanism is the "critical section" * mechanism. A critical section not only holds off cancel/die interrupts, * but causes any ereport(ERROR) or ereport(FATAL) to become ereport(PANIC) * --- that is, a system-wide reset is forced. Needless to say, only really * *critical* code should be marked as a critical section! Currently, this * mechanism is only used for XLOG-related code. * *****************************************************************************/ /* in globals.c */ /* these are marked volatile because they are set by signal handlers: */ extern PGDLLIMPORT volatile bool InterruptPending; extern volatile bool QueryCancelPending; extern volatile bool ProcDiePending; extern PGDLLIMPORT volatile sig_atomic_t ConfigReloadPending; extern volatile bool ClientConnectionLost; /* these are marked volatile because they are examined by signal handlers: */ extern volatile bool ImmediateInterruptOK; extern PGDLLIMPORT volatile uint32 InterruptHoldoffCount; extern PGDLLIMPORT volatile uint32 QueryCancelHoldoffCount; extern PGDLLIMPORT volatile uint32 CritSectionCount; /* in tcop/postgres.c */ extern void ProcessInterrupts(void); #ifndef WIN32 #define CHECK_FOR_INTERRUPTS() \ do { \ if (InterruptPending) \ ProcessInterrupts(); \ } while(0) #else /* WIN32 */ #define CHECK_FOR_INTERRUPTS() \ do { \ if (UNBLOCKED_SIGNAL_QUEUE()) \ pgwin32_dispatch_queued_signals(); \ if (InterruptPending) \ ProcessInterrupts(); \ } while(0) #endif /* WIN32 */ #define HOLD_INTERRUPTS() (InterruptHoldoffCount++) #define RESUME_INTERRUPTS() \ do { \ Assert(InterruptHoldoffCount > 0); \ InterruptHoldoffCount--; \ } while(0) #define HOLD_CANCEL_INTERRUPTS() (QueryCancelHoldoffCount++) #define RESUME_CANCEL_INTERRUPTS() \ do { \ Assert(QueryCancelHoldoffCount > 0); \ QueryCancelHoldoffCount--; \ } while(0) #define START_CRIT_SECTION() (CritSectionCount++) #define END_CRIT_SECTION() \ do { \ Assert(CritSectionCount > 0); \ CritSectionCount--; \ } while(0) /***************************************************************************** * globals.h -- * *****************************************************************************/ /* * from utils/init/globals.c */ extern pid_t PostmasterPid; extern bool IsPostmasterEnvironment; extern PGDLLIMPORT bool IsUnderPostmaster; extern bool IsBinaryUpgrade; extern bool ExitOnAnyError; extern PGDLLIMPORT char *DataDir; extern PGDLLIMPORT int NBuffers; extern int MaxBackends; extern int MaxConnections; extern PGDLLIMPORT int MyProcPid; extern PGDLLIMPORT pg_time_t MyStartTime; extern PGDLLIMPORT struct Port *MyProcPort; extern long MyCancelKey; extern int MyPMChildSlot; extern char OutputFileName[]; extern PGDLLIMPORT char my_exec_path[]; extern char pkglib_path[]; #ifdef EXEC_BACKEND extern char postgres_exec_path[]; #endif /* * done in storage/backendid.h for now. * * extern BackendId MyBackendId; */ extern PGDLLIMPORT Oid MyDatabaseId; extern PGDLLIMPORT Oid MyDatabaseTableSpace; /* * Date/Time Configuration * * DateStyle defines the output formatting choice for date/time types: * USE_POSTGRES_DATES specifies traditional Postgres format * USE_ISO_DATES specifies ISO-compliant format * USE_SQL_DATES specifies Oracle/Ingres-compliant format * USE_GERMAN_DATES specifies German-style dd.mm/yyyy * * DateOrder defines the field order to be assumed when reading an * ambiguous date (anything not in YYYY-MM-DD format, with a four-digit * year field first, is taken to be ambiguous): * DATEORDER_YMD specifies field order yy-mm-dd * DATEORDER_DMY specifies field order dd-mm-yy ("European" convention) * DATEORDER_MDY specifies field order mm-dd-yy ("US" convention) * * In the Postgres and SQL DateStyles, DateOrder also selects output field * order: day comes before month in DMY style, else month comes before day. * * The user-visible "DateStyle" run-time parameter subsumes both of these. */ /* valid DateStyle values */ #define USE_POSTGRES_DATES 0 #define USE_ISO_DATES 1 #define USE_SQL_DATES 2 #define USE_GERMAN_DATES 3 #define USE_XSD_DATES 4 /* valid DateOrder values */ #define DATEORDER_YMD 0 #define DATEORDER_DMY 1 #define DATEORDER_MDY 2 extern int DateStyle; extern int DateOrder; /* * IntervalStyles * INTSTYLE_POSTGRES Like Postgres < 8.4 when DateStyle = 'iso' * INTSTYLE_POSTGRES_VERBOSE Like Postgres < 8.4 when DateStyle != 'iso' * INTSTYLE_SQL_STANDARD SQL standard interval literals * INTSTYLE_ISO_8601 ISO-8601-basic formatted intervals */ #define INTSTYLE_POSTGRES 0 #define INTSTYLE_POSTGRES_VERBOSE 1 #define INTSTYLE_SQL_STANDARD 2 #define INTSTYLE_ISO_8601 3 extern int IntervalStyle; /* * HasCTZSet is true if user has set timezone as a numeric offset from UTC. * If so, CTimeZone is the timezone offset in seconds (using the Unix-ish * sign convention, ie, positive offset is west of UTC, rather than the * SQL-ish convention that positive is east of UTC). */ extern bool HasCTZSet; extern int CTimeZone; #define MAXTZLEN 10 /* max TZ name len, not counting tr. null */ extern bool enableFsync; extern bool allowSystemTableMods; extern PGDLLIMPORT int work_mem; extern PGDLLIMPORT int maintenance_work_mem; extern int VacuumCostPageHit; extern int VacuumCostPageMiss; extern int VacuumCostPageDirty; extern int VacuumCostLimit; extern int VacuumCostDelay; extern int VacuumPageHit; extern int VacuumPageMiss; extern int VacuumPageDirty; extern int VacuumCostBalance; extern bool VacuumCostActive; /* in tcop/postgres.c */ #if defined(__ia64__) || defined(__ia64) typedef struct { char *stack_base_ptr; char *register_stack_base_ptr; } pg_stack_base_t; #else typedef char *pg_stack_base_t; #endif extern pg_stack_base_t set_stack_base(void); extern void restore_stack_base(pg_stack_base_t base); extern void check_stack_depth(void); extern bool stack_is_too_deep(void); extern void PostgresSigHupHandler(SIGNAL_ARGS); /* in tcop/utility.c */ extern void PreventCommandIfReadOnly(const char *cmdname); extern void PreventCommandDuringRecovery(const char *cmdname); /* in utils/misc/guc.c */ extern int trace_recovery_messages; extern int trace_recovery(int trace_level); /***************************************************************************** * pdir.h -- * * POSTGRES directory path definitions. * *****************************************************************************/ /* flags to be OR'd to form sec_context */ #define SECURITY_LOCAL_USERID_CHANGE 0x0001 #define SECURITY_RESTRICTED_OPERATION 0x0002 extern char *DatabasePath; /* now in utils/init/miscinit.c */ extern void SetDatabasePath(const char *path); extern char *GetUserNameFromId(Oid roleid); extern Oid GetUserId(void); extern Oid GetOuterUserId(void); extern Oid GetSessionUserId(void); extern void GetUserIdAndSecContext(Oid *userid, int *sec_context); extern void SetUserIdAndSecContext(Oid userid, int sec_context); extern bool InLocalUserIdChange(void); extern bool InSecurityRestrictedOperation(void); extern void GetUserIdAndContext(Oid *userid, bool *sec_def_context); extern void SetUserIdAndContext(Oid userid, bool sec_def_context); extern void InitializeSessionUserId(const char *rolename); extern void InitializeSessionUserIdStandalone(void); extern void SetSessionAuthorization(Oid userid, bool is_superuser); extern Oid GetCurrentRoleId(void); extern void SetCurrentRoleId(Oid roleid, bool is_superuser); extern void SetDataDir(const char *dir); extern void ChangeToDataDir(void); extern char *make_absolute_path(const char *path); /* in utils/misc/superuser.c */ extern bool superuser(void); /* current user is superuser */ extern bool superuser_arg(Oid roleid); /* given user is superuser */ /***************************************************************************** * pmod.h -- * * POSTGRES processing mode definitions. * *****************************************************************************/ /* * Description: * There are three processing modes in POSTGRES. They are * BootstrapProcessing or "bootstrap," InitProcessing or * "initialization," and NormalProcessing or "normal." * * The first two processing modes are used during special times. When the * system state indicates bootstrap processing, transactions are all given * transaction id "one" and are consequently guaranteed to commit. This mode * is used during the initial generation of template databases. * * Initialization mode: used while starting a backend, until all normal * initialization is complete. Some code behaves differently when executed * in this mode to enable system bootstrapping. * * If a POSTGRES backend process is in normal mode, then all code may be * executed normally. */ typedef enum ProcessingMode { BootstrapProcessing, /* bootstrap creation of template database */ InitProcessing, /* initializing system */ NormalProcessing /* normal processing */ } ProcessingMode; extern ProcessingMode Mode; #define IsBootstrapProcessingMode() (Mode == BootstrapProcessing) #define IsInitProcessingMode() (Mode == InitProcessing) #define IsNormalProcessingMode() (Mode == NormalProcessing) #define GetProcessingMode() Mode #define SetProcessingMode(mode) \ do { \ AssertArg((mode) == BootstrapProcessing || \ (mode) == InitProcessing || \ (mode) == NormalProcessing); \ Mode = (mode); \ } while(0) /* * Auxiliary-process type identifiers. These used to be in bootstrap.h * but it seems saner to have them here, with the ProcessingMode stuff. * The MyAuxProcType global is defined and set in bootstrap.c. */ typedef enum { NotAnAuxProcess = -1, CheckerProcess = 0, BootstrapProcess, StartupProcess, BgWriterProcess, CheckpointerProcess, WalWriterProcess, WalReceiverProcess, NUM_AUXPROCTYPES /* Must be last! */ } AuxProcType; extern AuxProcType MyAuxProcType; #define AmBootstrapProcess() (MyAuxProcType == BootstrapProcess) #define AmStartupProcess() (MyAuxProcType == StartupProcess) #define AmBackgroundWriterProcess() (MyAuxProcType == BgWriterProcess) #define AmCheckpointerProcess() (MyAuxProcType == CheckpointerProcess) #define AmWalWriterProcess() (MyAuxProcType == WalWriterProcess) #define AmWalReceiverProcess() (MyAuxProcType == WalReceiverProcess) /***************************************************************************** * pinit.h -- * * POSTGRES initialization and cleanup definitions. * *****************************************************************************/ /* in utils/init/postinit.c */ extern void pg_split_opts(char **argv, int *argcp, char *optstr); extern void InitPostgres(const char *in_dbname, Oid dboid, const char *username, char *out_dbname); extern void BaseInit(void); /* in utils/init/miscinit.c */ extern bool IgnoreSystemIndexes; extern PGDLLIMPORT bool process_shared_preload_libraries_in_progress; extern char *shared_preload_libraries_string; extern char *local_preload_libraries_string; /* * As of 9.1, the contents of the data-directory lock file are: * * line # * 1 postmaster PID (or negative of a standalone backend's PID) * 2 data directory path * 3 postmaster start timestamp (time_t representation) * 4 port number * 5 first Unix socket directory path (empty if none) * 6 first listen_address (IP address or "*"; empty if no TCP port) * 7 shared memory key (not present on Windows) * * Lines 6 and up are added via AddToDataDirLockFile() after initial file * creation; they have to be ordered according to time of addition. * * The socket lock file, if used, has the same contents as lines 1-5. */ #define LOCK_FILE_LINE_PID 1 #define LOCK_FILE_LINE_DATA_DIR 2 #define LOCK_FILE_LINE_START_TIME 3 #define LOCK_FILE_LINE_PORT 4 #define LOCK_FILE_LINE_SOCKET_DIR 5 #define LOCK_FILE_LINE_LISTEN_ADDR 6 #define LOCK_FILE_LINE_SHMEM_KEY 7 extern void CreateDataDirLockFile(bool amPostmaster); extern void CreateSocketLockFile(const char *socketfile, bool amPostmaster, const char *socketDir); extern void TouchSocketLockFiles(void); extern void AddToDataDirLockFile(int target_line, const char *str); extern bool RecheckDataDirLockFile(void); extern void ValidatePgVersion(const char *path); extern void process_shared_preload_libraries(void); extern void process_local_preload_libraries(void); extern void pg_bindtextdomain(const char *domain); extern bool has_rolreplication(Oid roleid); /* in access/transam/xlog.c */ extern bool BackupInProgress(void); extern void CancelBackup(void); #endif /* MISCADMIN_H */ PKBiZ] server/port/netbsd.hnu[/* src/include/port/netbsd.h */ PKBiZ۷!!server/port/freebsd.hnu[/* src/include/port/freebsd.h */ PKBiZC544server/port/hpux.hnu[/* src/include/port/hpux.h */ /* nothing needed */ PKBiZ:RRserver/port/aix.hnu[/* * src/include/port/aix.h */ #define CLASS_CONFLICT #define DISABLE_XOPEN_NLS PKBiZ`">server/port/unixware.hnu[/* * src/include/port/unixware.h * * see src/backend/libpq/pqcomm.c */ #define SCO_ACCEPT_BUG /*************************************** * Define this if you are compiling with * the native UNIXWARE C compiler. ***************************************/ #define USE_UNIVEL_CC PKBiZK}server/port/irix.hnu[/* src/include/port/irix.h */ /* * IRIX 6.5.26f and 6.5.22f (at least) have a strtod() that accepts * "infinity", but leaves endptr pointing to "inity". */ #define HAVE_BUGGY_IRIX_STRTOD PKBiZserver/port/solaris.hnu[/* src/include/port/solaris.h */ /* * Sort this out for all operating systems some time. The __xxx * symbols are defined on both GCC and Solaris CC, although GCC * doesn't document them. The __xxx__ symbols are only on GCC. */ #if defined(__i386) && !defined(__i386__) #define __i386__ #endif #if defined(__amd64) && !defined(__amd64__) #define __amd64__ #endif #if defined(__x86_64) && !defined(__x86_64__) #define __x86_64__ #endif #if defined(__sparc) && !defined(__sparc__) #define __sparc__ #endif #if defined(__i386__) #include #endif /* * Many versions of Solaris have broken strtod() --- see bug #4751182. * This has been fixed in current versions of Solaris: * * http://sunsolve.sun.com/search/document.do?assetkey=1-21-108993-62-1&searchclause=108993-62 * http://sunsolve.sun.com/search/document.do?assetkey=1-21-112874-34-1&searchclause=112874-34 * * However, many people might not have patched versions, so * still use our own fix for the buggy version. */ #define HAVE_BUGGY_SOLARIS_STRTOD PKBiZA--!server/port/win32_msvc/sys/time.hnu[/* src/include/port/win32_msvc/sys/time.h */ PKBiZs;--!server/port/win32_msvc/sys/file.hnu[/* src/include/port/win32_msvc/sys/file.h */ PKBiZsK.."server/port/win32_msvc/sys/param.hnu[/* src/include/port/win32_msvc/sys/param.h */ PKBiZ\server/port/win32_msvc/dirent.hnu[/* * Headers for port/dirent.c, win32 native implementation of dirent functions * * src/include/port/win32_msvc/dirent.h */ #ifndef _WIN32VC_DIRENT_H #define _WIN32VC_DIRENT_H struct dirent { long d_ino; unsigned short d_reclen; unsigned short d_namlen; char d_name[MAX_PATH]; }; typedef struct DIR DIR; DIR *opendir(const char *); struct dirent *readdir(DIR *); int closedir(DIR *); #endif PKBiZTC**server/port/win32_msvc/utime.hnu[/* src/include/port/win32_msvc/utime.h */ PKBiZa++server/port/win32_msvc/unistd.hnu[/* src/include/port/win32_msvc/unistd.h */ PKBiZserver/port/linux.hnu[/* src/include/port/linux.h */ /* * As of July 2007, all known versions of the Linux kernel will sometimes * return EIDRM for a shmctl() operation when EINVAL is correct (it happens * when the low-order 15 bits of the supplied shm ID match the slot number * assigned to a newer shmem segment). We deal with this by assuming that * EIDRM means EINVAL in PGSharedMemoryIsInUse(). This is reasonably safe * since in fact Linux has no excuse for ever returning EIDRM; it doesn't * track removed segments in a way that would allow distinguishing them from * private ones. But someday that code might get upgraded, and we'd have * to have a kernel version test here. */ #define HAVE_LINUX_EIDRM_BUG /* * Set the default wal_sync_method to fdatasync. With recent Linux versions, * xlogdefs.h's normal rules will prefer open_datasync, which (a) doesn't * perform better and (b) causes outright failures on ext4 data=journal * filesystems, because those don't support O_DIRECT. */ #define PLATFORM_DEFAULT_SYNC_METHOD SYNC_METHOD_FDATASYNC PKBiZserver/port/cygwin.hnu[/* src/include/port/cygwin.h */ #include /* * Check for b20.1 and disable AF_UNIX family socket support. */ #if CYGWIN_VERSION_DLL_MAJOR < 1001 #undef HAVE_UNIX_SOCKETS #endif #if __GNUC__ && ! defined (__declspec) #error You need egcs 1.1 or newer for compiling! #endif #ifdef BUILDING_DLL #define PGDLLIMPORT __declspec (dllexport) #else #define PGDLLIMPORT __declspec (dllimport) #endif #define PGDLLEXPORT PKBiZ(ssserver/port/sco.hnu[/* * src/include/port/sco.h * * see src/backend/libpq/pqcomm.c */ #define SCO_ACCEPT_BUG #define USE_UNIVEL_CC PKBiZ=N!!server/port/openbsd.hnu[/* src/include/port/openbsd.h */ PKBiZ0 %%server/port/win32/dlfcn.hnu[/* src/include/port/win32/dlfcn.h */ PKBiZDX''server/port/win32/pwd.hnu[/* * src/include/port/win32/pwd.h */ PKBiZIR##server/port/win32/grp.hnu[/* src/include/port/win32/grp.h */ PKBiZEow,,server/port/win32/sys/wait.hnu[/* * src/include/port/win32/sys/wait.h */ PKBiZ­}server/port/win32/sys/socket.hnu[/* * src/include/port/win32/sys/socket.h */ #ifndef WIN32_SYS_SOCKET_H #define WIN32_SYS_SOCKET_H /* * Unfortunately, of VC++ also defines ERROR. * To avoid the conflict, we include here and undefine ERROR * immediately. * * Note: Don't include directly. It causes compile errors. */ #include #include #include #undef ERROR #undef small /* Restore old ERROR value */ #ifdef PGERROR #define ERROR PGERROR #endif /* * we can't use the windows gai_strerror{AW} functions because * they are defined inline in the MS header files. So we'll use our * own */ #undef gai_strerror #endif /* WIN32_SYS_SOCKET_H */ PKBiZZ%%server/port/win32/netdb.hnu[/* src/include/port/win32/netdb.h */ PKBiZwwCCserver/port/win32/netinet/in.hnu[/* src/include/port/win32/netinet/in.h */ #include PKBiZS$BBserver/port/win32/arpa/inet.hnu[/* src/include/port/win32/arpa/inet.h */ #include PKBiZ(ﺑU3U3server/port/win32.hnu[/* src/include/port/win32.h */ #if defined(_MSC_VER) || defined(__BORLANDC__) #define WIN32_ONLY_COMPILER #endif /* * Make sure _WIN32_WINNT has the minimum required value. * Leave a higher value in place. */ #if defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0501 #undef _WIN32_WINNT #endif #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0501 #endif /* * Always build with SSPI support. Keep it as a #define in case * we want a switch to disable it sometime in the future. */ #ifndef __BORLANDC__ #define ENABLE_SSPI 1 #endif /* undefine and redefine after #include */ #undef mkdir #undef ERROR /* * The Mingw64 headers choke if this is already defined - they * define it themselves. */ #if !defined(__MINGW64_VERSION_MAJOR) || defined(WIN32_ONLY_COMPILER) #define _WINSOCKAPI_ #endif #include #include #include #undef small #include #include #include #include #ifndef __BORLANDC__ #include /* for non-unicode version */ #endif #undef near /* Must be here to avoid conflicting with prototype in windows.h */ #define mkdir(a,b) mkdir(a) #define ftruncate(a,b) chsize(a,b) /* Windows doesn't have fsync() as such, use _commit() */ #define fsync(fd) _commit(fd) /* * For historical reasons, we allow setting wal_sync_method to * fsync_writethrough on Windows, even though it's really identical to fsync * (both code paths wind up at _commit()). */ #define HAVE_FSYNC_WRITETHROUGH #define FSYNC_WRITETHROUGH_IS_FSYNC #define USES_WINSOCK /* defines for dynamic linking on Win32 platform */ #if defined(WIN32) || defined(__CYGWIN__) #if __GNUC__ && ! defined (__declspec) #error You need egcs 1.1 or newer for compiling! #endif #ifdef BUILDING_DLL #define PGDLLIMPORT __declspec (dllexport) #else /* not BUILDING_DLL */ #define PGDLLIMPORT __declspec (dllimport) #endif #ifdef _MSC_VER #define PGDLLEXPORT __declspec (dllexport) #else #define PGDLLEXPORT #endif #else /* not CYGWIN, not MSVC, not MingW */ #define PGDLLIMPORT #define PGDLLEXPORT #endif /* * IPC defines */ #undef HAVE_UNION_SEMUN #define HAVE_UNION_SEMUN 1 #define IPC_RMID 256 #define IPC_CREAT 512 #define IPC_EXCL 1024 #define IPC_PRIVATE 234564 #define IPC_NOWAIT 2048 #define IPC_STAT 4096 #define EACCESS 2048 #ifndef EIDRM #define EIDRM 4096 #endif #define SETALL 8192 #define GETNCNT 16384 #define GETVAL 65536 #define SETVAL 131072 #define GETPID 262144 /* * Signal stuff * * For WIN32, there is no wait() call so there are no wait() macros * to interpret the return value of system(). Instead, system() * return values < 0x100 are used for exit() termination, and higher * values are used to indicated non-exit() termination, which is * similar to a unix-style signal exit (think SIGSEGV == * STATUS_ACCESS_VIOLATION). Return values are broken up into groups: * * http://msdn2.microsoft.com/en-gb/library/aa489609.aspx * * NT_SUCCESS 0 - 0x3FFFFFFF * NT_INFORMATION 0x40000000 - 0x7FFFFFFF * NT_WARNING 0x80000000 - 0xBFFFFFFF * NT_ERROR 0xC0000000 - 0xFFFFFFFF * * Effectively, we don't care on the severity of the return value from * system(), we just need to know if it was because of exit() or generated * by the system, and it seems values >= 0x100 are system-generated. * See this URL for a list of WIN32 STATUS_* values: * * Wine (URL used in our error messages) - * http://source.winehq.org/source/include/ntstatus.h * Descriptions - http://www.comp.nus.edu.sg/~wuyongzh/my_doc/ntstatus.txt * MS SDK - http://www.nologs.com/ntstatus.html * * It seems the exception lists are in both ntstatus.h and winnt.h, but * ntstatus.h has a more comprehensive list, and it only contains * exception values, rather than winnt, which contains lots of other * things: * * http://www.microsoft.com/msj/0197/exception/exception.aspx * * The ExceptionCode parameter is the number that the operating system * assigned to the exception. You can see a list of various exception codes * in WINNT.H by searching for #defines that start with "STATUS_". For * example, the code for the all-too-familiar STATUS_ACCESS_VIOLATION is * 0xC0000005. A more complete set of exception codes can be found in * NTSTATUS.H from the Windows NT DDK. * * Some day we might want to print descriptions for the most common * exceptions, rather than printing an include file name. We could use * RtlNtStatusToDosError() and pass to FormatMessage(), which can print * the text of error values, but MinGW does not support * RtlNtStatusToDosError(). */ #define WIFEXITED(w) (((w) & 0XFFFFFF00) == 0) #define WIFSIGNALED(w) (!WIFEXITED(w)) #define WEXITSTATUS(w) (w) #define WTERMSIG(w) (w) #define sigmask(sig) ( 1 << ((sig)-1) ) /* Signal function return values */ #undef SIG_DFL #undef SIG_ERR #undef SIG_IGN #define SIG_DFL ((pqsigfunc)0) #define SIG_ERR ((pqsigfunc)-1) #define SIG_IGN ((pqsigfunc)1) /* Some extra signals */ #define SIGHUP 1 #define SIGQUIT 3 #define SIGTRAP 5 #define SIGABRT 22 /* Set to match W32 value -- not UNIX value */ #define SIGKILL 9 #define SIGPIPE 13 #define SIGALRM 14 #define SIGSTOP 17 #define SIGTSTP 18 #define SIGCONT 19 #define SIGCHLD 20 #define SIGTTIN 21 #define SIGTTOU 22 /* Same as SIGABRT -- no problem, I hope */ #define SIGWINCH 28 #ifndef __BORLANDC__ #define SIGUSR1 30 #define SIGUSR2 31 #endif /* * New versions of mingw have gettimeofday() and also declare * struct timezone to support it. */ #ifndef HAVE_GETTIMEOFDAY struct timezone { int tz_minuteswest; /* Minutes west of GMT. */ int tz_dsttime; /* Nonzero if DST is ever in effect. */ }; #endif /* for setitimer in backend/port/win32/timer.c */ #define ITIMER_REAL 0 struct itimerval { struct timeval it_interval; struct timeval it_value; }; int setitimer(int which, const struct itimerval * value, struct itimerval * ovalue); /* * WIN32 does not provide 64-bit off_t, but does provide the functions operating * with 64-bit offsets. */ #define pgoff_t __int64 #ifdef WIN32_ONLY_COMPILER #define fseeko(stream, offset, origin) _fseeki64(stream, offset, origin) #define ftello(stream) _ftelli64(stream) #else #ifndef fseeko #define fseeko(stream, offset, origin) fseeko64(stream, offset, origin) #endif #ifndef ftello #define ftello(stream) ftello64(stream) #endif #endif /* * Supplement to . * * Perl already has typedefs for uid_t and gid_t. */ #ifndef PLPERL_HAVE_UID_GID typedef int uid_t; typedef int gid_t; #endif typedef long key_t; #ifdef WIN32_ONLY_COMPILER typedef int pid_t; #endif /* * Supplement to . */ #define lstat(path, sb) stat((path), (sb)) /* * Supplement to . * This is the same value as _O_NOINHERIT in the MS header file. This is * to ensure that we don't collide with a future definition. It means * we cannot use _O_NOINHERIT ourselves. */ #define O_DSYNC 0x0080 /* * Supplement to . * * We redefine network-related Berkeley error symbols as the corresponding WSA * constants. This allows elog.c to recognize them as being in the Winsock * error code range and pass them off to pgwin32_socket_strerror(), since * Windows' version of plain strerror() won't cope. Note that this will break * if these names are used for anything else besides Windows Sockets errors. * See TranslateSocketError() when changing this list. */ #undef EAGAIN #define EAGAIN WSAEWOULDBLOCK #undef EINTR #define EINTR WSAEINTR #undef EMSGSIZE #define EMSGSIZE WSAEMSGSIZE #undef EAFNOSUPPORT #define EAFNOSUPPORT WSAEAFNOSUPPORT #undef EWOULDBLOCK #define EWOULDBLOCK WSAEWOULDBLOCK #undef ECONNABORTED #define ECONNABORTED WSAECONNABORTED #undef ECONNRESET #define ECONNRESET WSAECONNRESET #undef EINPROGRESS #define EINPROGRESS WSAEINPROGRESS #undef EISCONN #define EISCONN WSAEISCONN #undef ENOBUFS #define ENOBUFS WSAENOBUFS #undef EPROTONOSUPPORT #define EPROTONOSUPPORT WSAEPROTONOSUPPORT #undef ECONNREFUSED #define ECONNREFUSED WSAECONNREFUSED #undef ENOTSOCK #define ENOTSOCK WSAENOTSOCK #undef EOPNOTSUPP #define EOPNOTSUPP WSAEOPNOTSUPP #undef EADDRINUSE #define EADDRINUSE WSAEADDRINUSE #undef EADDRNOTAVAIL #define EADDRNOTAVAIL WSAEADDRNOTAVAIL #undef EHOSTUNREACH #define EHOSTUNREACH WSAEHOSTUNREACH #undef ENOTCONN #define ENOTCONN WSAENOTCONN /* * Extended locale functions with gratuitous underscore prefixes. * (These APIs are nevertheless fully documented by Microsoft.) */ #define locale_t _locale_t #define tolower_l _tolower_l #define toupper_l _toupper_l #define towlower_l _towlower_l #define towupper_l _towupper_l #define isdigit_l _isdigit_l #define iswdigit_l _iswdigit_l #define isalpha_l _isalpha_l #define iswalpha_l _iswalpha_l #define isalnum_l _isalnum_l #define iswalnum_l _iswalnum_l #define isupper_l _isupper_l #define iswupper_l _iswupper_l #define islower_l _islower_l #define iswlower_l _iswlower_l #define isgraph_l _isgraph_l #define iswgraph_l _iswgraph_l #define isprint_l _isprint_l #define iswprint_l _iswprint_l #define ispunct_l _ispunct_l #define iswpunct_l _iswpunct_l #define isspace_l _isspace_l #define iswspace_l _iswspace_l #define strcoll_l _strcoll_l #define wcscoll_l _wcscoll_l #define wcstombs_l _wcstombs_l #define mbstowcs_l _mbstowcs_l /* In backend/port/win32/signal.c */ extern PGDLLIMPORT volatile int pg_signal_queue; extern PGDLLIMPORT int pg_signal_mask; extern HANDLE pgwin32_signal_event; extern HANDLE pgwin32_initial_signal_pipe; #define UNBLOCKED_SIGNAL_QUEUE() (pg_signal_queue & ~pg_signal_mask) void pgwin32_signal_initialize(void); HANDLE pgwin32_create_signal_listener(pid_t pid); void pgwin32_dispatch_queued_signals(void); void pg_queue_signal(int signum); /* In backend/port/win32/socket.c */ #ifndef FRONTEND #define socket(af, type, protocol) pgwin32_socket(af, type, protocol) #define bind(s, addr, addrlen) pgwin32_bind(s, addr, addrlen) #define listen(s, backlog) pgwin32_listen(s, backlog) #define accept(s, addr, addrlen) pgwin32_accept(s, addr, addrlen) #define connect(s, name, namelen) pgwin32_connect(s, name, namelen) #define select(n, r, w, e, timeout) pgwin32_select(n, r, w, e, timeout) #define recv(s, buf, len, flags) pgwin32_recv(s, buf, len, flags) #define send(s, buf, len, flags) pgwin32_send(s, buf, len, flags) SOCKET pgwin32_socket(int af, int type, int protocol); int pgwin32_bind(SOCKET s, struct sockaddr * addr, int addrlen); int pgwin32_listen(SOCKET s, int backlog); SOCKET pgwin32_accept(SOCKET s, struct sockaddr * addr, int *addrlen); int pgwin32_connect(SOCKET s, const struct sockaddr * name, int namelen); int pgwin32_select(int nfds, fd_set *readfs, fd_set *writefds, fd_set *exceptfds, const struct timeval * timeout); int pgwin32_recv(SOCKET s, char *buf, int len, int flags); int pgwin32_send(SOCKET s, const void *buf, int len, int flags); const char *pgwin32_socket_strerror(int err); int pgwin32_waitforsinglesocket(SOCKET s, int what, int timeout); extern int pgwin32_noblock; /* in backend/port/win32/security.c */ extern int pgwin32_is_admin(void); extern int pgwin32_is_service(void); #endif /* in backend/port/win32_shmem.c */ extern int pgwin32_ReserveSharedMemoryRegion(HANDLE); /* in backend/port/win32/crashdump.c */ extern void pgwin32_install_crashdump_handler(void); /* in port/win32error.c */ extern void _dosmaperr(unsigned long); /* in port/win32env.c */ extern int pgwin32_putenv(const char *); extern void pgwin32_unsetenv(const char *); #define putenv(x) pgwin32_putenv(x) #define unsetenv(x) pgwin32_unsetenv(x) /* Things that exist in MingW headers, but need to be added to MSVC & BCC */ #ifdef WIN32_ONLY_COMPILER #ifndef _WIN64 typedef long ssize_t; #else typedef __int64 ssize_t; #endif #ifndef __BORLANDC__ typedef unsigned short mode_t; #define S_IRUSR _S_IREAD #define S_IWUSR _S_IWRITE #define S_IXUSR _S_IEXEC #define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR) /* see also S_IRGRP etc below */ #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) #endif /* __BORLANDC__ */ #define F_OK 0 #define W_OK 2 #define R_OK 4 #define isinf(x) ((_fpclass(x) == _FPCLASS_PINF) || (_fpclass(x) == _FPCLASS_NINF)) #define isnan(x) _isnan(x) /* Pulled from Makefile.port in mingw */ #define DLSUFFIX ".dll" #ifdef __BORLANDC__ /* for port/dirent.c */ #ifndef INVALID_FILE_ATTRIBUTES #define INVALID_FILE_ATTRIBUTES ((DWORD) -1) #endif /* for port/open.c */ #ifndef O_RANDOM #define O_RANDOM 0x0010 /* File access is primarily random */ #define O_SEQUENTIAL 0x0020 /* File access is primarily sequential */ #define O_TEMPORARY 0x0040 /* Temporary file bit */ #define O_SHORT_LIVED 0x1000 /* Temporary storage file, try not to flush */ #define _O_SHORT_LIVED O_SHORT_LIVED #endif /* ifndef O_RANDOM */ #endif /* __BORLANDC__ */ #endif /* WIN32_ONLY_COMPILER */ /* These aren't provided by either MingW or MSVC */ #ifndef __BORLANDC__ #define S_IRGRP 0 #define S_IWGRP 0 #define S_IXGRP 0 #define S_IRWXG 0 #define S_IROTH 0 #define S_IWOTH 0 #define S_IXOTH 0 #define S_IRWXO 0 #endif /* __BORLANDC__ */ PKBiZ+IIserver/port/osf.hnu[/* src/include/port/osf.h */ #define NOFIXADE #define DISABLE_XOPEN_NLS PKBiZMFserver/port/darwin.hnu[/* src/include/port/darwin.h */ #define __darwin__ 1 #if HAVE_DECL_F_FULLFSYNC /* not present before OS X 10.3 */ #define HAVE_FSYNC_WRITETHROUGH #endif PKBiZC#KKserver/rusagestub.hnu[/*------------------------------------------------------------------------- * * rusagestub.h * Stubs for getrusage(3). * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/rusagestub.h * *------------------------------------------------------------------------- */ #ifndef RUSAGESTUB_H #define RUSAGESTUB_H #include /* for struct timeval */ #ifndef WIN32 #include /* for struct tms */ #endif #include /* for CLK_TCK */ #define RUSAGE_SELF 0 #define RUSAGE_CHILDREN (-1) struct rusage { struct timeval ru_utime; /* user time used */ struct timeval ru_stime; /* system time used */ }; extern int getrusage(int who, struct rusage * rusage); #endif /* RUSAGESTUB_H */ PKBiZ@m%m%server/pg_config_manual.hnu[/*------------------------------------------------------------------------ * PostgreSQL manual configuration settings * * This file contains various configuration symbols and limits. In * all cases, changing them is only useful in very rare situations or * for developers. If you edit any of these, be sure to do a *full* * rebuild (and an initdb if noted). * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/pg_config_manual.h *------------------------------------------------------------------------ */ /* * Maximum length for identifiers (e.g. table names, column names, * function names). Names actually are limited to one less byte than this, * because the length must include a trailing zero byte. * * Changing this requires an initdb. */ #define NAMEDATALEN 64 /* * Maximum number of arguments to a function. * * The minimum value is 8 (GIN indexes use 8-argument support functions). * The maximum possible value is around 600 (limited by index tuple size in * pg_proc's index; BLCKSZ larger than 8K would allow more). Values larger * than needed will waste memory and processing time, but do not directly * cost disk space. * * Changing this does not require an initdb, but it does require a full * backend recompile (including any user-defined C functions). */ #define FUNC_MAX_ARGS 100 /* * Maximum number of columns in an index. There is little point in making * this anything but a multiple of 32, because the main cost is associated * with index tuple header size (see access/itup.h). * * Changing this requires an initdb. */ #define INDEX_MAX_KEYS 32 /* * Set the upper and lower bounds of sequence values. */ #define SEQ_MAXVALUE INT64CONST(0x7FFFFFFFFFFFFFFF) #define SEQ_MINVALUE (-SEQ_MAXVALUE) /* * Number of spare LWLocks to allocate for user-defined add-on code. */ #define NUM_USER_DEFINED_LWLOCKS 4 /* * When we don't have native spinlocks, we use semaphores to simulate them. * Decreasing this value reduces consumption of OS resources; increasing it * may improve performance, but supplying a real spinlock implementation is * probably far better. */ #define NUM_SPINLOCK_SEMAPHORES 128 /* * Define this if you want to allow the lo_import and lo_export SQL * functions to be executed by ordinary users. By default these * functions are only available to the Postgres superuser. CAUTION: * These functions are SECURITY HOLES since they can read and write * any file that the PostgreSQL server has permission to access. If * you turn this on, don't say we didn't warn you. */ /* #define ALLOW_DANGEROUS_LO_FUNCTIONS */ /* * MAXPGPATH: standard size of a pathname buffer in PostgreSQL (hence, * maximum usable pathname length is one less). * * We'd use a standard system header symbol for this, if there weren't * so many to choose from: MAXPATHLEN, MAX_PATH, PATH_MAX are all * defined by different "standards", and often have different values * on the same platform! So we just punt and use a reasonably * generous setting here. */ #define MAXPGPATH 1024 /* * PG_SOMAXCONN: maximum accept-queue length limit passed to * listen(2). You'd think we should use SOMAXCONN from * , but on many systems that symbol is much smaller * than the kernel's actual limit. In any case, this symbol need be * twiddled only if you have a kernel that refuses large limit values, * rather than silently reducing the value to what it can handle * (which is what most if not all Unixen do). */ #define PG_SOMAXCONN 10000 /* * You can try changing this if you have a machine with bytes of * another size, but no guarantee... */ #define BITS_PER_BYTE 8 /* * Preferred alignment for disk I/O buffers. On some CPUs, copies between * user space and kernel space are significantly faster if the user buffer * is aligned on a larger-than-MAXALIGN boundary. Ideally this should be * a platform-dependent value, but for now we just hard-wire it. */ #define ALIGNOF_BUFFER 32 /* * Disable UNIX sockets for certain operating systems. */ #if defined(WIN32) #undef HAVE_UNIX_SOCKETS #endif /* * Define this if your operating system supports link() */ #if !defined(WIN32) && !defined(__CYGWIN__) #define HAVE_WORKING_LINK 1 #endif /* * USE_POSIX_FADVISE controls whether Postgres will attempt to use the * posix_fadvise() kernel call. Usually the automatic configure tests are * sufficient, but some older Linux distributions had broken versions of * posix_fadvise(). If necessary you can remove the #define here. */ #if HAVE_DECL_POSIX_FADVISE && defined(HAVE_POSIX_FADVISE) #define USE_POSIX_FADVISE #endif /* * USE_PREFETCH code should be compiled only if we have a way to implement * prefetching. (This is decoupled from USE_POSIX_FADVISE because there * might in future be support for alternative low-level prefetch APIs.) */ #ifdef USE_POSIX_FADVISE #define USE_PREFETCH #endif /* * This is the default directory in which AF_UNIX socket files are * placed. Caution: changing this risks breaking your existing client * applications, which are likely to continue to look in the old * directory. But if you just hate the idea of sockets in /tmp, * here's where to twiddle it. You can also override this at runtime * with the postmaster's -k switch. */ #define DEFAULT_PGSOCKET_DIR "/var/run/postgresql" /* * The random() function is expected to yield values between 0 and * MAX_RANDOM_VALUE. Currently, all known implementations yield * 0..2^31-1, so we just hardwire this constant. We could do a * configure test if it proves to be necessary. CAUTION: Think not to * replace this with RAND_MAX. RAND_MAX defines the maximum value of * the older rand() function, which is often different from --- and * considerably inferior to --- random(). */ #define MAX_RANDOM_VALUE (0x7FFFFFFF) /* * Set the format style used by gcc to check printf type functions. We really * want the "gnu_printf" style set, which includes what glibc uses, such * as %m for error strings and %lld for 64 bit long longs. But not all gcc * compilers are known to support it, so we just use "printf" which all * gcc versions alive are known to support, except on Windows where * using "gnu_printf" style makes a dramatic difference. Maybe someday * we'll have a configure test for this, if we ever discover use of more * variants to be necessary. */ #ifdef WIN32 #define PG_PRINTF_ATTRIBUTE gnu_printf #else #define PG_PRINTF_ATTRIBUTE printf #endif /* * On PPC machines, decide whether to use the mutex hint bit in LWARX * instructions. Setting the hint bit will slightly improve spinlock * performance on POWER6 and later machines, but does nothing before that, * and will result in illegal-instruction failures on some pre-POWER4 * machines. By default we use the hint bit when building for 64-bit PPC, * which should be safe in nearly all cases. You might want to override * this if you are building 32-bit code for a known-recent PPC machine. */ #ifdef HAVE_PPC_LWARX_MUTEX_HINT /* must have assembler support in any case */ #if defined(__ppc64__) || defined(__powerpc64__) #define USE_PPC_LWARX_MUTEX_HINT #endif #endif /* * On PPC machines, decide whether to use LWSYNC instructions in place of * ISYNC and SYNC. This provides slightly better performance, but will * result in illegal-instruction failures on some pre-POWER4 machines. * By default we use LWSYNC when building for 64-bit PPC, which should be * safe in nearly all cases. */ #if defined(__ppc64__) || defined(__powerpc64__) #define USE_PPC_LWSYNC #endif /* *------------------------------------------------------------------------ * The following symbols are for enabling debugging code, not for * controlling user-visible features or resource limits. *------------------------------------------------------------------------ */ /* * Define this to cause pfree()'d memory to be cleared immediately, to * facilitate catching bugs that refer to already-freed values. * Right now, this gets defined automatically if --enable-cassert. */ #ifdef USE_ASSERT_CHECKING #define CLOBBER_FREED_MEMORY #endif /* * Define this to check memory allocation errors (scribbling on more * bytes than were allocated). Right now, this gets defined * automatically if --enable-cassert. */ #ifdef USE_ASSERT_CHECKING #define MEMORY_CONTEXT_CHECKING #endif /* * Define this to cause palloc()'d memory to be filled with random data, to * facilitate catching code that depends on the contents of uninitialized * memory. Caution: this is horrendously expensive. */ /* #define RANDOMIZE_ALLOCATED_MEMORY */ /* * Define this to force all parse and plan trees to be passed through * copyObject(), to facilitate catching errors and omissions in * copyObject(). */ /* #define COPY_PARSE_PLAN_TREES */ /* * Enable debugging print statements for lock-related operations. */ /* #define LOCK_DEBUG */ /* * Enable debugging print statements for WAL-related operations; see * also the wal_debug GUC var. */ /* #define WAL_DEBUG */ /* * Enable tracing of resource consumption during sort operations; * see also the trace_sort GUC var. For 8.1 this is enabled by default. */ #define TRACE_SORT 1 /* * Enable tracing of syncscan operations (see also the trace_syncscan GUC var). */ /* #define TRACE_SYNCSCAN */ /* * Other debug #defines (documentation, anyone?) */ /* #define HEAPDEBUGALL */ /* #define ACLDEBUG */ /* #define RTDEBUG */ PKBiZ'JPJPserver/postgres.hnu[/*------------------------------------------------------------------------- * * postgres.h * Primary include file for PostgreSQL server .c files * * This should be the first file included by PostgreSQL backend modules. * Client-side code should include postgres_fe.h instead. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1995, Regents of the University of California * * src/include/postgres.h * *------------------------------------------------------------------------- */ /* *---------------------------------------------------------------- * TABLE OF CONTENTS * * When adding stuff to this file, please try to put stuff * into the relevant section, or add new sections as appropriate. * * section description * ------- ------------------------------------------------ * 1) variable-length datatypes (TOAST support) * 2) datum type + support macros * 3) exception handling definitions * * NOTES * * In general, this file should contain declarations that are widely needed * in the backend environment, but are of no interest outside the backend. * * Simple type definitions live in c.h, where they are shared with * postgres_fe.h. We do that since those type definitions are needed by * frontend modules that want to deal with binary data transmission to or * from the backend. Type definitions in this file should be for * representations that never escape the backend, such as Datum or * TOASTed varlena objects. * *---------------------------------------------------------------- */ #ifndef POSTGRES_H #define POSTGRES_H #include "c.h" #include "utils/elog.h" #include "utils/palloc.h" /* ---------------------------------------------------------------- * Section 1: variable-length datatypes (TOAST support) * ---------------------------------------------------------------- */ /* * struct varatt_external is a "TOAST pointer", that is, the information * needed to fetch a stored-out-of-line Datum. The data is compressed * if and only if va_extsize < va_rawsize - VARHDRSZ. This struct must not * contain any padding, because we sometimes compare pointers using memcmp. * * Note that this information is stored unaligned within actual tuples, so * you need to memcpy from the tuple into a local struct variable before * you can look at these fields! (The reason we use memcmp is to avoid * having to do that just to detect equality of two TOAST pointers...) */ struct varatt_external { int32 va_rawsize; /* Original data size (includes header) */ int32 va_extsize; /* External saved size (doesn't) */ Oid va_valueid; /* Unique ID of value within TOAST table */ Oid va_toastrelid; /* RelID of TOAST table containing it */ }; /* * These structs describe the header of a varlena object that may have been * TOASTed. Generally, don't reference these structs directly, but use the * macros below. * * We use separate structs for the aligned and unaligned cases because the * compiler might otherwise think it could generate code that assumes * alignment while touching fields of a 1-byte-header varlena. */ typedef union { struct /* Normal varlena (4-byte length) */ { uint32 va_header; char va_data[1]; } va_4byte; struct /* Compressed-in-line format */ { uint32 va_header; uint32 va_rawsize; /* Original data size (excludes header) */ char va_data[1]; /* Compressed data */ } va_compressed; } varattrib_4b; typedef struct { uint8 va_header; char va_data[1]; /* Data begins here */ } varattrib_1b; typedef struct { uint8 va_header; /* Always 0x80 or 0x01 */ uint8 va_len_1be; /* Physical length of datum */ char va_data[1]; /* Data (for now always a TOAST pointer) */ } varattrib_1b_e; /* * Bit layouts for varlena headers on big-endian machines: * * 00xxxxxx 4-byte length word, aligned, uncompressed data (up to 1G) * 01xxxxxx 4-byte length word, aligned, *compressed* data (up to 1G) * 10000000 1-byte length word, unaligned, TOAST pointer * 1xxxxxxx 1-byte length word, unaligned, uncompressed data (up to 126b) * * Bit layouts for varlena headers on little-endian machines: * * xxxxxx00 4-byte length word, aligned, uncompressed data (up to 1G) * xxxxxx10 4-byte length word, aligned, *compressed* data (up to 1G) * 00000001 1-byte length word, unaligned, TOAST pointer * xxxxxxx1 1-byte length word, unaligned, uncompressed data (up to 126b) * * The "xxx" bits are the length field (which includes itself in all cases). * In the big-endian case we mask to extract the length, in the little-endian * case we shift. Note that in both cases the flag bits are in the physically * first byte. Also, it is not possible for a 1-byte length word to be zero; * this lets us disambiguate alignment padding bytes from the start of an * unaligned datum. (We now *require* pad bytes to be filled with zero!) */ /* * Endian-dependent macros. These are considered internal --- use the * external macros below instead of using these directly. * * Note: IS_1B is true for external toast records but VARSIZE_1B will return 0 * for such records. Hence you should usually check for IS_EXTERNAL before * checking for IS_1B. */ #ifdef WORDS_BIGENDIAN #define VARATT_IS_4B(PTR) \ ((((varattrib_1b *) (PTR))->va_header & 0x80) == 0x00) #define VARATT_IS_4B_U(PTR) \ ((((varattrib_1b *) (PTR))->va_header & 0xC0) == 0x00) #define VARATT_IS_4B_C(PTR) \ ((((varattrib_1b *) (PTR))->va_header & 0xC0) == 0x40) #define VARATT_IS_1B(PTR) \ ((((varattrib_1b *) (PTR))->va_header & 0x80) == 0x80) #define VARATT_IS_1B_E(PTR) \ ((((varattrib_1b *) (PTR))->va_header) == 0x80) #define VARATT_NOT_PAD_BYTE(PTR) \ (*((uint8 *) (PTR)) != 0) /* VARSIZE_4B() should only be used on known-aligned data */ #define VARSIZE_4B(PTR) \ (((varattrib_4b *) (PTR))->va_4byte.va_header & 0x3FFFFFFF) #define VARSIZE_1B(PTR) \ (((varattrib_1b *) (PTR))->va_header & 0x7F) #define VARSIZE_1B_E(PTR) \ (((varattrib_1b_e *) (PTR))->va_len_1be) #define SET_VARSIZE_4B(PTR,len) \ (((varattrib_4b *) (PTR))->va_4byte.va_header = (len) & 0x3FFFFFFF) #define SET_VARSIZE_4B_C(PTR,len) \ (((varattrib_4b *) (PTR))->va_4byte.va_header = ((len) & 0x3FFFFFFF) | 0x40000000) #define SET_VARSIZE_1B(PTR,len) \ (((varattrib_1b *) (PTR))->va_header = (len) | 0x80) #define SET_VARSIZE_1B_E(PTR,len) \ (((varattrib_1b_e *) (PTR))->va_header = 0x80, \ ((varattrib_1b_e *) (PTR))->va_len_1be = (len)) #else /* !WORDS_BIGENDIAN */ #define VARATT_IS_4B(PTR) \ ((((varattrib_1b *) (PTR))->va_header & 0x01) == 0x00) #define VARATT_IS_4B_U(PTR) \ ((((varattrib_1b *) (PTR))->va_header & 0x03) == 0x00) #define VARATT_IS_4B_C(PTR) \ ((((varattrib_1b *) (PTR))->va_header & 0x03) == 0x02) #define VARATT_IS_1B(PTR) \ ((((varattrib_1b *) (PTR))->va_header & 0x01) == 0x01) #define VARATT_IS_1B_E(PTR) \ ((((varattrib_1b *) (PTR))->va_header) == 0x01) #define VARATT_NOT_PAD_BYTE(PTR) \ (*((uint8 *) (PTR)) != 0) /* VARSIZE_4B() should only be used on known-aligned data */ #define VARSIZE_4B(PTR) \ ((((varattrib_4b *) (PTR))->va_4byte.va_header >> 2) & 0x3FFFFFFF) #define VARSIZE_1B(PTR) \ ((((varattrib_1b *) (PTR))->va_header >> 1) & 0x7F) #define VARSIZE_1B_E(PTR) \ (((varattrib_1b_e *) (PTR))->va_len_1be) #define SET_VARSIZE_4B(PTR,len) \ (((varattrib_4b *) (PTR))->va_4byte.va_header = (((uint32) (len)) << 2)) #define SET_VARSIZE_4B_C(PTR,len) \ (((varattrib_4b *) (PTR))->va_4byte.va_header = (((uint32) (len)) << 2) | 0x02) #define SET_VARSIZE_1B(PTR,len) \ (((varattrib_1b *) (PTR))->va_header = (((uint8) (len)) << 1) | 0x01) #define SET_VARSIZE_1B_E(PTR,len) \ (((varattrib_1b_e *) (PTR))->va_header = 0x01, \ ((varattrib_1b_e *) (PTR))->va_len_1be = (len)) #endif /* WORDS_BIGENDIAN */ #define VARHDRSZ_SHORT 1 #define VARATT_SHORT_MAX 0x7F #define VARATT_CAN_MAKE_SHORT(PTR) \ (VARATT_IS_4B_U(PTR) && \ (VARSIZE(PTR) - VARHDRSZ + VARHDRSZ_SHORT) <= VARATT_SHORT_MAX) #define VARATT_CONVERTED_SHORT_SIZE(PTR) \ (VARSIZE(PTR) - VARHDRSZ + VARHDRSZ_SHORT) #define VARHDRSZ_EXTERNAL 2 #define VARDATA_4B(PTR) (((varattrib_4b *) (PTR))->va_4byte.va_data) #define VARDATA_4B_C(PTR) (((varattrib_4b *) (PTR))->va_compressed.va_data) #define VARDATA_1B(PTR) (((varattrib_1b *) (PTR))->va_data) #define VARDATA_1B_E(PTR) (((varattrib_1b_e *) (PTR))->va_data) #define VARRAWSIZE_4B_C(PTR) \ (((varattrib_4b *) (PTR))->va_compressed.va_rawsize) /* Externally visible macros */ /* * VARDATA, VARSIZE, and SET_VARSIZE are the recommended API for most code * for varlena datatypes. Note that they only work on untoasted, * 4-byte-header Datums! * * Code that wants to use 1-byte-header values without detoasting should * use VARSIZE_ANY/VARSIZE_ANY_EXHDR/VARDATA_ANY. The other macros here * should usually be used only by tuple assembly/disassembly code and * code that specifically wants to work with still-toasted Datums. * * WARNING: It is only safe to use VARDATA_ANY() -- typically with * PG_DETOAST_DATUM_PACKED() -- if you really don't care about the alignment. * Either because you're working with something like text where the alignment * doesn't matter or because you're not going to access its constituent parts * and just use things like memcpy on it anyways. */ #define VARDATA(PTR) VARDATA_4B(PTR) #define VARSIZE(PTR) VARSIZE_4B(PTR) #define VARSIZE_SHORT(PTR) VARSIZE_1B(PTR) #define VARDATA_SHORT(PTR) VARDATA_1B(PTR) #define VARSIZE_EXTERNAL(PTR) VARSIZE_1B_E(PTR) #define VARDATA_EXTERNAL(PTR) VARDATA_1B_E(PTR) #define VARATT_IS_COMPRESSED(PTR) VARATT_IS_4B_C(PTR) #define VARATT_IS_EXTERNAL(PTR) VARATT_IS_1B_E(PTR) #define VARATT_IS_SHORT(PTR) VARATT_IS_1B(PTR) #define VARATT_IS_EXTENDED(PTR) (!VARATT_IS_4B_U(PTR)) #define SET_VARSIZE(PTR, len) SET_VARSIZE_4B(PTR, len) #define SET_VARSIZE_SHORT(PTR, len) SET_VARSIZE_1B(PTR, len) #define SET_VARSIZE_COMPRESSED(PTR, len) SET_VARSIZE_4B_C(PTR, len) #define SET_VARSIZE_EXTERNAL(PTR, len) SET_VARSIZE_1B_E(PTR, len) #define VARSIZE_ANY(PTR) \ (VARATT_IS_1B_E(PTR) ? VARSIZE_1B_E(PTR) : \ (VARATT_IS_1B(PTR) ? VARSIZE_1B(PTR) : \ VARSIZE_4B(PTR))) #define VARSIZE_ANY_EXHDR(PTR) \ (VARATT_IS_1B_E(PTR) ? VARSIZE_1B_E(PTR)-VARHDRSZ_EXTERNAL : \ (VARATT_IS_1B(PTR) ? VARSIZE_1B(PTR)-VARHDRSZ_SHORT : \ VARSIZE_4B(PTR)-VARHDRSZ)) /* caution: this will not work on an external or compressed-in-line Datum */ /* caution: this will return a possibly unaligned pointer */ #define VARDATA_ANY(PTR) \ (VARATT_IS_1B(PTR) ? VARDATA_1B(PTR) : VARDATA_4B(PTR)) /* ---------------------------------------------------------------- * Section 2: datum type + support macros * ---------------------------------------------------------------- */ /* * Port Notes: * Postgres makes the following assumptions about datatype sizes: * * sizeof(Datum) == sizeof(void *) == 4 or 8 * sizeof(char) == 1 * sizeof(short) == 2 * * When a type narrower than Datum is stored in a Datum, we place it in the * low-order bits and are careful that the DatumGetXXX macro for it discards * the unused high-order bits (as opposed to, say, assuming they are zero). * This is needed to support old-style user-defined functions, since depending * on architecture and compiler, the return value of a function returning char * or short may contain garbage when called as if it returned Datum. */ typedef uintptr_t Datum; #define SIZEOF_DATUM SIZEOF_VOID_P typedef Datum *DatumPtr; #define GET_1_BYTE(datum) (((Datum) (datum)) & 0x000000ff) #define GET_2_BYTES(datum) (((Datum) (datum)) & 0x0000ffff) #define GET_4_BYTES(datum) (((Datum) (datum)) & 0xffffffff) #if SIZEOF_DATUM == 8 #define GET_8_BYTES(datum) ((Datum) (datum)) #endif #define SET_1_BYTE(value) (((Datum) (value)) & 0x000000ff) #define SET_2_BYTES(value) (((Datum) (value)) & 0x0000ffff) #define SET_4_BYTES(value) (((Datum) (value)) & 0xffffffff) #if SIZEOF_DATUM == 8 #define SET_8_BYTES(value) ((Datum) (value)) #endif /* * DatumGetBool * Returns boolean value of a datum. * * Note: any nonzero value will be considered TRUE, but we ignore bits to * the left of the width of bool, per comment above. */ #define DatumGetBool(X) ((bool) (GET_1_BYTE(X) != 0)) /* * BoolGetDatum * Returns datum representation for a boolean. * * Note: any nonzero value will be considered TRUE. */ #define BoolGetDatum(X) ((Datum) ((X) ? 1 : 0)) /* * DatumGetChar * Returns character value of a datum. */ #define DatumGetChar(X) ((char) GET_1_BYTE(X)) /* * CharGetDatum * Returns datum representation for a character. */ #define CharGetDatum(X) ((Datum) SET_1_BYTE(X)) /* * Int8GetDatum * Returns datum representation for an 8-bit integer. */ #define Int8GetDatum(X) ((Datum) SET_1_BYTE(X)) /* * DatumGetUInt8 * Returns 8-bit unsigned integer value of a datum. */ #define DatumGetUInt8(X) ((uint8) GET_1_BYTE(X)) /* * UInt8GetDatum * Returns datum representation for an 8-bit unsigned integer. */ #define UInt8GetDatum(X) ((Datum) SET_1_BYTE(X)) /* * DatumGetInt16 * Returns 16-bit integer value of a datum. */ #define DatumGetInt16(X) ((int16) GET_2_BYTES(X)) /* * Int16GetDatum * Returns datum representation for a 16-bit integer. */ #define Int16GetDatum(X) ((Datum) SET_2_BYTES(X)) /* * DatumGetUInt16 * Returns 16-bit unsigned integer value of a datum. */ #define DatumGetUInt16(X) ((uint16) GET_2_BYTES(X)) /* * UInt16GetDatum * Returns datum representation for a 16-bit unsigned integer. */ #define UInt16GetDatum(X) ((Datum) SET_2_BYTES(X)) /* * DatumGetInt32 * Returns 32-bit integer value of a datum. */ #define DatumGetInt32(X) ((int32) GET_4_BYTES(X)) /* * Int32GetDatum * Returns datum representation for a 32-bit integer. */ #define Int32GetDatum(X) ((Datum) SET_4_BYTES(X)) /* * DatumGetUInt32 * Returns 32-bit unsigned integer value of a datum. */ #define DatumGetUInt32(X) ((uint32) GET_4_BYTES(X)) /* * UInt32GetDatum * Returns datum representation for a 32-bit unsigned integer. */ #define UInt32GetDatum(X) ((Datum) SET_4_BYTES(X)) /* * DatumGetObjectId * Returns object identifier value of a datum. */ #define DatumGetObjectId(X) ((Oid) GET_4_BYTES(X)) /* * ObjectIdGetDatum * Returns datum representation for an object identifier. */ #define ObjectIdGetDatum(X) ((Datum) SET_4_BYTES(X)) /* * DatumGetTransactionId * Returns transaction identifier value of a datum. */ #define DatumGetTransactionId(X) ((TransactionId) GET_4_BYTES(X)) /* * TransactionIdGetDatum * Returns datum representation for a transaction identifier. */ #define TransactionIdGetDatum(X) ((Datum) SET_4_BYTES((X))) /* * DatumGetCommandId * Returns command identifier value of a datum. */ #define DatumGetCommandId(X) ((CommandId) GET_4_BYTES(X)) /* * CommandIdGetDatum * Returns datum representation for a command identifier. */ #define CommandIdGetDatum(X) ((Datum) SET_4_BYTES(X)) /* * DatumGetPointer * Returns pointer value of a datum. */ #define DatumGetPointer(X) ((Pointer) (X)) /* * PointerGetDatum * Returns datum representation for a pointer. */ #define PointerGetDatum(X) ((Datum) (X)) /* * DatumGetCString * Returns C string (null-terminated string) value of a datum. * * Note: C string is not a full-fledged Postgres type at present, * but type input functions use this conversion for their inputs. */ #define DatumGetCString(X) ((char *) DatumGetPointer(X)) /* * CStringGetDatum * Returns datum representation for a C string (null-terminated string). * * Note: C string is not a full-fledged Postgres type at present, * but type output functions use this conversion for their outputs. * Note: CString is pass-by-reference; caller must ensure the pointed-to * value has adequate lifetime. */ #define CStringGetDatum(X) PointerGetDatum(X) /* * DatumGetName * Returns name value of a datum. */ #define DatumGetName(X) ((Name) DatumGetPointer(X)) /* * NameGetDatum * Returns datum representation for a name. * * Note: Name is pass-by-reference; caller must ensure the pointed-to * value has adequate lifetime. */ #define NameGetDatum(X) PointerGetDatum(X) /* * DatumGetInt64 * Returns 64-bit integer value of a datum. * * Note: this macro hides whether int64 is pass by value or by reference. */ #ifdef USE_FLOAT8_BYVAL #define DatumGetInt64(X) ((int64) GET_8_BYTES(X)) #else #define DatumGetInt64(X) (* ((int64 *) DatumGetPointer(X))) #endif /* * Int64GetDatum * Returns datum representation for a 64-bit integer. * * Note: if int64 is pass by reference, this function returns a reference * to palloc'd space. */ #ifdef USE_FLOAT8_BYVAL #define Int64GetDatum(X) ((Datum) SET_8_BYTES(X)) #else extern Datum Int64GetDatum(int64 X); #endif /* * DatumGetFloat4 * Returns 4-byte floating point value of a datum. * * Note: this macro hides whether float4 is pass by value or by reference. */ #ifdef USE_FLOAT4_BYVAL extern float4 DatumGetFloat4(Datum X); #else #define DatumGetFloat4(X) (* ((float4 *) DatumGetPointer(X))) #endif /* * Float4GetDatum * Returns datum representation for a 4-byte floating point number. * * Note: if float4 is pass by reference, this function returns a reference * to palloc'd space. */ extern Datum Float4GetDatum(float4 X); /* * DatumGetFloat8 * Returns 8-byte floating point value of a datum. * * Note: this macro hides whether float8 is pass by value or by reference. */ #ifdef USE_FLOAT8_BYVAL extern float8 DatumGetFloat8(Datum X); #else #define DatumGetFloat8(X) (* ((float8 *) DatumGetPointer(X))) #endif /* * Float8GetDatum * Returns datum representation for an 8-byte floating point number. * * Note: if float8 is pass by reference, this function returns a reference * to palloc'd space. */ extern Datum Float8GetDatum(float8 X); /* * Int64GetDatumFast * Float8GetDatumFast * Float4GetDatumFast * * These macros are intended to allow writing code that does not depend on * whether int64, float8, float4 are pass-by-reference types, while not * sacrificing performance when they are. The argument must be a variable * that will exist and have the same value for as long as the Datum is needed. * In the pass-by-ref case, the address of the variable is taken to use as * the Datum. In the pass-by-val case, these will be the same as the non-Fast * macros. */ #ifdef USE_FLOAT8_BYVAL #define Int64GetDatumFast(X) Int64GetDatum(X) #define Float8GetDatumFast(X) Float8GetDatum(X) #else #define Int64GetDatumFast(X) PointerGetDatum(&(X)) #define Float8GetDatumFast(X) PointerGetDatum(&(X)) #endif #ifdef USE_FLOAT4_BYVAL #define Float4GetDatumFast(X) Float4GetDatum(X) #else #define Float4GetDatumFast(X) PointerGetDatum(&(X)) #endif /* ---------------------------------------------------------------- * Section 3: exception handling definitions * Assert, Trap, etc macros * ---------------------------------------------------------------- */ extern PGDLLIMPORT bool assert_enabled; /* * USE_ASSERT_CHECKING, if defined, turns on all the assertions. * - plai 9/5/90 * * It should _NOT_ be defined in releases or in benchmark copies */ /* * Trap * Generates an exception if the given condition is true. */ #define Trap(condition, errorType) \ do { \ if ((assert_enabled) && (condition)) \ ExceptionalCondition(CppAsString(condition), (errorType), \ __FILE__, __LINE__); \ } while (0) /* * TrapMacro is the same as Trap but it's intended for use in macros: * * #define foo(x) (AssertMacro(x != 0), bar(x)) * * Isn't CPP fun? */ #define TrapMacro(condition, errorType) \ ((bool) ((! assert_enabled) || ! (condition) || \ (ExceptionalCondition(CppAsString(condition), (errorType), \ __FILE__, __LINE__), 0))) #ifndef USE_ASSERT_CHECKING #define Assert(condition) #define AssertMacro(condition) ((void)true) #define AssertArg(condition) #define AssertState(condition) #else #define Assert(condition) \ Trap(!(condition), "FailedAssertion") #define AssertMacro(condition) \ ((void) TrapMacro(!(condition), "FailedAssertion")) #define AssertArg(condition) \ Trap(!(condition), "BadArgument") #define AssertState(condition) \ Trap(!(condition), "BadState") #endif /* USE_ASSERT_CHECKING */ extern void ExceptionalCondition(const char *conditionName, const char *errorType, const char *fileName, int lineNumber) __attribute__((noreturn)); #endif /* POSTGRES_H */ PKBiZserver/getaddrinfo.hnu[/*------------------------------------------------------------------------- * * getaddrinfo.h * Support getaddrinfo() on platforms that don't have it. * * Note: we use our own routines on platforms that don't HAVE_STRUCT_ADDRINFO, * whether or not the library routine getaddrinfo() can be found. This * policy is needed because on some platforms a manually installed libbind.a * may provide getaddrinfo(), yet the system headers may not provide the * struct definitions needed to call it. To avoid conflict with the libbind * definition in such cases, we rename our routines to pg_xxx() via macros. * * This code will also work on platforms where struct addrinfo is defined * in the system headers but no getaddrinfo() can be located. * * Copyright (c) 2003-2012, PostgreSQL Global Development Group * * src/include/getaddrinfo.h * *------------------------------------------------------------------------- */ #ifndef GETADDRINFO_H #define GETADDRINFO_H #include #include /* Various macros that ought to be in , but might not be */ #ifndef EAI_FAIL #ifndef WIN32 #define EAI_BADFLAGS (-1) #define EAI_NONAME (-2) #define EAI_AGAIN (-3) #define EAI_FAIL (-4) #define EAI_FAMILY (-6) #define EAI_SOCKTYPE (-7) #define EAI_SERVICE (-8) #define EAI_MEMORY (-10) #define EAI_SYSTEM (-11) #else /* WIN32 */ #ifdef WIN32_ONLY_COMPILER #ifndef WSA_NOT_ENOUGH_MEMORY #define WSA_NOT_ENOUGH_MEMORY (WSAENOBUFS) #endif #ifndef __BORLANDC__ #define WSATYPE_NOT_FOUND (WSABASEERR+109) #endif #endif #define EAI_AGAIN WSATRY_AGAIN #define EAI_BADFLAGS WSAEINVAL #define EAI_FAIL WSANO_RECOVERY #define EAI_FAMILY WSAEAFNOSUPPORT #define EAI_MEMORY WSA_NOT_ENOUGH_MEMORY #define EAI_NODATA WSANO_DATA #define EAI_NONAME WSAHOST_NOT_FOUND #define EAI_SERVICE WSATYPE_NOT_FOUND #define EAI_SOCKTYPE WSAESOCKTNOSUPPORT #endif /* !WIN32 */ #endif /* !EAI_FAIL */ #ifndef AI_PASSIVE #define AI_PASSIVE 0x0001 #endif #ifndef AI_NUMERICHOST /* * some platforms don't support AI_NUMERICHOST; define as zero if using * the system version of getaddrinfo... */ #if defined(HAVE_STRUCT_ADDRINFO) && defined(HAVE_GETADDRINFO) #define AI_NUMERICHOST 0 #else #define AI_NUMERICHOST 0x0004 #endif #endif #ifndef NI_NUMERICHOST #define NI_NUMERICHOST 1 #endif #ifndef NI_NUMERICSERV #define NI_NUMERICSERV 2 #endif #ifndef NI_NAMEREQD #define NI_NAMEREQD 4 #endif #ifndef NI_MAXHOST #define NI_MAXHOST 1025 #endif #ifndef NI_MAXSERV #define NI_MAXSERV 32 #endif #ifndef HAVE_STRUCT_ADDRINFO #ifndef WIN32 struct addrinfo { int ai_flags; int ai_family; int ai_socktype; int ai_protocol; size_t ai_addrlen; struct sockaddr *ai_addr; char *ai_canonname; struct addrinfo *ai_next; }; #else /* * The order of the structure elements on Win32 doesn't match the * order specified in the standard, but we have to match it for * IPv6 to work. */ struct addrinfo { int ai_flags; int ai_family; int ai_socktype; int ai_protocol; size_t ai_addrlen; char *ai_canonname; struct sockaddr *ai_addr; struct addrinfo *ai_next; }; #endif #endif /* HAVE_STRUCT_ADDRINFO */ #ifndef HAVE_GETADDRINFO /* Rename private copies per comments above */ #ifdef getaddrinfo #undef getaddrinfo #endif #define getaddrinfo pg_getaddrinfo #ifdef freeaddrinfo #undef freeaddrinfo #endif #define freeaddrinfo pg_freeaddrinfo #ifdef gai_strerror #undef gai_strerror #endif #define gai_strerror pg_gai_strerror #ifdef getnameinfo #undef getnameinfo #endif #define getnameinfo pg_getnameinfo extern int getaddrinfo(const char *node, const char *service, const struct addrinfo * hints, struct addrinfo ** res); extern void freeaddrinfo(struct addrinfo * res); extern const char *gai_strerror(int errcode); extern int getnameinfo(const struct sockaddr * sa, int salen, char *node, int nodelen, char *service, int servicelen, int flags); #endif /* HAVE_GETADDRINFO */ #endif /* GETADDRINFO_H */ PKBiZ9server/utils/varbit.hnu[/*------------------------------------------------------------------------- * * varbit.h * Functions for the SQL datatypes BIT() and BIT VARYING(). * * Code originally contributed by Adriaan Joubert. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/varbit.h * *------------------------------------------------------------------------- */ #ifndef VARBIT_H #define VARBIT_H #include #include "fmgr.h" /* * Modeled on struct varlena from postgres.h, but data type is bits8. */ typedef struct { int32 vl_len_; /* varlena header (do not touch directly!) */ int32 bit_len; /* number of valid bits */ bits8 bit_dat[1]; /* bit string, most sig. byte first */ } VarBit; /* * fmgr interface macros * * BIT and BIT VARYING are toastable varlena types. They are the same * as far as representation goes, so we just have one set of macros. */ #define DatumGetVarBitP(X) ((VarBit *) PG_DETOAST_DATUM(X)) #define DatumGetVarBitPCopy(X) ((VarBit *) PG_DETOAST_DATUM_COPY(X)) #define VarBitPGetDatum(X) PointerGetDatum(X) #define PG_GETARG_VARBIT_P(n) DatumGetVarBitP(PG_GETARG_DATUM(n)) #define PG_GETARG_VARBIT_P_COPY(n) DatumGetVarBitPCopy(PG_GETARG_DATUM(n)) #define PG_RETURN_VARBIT_P(x) return VarBitPGetDatum(x) /* Header overhead *in addition to* VARHDRSZ */ #define VARBITHDRSZ sizeof(int32) /* Number of bits in this bit string */ #define VARBITLEN(PTR) (((VarBit *) (PTR))->bit_len) /* Pointer to the first byte containing bit string data */ #define VARBITS(PTR) (((VarBit *) (PTR))->bit_dat) /* Number of bytes in the data section of a bit string */ #define VARBITBYTES(PTR) (VARSIZE(PTR) - VARHDRSZ - VARBITHDRSZ) /* Padding of the bit string at the end (in bits) */ #define VARBITPAD(PTR) (VARBITBYTES(PTR)*BITS_PER_BYTE - VARBITLEN(PTR)) /* Number of bytes needed to store a bit string of a given length */ #define VARBITTOTALLEN(BITLEN) (((BITLEN) + BITS_PER_BYTE-1)/BITS_PER_BYTE + \ VARHDRSZ + VARBITHDRSZ) /* * Maximum number of bits. Several code sites assume no overflow from * computing bitlen + X; VARBITTOTALLEN() has the largest such X. */ #define VARBITMAXLEN (INT_MAX - BITS_PER_BYTE + 1) /* pointer beyond the end of the bit string (like end() in STL containers) */ #define VARBITEND(PTR) (((bits8 *) (PTR)) + VARSIZE(PTR)) /* Mask that will cover exactly one byte, i.e. BITS_PER_BYTE bits */ #define BITMASK 0xFF extern Datum bit_in(PG_FUNCTION_ARGS); extern Datum bit_out(PG_FUNCTION_ARGS); extern Datum bit_recv(PG_FUNCTION_ARGS); extern Datum bit_send(PG_FUNCTION_ARGS); extern Datum bittypmodin(PG_FUNCTION_ARGS); extern Datum bittypmodout(PG_FUNCTION_ARGS); extern Datum varbit_in(PG_FUNCTION_ARGS); extern Datum varbit_out(PG_FUNCTION_ARGS); extern Datum varbit_recv(PG_FUNCTION_ARGS); extern Datum varbit_send(PG_FUNCTION_ARGS); extern Datum varbittypmodin(PG_FUNCTION_ARGS); extern Datum varbittypmodout(PG_FUNCTION_ARGS); extern Datum bit(PG_FUNCTION_ARGS); extern Datum varbit_transform(PG_FUNCTION_ARGS); extern Datum varbit(PG_FUNCTION_ARGS); extern Datum biteq(PG_FUNCTION_ARGS); extern Datum bitne(PG_FUNCTION_ARGS); extern Datum bitlt(PG_FUNCTION_ARGS); extern Datum bitle(PG_FUNCTION_ARGS); extern Datum bitgt(PG_FUNCTION_ARGS); extern Datum bitge(PG_FUNCTION_ARGS); extern Datum bitcmp(PG_FUNCTION_ARGS); /* avoid the names bitand and bitor, since they are C++ keywords */ extern Datum bit_and(PG_FUNCTION_ARGS); extern Datum bit_or(PG_FUNCTION_ARGS); extern Datum bitxor(PG_FUNCTION_ARGS); extern Datum bitnot(PG_FUNCTION_ARGS); extern Datum bitshiftleft(PG_FUNCTION_ARGS); extern Datum bitshiftright(PG_FUNCTION_ARGS); extern Datum bitcat(PG_FUNCTION_ARGS); extern Datum bitsubstr(PG_FUNCTION_ARGS); extern Datum bitsubstr_no_len(PG_FUNCTION_ARGS); extern Datum bitoverlay(PG_FUNCTION_ARGS); extern Datum bitoverlay_no_len(PG_FUNCTION_ARGS); extern Datum bitlength(PG_FUNCTION_ARGS); extern Datum bitoctetlength(PG_FUNCTION_ARGS); extern Datum bitfromint4(PG_FUNCTION_ARGS); extern Datum bittoint4(PG_FUNCTION_ARGS); extern Datum bitfromint8(PG_FUNCTION_ARGS); extern Datum bittoint8(PG_FUNCTION_ARGS); extern Datum bitposition(PG_FUNCTION_ARGS); extern Datum bitsetbit(PG_FUNCTION_ARGS); extern Datum bitgetbit(PG_FUNCTION_ARGS); #endif PKBiZserver/utils/datum.hnu[/*------------------------------------------------------------------------- * * datum.h * POSTGRES Datum (abstract data type) manipulation routines. * * These routines are driven by the 'typbyval' and 'typlen' information, * which must previously have been obtained by the caller for the datatype * of the Datum. (We do it this way because in most situations the caller * can look up the info just once and use it for many per-datum operations.) * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/datum.h * *------------------------------------------------------------------------- */ #ifndef DATUM_H #define DATUM_H /* * datumGetSize - find the "real" length of a datum */ extern Size datumGetSize(Datum value, bool typByVal, int typLen); /* * datumCopy - make a copy of a datum. * * If the datatype is pass-by-reference, memory is obtained with palloc(). */ extern Datum datumCopy(Datum value, bool typByVal, int typLen); /* * datumFree - free a datum previously allocated by datumCopy, if any. * * Does nothing if datatype is pass-by-value. */ extern void datumFree(Datum value, bool typByVal, int typLen); /* * datumIsEqual * return true if two datums of the same type are equal, false otherwise. * * XXX : See comments in the code for restrictions! */ extern bool datumIsEqual(Datum value1, Datum value2, bool typByVal, int typLen); #endif /* DATUM_H */ PKBiZ!?;2;2server/utils/elog.hnu[/*------------------------------------------------------------------------- * * elog.h * POSTGRES error reporting/logging definitions. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/elog.h * *------------------------------------------------------------------------- */ #ifndef ELOG_H #define ELOG_H #include /* Error level codes */ #define DEBUG5 10 /* Debugging messages, in categories of * decreasing detail. */ #define DEBUG4 11 #define DEBUG3 12 #define DEBUG2 13 #define DEBUG1 14 /* used by GUC debug_* variables */ #define LOG 15 /* Server operational messages; sent only to * server log by default. */ #define COMMERROR 16 /* Client communication problems; same as LOG * for server reporting, but never sent to * client. */ #define INFO 17 /* Messages specifically requested by user (eg * VACUUM VERBOSE output); always sent to * client regardless of client_min_messages, * but by default not sent to server log. */ #define NOTICE 18 /* Helpful messages to users about query * operation; sent to client and server log by * default. */ #define WARNING 19 /* Warnings. NOTICE is for expected messages * like implicit sequence creation by SERIAL. * WARNING is for unexpected messages. */ #define ERROR 20 /* user error - abort transaction; return to * known state */ /* Save ERROR value in PGERROR so it can be restored when Win32 includes * modify it. We have to use a constant rather than ERROR because macros * are expanded only when referenced outside macros. */ #ifdef WIN32 #define PGERROR 20 #endif #define FATAL 21 /* fatal error - abort process */ #define PANIC 22 /* take down the other backends with me */ /* #define DEBUG DEBUG1 */ /* Backward compatibility with pre-7.3 */ /* macros for representing SQLSTATE strings compactly */ #define PGSIXBIT(ch) (((ch) - '0') & 0x3F) #define PGUNSIXBIT(val) (((val) & 0x3F) + '0') #define MAKE_SQLSTATE(ch1,ch2,ch3,ch4,ch5) \ (PGSIXBIT(ch1) + (PGSIXBIT(ch2) << 6) + (PGSIXBIT(ch3) << 12) + \ (PGSIXBIT(ch4) << 18) + (PGSIXBIT(ch5) << 24)) /* These macros depend on the fact that '0' becomes a zero in SIXBIT */ #define ERRCODE_TO_CATEGORY(ec) ((ec) & ((1 << 12) - 1)) #define ERRCODE_IS_CATEGORY(ec) (((ec) & ~((1 << 12) - 1)) == 0) /* SQLSTATE codes for errors are defined in a separate file */ #include "utils/errcodes.h" /* Which __func__ symbol do we have, if any? */ #ifdef HAVE_FUNCNAME__FUNC #define PG_FUNCNAME_MACRO __func__ #else #ifdef HAVE_FUNCNAME__FUNCTION #define PG_FUNCNAME_MACRO __FUNCTION__ #else #define PG_FUNCNAME_MACRO NULL #endif #endif /*---------- * New-style error reporting API: to be used in this way: * ereport(ERROR, * (errcode(ERRCODE_UNDEFINED_CURSOR), * errmsg("portal \"%s\" not found", stmt->portalname), * ... other errxxx() fields as needed ...)); * * The error level is required, and so is a primary error message (errmsg * or errmsg_internal). All else is optional. errcode() defaults to * ERRCODE_INTERNAL_ERROR if elevel is ERROR or more, ERRCODE_WARNING * if elevel is WARNING, or ERRCODE_SUCCESSFUL_COMPLETION if elevel is * NOTICE or below. * * ereport_domain() allows a message domain to be specified, for modules that * wish to use a different message catalog from the backend's. To avoid having * one copy of the default text domain per .o file, we define it as NULL here * and have errstart insert the default text domain. Modules can either use * ereport_domain() directly, or preferably they can override the TEXTDOMAIN * macro. *---------- */ #define ereport_domain(elevel, domain, rest) \ (errstart(elevel, __FILE__, __LINE__, PG_FUNCNAME_MACRO, domain) ? \ (errfinish rest) : (void) 0) #define ereport(elevel, rest) \ ereport_domain(elevel, TEXTDOMAIN, rest) #define TEXTDOMAIN NULL extern bool errstart(int elevel, const char *filename, int lineno, const char *funcname, const char *domain); extern void errfinish(int dummy,...); extern int errcode(int sqlerrcode); extern int errcode_for_file_access(void); extern int errcode_for_socket_access(void); extern int errmsg(const char *fmt,...) /* This extension allows gcc to check the format string for consistency with the supplied arguments. */ __attribute__((format(PG_PRINTF_ATTRIBUTE, 1, 2))); extern int errmsg_internal(const char *fmt,...) /* This extension allows gcc to check the format string for consistency with the supplied arguments. */ __attribute__((format(PG_PRINTF_ATTRIBUTE, 1, 2))); extern int errmsg_plural(const char *fmt_singular, const char *fmt_plural, unsigned long n,...) /* This extension allows gcc to check the format string for consistency with the supplied arguments. */ __attribute__((format(PG_PRINTF_ATTRIBUTE, 1, 4))) __attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 4))); extern int errdetail(const char *fmt,...) /* This extension allows gcc to check the format string for consistency with the supplied arguments. */ __attribute__((format(PG_PRINTF_ATTRIBUTE, 1, 2))); extern int errdetail_internal(const char *fmt,...) /* This extension allows gcc to check the format string for consistency with the supplied arguments. */ __attribute__((format(PG_PRINTF_ATTRIBUTE, 1, 2))); extern int errdetail_log(const char *fmt,...) /* This extension allows gcc to check the format string for consistency with the supplied arguments. */ __attribute__((format(PG_PRINTF_ATTRIBUTE, 1, 2))); extern int errdetail_plural(const char *fmt_singular, const char *fmt_plural, unsigned long n,...) /* This extension allows gcc to check the format string for consistency with the supplied arguments. */ __attribute__((format(PG_PRINTF_ATTRIBUTE, 1, 4))) __attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 4))); extern int errhint(const char *fmt,...) /* This extension allows gcc to check the format string for consistency with the supplied arguments. */ __attribute__((format(PG_PRINTF_ATTRIBUTE, 1, 2))); extern int errcontext(const char *fmt,...) /* This extension allows gcc to check the format string for consistency with the supplied arguments. */ __attribute__((format(PG_PRINTF_ATTRIBUTE, 1, 2))); extern int errhidestmt(bool hide_stmt); extern int errfunction(const char *funcname); extern int errposition(int cursorpos); extern int internalerrposition(int cursorpos); extern int internalerrquery(const char *query); extern int geterrcode(void); extern int geterrposition(void); extern int getinternalerrposition(void); /*---------- * Old-style error reporting API: to be used in this way: * elog(ERROR, "portal \"%s\" not found", stmt->portalname); *---------- */ #define elog elog_start(__FILE__, __LINE__, PG_FUNCNAME_MACRO), elog_finish extern void elog_start(const char *filename, int lineno, const char *funcname); extern void elog_finish(int elevel, const char *fmt,...) /* This extension allows gcc to check the format string for consistency with the supplied arguments. */ __attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 3))); /* Support for constructing error strings separately from ereport() calls */ extern void pre_format_elog_string(int errnumber, const char *domain); extern char * format_elog_string(const char *fmt,...) /* This extension allows gcc to check the format string for consistency with the supplied arguments. */ __attribute__((format(PG_PRINTF_ATTRIBUTE, 1, 2))); /* Support for attaching context information to error reports */ typedef struct ErrorContextCallback { struct ErrorContextCallback *previous; void (*callback) (void *arg); void *arg; } ErrorContextCallback; extern PGDLLIMPORT ErrorContextCallback *error_context_stack; /*---------- * API for catching ereport(ERROR) exits. Use these macros like so: * * PG_TRY(); * { * ... code that might throw ereport(ERROR) ... * } * PG_CATCH(); * { * ... error recovery code ... * } * PG_END_TRY(); * * (The braces are not actually necessary, but are recommended so that * pg_indent will indent the construct nicely.) The error recovery code * can optionally do PG_RE_THROW() to propagate the same error outwards. * * Note: while the system will correctly propagate any new ereport(ERROR) * occurring in the recovery section, there is a small limit on the number * of levels this will work for. It's best to keep the error recovery * section simple enough that it can't generate any new errors, at least * not before popping the error stack. * * Note: an ereport(FATAL) will not be caught by this construct; control will * exit straight through proc_exit(). Therefore, do NOT put any cleanup * of non-process-local resources into the error recovery section, at least * not without taking thought for what will happen during ereport(FATAL). * The PG_ENSURE_ERROR_CLEANUP macros provided by storage/ipc.h may be * helpful in such cases. *---------- */ #define PG_TRY() \ do { \ sigjmp_buf *save_exception_stack = PG_exception_stack; \ ErrorContextCallback *save_context_stack = error_context_stack; \ sigjmp_buf local_sigjmp_buf; \ if (sigsetjmp(local_sigjmp_buf, 0) == 0) \ { \ PG_exception_stack = &local_sigjmp_buf #define PG_CATCH() \ } \ else \ { \ PG_exception_stack = save_exception_stack; \ error_context_stack = save_context_stack #define PG_END_TRY() \ } \ PG_exception_stack = save_exception_stack; \ error_context_stack = save_context_stack; \ } while (0) /* * gcc understands __attribute__((noreturn)); for other compilers, insert * a useless exit() call so that the compiler gets the point. */ #ifdef __GNUC__ #define PG_RE_THROW() \ pg_re_throw() #else #define PG_RE_THROW() \ (pg_re_throw(), exit(1)) #endif extern PGDLLIMPORT sigjmp_buf *PG_exception_stack; /* Stuff that error handlers might want to use */ /* * ErrorData holds the data accumulated during any one ereport() cycle. * Any non-NULL pointers must point to palloc'd data. * (The const pointers are an exception; we assume they point at non-freeable * constant strings.) */ typedef struct ErrorData { int elevel; /* error level */ bool output_to_server; /* will report to server log? */ bool output_to_client; /* will report to client? */ bool show_funcname; /* true to force funcname inclusion */ bool hide_stmt; /* true to prevent STATEMENT: inclusion */ const char *filename; /* __FILE__ of ereport() call */ int lineno; /* __LINE__ of ereport() call */ const char *funcname; /* __func__ of ereport() call */ const char *domain; /* message domain */ int sqlerrcode; /* encoded ERRSTATE */ char *message; /* primary error message */ char *detail; /* detail error message */ char *detail_log; /* detail error message for server log only */ char *hint; /* hint message */ char *context; /* context message */ int cursorpos; /* cursor index into query string */ int internalpos; /* cursor index into internalquery */ char *internalquery; /* text of internally-generated query */ int saved_errno; /* errno at entry */ } ErrorData; extern void EmitErrorReport(void); extern ErrorData *CopyErrorData(void); extern void FreeErrorData(ErrorData *edata); extern void FlushErrorState(void); extern void ReThrowError(ErrorData *edata) __attribute__((noreturn)); extern void pg_re_throw(void) __attribute__((noreturn)); /* Hook for intercepting messages before they are sent to the server log */ typedef void (*emit_log_hook_type) (ErrorData *edata); extern PGDLLIMPORT emit_log_hook_type emit_log_hook; /* GUC-configurable parameters */ typedef enum { PGERROR_TERSE, /* single-line error messages */ PGERROR_DEFAULT, /* recommended style */ PGERROR_VERBOSE /* all the facts, ma'am */ } PGErrorVerbosity; extern int Log_error_verbosity; extern char *Log_line_prefix; extern int Log_destination; /* Log destination bitmap */ #define LOG_DESTINATION_STDERR 1 #define LOG_DESTINATION_SYSLOG 2 #define LOG_DESTINATION_EVENTLOG 4 #define LOG_DESTINATION_CSVLOG 8 /* Other exported functions */ extern void DebugFileOpen(void); extern char *unpack_sql_state(int sql_state); extern bool in_error_recursion_trouble(void); #ifdef HAVE_SYSLOG extern void set_syslog_parameters(const char *ident, int facility); #endif /* * Write errors to stderr (or by equal means when stderr is * not available). Used before ereport/elog can be used * safely (memory context, GUC load etc) */ extern void write_stderr(const char *fmt,...) /* This extension allows gcc to check the format string for consistency with the supplied arguments. */ __attribute__((format(PG_PRINTF_ATTRIBUTE, 1, 2))); #endif /* ELOG_H */ PKBiZX[CCserver/utils/ascii.hnu[/*----------------------------------------------------------------------- * ascii.h * * Portions Copyright (c) 1999-2012, PostgreSQL Global Development Group * * src/include/utils/ascii.h * *----------------------------------------------------------------------- */ #ifndef _ASCII_H_ #define _ASCII_H_ #include "fmgr.h" extern Datum to_ascii_encname(PG_FUNCTION_ARGS); extern Datum to_ascii_enc(PG_FUNCTION_ARGS); extern Datum to_ascii_default(PG_FUNCTION_ARGS); extern void ascii_safe_strlcpy(char *dest, const char *src, size_t destsiz); #endif /* _ASCII_H_ */ PKBiZ_t  server/utils/rbtree.hnu[/*------------------------------------------------------------------------- * * rbtree.h * interface for PostgreSQL generic Red-Black binary tree package * * Copyright (c) 2009-2012, PostgreSQL Global Development Group * * IDENTIFICATION * src/include/utils/rbtree.h * *------------------------------------------------------------------------- */ #ifndef RBTREE_H #define RBTREE_H /* * RBNode is intended to be used as the first field of a larger struct, * whose additional fields carry whatever payload data the caller needs * for a tree entry. (The total size of that larger struct is passed to * rb_create.) RBNode is declared here to support this usage, but * callers must treat it as an opaque struct. */ typedef struct RBNode { char iteratorState; /* workspace for iterating through tree */ char color; /* node's current color, red or black */ struct RBNode *left; /* left child, or RBNIL if none */ struct RBNode *right; /* right child, or RBNIL if none */ struct RBNode *parent; /* parent, or NULL (not RBNIL!) if none */ } RBNode; /* Opaque struct representing a whole tree */ typedef struct RBTree RBTree; /* Available tree iteration orderings */ typedef enum RBOrderControl { LeftRightWalk, /* inorder: left child, node, right child */ RightLeftWalk, /* reverse inorder: right, node, left */ DirectWalk, /* preorder: node, left child, right child */ InvertedWalk /* postorder: left child, right child, node */ } RBOrderControl; /* Support functions to be provided by caller */ typedef int (*rb_comparator) (const RBNode *a, const RBNode *b, void *arg); typedef void (*rb_combiner) (RBNode *existing, const RBNode *newdata, void *arg); typedef RBNode *(*rb_allocfunc) (void *arg); typedef void (*rb_freefunc) (RBNode *x, void *arg); extern RBTree *rb_create(Size node_size, rb_comparator comparator, rb_combiner combiner, rb_allocfunc allocfunc, rb_freefunc freefunc, void *arg); extern RBNode *rb_find(RBTree *rb, const RBNode *data); extern RBNode *rb_leftmost(RBTree *rb); extern RBNode *rb_insert(RBTree *rb, const RBNode *data, bool *isNew); extern void rb_delete(RBTree *rb, RBNode *node); extern void rb_begin_iterate(RBTree *rb, RBOrderControl ctrl); extern RBNode *rb_iterate(RBTree *rb); #endif /* RBTREE_H */ PKBiZ; ˃server/utils/tzparser.hnu[/*------------------------------------------------------------------------- * * tzparser.h * Timezone offset file parsing definitions. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/tzparser.h * *------------------------------------------------------------------------- */ #ifndef TZPARSER_H #define TZPARSER_H #include "utils/datetime.h" /* * The result of parsing a timezone configuration file is an array of * these structs, in order by abbrev. We export this because datetime.c * needs it. */ typedef struct tzEntry { /* the actual data */ char *abbrev; /* TZ abbreviation (downcased) */ char *zone; /* zone name if dynamic abbrev, else NULL */ /* for a dynamic abbreviation, offset/is_dst are not used */ int offset; /* offset in seconds from UTC */ bool is_dst; /* true if a DST abbreviation */ /* source information (for error messages) */ int lineno; const char *filename; } tzEntry; extern TimeZoneAbbrevTable *load_tzoffsets(const char *filename); #endif /* TZPARSER_H */ PKBiZ5server/utils/relmapper.hnu[/*------------------------------------------------------------------------- * * relmapper.h * Catalog-to-filenode mapping * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/relmapper.h * *------------------------------------------------------------------------- */ #ifndef RELMAPPER_H #define RELMAPPER_H #include "access/xlog.h" /* ---------------- * relmap-related XLOG entries * ---------------- */ #define XLOG_RELMAP_UPDATE 0x00 typedef struct xl_relmap_update { Oid dbid; /* database ID, or 0 for shared map */ Oid tsid; /* database's tablespace, or pg_global */ int32 nbytes; /* size of relmap data */ char data[1]; /* VARIABLE LENGTH ARRAY */ } xl_relmap_update; #define MinSizeOfRelmapUpdate offsetof(xl_relmap_update, data) extern Oid RelationMapOidToFilenode(Oid relationId, bool shared); extern void RelationMapUpdateMap(Oid relationId, Oid fileNode, bool shared, bool immediate); extern void RelationMapRemoveMapping(Oid relationId); extern void RelationMapInvalidate(bool shared); extern void RelationMapInvalidateAll(void); extern void AtCCI_RelationMap(void); extern void AtEOXact_RelationMap(bool isCommit); extern void AtPrepare_RelationMap(void); extern void CheckPointRelationMap(void); extern void RelationMapFinishBootstrap(void); extern void RelationMapInitialize(void); extern void RelationMapInitializePhase2(void); extern void RelationMapInitializePhase3(void); extern void relmap_redo(XLogRecPtr lsn, XLogRecord *record); extern void relmap_desc(StringInfo buf, uint8 xl_info, char *rec); #endif /* RELMAPPER_H */ PKBiZbiOOserver/utils/bytea.hnu[/*------------------------------------------------------------------------- * * bytea.h * Declarations for BYTEA data type support. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/bytea.h * *------------------------------------------------------------------------- */ #ifndef BYTEA_H #define BYTEA_H #include "fmgr.h" typedef enum { BYTEA_OUTPUT_ESCAPE, BYTEA_OUTPUT_HEX } ByteaOutputType; extern int bytea_output; /* ByteaOutputType, but int for GUC enum */ /* functions are in utils/adt/varlena.c */ extern Datum byteain(PG_FUNCTION_ARGS); extern Datum byteaout(PG_FUNCTION_ARGS); extern Datum bytearecv(PG_FUNCTION_ARGS); extern Datum byteasend(PG_FUNCTION_ARGS); extern Datum byteaoctetlen(PG_FUNCTION_ARGS); extern Datum byteaGetByte(PG_FUNCTION_ARGS); extern Datum byteaGetBit(PG_FUNCTION_ARGS); extern Datum byteaSetByte(PG_FUNCTION_ARGS); extern Datum byteaSetBit(PG_FUNCTION_ARGS); extern Datum byteaeq(PG_FUNCTION_ARGS); extern Datum byteane(PG_FUNCTION_ARGS); extern Datum bytealt(PG_FUNCTION_ARGS); extern Datum byteale(PG_FUNCTION_ARGS); extern Datum byteagt(PG_FUNCTION_ARGS); extern Datum byteage(PG_FUNCTION_ARGS); extern Datum byteacmp(PG_FUNCTION_ARGS); extern Datum byteacat(PG_FUNCTION_ARGS); extern Datum byteapos(PG_FUNCTION_ARGS); extern Datum bytea_substr(PG_FUNCTION_ARGS); extern Datum bytea_substr_no_len(PG_FUNCTION_ARGS); extern Datum byteaoverlay(PG_FUNCTION_ARGS); extern Datum byteaoverlay_no_len(PG_FUNCTION_ARGS); #endif /* BYTEA_H */ PKBiZIserver/utils/attoptcache.hnu[/*------------------------------------------------------------------------- * * attoptcache.h * Attribute options cache. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/attoptcache.h * *------------------------------------------------------------------------- */ #ifndef ATTOPTCACHE_H #define ATTOPTCACHE_H /* * Attribute options. */ typedef struct AttributeOpts { int32 vl_len_; /* varlena header (do not touch directly!) */ float8 n_distinct; float8 n_distinct_inherited; } AttributeOpts; AttributeOpts *get_attribute_options(Oid spcid, int attnum); #endif /* ATTOPTCACHE_H */ PKBiZ)&&server/utils/timestamp.hnu[/*------------------------------------------------------------------------- * * timestamp.h * Definitions for the SQL92 "timestamp" and "interval" types. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/timestamp.h * *------------------------------------------------------------------------- */ #ifndef TIMESTAMP_H #define TIMESTAMP_H #include "datatype/timestamp.h" #include "fmgr.h" #include "pgtime.h" /* * Macros for fmgr-callable functions. * * For Timestamp, we make use of the same support routines as for int64 * or float8. Therefore Timestamp is pass-by-reference if and only if * int64 or float8 is! */ #ifdef HAVE_INT64_TIMESTAMP #define DatumGetTimestamp(X) ((Timestamp) DatumGetInt64(X)) #define DatumGetTimestampTz(X) ((TimestampTz) DatumGetInt64(X)) #define DatumGetIntervalP(X) ((Interval *) DatumGetPointer(X)) #define TimestampGetDatum(X) Int64GetDatum(X) #define TimestampTzGetDatum(X) Int64GetDatum(X) #define IntervalPGetDatum(X) PointerGetDatum(X) #define PG_GETARG_TIMESTAMP(n) DatumGetTimestamp(PG_GETARG_DATUM(n)) #define PG_GETARG_TIMESTAMPTZ(n) DatumGetTimestampTz(PG_GETARG_DATUM(n)) #define PG_GETARG_INTERVAL_P(n) DatumGetIntervalP(PG_GETARG_DATUM(n)) #define PG_RETURN_TIMESTAMP(x) return TimestampGetDatum(x) #define PG_RETURN_TIMESTAMPTZ(x) return TimestampTzGetDatum(x) #define PG_RETURN_INTERVAL_P(x) return IntervalPGetDatum(x) #else /* !HAVE_INT64_TIMESTAMP */ #define DatumGetTimestamp(X) ((Timestamp) DatumGetFloat8(X)) #define DatumGetTimestampTz(X) ((TimestampTz) DatumGetFloat8(X)) #define DatumGetIntervalP(X) ((Interval *) DatumGetPointer(X)) #define TimestampGetDatum(X) Float8GetDatum(X) #define TimestampTzGetDatum(X) Float8GetDatum(X) #define IntervalPGetDatum(X) PointerGetDatum(X) #define PG_GETARG_TIMESTAMP(n) DatumGetTimestamp(PG_GETARG_DATUM(n)) #define PG_GETARG_TIMESTAMPTZ(n) DatumGetTimestampTz(PG_GETARG_DATUM(n)) #define PG_GETARG_INTERVAL_P(n) DatumGetIntervalP(PG_GETARG_DATUM(n)) #define PG_RETURN_TIMESTAMP(x) return TimestampGetDatum(x) #define PG_RETURN_TIMESTAMPTZ(x) return TimestampTzGetDatum(x) #define PG_RETURN_INTERVAL_P(x) return IntervalPGetDatum(x) #endif /* HAVE_INT64_TIMESTAMP */ #define TIMESTAMP_MASK(b) (1 << (b)) #define INTERVAL_MASK(b) (1 << (b)) /* Macros to handle packing and unpacking the typmod field for intervals */ #define INTERVAL_FULL_RANGE (0x7FFF) #define INTERVAL_RANGE_MASK (0x7FFF) #define INTERVAL_FULL_PRECISION (0xFFFF) #define INTERVAL_PRECISION_MASK (0xFFFF) #define INTERVAL_TYPMOD(p,r) ((((r) & INTERVAL_RANGE_MASK) << 16) | ((p) & INTERVAL_PRECISION_MASK)) #define INTERVAL_PRECISION(t) ((t) & INTERVAL_PRECISION_MASK) #define INTERVAL_RANGE(t) (((t) >> 16) & INTERVAL_RANGE_MASK) #ifdef HAVE_INT64_TIMESTAMP #define TimestampTzPlusMilliseconds(tz,ms) ((tz) + ((ms) * (int64) 1000)) #else #define TimestampTzPlusMilliseconds(tz,ms) ((tz) + ((ms) / 1000.0)) #endif /* Set at postmaster start */ extern TimestampTz PgStartTime; /* Set at configuration reload */ extern TimestampTz PgReloadTime; /* * timestamp.c prototypes */ extern Datum timestamp_in(PG_FUNCTION_ARGS); extern Datum timestamp_out(PG_FUNCTION_ARGS); extern Datum timestamp_recv(PG_FUNCTION_ARGS); extern Datum timestamp_send(PG_FUNCTION_ARGS); extern Datum timestamptypmodin(PG_FUNCTION_ARGS); extern Datum timestamptypmodout(PG_FUNCTION_ARGS); extern Datum timestamp_transform(PG_FUNCTION_ARGS); extern Datum timestamp_scale(PG_FUNCTION_ARGS); extern Datum timestamp_eq(PG_FUNCTION_ARGS); extern Datum timestamp_ne(PG_FUNCTION_ARGS); extern Datum timestamp_lt(PG_FUNCTION_ARGS); extern Datum timestamp_le(PG_FUNCTION_ARGS); extern Datum timestamp_ge(PG_FUNCTION_ARGS); extern Datum timestamp_gt(PG_FUNCTION_ARGS); extern Datum timestamp_finite(PG_FUNCTION_ARGS); extern Datum timestamp_cmp(PG_FUNCTION_ARGS); extern Datum timestamp_sortsupport(PG_FUNCTION_ARGS); extern Datum timestamp_hash(PG_FUNCTION_ARGS); extern Datum timestamp_smaller(PG_FUNCTION_ARGS); extern Datum timestamp_larger(PG_FUNCTION_ARGS); extern Datum timestamp_eq_timestamptz(PG_FUNCTION_ARGS); extern Datum timestamp_ne_timestamptz(PG_FUNCTION_ARGS); extern Datum timestamp_lt_timestamptz(PG_FUNCTION_ARGS); extern Datum timestamp_le_timestamptz(PG_FUNCTION_ARGS); extern Datum timestamp_gt_timestamptz(PG_FUNCTION_ARGS); extern Datum timestamp_ge_timestamptz(PG_FUNCTION_ARGS); extern Datum timestamp_cmp_timestamptz(PG_FUNCTION_ARGS); extern Datum timestamptz_eq_timestamp(PG_FUNCTION_ARGS); extern Datum timestamptz_ne_timestamp(PG_FUNCTION_ARGS); extern Datum timestamptz_lt_timestamp(PG_FUNCTION_ARGS); extern Datum timestamptz_le_timestamp(PG_FUNCTION_ARGS); extern Datum timestamptz_gt_timestamp(PG_FUNCTION_ARGS); extern Datum timestamptz_ge_timestamp(PG_FUNCTION_ARGS); extern Datum timestamptz_cmp_timestamp(PG_FUNCTION_ARGS); extern Datum interval_in(PG_FUNCTION_ARGS); extern Datum interval_out(PG_FUNCTION_ARGS); extern Datum interval_recv(PG_FUNCTION_ARGS); extern Datum interval_send(PG_FUNCTION_ARGS); extern Datum intervaltypmodin(PG_FUNCTION_ARGS); extern Datum intervaltypmodout(PG_FUNCTION_ARGS); extern Datum interval_transform(PG_FUNCTION_ARGS); extern Datum interval_scale(PG_FUNCTION_ARGS); extern Datum interval_eq(PG_FUNCTION_ARGS); extern Datum interval_ne(PG_FUNCTION_ARGS); extern Datum interval_lt(PG_FUNCTION_ARGS); extern Datum interval_le(PG_FUNCTION_ARGS); extern Datum interval_ge(PG_FUNCTION_ARGS); extern Datum interval_gt(PG_FUNCTION_ARGS); extern Datum interval_finite(PG_FUNCTION_ARGS); extern Datum interval_cmp(PG_FUNCTION_ARGS); extern Datum interval_hash(PG_FUNCTION_ARGS); extern Datum interval_smaller(PG_FUNCTION_ARGS); extern Datum interval_larger(PG_FUNCTION_ARGS); extern Datum interval_justify_interval(PG_FUNCTION_ARGS); extern Datum interval_justify_hours(PG_FUNCTION_ARGS); extern Datum interval_justify_days(PG_FUNCTION_ARGS); extern Datum timestamp_trunc(PG_FUNCTION_ARGS); extern Datum interval_trunc(PG_FUNCTION_ARGS); extern Datum timestamp_part(PG_FUNCTION_ARGS); extern Datum interval_part(PG_FUNCTION_ARGS); extern Datum timestamp_zone(PG_FUNCTION_ARGS); extern Datum timestamp_izone(PG_FUNCTION_ARGS); extern Datum timestamp_timestamptz(PG_FUNCTION_ARGS); extern Datum timestamptz_in(PG_FUNCTION_ARGS); extern Datum timestamptz_out(PG_FUNCTION_ARGS); extern Datum timestamptz_recv(PG_FUNCTION_ARGS); extern Datum timestamptz_send(PG_FUNCTION_ARGS); extern Datum timestamptztypmodin(PG_FUNCTION_ARGS); extern Datum timestamptztypmodout(PG_FUNCTION_ARGS); extern Datum timestamptz_scale(PG_FUNCTION_ARGS); extern Datum timestamptz_timestamp(PG_FUNCTION_ARGS); extern Datum timestamptz_zone(PG_FUNCTION_ARGS); extern Datum timestamptz_izone(PG_FUNCTION_ARGS); extern Datum timestamptz_timestamptz(PG_FUNCTION_ARGS); extern Datum interval_um(PG_FUNCTION_ARGS); extern Datum interval_pl(PG_FUNCTION_ARGS); extern Datum interval_mi(PG_FUNCTION_ARGS); extern Datum interval_mul(PG_FUNCTION_ARGS); extern Datum mul_d_interval(PG_FUNCTION_ARGS); extern Datum interval_div(PG_FUNCTION_ARGS); extern Datum interval_accum(PG_FUNCTION_ARGS); extern Datum interval_avg(PG_FUNCTION_ARGS); extern Datum timestamp_mi(PG_FUNCTION_ARGS); extern Datum timestamp_pl_interval(PG_FUNCTION_ARGS); extern Datum timestamp_mi_interval(PG_FUNCTION_ARGS); extern Datum timestamp_age(PG_FUNCTION_ARGS); extern Datum overlaps_timestamp(PG_FUNCTION_ARGS); extern Datum timestamptz_pl_interval(PG_FUNCTION_ARGS); extern Datum timestamptz_mi_interval(PG_FUNCTION_ARGS); extern Datum timestamptz_age(PG_FUNCTION_ARGS); extern Datum timestamptz_trunc(PG_FUNCTION_ARGS); extern Datum timestamptz_part(PG_FUNCTION_ARGS); extern Datum now(PG_FUNCTION_ARGS); extern Datum statement_timestamp(PG_FUNCTION_ARGS); extern Datum clock_timestamp(PG_FUNCTION_ARGS); extern Datum pg_postmaster_start_time(PG_FUNCTION_ARGS); extern Datum pg_conf_load_time(PG_FUNCTION_ARGS); extern Datum generate_series_timestamp(PG_FUNCTION_ARGS); extern Datum generate_series_timestamptz(PG_FUNCTION_ARGS); /* Internal routines (not fmgr-callable) */ extern TimestampTz GetCurrentTimestamp(void); extern void TimestampDifference(TimestampTz start_time, TimestampTz stop_time, long *secs, int *microsecs); extern bool TimestampDifferenceExceeds(TimestampTz start_time, TimestampTz stop_time, int msec); extern TimestampTz time_t_to_timestamptz(pg_time_t tm); extern pg_time_t timestamptz_to_time_t(TimestampTz t); extern const char *timestamptz_to_str(TimestampTz t); extern int tm2timestamp(struct pg_tm * tm, fsec_t fsec, int *tzp, Timestamp *dt); extern int timestamp2tm(Timestamp dt, int *tzp, struct pg_tm * tm, fsec_t *fsec, const char **tzn, pg_tz *attimezone); extern void dt2time(Timestamp dt, int *hour, int *min, int *sec, fsec_t *fsec); extern int interval2tm(Interval span, struct pg_tm * tm, fsec_t *fsec); extern int tm2interval(struct pg_tm * tm, fsec_t fsec, Interval *span); extern Timestamp SetEpochTimestamp(void); extern void GetEpochTime(struct pg_tm * tm); extern int timestamp_cmp_internal(Timestamp dt1, Timestamp dt2); /* timestamp comparison works for timestamptz also */ #define timestamptz_cmp_internal(dt1,dt2) timestamp_cmp_internal(dt1, dt2) extern int isoweek2j(int year, int week); extern void isoweek2date(int woy, int *year, int *mon, int *mday); extern void isoweekdate2date(int isoweek, int isowday, int *year, int *mon, int *mday); extern int date2isoweek(int year, int mon, int mday); extern int date2isoyear(int year, int mon, int mday); extern int date2isoyearday(int year, int mon, int mday); #endif /* TIMESTAMP_H */ PKBiZa"rrserver/utils/pg_crc.hnu[/* * pg_crc.h * * PostgreSQL CRC support * * See Ross Williams' excellent introduction * A PAINLESS GUIDE TO CRC ERROR DETECTION ALGORITHMS, available from * http://www.ross.net/crc/ or several other net sites. * * We use a normal (not "reflected", in Williams' terms) CRC, using initial * all-ones register contents and a final bit inversion. * * The 64-bit variant is not used as of PostgreSQL 8.1, but we retain the * code for possible future use. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/pg_crc.h */ #ifndef PG_CRC_H #define PG_CRC_H /* ugly hack to let this be used in frontend and backend code on Cygwin */ #ifdef FRONTEND #define CRCDLLIMPORT #else #define CRCDLLIMPORT PGDLLIMPORT #endif typedef uint32 pg_crc32; /* Initialize a CRC accumulator */ #define INIT_CRC32(crc) ((crc) = 0xFFFFFFFF) /* Finish a CRC calculation */ #define FIN_CRC32(crc) ((crc) ^= 0xFFFFFFFF) /* Accumulate some (more) bytes into a CRC */ #define COMP_CRC32(crc, data, len) \ do { \ const unsigned char *__data = (const unsigned char *) (data); \ uint32 __len = (len); \ \ while (__len-- > 0) \ { \ int __tab_index = ((int) ((crc) >> 24) ^ *__data++) & 0xFF; \ (crc) = pg_crc32_table[__tab_index] ^ ((crc) << 8); \ } \ } while (0) /* Check for equality of two CRCs */ #define EQ_CRC32(c1,c2) ((c1) == (c2)) /* Constant table for CRC calculation */ extern CRCDLLIMPORT const uint32 pg_crc32_table[]; #ifdef PROVIDE_64BIT_CRC /* * If we use a 64-bit integer type, then a 64-bit CRC looks just like the * usual sort of implementation. However, we can also fake it with two * 32-bit registers. Experience has shown that the two-32-bit-registers code * is as fast as, or even much faster than, the 64-bit code on all but true * 64-bit machines. We use SIZEOF_VOID_P to check the native word width. */ #if SIZEOF_VOID_P < 8 /* * crc0 represents the LSBs of the 64-bit value, crc1 the MSBs. Note that * with crc0 placed first, the output of 32-bit and 64-bit implementations * will be bit-compatible only on little-endian architectures. If it were * important to make the two possible implementations bit-compatible on * all machines, we could do a configure test to decide how to order the * two fields, but it seems not worth the trouble. */ typedef struct pg_crc64 { uint32 crc0; uint32 crc1; } pg_crc64; /* Initialize a CRC accumulator */ #define INIT_CRC64(crc) ((crc).crc0 = 0xffffffff, (crc).crc1 = 0xffffffff) /* Finish a CRC calculation */ #define FIN_CRC64(crc) ((crc).crc0 ^= 0xffffffff, (crc).crc1 ^= 0xffffffff) /* Accumulate some (more) bytes into a CRC */ #define COMP_CRC64(crc, data, len) \ do { \ uint32 __crc0 = (crc).crc0; \ uint32 __crc1 = (crc).crc1; \ unsigned char *__data = (unsigned char *) (data); \ uint32 __len = (len); \ \ while (__len-- > 0) \ { \ int __tab_index = ((int) (__crc1 >> 24) ^ *__data++) & 0xFF; \ __crc1 = pg_crc64_table1[__tab_index] ^ ((__crc1 << 8) | (__crc0 >> 24)); \ __crc0 = pg_crc64_table0[__tab_index] ^ (__crc0 << 8); \ } \ (crc).crc0 = __crc0; \ (crc).crc1 = __crc1; \ } while (0) /* Check for equality of two CRCs */ #define EQ_CRC64(c1,c2) ((c1).crc0 == (c2).crc0 && (c1).crc1 == (c2).crc1) /* Constant table for CRC calculation */ extern CRCDLLIMPORT const uint32 pg_crc64_table0[]; extern CRCDLLIMPORT const uint32 pg_crc64_table1[]; #else /* use int64 implementation */ typedef struct pg_crc64 { uint64 crc0; } pg_crc64; /* Initialize a CRC accumulator */ #define INIT_CRC64(crc) ((crc).crc0 = UINT64CONST(0xffffffffffffffff)) /* Finish a CRC calculation */ #define FIN_CRC64(crc) ((crc).crc0 ^= UINT64CONST(0xffffffffffffffff)) /* Accumulate some (more) bytes into a CRC */ #define COMP_CRC64(crc, data, len) \ do { \ uint64 __crc0 = (crc).crc0; \ unsigned char *__data = (unsigned char *) (data); \ uint32 __len = (len); \ \ while (__len-- > 0) \ { \ int __tab_index = ((int) (__crc0 >> 56) ^ *__data++) & 0xFF; \ __crc0 = pg_crc64_table[__tab_index] ^ (__crc0 << 8); \ } \ (crc).crc0 = __crc0; \ } while (0) /* Check for equality of two CRCs */ #define EQ_CRC64(c1,c2) ((c1).crc0 == (c2).crc0) /* Constant table for CRC calculation */ extern CRCDLLIMPORT const uint64 pg_crc64_table[]; #endif /* SIZEOF_VOID_P < 8 */ #endif /* PROVIDE_64BIT_CRC */ #endif /* PG_CRC_H */ PKBiZL >server/utils/lsyscache.hnu[/*------------------------------------------------------------------------- * * lsyscache.h * Convenience routines for common queries in the system catalog cache. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/lsyscache.h * *------------------------------------------------------------------------- */ #ifndef LSYSCACHE_H #define LSYSCACHE_H #include "access/htup.h" /* Result list element for get_op_btree_interpretation */ typedef struct OpBtreeInterpretation { Oid opfamily_id; /* btree opfamily containing operator */ int strategy; /* its strategy number */ Oid oplefttype; /* declared left input datatype */ Oid oprighttype; /* declared right input datatype */ } OpBtreeInterpretation; /* I/O function selector for get_type_io_data */ typedef enum IOFuncSelector { IOFunc_input, IOFunc_output, IOFunc_receive, IOFunc_send } IOFuncSelector; /* Hook for plugins to get control in get_attavgwidth() */ typedef int32 (*get_attavgwidth_hook_type) (Oid relid, AttrNumber attnum); extern PGDLLIMPORT get_attavgwidth_hook_type get_attavgwidth_hook; extern bool op_in_opfamily(Oid opno, Oid opfamily); extern int get_op_opfamily_strategy(Oid opno, Oid opfamily); extern Oid get_op_opfamily_sortfamily(Oid opno, Oid opfamily); extern void get_op_opfamily_properties(Oid opno, Oid opfamily, bool ordering_op, int *strategy, Oid *lefttype, Oid *righttype); extern Oid get_opfamily_member(Oid opfamily, Oid lefttype, Oid righttype, int16 strategy); extern bool get_ordering_op_properties(Oid opno, Oid *opfamily, Oid *opcintype, int16 *strategy); extern bool get_sort_function_for_ordering_op(Oid opno, Oid *sortfunc, bool *issupport, bool *reverse); extern Oid get_equality_op_for_ordering_op(Oid opno, bool *reverse); extern Oid get_ordering_op_for_equality_op(Oid opno, bool use_lhs_type); extern List *get_mergejoin_opfamilies(Oid opno); extern bool get_compatible_hash_operators(Oid opno, Oid *lhs_opno, Oid *rhs_opno); extern bool get_op_hash_functions(Oid opno, RegProcedure *lhs_procno, RegProcedure *rhs_procno); extern List *get_op_btree_interpretation(Oid opno); extern bool equality_ops_are_compatible(Oid opno1, Oid opno2); extern Oid get_opfamily_proc(Oid opfamily, Oid lefttype, Oid righttype, int16 procnum); extern char *get_attname(Oid relid, AttrNumber attnum); extern char *get_relid_attribute_name(Oid relid, AttrNumber attnum); extern AttrNumber get_attnum(Oid relid, const char *attname); extern Oid get_atttype(Oid relid, AttrNumber attnum); extern int32 get_atttypmod(Oid relid, AttrNumber attnum); extern void get_atttypetypmodcoll(Oid relid, AttrNumber attnum, Oid *typid, int32 *typmod, Oid *collid); extern char *get_collation_name(Oid colloid); extern char *get_constraint_name(Oid conoid); extern Oid get_opclass_family(Oid opclass); extern Oid get_opclass_input_type(Oid opclass); extern RegProcedure get_opcode(Oid opno); extern char *get_opname(Oid opno); extern void op_input_types(Oid opno, Oid *lefttype, Oid *righttype); extern bool op_mergejoinable(Oid opno, Oid inputtype); extern bool op_hashjoinable(Oid opno, Oid inputtype); extern bool op_strict(Oid opno); extern char op_volatile(Oid opno); extern Oid get_commutator(Oid opno); extern Oid get_negator(Oid opno); extern RegProcedure get_oprrest(Oid opno); extern RegProcedure get_oprjoin(Oid opno); extern char *get_func_name(Oid funcid); extern Oid get_func_namespace(Oid funcid); extern Oid get_func_rettype(Oid funcid); extern int get_func_nargs(Oid funcid); extern Oid get_func_signature(Oid funcid, Oid **argtypes, int *nargs); extern bool get_func_retset(Oid funcid); extern bool func_strict(Oid funcid); extern char func_volatile(Oid funcid); extern bool get_func_leakproof(Oid funcid); extern float4 get_func_cost(Oid funcid); extern float4 get_func_rows(Oid funcid); extern Oid get_relname_relid(const char *relname, Oid relnamespace); extern char *get_rel_name(Oid relid); extern Oid get_rel_namespace(Oid relid); extern Oid get_rel_type_id(Oid relid); extern char get_rel_relkind(Oid relid); extern Oid get_rel_tablespace(Oid relid); extern bool get_typisdefined(Oid typid); extern int16 get_typlen(Oid typid); extern bool get_typbyval(Oid typid); extern void get_typlenbyval(Oid typid, int16 *typlen, bool *typbyval); extern void get_typlenbyvalalign(Oid typid, int16 *typlen, bool *typbyval, char *typalign); extern Oid getTypeIOParam(HeapTuple typeTuple); extern void get_type_io_data(Oid typid, IOFuncSelector which_func, int16 *typlen, bool *typbyval, char *typalign, char *typdelim, Oid *typioparam, Oid *func); extern char get_typstorage(Oid typid); extern Node *get_typdefault(Oid typid); extern char get_typtype(Oid typid); extern bool type_is_rowtype(Oid typid); extern bool type_is_enum(Oid typid); extern bool type_is_range(Oid typid); extern void get_type_category_preferred(Oid typid, char *typcategory, bool *typispreferred); extern Oid get_typ_typrelid(Oid typid); extern Oid get_element_type(Oid typid); extern Oid get_array_type(Oid typid); extern Oid get_base_element_type(Oid typid); extern void getTypeInputInfo(Oid type, Oid *typInput, Oid *typIOParam); extern void getTypeOutputInfo(Oid type, Oid *typOutput, bool *typIsVarlena); extern void getTypeBinaryInputInfo(Oid type, Oid *typReceive, Oid *typIOParam); extern void getTypeBinaryOutputInfo(Oid type, Oid *typSend, bool *typIsVarlena); extern Oid get_typmodin(Oid typid); extern Oid get_typcollation(Oid typid); extern bool type_is_collatable(Oid typid); extern Oid getBaseType(Oid typid); extern Oid getBaseTypeAndTypmod(Oid typid, int32 *typmod); extern int32 get_typavgwidth(Oid typid, int32 typmod); extern int32 get_attavgwidth(Oid relid, AttrNumber attnum); extern bool get_attstatsslot(HeapTuple statstuple, Oid atttype, int32 atttypmod, int reqkind, Oid reqop, Oid *actualop, Datum **values, int *nvalues, float4 **numbers, int *nnumbers); extern void free_attstatsslot(Oid atttype, Datum *values, int nvalues, float4 *numbers, int nnumbers); extern char *get_namespace_name(Oid nspid); extern Oid get_range_subtype(Oid rangeOid); #define type_is_array(typid) (get_element_type(typid) != InvalidOid) /* type_is_array_domain accepts both plain arrays and domains over arrays */ #define type_is_array_domain(typid) (get_base_element_type(typid) != InvalidOid) #define TypeIsToastable(typid) (get_typstorage(typid) != 'p') #endif /* LSYSCACHE_H */ PKBiZZ server/utils/inet.hnu[/*------------------------------------------------------------------------- * * inet.h * Declarations for operations on INET datatypes. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/inet.h * *------------------------------------------------------------------------- */ #ifndef INET_H #define INET_H #include "fmgr.h" /* * This is the internal storage format for IP addresses * (both INET and CIDR datatypes): */ typedef struct { unsigned char family; /* PGSQL_AF_INET or PGSQL_AF_INET6 */ unsigned char bits; /* number of bits in netmask */ unsigned char ipaddr[16]; /* up to 128 bits of address */ } inet_struct; /* * Referencing all of the non-AF_INET types to AF_INET lets us work on * machines which may not have the appropriate address family (like * inet6 addresses when AF_INET6 isn't present) but doesn't cause a * dump/reload requirement. Existing databases used AF_INET for the family * type on disk. */ #define PGSQL_AF_INET (AF_INET + 0) #define PGSQL_AF_INET6 (AF_INET + 1) /* * Both INET and CIDR addresses are represented within Postgres as varlena * objects, ie, there is a varlena header in front of the struct type * depicted above. This struct depicts what we actually have in memory * in "uncompressed" cases. Note that since the maximum data size is only * 18 bytes, INET/CIDR will invariably be stored into tuples using the * 1-byte-header varlena format. However, we have to be prepared to cope * with the 4-byte-header format too, because various code may helpfully * try to "decompress" 1-byte-header datums. */ typedef struct { char vl_len_[4]; /* Do not touch this field directly! */ inet_struct inet_data; } inet; /* * This is the internal storage format for MAC addresses: */ typedef struct macaddr { unsigned char a; unsigned char b; unsigned char c; unsigned char d; unsigned char e; unsigned char f; } macaddr; /* * fmgr interface macros */ #define DatumGetInetP(X) ((inet *) PG_DETOAST_DATUM(X)) #define DatumGetInetPP(X) ((inet *) PG_DETOAST_DATUM_PACKED(X)) #define InetPGetDatum(X) PointerGetDatum(X) #define PG_GETARG_INET_P(n) DatumGetInetP(PG_GETARG_DATUM(n)) #define PG_GETARG_INET_PP(n) DatumGetInetPP(PG_GETARG_DATUM(n)) #define PG_RETURN_INET_P(x) return InetPGetDatum(x) /* macaddr is a fixed-length pass-by-reference datatype */ #define DatumGetMacaddrP(X) ((macaddr *) DatumGetPointer(X)) #define MacaddrPGetDatum(X) PointerGetDatum(X) #define PG_GETARG_MACADDR_P(n) DatumGetMacaddrP(PG_GETARG_DATUM(n)) #define PG_RETURN_MACADDR_P(x) return MacaddrPGetDatum(x) #endif /* INET_H */ PKBiZLzzserver/utils/tuplesort.hnu[/*------------------------------------------------------------------------- * * tuplesort.h * Generalized tuple sorting routines. * * This module handles sorting of heap tuples, index tuples, or single * Datums (and could easily support other kinds of sortable objects, * if necessary). It works efficiently for both small and large amounts * of data. Small amounts are sorted in-memory using qsort(). Large * amounts are sorted using temporary files and a standard external sort * algorithm. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/tuplesort.h * *------------------------------------------------------------------------- */ #ifndef TUPLESORT_H #define TUPLESORT_H #include "access/itup.h" #include "executor/tuptable.h" #include "fmgr.h" #include "utils/relcache.h" /* Tuplesortstate is an opaque type whose details are not known outside * tuplesort.c. */ typedef struct Tuplesortstate Tuplesortstate; /* * We provide multiple interfaces to what is essentially the same code, * since different callers have different data to be sorted and want to * specify the sort key information differently. There are two APIs for * sorting HeapTuples and two more for sorting IndexTuples. Yet another * API supports sorting bare Datums. * * The "heap" API actually stores/sorts MinimalTuples, which means it doesn't * preserve the system columns (tuple identity and transaction visibility * info). The sort keys are specified by column numbers within the tuples * and sort operator OIDs. We save some cycles by passing and returning the * tuples in TupleTableSlots, rather than forming actual HeapTuples (which'd * have to be converted to MinimalTuples). This API works well for sorts * executed as parts of plan trees. * * The "cluster" API stores/sorts full HeapTuples including all visibility * info. The sort keys are specified by reference to a btree index that is * defined on the relation to be sorted. Note that putheaptuple/getheaptuple * go with this API, not the "begin_heap" one! * * The "index_btree" API stores/sorts IndexTuples (preserving all their * header fields). The sort keys are specified by a btree index definition. * * The "index_hash" API is similar to index_btree, but the tuples are * actually sorted by their hash codes not the raw data. */ extern Tuplesortstate *tuplesort_begin_heap(TupleDesc tupDesc, int nkeys, AttrNumber *attNums, Oid *sortOperators, Oid *sortCollations, bool *nullsFirstFlags, int workMem, bool randomAccess); extern Tuplesortstate *tuplesort_begin_cluster(TupleDesc tupDesc, Relation indexRel, int workMem, bool randomAccess); extern Tuplesortstate *tuplesort_begin_index_btree(Relation indexRel, bool enforceUnique, int workMem, bool randomAccess); extern Tuplesortstate *tuplesort_begin_index_hash(Relation indexRel, uint32 hash_mask, int workMem, bool randomAccess); extern Tuplesortstate *tuplesort_begin_datum(Oid datumType, Oid sortOperator, Oid sortCollation, bool nullsFirstFlag, int workMem, bool randomAccess); extern void tuplesort_set_bound(Tuplesortstate *state, int64 bound); extern void tuplesort_puttupleslot(Tuplesortstate *state, TupleTableSlot *slot); extern void tuplesort_putheaptuple(Tuplesortstate *state, HeapTuple tup); extern void tuplesort_putindextuple(Tuplesortstate *state, IndexTuple tuple); extern void tuplesort_putdatum(Tuplesortstate *state, Datum val, bool isNull); extern void tuplesort_performsort(Tuplesortstate *state); extern bool tuplesort_gettupleslot(Tuplesortstate *state, bool forward, TupleTableSlot *slot); extern HeapTuple tuplesort_getheaptuple(Tuplesortstate *state, bool forward, bool *should_free); extern IndexTuple tuplesort_getindextuple(Tuplesortstate *state, bool forward, bool *should_free); extern bool tuplesort_getdatum(Tuplesortstate *state, bool forward, Datum *val, bool *isNull); extern void tuplesort_end(Tuplesortstate *state); extern void tuplesort_get_stats(Tuplesortstate *state, const char **sortMethod, const char **spaceType, long *spaceUsed); extern int tuplesort_merge_order(long allowedMem); /* * These routines may only be called if randomAccess was specified 'true'. * Likewise, backwards scan in gettuple/getdatum is only allowed if * randomAccess was specified. */ extern void tuplesort_rescan(Tuplesortstate *state); extern void tuplesort_markpos(Tuplesortstate *state); extern void tuplesort_restorepos(Tuplesortstate *state); #endif /* TUPLESORT_H */ PKBiZa!"server/utils/ps_status.hnu[/*------------------------------------------------------------------------- * * ps_status.h * * Declarations for backend/utils/misc/ps_status.c * * src/include/utils/ps_status.h * *------------------------------------------------------------------------- */ #ifndef PS_STATUS_H #define PS_STATUS_H extern bool update_process_title; extern char **save_ps_display_args(int argc, char **argv); extern void init_ps_display(const char *username, const char *dbname, const char *host_info, const char *initial_str); extern void set_ps_display(const char *activity, bool force); extern const char *get_ps_display(int *displen); #endif /* PS_STATUS_H */ PKBiZserver/utils/memutils.hnu[/*------------------------------------------------------------------------- * * memutils.h * This file contains declarations for memory allocation utility * functions. These are functions that are not quite widely used * enough to justify going in utils/palloc.h, but are still part * of the API of the memory management subsystem. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/memutils.h * *------------------------------------------------------------------------- */ #ifndef MEMUTILS_H #define MEMUTILS_H #include "nodes/memnodes.h" /* * MaxAllocSize * Quasi-arbitrary limit on size of allocations. * * Note: * There is no guarantee that allocations smaller than MaxAllocSize * will succeed. Allocation requests larger than MaxAllocSize will * be summarily denied. * * XXX This is deliberately chosen to correspond to the limiting size * of varlena objects under TOAST. See VARSIZE_4B() and related macros * in postgres.h. Many datatypes assume that any allocatable size can * be represented in a varlena header. * * XXX Also, various places in aset.c assume they can compute twice an * allocation's size without overflow, so beware of raising this. */ #define MaxAllocSize ((Size) 0x3fffffff) /* 1 gigabyte - 1 */ #define AllocSizeIsValid(size) ((Size) (size) <= MaxAllocSize) /* * All chunks allocated by any memory context manager are required to be * preceded by a StandardChunkHeader at a spacing of STANDARDCHUNKHEADERSIZE. * A currently-allocated chunk must contain a backpointer to its owning * context as well as the allocated size of the chunk. The backpointer is * used by pfree() and repalloc() to find the context to call. The allocated * size is not absolutely essential, but it's expected to be needed by any * reasonable implementation. */ typedef struct StandardChunkHeader { MemoryContext context; /* owning context */ Size size; /* size of data space allocated in chunk */ #ifdef MEMORY_CONTEXT_CHECKING /* when debugging memory usage, also store actual requested size */ Size requested_size; #endif } StandardChunkHeader; #define STANDARDCHUNKHEADERSIZE MAXALIGN(sizeof(StandardChunkHeader)) /* * Standard top-level memory contexts. * * Only TopMemoryContext and ErrorContext are initialized by * MemoryContextInit() itself. */ extern PGDLLIMPORT MemoryContext TopMemoryContext; extern PGDLLIMPORT MemoryContext ErrorContext; extern PGDLLIMPORT MemoryContext PostmasterContext; extern PGDLLIMPORT MemoryContext CacheMemoryContext; extern PGDLLIMPORT MemoryContext MessageContext; extern PGDLLIMPORT MemoryContext TopTransactionContext; extern PGDLLIMPORT MemoryContext CurTransactionContext; /* This is a transient link to the active portal's memory context: */ extern PGDLLIMPORT MemoryContext PortalContext; /* * Memory-context-type-independent functions in mcxt.c */ extern void MemoryContextInit(void); extern void MemoryContextReset(MemoryContext context); extern void MemoryContextDelete(MemoryContext context); extern void MemoryContextResetChildren(MemoryContext context); extern void MemoryContextDeleteChildren(MemoryContext context); extern void MemoryContextResetAndDeleteChildren(MemoryContext context); extern void MemoryContextSetParent(MemoryContext context, MemoryContext new_parent); extern Size GetMemoryChunkSpace(void *pointer); extern MemoryContext GetMemoryChunkContext(void *pointer); extern MemoryContext MemoryContextGetParent(MemoryContext context); extern bool MemoryContextIsEmpty(MemoryContext context); extern void MemoryContextStats(MemoryContext context); #ifdef MEMORY_CONTEXT_CHECKING extern void MemoryContextCheck(MemoryContext context); #endif extern bool MemoryContextContains(MemoryContext context, void *pointer); /* * This routine handles the context-type-independent part of memory * context creation. It's intended to be called from context-type- * specific creation routines, and noplace else. */ extern MemoryContext MemoryContextCreate(NodeTag tag, Size size, MemoryContextMethods *methods, MemoryContext parent, const char *name); /* * Memory-context-type-specific functions */ /* aset.c */ extern MemoryContext AllocSetContextCreate(MemoryContext parent, const char *name, Size minContextSize, Size initBlockSize, Size maxBlockSize); /* * Recommended default alloc parameters, suitable for "ordinary" contexts * that might hold quite a lot of data. */ #define ALLOCSET_DEFAULT_MINSIZE 0 #define ALLOCSET_DEFAULT_INITSIZE (8 * 1024) #define ALLOCSET_DEFAULT_MAXSIZE (8 * 1024 * 1024) /* * Recommended alloc parameters for "small" contexts that are not expected * to contain much data (for example, a context to contain a query plan). */ #define ALLOCSET_SMALL_MINSIZE 0 #define ALLOCSET_SMALL_INITSIZE (1 * 1024) #define ALLOCSET_SMALL_MAXSIZE (8 * 1024) /* * Threshold above which a request in an AllocSet context is certain to be * allocated separately (and thereby have constant allocation overhead). * Few callers should be interested in this, but tuplesort/tuplestore need * to know it. */ #define ALLOCSET_SEPARATE_THRESHOLD 8192 #endif /* MEMUTILS_H */ PKBiZ)Mserver/utils/builtins.hnu[/*------------------------------------------------------------------------- * * builtins.h * Declarations for operations on built-in types. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/builtins.h * *------------------------------------------------------------------------- */ #ifndef BUILTINS_H #define BUILTINS_H #include "fmgr.h" #include "nodes/parsenodes.h" /* * Defined in adt/ */ /* acl.c */ extern Datum has_any_column_privilege_name_name(PG_FUNCTION_ARGS); extern Datum has_any_column_privilege_name_id(PG_FUNCTION_ARGS); extern Datum has_any_column_privilege_id_name(PG_FUNCTION_ARGS); extern Datum has_any_column_privilege_id_id(PG_FUNCTION_ARGS); extern Datum has_any_column_privilege_name(PG_FUNCTION_ARGS); extern Datum has_any_column_privilege_id(PG_FUNCTION_ARGS); extern Datum has_column_privilege_name_name_name(PG_FUNCTION_ARGS); extern Datum has_column_privilege_name_name_attnum(PG_FUNCTION_ARGS); extern Datum has_column_privilege_name_id_name(PG_FUNCTION_ARGS); extern Datum has_column_privilege_name_id_attnum(PG_FUNCTION_ARGS); extern Datum has_column_privilege_id_name_name(PG_FUNCTION_ARGS); extern Datum has_column_privilege_id_name_attnum(PG_FUNCTION_ARGS); extern Datum has_column_privilege_id_id_name(PG_FUNCTION_ARGS); extern Datum has_column_privilege_id_id_attnum(PG_FUNCTION_ARGS); extern Datum has_column_privilege_name_name(PG_FUNCTION_ARGS); extern Datum has_column_privilege_name_attnum(PG_FUNCTION_ARGS); extern Datum has_column_privilege_id_name(PG_FUNCTION_ARGS); extern Datum has_column_privilege_id_attnum(PG_FUNCTION_ARGS); extern Datum has_table_privilege_name_name(PG_FUNCTION_ARGS); extern Datum has_table_privilege_name_id(PG_FUNCTION_ARGS); extern Datum has_table_privilege_id_name(PG_FUNCTION_ARGS); extern Datum has_table_privilege_id_id(PG_FUNCTION_ARGS); extern Datum has_table_privilege_name(PG_FUNCTION_ARGS); extern Datum has_table_privilege_id(PG_FUNCTION_ARGS); extern Datum has_sequence_privilege_name_name(PG_FUNCTION_ARGS); extern Datum has_sequence_privilege_name_id(PG_FUNCTION_ARGS); extern Datum has_sequence_privilege_id_name(PG_FUNCTION_ARGS); extern Datum has_sequence_privilege_id_id(PG_FUNCTION_ARGS); extern Datum has_sequence_privilege_name(PG_FUNCTION_ARGS); extern Datum has_sequence_privilege_id(PG_FUNCTION_ARGS); extern Datum has_database_privilege_name_name(PG_FUNCTION_ARGS); extern Datum has_database_privilege_name_id(PG_FUNCTION_ARGS); extern Datum has_database_privilege_id_name(PG_FUNCTION_ARGS); extern Datum has_database_privilege_id_id(PG_FUNCTION_ARGS); extern Datum has_database_privilege_name(PG_FUNCTION_ARGS); extern Datum has_database_privilege_id(PG_FUNCTION_ARGS); extern Datum has_foreign_data_wrapper_privilege_name_name(PG_FUNCTION_ARGS); extern Datum has_foreign_data_wrapper_privilege_name_id(PG_FUNCTION_ARGS); extern Datum has_foreign_data_wrapper_privilege_id_name(PG_FUNCTION_ARGS); extern Datum has_foreign_data_wrapper_privilege_id_id(PG_FUNCTION_ARGS); extern Datum has_foreign_data_wrapper_privilege_name(PG_FUNCTION_ARGS); extern Datum has_foreign_data_wrapper_privilege_id(PG_FUNCTION_ARGS); extern Datum has_function_privilege_name_name(PG_FUNCTION_ARGS); extern Datum has_function_privilege_name_id(PG_FUNCTION_ARGS); extern Datum has_function_privilege_id_name(PG_FUNCTION_ARGS); extern Datum has_function_privilege_id_id(PG_FUNCTION_ARGS); extern Datum has_function_privilege_name(PG_FUNCTION_ARGS); extern Datum has_function_privilege_id(PG_FUNCTION_ARGS); extern Datum has_language_privilege_name_name(PG_FUNCTION_ARGS); extern Datum has_language_privilege_name_id(PG_FUNCTION_ARGS); extern Datum has_language_privilege_id_name(PG_FUNCTION_ARGS); extern Datum has_language_privilege_id_id(PG_FUNCTION_ARGS); extern Datum has_language_privilege_name(PG_FUNCTION_ARGS); extern Datum has_language_privilege_id(PG_FUNCTION_ARGS); extern Datum has_schema_privilege_name_name(PG_FUNCTION_ARGS); extern Datum has_schema_privilege_name_id(PG_FUNCTION_ARGS); extern Datum has_schema_privilege_id_name(PG_FUNCTION_ARGS); extern Datum has_schema_privilege_id_id(PG_FUNCTION_ARGS); extern Datum has_schema_privilege_name(PG_FUNCTION_ARGS); extern Datum has_schema_privilege_id(PG_FUNCTION_ARGS); extern Datum has_server_privilege_name_name(PG_FUNCTION_ARGS); extern Datum has_server_privilege_name_id(PG_FUNCTION_ARGS); extern Datum has_server_privilege_id_name(PG_FUNCTION_ARGS); extern Datum has_server_privilege_id_id(PG_FUNCTION_ARGS); extern Datum has_server_privilege_name(PG_FUNCTION_ARGS); extern Datum has_server_privilege_id(PG_FUNCTION_ARGS); extern Datum has_tablespace_privilege_name_name(PG_FUNCTION_ARGS); extern Datum has_tablespace_privilege_name_id(PG_FUNCTION_ARGS); extern Datum has_tablespace_privilege_id_name(PG_FUNCTION_ARGS); extern Datum has_tablespace_privilege_id_id(PG_FUNCTION_ARGS); extern Datum has_tablespace_privilege_name(PG_FUNCTION_ARGS); extern Datum has_tablespace_privilege_id(PG_FUNCTION_ARGS); extern Datum has_type_privilege_name_name(PG_FUNCTION_ARGS); extern Datum has_type_privilege_name_id(PG_FUNCTION_ARGS); extern Datum has_type_privilege_id_name(PG_FUNCTION_ARGS); extern Datum has_type_privilege_id_id(PG_FUNCTION_ARGS); extern Datum has_type_privilege_name(PG_FUNCTION_ARGS); extern Datum has_type_privilege_id(PG_FUNCTION_ARGS); extern Datum pg_has_role_name_name(PG_FUNCTION_ARGS); extern Datum pg_has_role_name_id(PG_FUNCTION_ARGS); extern Datum pg_has_role_id_name(PG_FUNCTION_ARGS); extern Datum pg_has_role_id_id(PG_FUNCTION_ARGS); extern Datum pg_has_role_name(PG_FUNCTION_ARGS); extern Datum pg_has_role_id(PG_FUNCTION_ARGS); /* bool.c */ extern Datum boolin(PG_FUNCTION_ARGS); extern Datum boolout(PG_FUNCTION_ARGS); extern Datum boolrecv(PG_FUNCTION_ARGS); extern Datum boolsend(PG_FUNCTION_ARGS); extern Datum booltext(PG_FUNCTION_ARGS); extern Datum booleq(PG_FUNCTION_ARGS); extern Datum boolne(PG_FUNCTION_ARGS); extern Datum boollt(PG_FUNCTION_ARGS); extern Datum boolgt(PG_FUNCTION_ARGS); extern Datum boolle(PG_FUNCTION_ARGS); extern Datum boolge(PG_FUNCTION_ARGS); extern Datum booland_statefunc(PG_FUNCTION_ARGS); extern Datum boolor_statefunc(PG_FUNCTION_ARGS); extern bool parse_bool(const char *value, bool *result); extern bool parse_bool_with_len(const char *value, size_t len, bool *result); /* char.c */ extern Datum charin(PG_FUNCTION_ARGS); extern Datum charout(PG_FUNCTION_ARGS); extern Datum charrecv(PG_FUNCTION_ARGS); extern Datum charsend(PG_FUNCTION_ARGS); extern Datum chareq(PG_FUNCTION_ARGS); extern Datum charne(PG_FUNCTION_ARGS); extern Datum charlt(PG_FUNCTION_ARGS); extern Datum charle(PG_FUNCTION_ARGS); extern Datum chargt(PG_FUNCTION_ARGS); extern Datum charge(PG_FUNCTION_ARGS); extern Datum chartoi4(PG_FUNCTION_ARGS); extern Datum i4tochar(PG_FUNCTION_ARGS); extern Datum text_char(PG_FUNCTION_ARGS); extern Datum char_text(PG_FUNCTION_ARGS); /* domains.c */ extern Datum domain_in(PG_FUNCTION_ARGS); extern Datum domain_recv(PG_FUNCTION_ARGS); extern void domain_check(Datum value, bool isnull, Oid domainType, void **extra, MemoryContext mcxt); /* encode.c */ extern Datum binary_encode(PG_FUNCTION_ARGS); extern Datum binary_decode(PG_FUNCTION_ARGS); extern unsigned hex_encode(const char *src, unsigned len, char *dst); extern unsigned hex_decode(const char *src, unsigned len, char *dst); /* enum.c */ extern Datum enum_in(PG_FUNCTION_ARGS); extern Datum enum_out(PG_FUNCTION_ARGS); extern Datum enum_recv(PG_FUNCTION_ARGS); extern Datum enum_send(PG_FUNCTION_ARGS); extern Datum enum_lt(PG_FUNCTION_ARGS); extern Datum enum_le(PG_FUNCTION_ARGS); extern Datum enum_eq(PG_FUNCTION_ARGS); extern Datum enum_ne(PG_FUNCTION_ARGS); extern Datum enum_ge(PG_FUNCTION_ARGS); extern Datum enum_gt(PG_FUNCTION_ARGS); extern Datum enum_cmp(PG_FUNCTION_ARGS); extern Datum enum_smaller(PG_FUNCTION_ARGS); extern Datum enum_larger(PG_FUNCTION_ARGS); extern Datum enum_first(PG_FUNCTION_ARGS); extern Datum enum_last(PG_FUNCTION_ARGS); extern Datum enum_range_bounds(PG_FUNCTION_ARGS); extern Datum enum_range_all(PG_FUNCTION_ARGS); /* int.c */ extern Datum int2in(PG_FUNCTION_ARGS); extern Datum int2out(PG_FUNCTION_ARGS); extern Datum int2recv(PG_FUNCTION_ARGS); extern Datum int2send(PG_FUNCTION_ARGS); extern Datum int2vectorin(PG_FUNCTION_ARGS); extern Datum int2vectorout(PG_FUNCTION_ARGS); extern Datum int2vectorrecv(PG_FUNCTION_ARGS); extern Datum int2vectorsend(PG_FUNCTION_ARGS); extern Datum int2vectoreq(PG_FUNCTION_ARGS); extern Datum int4in(PG_FUNCTION_ARGS); extern Datum int4out(PG_FUNCTION_ARGS); extern Datum int4recv(PG_FUNCTION_ARGS); extern Datum int4send(PG_FUNCTION_ARGS); extern Datum i2toi4(PG_FUNCTION_ARGS); extern Datum i4toi2(PG_FUNCTION_ARGS); extern Datum int4_bool(PG_FUNCTION_ARGS); extern Datum bool_int4(PG_FUNCTION_ARGS); extern Datum int4eq(PG_FUNCTION_ARGS); extern Datum int4ne(PG_FUNCTION_ARGS); extern Datum int4lt(PG_FUNCTION_ARGS); extern Datum int4le(PG_FUNCTION_ARGS); extern Datum int4gt(PG_FUNCTION_ARGS); extern Datum int4ge(PG_FUNCTION_ARGS); extern Datum int2eq(PG_FUNCTION_ARGS); extern Datum int2ne(PG_FUNCTION_ARGS); extern Datum int2lt(PG_FUNCTION_ARGS); extern Datum int2le(PG_FUNCTION_ARGS); extern Datum int2gt(PG_FUNCTION_ARGS); extern Datum int2ge(PG_FUNCTION_ARGS); extern Datum int24eq(PG_FUNCTION_ARGS); extern Datum int24ne(PG_FUNCTION_ARGS); extern Datum int24lt(PG_FUNCTION_ARGS); extern Datum int24le(PG_FUNCTION_ARGS); extern Datum int24gt(PG_FUNCTION_ARGS); extern Datum int24ge(PG_FUNCTION_ARGS); extern Datum int42eq(PG_FUNCTION_ARGS); extern Datum int42ne(PG_FUNCTION_ARGS); extern Datum int42lt(PG_FUNCTION_ARGS); extern Datum int42le(PG_FUNCTION_ARGS); extern Datum int42gt(PG_FUNCTION_ARGS); extern Datum int42ge(PG_FUNCTION_ARGS); extern Datum int4um(PG_FUNCTION_ARGS); extern Datum int4up(PG_FUNCTION_ARGS); extern Datum int4pl(PG_FUNCTION_ARGS); extern Datum int4mi(PG_FUNCTION_ARGS); extern Datum int4mul(PG_FUNCTION_ARGS); extern Datum int4div(PG_FUNCTION_ARGS); extern Datum int4abs(PG_FUNCTION_ARGS); extern Datum int4inc(PG_FUNCTION_ARGS); extern Datum int2um(PG_FUNCTION_ARGS); extern Datum int2up(PG_FUNCTION_ARGS); extern Datum int2pl(PG_FUNCTION_ARGS); extern Datum int2mi(PG_FUNCTION_ARGS); extern Datum int2mul(PG_FUNCTION_ARGS); extern Datum int2div(PG_FUNCTION_ARGS); extern Datum int2abs(PG_FUNCTION_ARGS); extern Datum int24pl(PG_FUNCTION_ARGS); extern Datum int24mi(PG_FUNCTION_ARGS); extern Datum int24mul(PG_FUNCTION_ARGS); extern Datum int24div(PG_FUNCTION_ARGS); extern Datum int42pl(PG_FUNCTION_ARGS); extern Datum int42mi(PG_FUNCTION_ARGS); extern Datum int42mul(PG_FUNCTION_ARGS); extern Datum int42div(PG_FUNCTION_ARGS); extern Datum int4mod(PG_FUNCTION_ARGS); extern Datum int2mod(PG_FUNCTION_ARGS); extern Datum int2larger(PG_FUNCTION_ARGS); extern Datum int2smaller(PG_FUNCTION_ARGS); extern Datum int4larger(PG_FUNCTION_ARGS); extern Datum int4smaller(PG_FUNCTION_ARGS); extern Datum int4and(PG_FUNCTION_ARGS); extern Datum int4or(PG_FUNCTION_ARGS); extern Datum int4xor(PG_FUNCTION_ARGS); extern Datum int4not(PG_FUNCTION_ARGS); extern Datum int4shl(PG_FUNCTION_ARGS); extern Datum int4shr(PG_FUNCTION_ARGS); extern Datum int2and(PG_FUNCTION_ARGS); extern Datum int2or(PG_FUNCTION_ARGS); extern Datum int2xor(PG_FUNCTION_ARGS); extern Datum int2not(PG_FUNCTION_ARGS); extern Datum int2shl(PG_FUNCTION_ARGS); extern Datum int2shr(PG_FUNCTION_ARGS); extern Datum generate_series_int4(PG_FUNCTION_ARGS); extern Datum generate_series_step_int4(PG_FUNCTION_ARGS); extern int2vector *buildint2vector(const int2 *int2s, int n); /* name.c */ extern Datum namein(PG_FUNCTION_ARGS); extern Datum nameout(PG_FUNCTION_ARGS); extern Datum namerecv(PG_FUNCTION_ARGS); extern Datum namesend(PG_FUNCTION_ARGS); extern Datum nameeq(PG_FUNCTION_ARGS); extern Datum namene(PG_FUNCTION_ARGS); extern Datum namelt(PG_FUNCTION_ARGS); extern Datum namele(PG_FUNCTION_ARGS); extern Datum namegt(PG_FUNCTION_ARGS); extern Datum namege(PG_FUNCTION_ARGS); extern int namecpy(Name n1, Name n2); extern int namestrcpy(Name name, const char *str); extern int namestrcmp(Name name, const char *str); extern Datum current_user(PG_FUNCTION_ARGS); extern Datum session_user(PG_FUNCTION_ARGS); extern Datum current_schema(PG_FUNCTION_ARGS); extern Datum current_schemas(PG_FUNCTION_ARGS); /* numutils.c */ extern int32 pg_atoi(char *s, int size, int c); extern void pg_itoa(int16 i, char *a); extern void pg_ltoa(int32 l, char *a); extern void pg_lltoa(int64 ll, char *a); /* * Per-opclass comparison functions for new btrees. These are * stored in pg_amproc; most are defined in access/nbtree/nbtcompare.c */ extern Datum btboolcmp(PG_FUNCTION_ARGS); extern Datum btint2cmp(PG_FUNCTION_ARGS); extern Datum btint4cmp(PG_FUNCTION_ARGS); extern Datum btint8cmp(PG_FUNCTION_ARGS); extern Datum btfloat4cmp(PG_FUNCTION_ARGS); extern Datum btfloat8cmp(PG_FUNCTION_ARGS); extern Datum btint48cmp(PG_FUNCTION_ARGS); extern Datum btint84cmp(PG_FUNCTION_ARGS); extern Datum btint24cmp(PG_FUNCTION_ARGS); extern Datum btint42cmp(PG_FUNCTION_ARGS); extern Datum btint28cmp(PG_FUNCTION_ARGS); extern Datum btint82cmp(PG_FUNCTION_ARGS); extern Datum btfloat48cmp(PG_FUNCTION_ARGS); extern Datum btfloat84cmp(PG_FUNCTION_ARGS); extern Datum btoidcmp(PG_FUNCTION_ARGS); extern Datum btoidvectorcmp(PG_FUNCTION_ARGS); extern Datum btabstimecmp(PG_FUNCTION_ARGS); extern Datum btreltimecmp(PG_FUNCTION_ARGS); extern Datum bttintervalcmp(PG_FUNCTION_ARGS); extern Datum btcharcmp(PG_FUNCTION_ARGS); extern Datum btnamecmp(PG_FUNCTION_ARGS); extern Datum bttextcmp(PG_FUNCTION_ARGS); /* * Per-opclass sort support functions for new btrees. Like the * functions above, these are stored in pg_amproc; most are defined in * access/nbtree/nbtcompare.c */ extern Datum btint2sortsupport(PG_FUNCTION_ARGS); extern Datum btint4sortsupport(PG_FUNCTION_ARGS); extern Datum btint8sortsupport(PG_FUNCTION_ARGS); extern Datum btfloat4sortsupport(PG_FUNCTION_ARGS); extern Datum btfloat8sortsupport(PG_FUNCTION_ARGS); extern Datum btoidsortsupport(PG_FUNCTION_ARGS); extern Datum btnamesortsupport(PG_FUNCTION_ARGS); /* float.c */ extern PGDLLIMPORT int extra_float_digits; extern double get_float8_infinity(void); extern float get_float4_infinity(void); extern double get_float8_nan(void); extern float get_float4_nan(void); extern int is_infinite(double val); extern int float4_cmp_internal(float4 a, float4 b); extern int float8_cmp_internal(float8 a, float8 b); extern Datum float4in(PG_FUNCTION_ARGS); extern Datum float4out(PG_FUNCTION_ARGS); extern Datum float4recv(PG_FUNCTION_ARGS); extern Datum float4send(PG_FUNCTION_ARGS); extern Datum float8in(PG_FUNCTION_ARGS); extern Datum float8out(PG_FUNCTION_ARGS); extern Datum float8recv(PG_FUNCTION_ARGS); extern Datum float8send(PG_FUNCTION_ARGS); extern Datum float4abs(PG_FUNCTION_ARGS); extern Datum float4um(PG_FUNCTION_ARGS); extern Datum float4up(PG_FUNCTION_ARGS); extern Datum float4larger(PG_FUNCTION_ARGS); extern Datum float4smaller(PG_FUNCTION_ARGS); extern Datum float8abs(PG_FUNCTION_ARGS); extern Datum float8um(PG_FUNCTION_ARGS); extern Datum float8up(PG_FUNCTION_ARGS); extern Datum float8larger(PG_FUNCTION_ARGS); extern Datum float8smaller(PG_FUNCTION_ARGS); extern Datum float4pl(PG_FUNCTION_ARGS); extern Datum float4mi(PG_FUNCTION_ARGS); extern Datum float4mul(PG_FUNCTION_ARGS); extern Datum float4div(PG_FUNCTION_ARGS); extern Datum float8pl(PG_FUNCTION_ARGS); extern Datum float8mi(PG_FUNCTION_ARGS); extern Datum float8mul(PG_FUNCTION_ARGS); extern Datum float8div(PG_FUNCTION_ARGS); extern Datum float4eq(PG_FUNCTION_ARGS); extern Datum float4ne(PG_FUNCTION_ARGS); extern Datum float4lt(PG_FUNCTION_ARGS); extern Datum float4le(PG_FUNCTION_ARGS); extern Datum float4gt(PG_FUNCTION_ARGS); extern Datum float4ge(PG_FUNCTION_ARGS); extern Datum float8eq(PG_FUNCTION_ARGS); extern Datum float8ne(PG_FUNCTION_ARGS); extern Datum float8lt(PG_FUNCTION_ARGS); extern Datum float8le(PG_FUNCTION_ARGS); extern Datum float8gt(PG_FUNCTION_ARGS); extern Datum float8ge(PG_FUNCTION_ARGS); extern Datum ftod(PG_FUNCTION_ARGS); extern Datum i4tod(PG_FUNCTION_ARGS); extern Datum i2tod(PG_FUNCTION_ARGS); extern Datum dtof(PG_FUNCTION_ARGS); extern Datum dtoi4(PG_FUNCTION_ARGS); extern Datum dtoi2(PG_FUNCTION_ARGS); extern Datum i4tof(PG_FUNCTION_ARGS); extern Datum i2tof(PG_FUNCTION_ARGS); extern Datum ftoi4(PG_FUNCTION_ARGS); extern Datum ftoi2(PG_FUNCTION_ARGS); extern Datum dround(PG_FUNCTION_ARGS); extern Datum dceil(PG_FUNCTION_ARGS); extern Datum dfloor(PG_FUNCTION_ARGS); extern Datum dsign(PG_FUNCTION_ARGS); extern Datum dtrunc(PG_FUNCTION_ARGS); extern Datum dsqrt(PG_FUNCTION_ARGS); extern Datum dcbrt(PG_FUNCTION_ARGS); extern Datum dpow(PG_FUNCTION_ARGS); extern Datum dexp(PG_FUNCTION_ARGS); extern Datum dlog1(PG_FUNCTION_ARGS); extern Datum dlog10(PG_FUNCTION_ARGS); extern Datum dacos(PG_FUNCTION_ARGS); extern Datum dasin(PG_FUNCTION_ARGS); extern Datum datan(PG_FUNCTION_ARGS); extern Datum datan2(PG_FUNCTION_ARGS); extern Datum dcos(PG_FUNCTION_ARGS); extern Datum dcot(PG_FUNCTION_ARGS); extern Datum dsin(PG_FUNCTION_ARGS); extern Datum dtan(PG_FUNCTION_ARGS); extern Datum degrees(PG_FUNCTION_ARGS); extern Datum dpi(PG_FUNCTION_ARGS); extern Datum radians(PG_FUNCTION_ARGS); extern Datum drandom(PG_FUNCTION_ARGS); extern Datum setseed(PG_FUNCTION_ARGS); extern Datum float8_accum(PG_FUNCTION_ARGS); extern Datum float4_accum(PG_FUNCTION_ARGS); extern Datum float8_avg(PG_FUNCTION_ARGS); extern Datum float8_var_pop(PG_FUNCTION_ARGS); extern Datum float8_var_samp(PG_FUNCTION_ARGS); extern Datum float8_stddev_pop(PG_FUNCTION_ARGS); extern Datum float8_stddev_samp(PG_FUNCTION_ARGS); extern Datum float8_regr_accum(PG_FUNCTION_ARGS); extern Datum float8_regr_sxx(PG_FUNCTION_ARGS); extern Datum float8_regr_syy(PG_FUNCTION_ARGS); extern Datum float8_regr_sxy(PG_FUNCTION_ARGS); extern Datum float8_regr_avgx(PG_FUNCTION_ARGS); extern Datum float8_regr_avgy(PG_FUNCTION_ARGS); extern Datum float8_covar_pop(PG_FUNCTION_ARGS); extern Datum float8_covar_samp(PG_FUNCTION_ARGS); extern Datum float8_corr(PG_FUNCTION_ARGS); extern Datum float8_regr_r2(PG_FUNCTION_ARGS); extern Datum float8_regr_slope(PG_FUNCTION_ARGS); extern Datum float8_regr_intercept(PG_FUNCTION_ARGS); extern Datum float48pl(PG_FUNCTION_ARGS); extern Datum float48mi(PG_FUNCTION_ARGS); extern Datum float48mul(PG_FUNCTION_ARGS); extern Datum float48div(PG_FUNCTION_ARGS); extern Datum float84pl(PG_FUNCTION_ARGS); extern Datum float84mi(PG_FUNCTION_ARGS); extern Datum float84mul(PG_FUNCTION_ARGS); extern Datum float84div(PG_FUNCTION_ARGS); extern Datum float48eq(PG_FUNCTION_ARGS); extern Datum float48ne(PG_FUNCTION_ARGS); extern Datum float48lt(PG_FUNCTION_ARGS); extern Datum float48le(PG_FUNCTION_ARGS); extern Datum float48gt(PG_FUNCTION_ARGS); extern Datum float48ge(PG_FUNCTION_ARGS); extern Datum float84eq(PG_FUNCTION_ARGS); extern Datum float84ne(PG_FUNCTION_ARGS); extern Datum float84lt(PG_FUNCTION_ARGS); extern Datum float84le(PG_FUNCTION_ARGS); extern Datum float84gt(PG_FUNCTION_ARGS); extern Datum float84ge(PG_FUNCTION_ARGS); extern Datum width_bucket_float8(PG_FUNCTION_ARGS); /* dbsize.c */ extern Datum pg_tablespace_size_oid(PG_FUNCTION_ARGS); extern Datum pg_tablespace_size_name(PG_FUNCTION_ARGS); extern Datum pg_database_size_oid(PG_FUNCTION_ARGS); extern Datum pg_database_size_name(PG_FUNCTION_ARGS); extern Datum pg_relation_size(PG_FUNCTION_ARGS); extern Datum pg_total_relation_size(PG_FUNCTION_ARGS); extern Datum pg_size_pretty(PG_FUNCTION_ARGS); extern Datum pg_size_pretty_numeric(PG_FUNCTION_ARGS); extern Datum pg_table_size(PG_FUNCTION_ARGS); extern Datum pg_indexes_size(PG_FUNCTION_ARGS); extern Datum pg_relation_filenode(PG_FUNCTION_ARGS); extern Datum pg_relation_filepath(PG_FUNCTION_ARGS); /* genfile.c */ extern bytea *read_binary_file(const char *filename, int64 seek_offset, int64 bytes_to_read); extern Datum pg_stat_file(PG_FUNCTION_ARGS); extern Datum pg_read_file(PG_FUNCTION_ARGS); extern Datum pg_read_file_all(PG_FUNCTION_ARGS); extern Datum pg_read_binary_file(PG_FUNCTION_ARGS); extern Datum pg_read_binary_file_all(PG_FUNCTION_ARGS); extern Datum pg_ls_dir(PG_FUNCTION_ARGS); /* misc.c */ extern Datum current_database(PG_FUNCTION_ARGS); extern Datum current_query(PG_FUNCTION_ARGS); extern Datum pg_cancel_backend(PG_FUNCTION_ARGS); extern Datum pg_terminate_backend(PG_FUNCTION_ARGS); extern Datum pg_reload_conf(PG_FUNCTION_ARGS); extern Datum pg_tablespace_databases(PG_FUNCTION_ARGS); extern Datum pg_tablespace_location(PG_FUNCTION_ARGS); extern Datum pg_rotate_logfile(PG_FUNCTION_ARGS); extern Datum pg_sleep(PG_FUNCTION_ARGS); extern Datum pg_get_keywords(PG_FUNCTION_ARGS); extern Datum pg_typeof(PG_FUNCTION_ARGS); extern Datum pg_collation_for(PG_FUNCTION_ARGS); /* oid.c */ extern Datum oidin(PG_FUNCTION_ARGS); extern Datum oidout(PG_FUNCTION_ARGS); extern Datum oidrecv(PG_FUNCTION_ARGS); extern Datum oidsend(PG_FUNCTION_ARGS); extern Datum oideq(PG_FUNCTION_ARGS); extern Datum oidne(PG_FUNCTION_ARGS); extern Datum oidlt(PG_FUNCTION_ARGS); extern Datum oidle(PG_FUNCTION_ARGS); extern Datum oidge(PG_FUNCTION_ARGS); extern Datum oidgt(PG_FUNCTION_ARGS); extern Datum oidlarger(PG_FUNCTION_ARGS); extern Datum oidsmaller(PG_FUNCTION_ARGS); extern Datum oidvectorin(PG_FUNCTION_ARGS); extern Datum oidvectorout(PG_FUNCTION_ARGS); extern Datum oidvectorrecv(PG_FUNCTION_ARGS); extern Datum oidvectorsend(PG_FUNCTION_ARGS); extern Datum oidvectoreq(PG_FUNCTION_ARGS); extern Datum oidvectorne(PG_FUNCTION_ARGS); extern Datum oidvectorlt(PG_FUNCTION_ARGS); extern Datum oidvectorle(PG_FUNCTION_ARGS); extern Datum oidvectorge(PG_FUNCTION_ARGS); extern Datum oidvectorgt(PG_FUNCTION_ARGS); extern oidvector *buildoidvector(const Oid *oids, int n); extern Oid oidparse(Node *node); /* pseudotypes.c */ extern Datum cstring_in(PG_FUNCTION_ARGS); extern Datum cstring_out(PG_FUNCTION_ARGS); extern Datum cstring_recv(PG_FUNCTION_ARGS); extern Datum cstring_send(PG_FUNCTION_ARGS); extern Datum any_in(PG_FUNCTION_ARGS); extern Datum any_out(PG_FUNCTION_ARGS); extern Datum anyarray_in(PG_FUNCTION_ARGS); extern Datum anyarray_out(PG_FUNCTION_ARGS); extern Datum anyarray_recv(PG_FUNCTION_ARGS); extern Datum anyarray_send(PG_FUNCTION_ARGS); extern Datum anynonarray_in(PG_FUNCTION_ARGS); extern Datum anynonarray_out(PG_FUNCTION_ARGS); extern Datum anyenum_in(PG_FUNCTION_ARGS); extern Datum anyenum_out(PG_FUNCTION_ARGS); extern Datum anyrange_in(PG_FUNCTION_ARGS); extern Datum anyrange_out(PG_FUNCTION_ARGS); extern Datum void_in(PG_FUNCTION_ARGS); extern Datum void_out(PG_FUNCTION_ARGS); extern Datum void_recv(PG_FUNCTION_ARGS); extern Datum void_send(PG_FUNCTION_ARGS); extern Datum trigger_in(PG_FUNCTION_ARGS); extern Datum trigger_out(PG_FUNCTION_ARGS); extern Datum language_handler_in(PG_FUNCTION_ARGS); extern Datum language_handler_out(PG_FUNCTION_ARGS); extern Datum fdw_handler_in(PG_FUNCTION_ARGS); extern Datum fdw_handler_out(PG_FUNCTION_ARGS); extern Datum internal_in(PG_FUNCTION_ARGS); extern Datum internal_out(PG_FUNCTION_ARGS); extern Datum opaque_in(PG_FUNCTION_ARGS); extern Datum opaque_out(PG_FUNCTION_ARGS); extern Datum anyelement_in(PG_FUNCTION_ARGS); extern Datum anyelement_out(PG_FUNCTION_ARGS); extern Datum shell_in(PG_FUNCTION_ARGS); extern Datum shell_out(PG_FUNCTION_ARGS); extern Datum pg_node_tree_in(PG_FUNCTION_ARGS); extern Datum pg_node_tree_out(PG_FUNCTION_ARGS); extern Datum pg_node_tree_recv(PG_FUNCTION_ARGS); extern Datum pg_node_tree_send(PG_FUNCTION_ARGS); /* regexp.c */ extern Datum nameregexeq(PG_FUNCTION_ARGS); extern Datum nameregexne(PG_FUNCTION_ARGS); extern Datum textregexeq(PG_FUNCTION_ARGS); extern Datum textregexne(PG_FUNCTION_ARGS); extern Datum nameicregexeq(PG_FUNCTION_ARGS); extern Datum nameicregexne(PG_FUNCTION_ARGS); extern Datum texticregexeq(PG_FUNCTION_ARGS); extern Datum texticregexne(PG_FUNCTION_ARGS); extern Datum textregexsubstr(PG_FUNCTION_ARGS); extern Datum textregexreplace_noopt(PG_FUNCTION_ARGS); extern Datum textregexreplace(PG_FUNCTION_ARGS); extern Datum similar_escape(PG_FUNCTION_ARGS); extern Datum regexp_matches(PG_FUNCTION_ARGS); extern Datum regexp_matches_no_flags(PG_FUNCTION_ARGS); extern Datum regexp_split_to_table(PG_FUNCTION_ARGS); extern Datum regexp_split_to_table_no_flags(PG_FUNCTION_ARGS); extern Datum regexp_split_to_array(PG_FUNCTION_ARGS); extern Datum regexp_split_to_array_no_flags(PG_FUNCTION_ARGS); extern char *regexp_fixed_prefix(text *text_re, bool case_insensitive, Oid collation, bool *exact); /* regproc.c */ extern Datum regprocin(PG_FUNCTION_ARGS); extern Datum regprocout(PG_FUNCTION_ARGS); extern Datum regprocrecv(PG_FUNCTION_ARGS); extern Datum regprocsend(PG_FUNCTION_ARGS); extern Datum regprocedurein(PG_FUNCTION_ARGS); extern Datum regprocedureout(PG_FUNCTION_ARGS); extern Datum regprocedurerecv(PG_FUNCTION_ARGS); extern Datum regproceduresend(PG_FUNCTION_ARGS); extern Datum regoperin(PG_FUNCTION_ARGS); extern Datum regoperout(PG_FUNCTION_ARGS); extern Datum regoperrecv(PG_FUNCTION_ARGS); extern Datum regopersend(PG_FUNCTION_ARGS); extern Datum regoperatorin(PG_FUNCTION_ARGS); extern Datum regoperatorout(PG_FUNCTION_ARGS); extern Datum regoperatorrecv(PG_FUNCTION_ARGS); extern Datum regoperatorsend(PG_FUNCTION_ARGS); extern Datum regclassin(PG_FUNCTION_ARGS); extern Datum regclassout(PG_FUNCTION_ARGS); extern Datum regclassrecv(PG_FUNCTION_ARGS); extern Datum regclasssend(PG_FUNCTION_ARGS); extern Datum regtypein(PG_FUNCTION_ARGS); extern Datum regtypeout(PG_FUNCTION_ARGS); extern Datum regtyperecv(PG_FUNCTION_ARGS); extern Datum regtypesend(PG_FUNCTION_ARGS); extern Datum regconfigin(PG_FUNCTION_ARGS); extern Datum regconfigout(PG_FUNCTION_ARGS); extern Datum regconfigrecv(PG_FUNCTION_ARGS); extern Datum regconfigsend(PG_FUNCTION_ARGS); extern Datum regdictionaryin(PG_FUNCTION_ARGS); extern Datum regdictionaryout(PG_FUNCTION_ARGS); extern Datum regdictionaryrecv(PG_FUNCTION_ARGS); extern Datum regdictionarysend(PG_FUNCTION_ARGS); extern Datum text_regclass(PG_FUNCTION_ARGS); extern List *stringToQualifiedNameList(const char *string); extern char *format_procedure(Oid procedure_oid); extern char *format_operator(Oid operator_oid); /* rowtypes.c */ extern Datum record_in(PG_FUNCTION_ARGS); extern Datum record_out(PG_FUNCTION_ARGS); extern Datum record_recv(PG_FUNCTION_ARGS); extern Datum record_send(PG_FUNCTION_ARGS); extern Datum record_eq(PG_FUNCTION_ARGS); extern Datum record_ne(PG_FUNCTION_ARGS); extern Datum record_lt(PG_FUNCTION_ARGS); extern Datum record_gt(PG_FUNCTION_ARGS); extern Datum record_le(PG_FUNCTION_ARGS); extern Datum record_ge(PG_FUNCTION_ARGS); extern Datum btrecordcmp(PG_FUNCTION_ARGS); /* ruleutils.c */ extern bool quote_all_identifiers; extern Datum pg_get_ruledef(PG_FUNCTION_ARGS); extern Datum pg_get_ruledef_ext(PG_FUNCTION_ARGS); extern Datum pg_get_viewdef(PG_FUNCTION_ARGS); extern Datum pg_get_viewdef_ext(PG_FUNCTION_ARGS); extern Datum pg_get_viewdef_wrap(PG_FUNCTION_ARGS); extern Datum pg_get_viewdef_name(PG_FUNCTION_ARGS); extern Datum pg_get_viewdef_name_ext(PG_FUNCTION_ARGS); extern Datum pg_get_indexdef(PG_FUNCTION_ARGS); extern Datum pg_get_indexdef_ext(PG_FUNCTION_ARGS); extern char *pg_get_indexdef_string(Oid indexrelid); extern char *pg_get_indexdef_columns(Oid indexrelid, bool pretty); extern Datum pg_get_triggerdef(PG_FUNCTION_ARGS); extern Datum pg_get_triggerdef_ext(PG_FUNCTION_ARGS); extern Datum pg_get_constraintdef(PG_FUNCTION_ARGS); extern Datum pg_get_constraintdef_ext(PG_FUNCTION_ARGS); extern char *pg_get_constraintdef_string(Oid constraintId); extern Datum pg_get_expr(PG_FUNCTION_ARGS); extern Datum pg_get_expr_ext(PG_FUNCTION_ARGS); extern Datum pg_get_userbyid(PG_FUNCTION_ARGS); extern Datum pg_get_serial_sequence(PG_FUNCTION_ARGS); extern Datum pg_get_functiondef(PG_FUNCTION_ARGS); extern Datum pg_get_function_arguments(PG_FUNCTION_ARGS); extern Datum pg_get_function_identity_arguments(PG_FUNCTION_ARGS); extern Datum pg_get_function_result(PG_FUNCTION_ARGS); extern char *deparse_expression(Node *expr, List *dpcontext, bool forceprefix, bool showimplicit); extern List *deparse_context_for(const char *aliasname, Oid relid); extern List *deparse_context_for_planstate(Node *planstate, List *ancestors, List *rtable); extern const char *quote_identifier(const char *ident); extern char *quote_qualified_identifier(const char *qualifier, const char *ident); extern char *generate_collation_name(Oid collid); /* tid.c */ extern Datum tidin(PG_FUNCTION_ARGS); extern Datum tidout(PG_FUNCTION_ARGS); extern Datum tidrecv(PG_FUNCTION_ARGS); extern Datum tidsend(PG_FUNCTION_ARGS); extern Datum tideq(PG_FUNCTION_ARGS); extern Datum tidne(PG_FUNCTION_ARGS); extern Datum tidlt(PG_FUNCTION_ARGS); extern Datum tidle(PG_FUNCTION_ARGS); extern Datum tidgt(PG_FUNCTION_ARGS); extern Datum tidge(PG_FUNCTION_ARGS); extern Datum bttidcmp(PG_FUNCTION_ARGS); extern Datum tidlarger(PG_FUNCTION_ARGS); extern Datum tidsmaller(PG_FUNCTION_ARGS); extern Datum currtid_byreloid(PG_FUNCTION_ARGS); extern Datum currtid_byrelname(PG_FUNCTION_ARGS); /* varchar.c */ extern Datum bpcharin(PG_FUNCTION_ARGS); extern Datum bpcharout(PG_FUNCTION_ARGS); extern Datum bpcharrecv(PG_FUNCTION_ARGS); extern Datum bpcharsend(PG_FUNCTION_ARGS); extern Datum bpchartypmodin(PG_FUNCTION_ARGS); extern Datum bpchartypmodout(PG_FUNCTION_ARGS); extern Datum bpchar(PG_FUNCTION_ARGS); extern Datum char_bpchar(PG_FUNCTION_ARGS); extern Datum name_bpchar(PG_FUNCTION_ARGS); extern Datum bpchar_name(PG_FUNCTION_ARGS); extern Datum bpchareq(PG_FUNCTION_ARGS); extern Datum bpcharne(PG_FUNCTION_ARGS); extern Datum bpcharlt(PG_FUNCTION_ARGS); extern Datum bpcharle(PG_FUNCTION_ARGS); extern Datum bpchargt(PG_FUNCTION_ARGS); extern Datum bpcharge(PG_FUNCTION_ARGS); extern Datum bpcharcmp(PG_FUNCTION_ARGS); extern Datum bpchar_larger(PG_FUNCTION_ARGS); extern Datum bpchar_smaller(PG_FUNCTION_ARGS); extern Datum bpcharlen(PG_FUNCTION_ARGS); extern Datum bpcharoctetlen(PG_FUNCTION_ARGS); extern Datum hashbpchar(PG_FUNCTION_ARGS); extern Datum bpchar_pattern_lt(PG_FUNCTION_ARGS); extern Datum bpchar_pattern_le(PG_FUNCTION_ARGS); extern Datum bpchar_pattern_gt(PG_FUNCTION_ARGS); extern Datum bpchar_pattern_ge(PG_FUNCTION_ARGS); extern Datum btbpchar_pattern_cmp(PG_FUNCTION_ARGS); extern Datum varcharin(PG_FUNCTION_ARGS); extern Datum varcharout(PG_FUNCTION_ARGS); extern Datum varcharrecv(PG_FUNCTION_ARGS); extern Datum varcharsend(PG_FUNCTION_ARGS); extern Datum varchartypmodin(PG_FUNCTION_ARGS); extern Datum varchartypmodout(PG_FUNCTION_ARGS); extern Datum varchar_transform(PG_FUNCTION_ARGS); extern Datum varchar(PG_FUNCTION_ARGS); /* varlena.c */ extern text *cstring_to_text(const char *s); extern text *cstring_to_text_with_len(const char *s, int len); extern char *text_to_cstring(const text *t); extern void text_to_cstring_buffer(const text *src, char *dst, size_t dst_len); #define CStringGetTextDatum(s) PointerGetDatum(cstring_to_text(s)) #define TextDatumGetCString(d) text_to_cstring((text *) DatumGetPointer(d)) extern Datum textin(PG_FUNCTION_ARGS); extern Datum textout(PG_FUNCTION_ARGS); extern Datum textrecv(PG_FUNCTION_ARGS); extern Datum textsend(PG_FUNCTION_ARGS); extern Datum textcat(PG_FUNCTION_ARGS); extern Datum texteq(PG_FUNCTION_ARGS); extern Datum textne(PG_FUNCTION_ARGS); extern Datum text_lt(PG_FUNCTION_ARGS); extern Datum text_le(PG_FUNCTION_ARGS); extern Datum text_gt(PG_FUNCTION_ARGS); extern Datum text_ge(PG_FUNCTION_ARGS); extern Datum text_larger(PG_FUNCTION_ARGS); extern Datum text_smaller(PG_FUNCTION_ARGS); extern Datum text_pattern_lt(PG_FUNCTION_ARGS); extern Datum text_pattern_le(PG_FUNCTION_ARGS); extern Datum text_pattern_gt(PG_FUNCTION_ARGS); extern Datum text_pattern_ge(PG_FUNCTION_ARGS); extern Datum bttext_pattern_cmp(PG_FUNCTION_ARGS); extern Datum textlen(PG_FUNCTION_ARGS); extern Datum textoctetlen(PG_FUNCTION_ARGS); extern Datum textpos(PG_FUNCTION_ARGS); extern Datum text_substr(PG_FUNCTION_ARGS); extern Datum text_substr_no_len(PG_FUNCTION_ARGS); extern Datum textoverlay(PG_FUNCTION_ARGS); extern Datum textoverlay_no_len(PG_FUNCTION_ARGS); extern Datum name_text(PG_FUNCTION_ARGS); extern Datum text_name(PG_FUNCTION_ARGS); extern int varstr_cmp(char *arg1, int len1, char *arg2, int len2, Oid collid); extern List *textToQualifiedNameList(text *textval); extern bool SplitIdentifierString(char *rawstring, char separator, List **namelist); extern bool SplitDirectoriesString(char *rawstring, char separator, List **namelist); extern Datum replace_text(PG_FUNCTION_ARGS); extern text *replace_text_regexp(text *src_text, void *regexp, text *replace_text, bool glob); extern Datum split_text(PG_FUNCTION_ARGS); extern Datum text_to_array(PG_FUNCTION_ARGS); extern Datum array_to_text(PG_FUNCTION_ARGS); extern Datum text_to_array_null(PG_FUNCTION_ARGS); extern Datum array_to_text_null(PG_FUNCTION_ARGS); extern Datum to_hex32(PG_FUNCTION_ARGS); extern Datum to_hex64(PG_FUNCTION_ARGS); extern Datum md5_text(PG_FUNCTION_ARGS); extern Datum md5_bytea(PG_FUNCTION_ARGS); extern Datum unknownin(PG_FUNCTION_ARGS); extern Datum unknownout(PG_FUNCTION_ARGS); extern Datum unknownrecv(PG_FUNCTION_ARGS); extern Datum unknownsend(PG_FUNCTION_ARGS); extern Datum pg_column_size(PG_FUNCTION_ARGS); extern Datum bytea_string_agg_transfn(PG_FUNCTION_ARGS); extern Datum bytea_string_agg_finalfn(PG_FUNCTION_ARGS); extern Datum string_agg_transfn(PG_FUNCTION_ARGS); extern Datum string_agg_finalfn(PG_FUNCTION_ARGS); extern Datum text_concat(PG_FUNCTION_ARGS); extern Datum text_concat_ws(PG_FUNCTION_ARGS); extern Datum text_left(PG_FUNCTION_ARGS); extern Datum text_right(PG_FUNCTION_ARGS); extern Datum text_reverse(PG_FUNCTION_ARGS); extern Datum text_format(PG_FUNCTION_ARGS); extern Datum text_format_nv(PG_FUNCTION_ARGS); /* version.c */ extern Datum pgsql_version(PG_FUNCTION_ARGS); /* xid.c */ extern Datum xidin(PG_FUNCTION_ARGS); extern Datum xidout(PG_FUNCTION_ARGS); extern Datum xidrecv(PG_FUNCTION_ARGS); extern Datum xidsend(PG_FUNCTION_ARGS); extern Datum xideq(PG_FUNCTION_ARGS); extern Datum xid_age(PG_FUNCTION_ARGS); extern int xidComparator(const void *arg1, const void *arg2); extern Datum cidin(PG_FUNCTION_ARGS); extern Datum cidout(PG_FUNCTION_ARGS); extern Datum cidrecv(PG_FUNCTION_ARGS); extern Datum cidsend(PG_FUNCTION_ARGS); extern Datum cideq(PG_FUNCTION_ARGS); /* like.c */ extern Datum namelike(PG_FUNCTION_ARGS); extern Datum namenlike(PG_FUNCTION_ARGS); extern Datum nameiclike(PG_FUNCTION_ARGS); extern Datum nameicnlike(PG_FUNCTION_ARGS); extern Datum textlike(PG_FUNCTION_ARGS); extern Datum textnlike(PG_FUNCTION_ARGS); extern Datum texticlike(PG_FUNCTION_ARGS); extern Datum texticnlike(PG_FUNCTION_ARGS); extern Datum bytealike(PG_FUNCTION_ARGS); extern Datum byteanlike(PG_FUNCTION_ARGS); extern Datum like_escape(PG_FUNCTION_ARGS); extern Datum like_escape_bytea(PG_FUNCTION_ARGS); /* oracle_compat.c */ extern Datum lower(PG_FUNCTION_ARGS); extern Datum upper(PG_FUNCTION_ARGS); extern Datum initcap(PG_FUNCTION_ARGS); extern Datum lpad(PG_FUNCTION_ARGS); extern Datum rpad(PG_FUNCTION_ARGS); extern Datum btrim(PG_FUNCTION_ARGS); extern Datum btrim1(PG_FUNCTION_ARGS); extern Datum byteatrim(PG_FUNCTION_ARGS); extern Datum ltrim(PG_FUNCTION_ARGS); extern Datum ltrim1(PG_FUNCTION_ARGS); extern Datum rtrim(PG_FUNCTION_ARGS); extern Datum rtrim1(PG_FUNCTION_ARGS); extern Datum translate(PG_FUNCTION_ARGS); extern Datum chr (PG_FUNCTION_ARGS); extern Datum repeat(PG_FUNCTION_ARGS); extern Datum ascii(PG_FUNCTION_ARGS); /* inet_cidr_ntop.c */ extern char *inet_cidr_ntop(int af, const void *src, int bits, char *dst, size_t size); /* inet_net_pton.c */ extern int inet_net_pton(int af, const char *src, void *dst, size_t size); /* network.c */ extern Datum inet_in(PG_FUNCTION_ARGS); extern Datum inet_out(PG_FUNCTION_ARGS); extern Datum inet_recv(PG_FUNCTION_ARGS); extern Datum inet_send(PG_FUNCTION_ARGS); extern Datum cidr_in(PG_FUNCTION_ARGS); extern Datum cidr_out(PG_FUNCTION_ARGS); extern Datum cidr_recv(PG_FUNCTION_ARGS); extern Datum cidr_send(PG_FUNCTION_ARGS); extern Datum network_cmp(PG_FUNCTION_ARGS); extern Datum network_lt(PG_FUNCTION_ARGS); extern Datum network_le(PG_FUNCTION_ARGS); extern Datum network_eq(PG_FUNCTION_ARGS); extern Datum network_ge(PG_FUNCTION_ARGS); extern Datum network_gt(PG_FUNCTION_ARGS); extern Datum network_ne(PG_FUNCTION_ARGS); extern Datum hashinet(PG_FUNCTION_ARGS); extern Datum network_sub(PG_FUNCTION_ARGS); extern Datum network_subeq(PG_FUNCTION_ARGS); extern Datum network_sup(PG_FUNCTION_ARGS); extern Datum network_supeq(PG_FUNCTION_ARGS); extern Datum network_network(PG_FUNCTION_ARGS); extern Datum network_netmask(PG_FUNCTION_ARGS); extern Datum network_hostmask(PG_FUNCTION_ARGS); extern Datum network_masklen(PG_FUNCTION_ARGS); extern Datum network_family(PG_FUNCTION_ARGS); extern Datum network_broadcast(PG_FUNCTION_ARGS); extern Datum network_host(PG_FUNCTION_ARGS); extern Datum network_show(PG_FUNCTION_ARGS); extern Datum inet_abbrev(PG_FUNCTION_ARGS); extern Datum cidr_abbrev(PG_FUNCTION_ARGS); extern double convert_network_to_scalar(Datum value, Oid typid); extern Datum inet_to_cidr(PG_FUNCTION_ARGS); extern Datum inet_set_masklen(PG_FUNCTION_ARGS); extern Datum cidr_set_masklen(PG_FUNCTION_ARGS); extern Datum network_scan_first(Datum in); extern Datum network_scan_last(Datum in); extern Datum inet_client_addr(PG_FUNCTION_ARGS); extern Datum inet_client_port(PG_FUNCTION_ARGS); extern Datum inet_server_addr(PG_FUNCTION_ARGS); extern Datum inet_server_port(PG_FUNCTION_ARGS); extern Datum inetnot(PG_FUNCTION_ARGS); extern Datum inetand(PG_FUNCTION_ARGS); extern Datum inetor(PG_FUNCTION_ARGS); extern Datum inetpl(PG_FUNCTION_ARGS); extern Datum inetmi_int8(PG_FUNCTION_ARGS); extern Datum inetmi(PG_FUNCTION_ARGS); extern void clean_ipv6_addr(int addr_family, char *addr); /* mac.c */ extern Datum macaddr_in(PG_FUNCTION_ARGS); extern Datum macaddr_out(PG_FUNCTION_ARGS); extern Datum macaddr_recv(PG_FUNCTION_ARGS); extern Datum macaddr_send(PG_FUNCTION_ARGS); extern Datum macaddr_cmp(PG_FUNCTION_ARGS); extern Datum macaddr_lt(PG_FUNCTION_ARGS); extern Datum macaddr_le(PG_FUNCTION_ARGS); extern Datum macaddr_eq(PG_FUNCTION_ARGS); extern Datum macaddr_ge(PG_FUNCTION_ARGS); extern Datum macaddr_gt(PG_FUNCTION_ARGS); extern Datum macaddr_ne(PG_FUNCTION_ARGS); extern Datum macaddr_not(PG_FUNCTION_ARGS); extern Datum macaddr_and(PG_FUNCTION_ARGS); extern Datum macaddr_or(PG_FUNCTION_ARGS); extern Datum macaddr_trunc(PG_FUNCTION_ARGS); extern Datum hashmacaddr(PG_FUNCTION_ARGS); /* numeric.c */ extern Datum numeric_in(PG_FUNCTION_ARGS); extern Datum numeric_out(PG_FUNCTION_ARGS); extern Datum numeric_recv(PG_FUNCTION_ARGS); extern Datum numeric_send(PG_FUNCTION_ARGS); extern Datum numerictypmodin(PG_FUNCTION_ARGS); extern Datum numerictypmodout(PG_FUNCTION_ARGS); extern Datum numeric_transform(PG_FUNCTION_ARGS); extern Datum numeric (PG_FUNCTION_ARGS); extern Datum numeric_abs(PG_FUNCTION_ARGS); extern Datum numeric_uminus(PG_FUNCTION_ARGS); extern Datum numeric_uplus(PG_FUNCTION_ARGS); extern Datum numeric_sign(PG_FUNCTION_ARGS); extern Datum numeric_round(PG_FUNCTION_ARGS); extern Datum numeric_trunc(PG_FUNCTION_ARGS); extern Datum numeric_ceil(PG_FUNCTION_ARGS); extern Datum numeric_floor(PG_FUNCTION_ARGS); extern Datum numeric_cmp(PG_FUNCTION_ARGS); extern Datum numeric_eq(PG_FUNCTION_ARGS); extern Datum numeric_ne(PG_FUNCTION_ARGS); extern Datum numeric_gt(PG_FUNCTION_ARGS); extern Datum numeric_ge(PG_FUNCTION_ARGS); extern Datum numeric_lt(PG_FUNCTION_ARGS); extern Datum numeric_le(PG_FUNCTION_ARGS); extern Datum numeric_add(PG_FUNCTION_ARGS); extern Datum numeric_sub(PG_FUNCTION_ARGS); extern Datum numeric_mul(PG_FUNCTION_ARGS); extern Datum numeric_div(PG_FUNCTION_ARGS); extern Datum numeric_div_trunc(PG_FUNCTION_ARGS); extern Datum numeric_mod(PG_FUNCTION_ARGS); extern Datum numeric_inc(PG_FUNCTION_ARGS); extern Datum numeric_smaller(PG_FUNCTION_ARGS); extern Datum numeric_larger(PG_FUNCTION_ARGS); extern Datum numeric_fac(PG_FUNCTION_ARGS); extern Datum numeric_sqrt(PG_FUNCTION_ARGS); extern Datum numeric_exp(PG_FUNCTION_ARGS); extern Datum numeric_ln(PG_FUNCTION_ARGS); extern Datum numeric_log(PG_FUNCTION_ARGS); extern Datum numeric_power(PG_FUNCTION_ARGS); extern Datum int4_numeric(PG_FUNCTION_ARGS); extern Datum numeric_int4(PG_FUNCTION_ARGS); extern Datum int8_numeric(PG_FUNCTION_ARGS); extern Datum numeric_int8(PG_FUNCTION_ARGS); extern Datum int2_numeric(PG_FUNCTION_ARGS); extern Datum numeric_int2(PG_FUNCTION_ARGS); extern Datum float8_numeric(PG_FUNCTION_ARGS); extern Datum numeric_float8(PG_FUNCTION_ARGS); extern Datum numeric_float8_no_overflow(PG_FUNCTION_ARGS); extern Datum float4_numeric(PG_FUNCTION_ARGS); extern Datum numeric_float4(PG_FUNCTION_ARGS); extern Datum numeric_accum(PG_FUNCTION_ARGS); extern Datum numeric_avg_accum(PG_FUNCTION_ARGS); extern Datum int2_accum(PG_FUNCTION_ARGS); extern Datum int4_accum(PG_FUNCTION_ARGS); extern Datum int8_accum(PG_FUNCTION_ARGS); extern Datum int8_avg_accum(PG_FUNCTION_ARGS); extern Datum numeric_avg(PG_FUNCTION_ARGS); extern Datum numeric_var_pop(PG_FUNCTION_ARGS); extern Datum numeric_var_samp(PG_FUNCTION_ARGS); extern Datum numeric_stddev_pop(PG_FUNCTION_ARGS); extern Datum numeric_stddev_samp(PG_FUNCTION_ARGS); extern Datum int2_sum(PG_FUNCTION_ARGS); extern Datum int4_sum(PG_FUNCTION_ARGS); extern Datum int8_sum(PG_FUNCTION_ARGS); extern Datum int2_avg_accum(PG_FUNCTION_ARGS); extern Datum int4_avg_accum(PG_FUNCTION_ARGS); extern Datum int8_avg(PG_FUNCTION_ARGS); extern Datum width_bucket_numeric(PG_FUNCTION_ARGS); extern Datum hash_numeric(PG_FUNCTION_ARGS); /* ri_triggers.c */ extern Datum RI_FKey_check_ins(PG_FUNCTION_ARGS); extern Datum RI_FKey_check_upd(PG_FUNCTION_ARGS); extern Datum RI_FKey_noaction_del(PG_FUNCTION_ARGS); extern Datum RI_FKey_noaction_upd(PG_FUNCTION_ARGS); extern Datum RI_FKey_cascade_del(PG_FUNCTION_ARGS); extern Datum RI_FKey_cascade_upd(PG_FUNCTION_ARGS); extern Datum RI_FKey_restrict_del(PG_FUNCTION_ARGS); extern Datum RI_FKey_restrict_upd(PG_FUNCTION_ARGS); extern Datum RI_FKey_setnull_del(PG_FUNCTION_ARGS); extern Datum RI_FKey_setnull_upd(PG_FUNCTION_ARGS); extern Datum RI_FKey_setdefault_del(PG_FUNCTION_ARGS); extern Datum RI_FKey_setdefault_upd(PG_FUNCTION_ARGS); /* trigfuncs.c */ extern Datum suppress_redundant_updates_trigger(PG_FUNCTION_ARGS); /* encoding support functions */ extern Datum getdatabaseencoding(PG_FUNCTION_ARGS); extern Datum database_character_set(PG_FUNCTION_ARGS); extern Datum pg_client_encoding(PG_FUNCTION_ARGS); extern Datum PG_encoding_to_char(PG_FUNCTION_ARGS); extern Datum PG_char_to_encoding(PG_FUNCTION_ARGS); extern Datum PG_character_set_name(PG_FUNCTION_ARGS); extern Datum PG_character_set_id(PG_FUNCTION_ARGS); extern Datum pg_convert(PG_FUNCTION_ARGS); extern Datum pg_convert_to(PG_FUNCTION_ARGS); extern Datum pg_convert_from(PG_FUNCTION_ARGS); extern Datum length_in_encoding(PG_FUNCTION_ARGS); extern Datum pg_encoding_max_length_sql(PG_FUNCTION_ARGS); /* format_type.c */ extern Datum format_type(PG_FUNCTION_ARGS); extern char *format_type_be(Oid type_oid); extern char *format_type_with_typemod(Oid type_oid, int32 typemod); extern Datum oidvectortypes(PG_FUNCTION_ARGS); extern int32 type_maximum_size(Oid type_oid, int32 typemod); /* quote.c */ extern Datum quote_ident(PG_FUNCTION_ARGS); extern Datum quote_literal(PG_FUNCTION_ARGS); extern char *quote_literal_cstr(const char *rawstr); extern Datum quote_nullable(PG_FUNCTION_ARGS); /* guc.c */ extern Datum show_config_by_name(PG_FUNCTION_ARGS); extern Datum set_config_by_name(PG_FUNCTION_ARGS); extern Datum show_all_settings(PG_FUNCTION_ARGS); /* lockfuncs.c */ extern Datum pg_lock_status(PG_FUNCTION_ARGS); extern Datum pg_advisory_lock_int8(PG_FUNCTION_ARGS); extern Datum pg_advisory_xact_lock_int8(PG_FUNCTION_ARGS); extern Datum pg_advisory_lock_shared_int8(PG_FUNCTION_ARGS); extern Datum pg_advisory_xact_lock_shared_int8(PG_FUNCTION_ARGS); extern Datum pg_try_advisory_lock_int8(PG_FUNCTION_ARGS); extern Datum pg_try_advisory_xact_lock_int8(PG_FUNCTION_ARGS); extern Datum pg_try_advisory_lock_shared_int8(PG_FUNCTION_ARGS); extern Datum pg_try_advisory_xact_lock_shared_int8(PG_FUNCTION_ARGS); extern Datum pg_advisory_unlock_int8(PG_FUNCTION_ARGS); extern Datum pg_advisory_unlock_shared_int8(PG_FUNCTION_ARGS); extern Datum pg_advisory_lock_int4(PG_FUNCTION_ARGS); extern Datum pg_advisory_xact_lock_int4(PG_FUNCTION_ARGS); extern Datum pg_advisory_lock_shared_int4(PG_FUNCTION_ARGS); extern Datum pg_advisory_xact_lock_shared_int4(PG_FUNCTION_ARGS); extern Datum pg_try_advisory_lock_int4(PG_FUNCTION_ARGS); extern Datum pg_try_advisory_xact_lock_int4(PG_FUNCTION_ARGS); extern Datum pg_try_advisory_lock_shared_int4(PG_FUNCTION_ARGS); extern Datum pg_try_advisory_xact_lock_shared_int4(PG_FUNCTION_ARGS); extern Datum pg_advisory_unlock_int4(PG_FUNCTION_ARGS); extern Datum pg_advisory_unlock_shared_int4(PG_FUNCTION_ARGS); extern Datum pg_advisory_unlock_all(PG_FUNCTION_ARGS); /* txid.c */ extern Datum txid_snapshot_in(PG_FUNCTION_ARGS); extern Datum txid_snapshot_out(PG_FUNCTION_ARGS); extern Datum txid_snapshot_recv(PG_FUNCTION_ARGS); extern Datum txid_snapshot_send(PG_FUNCTION_ARGS); extern Datum txid_current(PG_FUNCTION_ARGS); extern Datum txid_current_snapshot(PG_FUNCTION_ARGS); extern Datum txid_snapshot_xmin(PG_FUNCTION_ARGS); extern Datum txid_snapshot_xmax(PG_FUNCTION_ARGS); extern Datum txid_snapshot_xip(PG_FUNCTION_ARGS); extern Datum txid_visible_in_snapshot(PG_FUNCTION_ARGS); /* uuid.c */ extern Datum uuid_in(PG_FUNCTION_ARGS); extern Datum uuid_out(PG_FUNCTION_ARGS); extern Datum uuid_send(PG_FUNCTION_ARGS); extern Datum uuid_recv(PG_FUNCTION_ARGS); extern Datum uuid_lt(PG_FUNCTION_ARGS); extern Datum uuid_le(PG_FUNCTION_ARGS); extern Datum uuid_eq(PG_FUNCTION_ARGS); extern Datum uuid_ge(PG_FUNCTION_ARGS); extern Datum uuid_gt(PG_FUNCTION_ARGS); extern Datum uuid_ne(PG_FUNCTION_ARGS); extern Datum uuid_cmp(PG_FUNCTION_ARGS); extern Datum uuid_hash(PG_FUNCTION_ARGS); /* windowfuncs.c */ extern Datum window_row_number(PG_FUNCTION_ARGS); extern Datum window_rank(PG_FUNCTION_ARGS); extern Datum window_dense_rank(PG_FUNCTION_ARGS); extern Datum window_percent_rank(PG_FUNCTION_ARGS); extern Datum window_cume_dist(PG_FUNCTION_ARGS); extern Datum window_ntile(PG_FUNCTION_ARGS); extern Datum window_lag(PG_FUNCTION_ARGS); extern Datum window_lag_with_offset(PG_FUNCTION_ARGS); extern Datum window_lag_with_offset_and_default(PG_FUNCTION_ARGS); extern Datum window_lead(PG_FUNCTION_ARGS); extern Datum window_lead_with_offset(PG_FUNCTION_ARGS); extern Datum window_lead_with_offset_and_default(PG_FUNCTION_ARGS); extern Datum window_first_value(PG_FUNCTION_ARGS); extern Datum window_last_value(PG_FUNCTION_ARGS); extern Datum window_nth_value(PG_FUNCTION_ARGS); /* access/spgist/spgquadtreeproc.c */ extern Datum spg_quad_config(PG_FUNCTION_ARGS); extern Datum spg_quad_choose(PG_FUNCTION_ARGS); extern Datum spg_quad_picksplit(PG_FUNCTION_ARGS); extern Datum spg_quad_inner_consistent(PG_FUNCTION_ARGS); extern Datum spg_quad_leaf_consistent(PG_FUNCTION_ARGS); /* access/spgist/spgkdtreeproc.c */ extern Datum spg_kd_config(PG_FUNCTION_ARGS); extern Datum spg_kd_choose(PG_FUNCTION_ARGS); extern Datum spg_kd_picksplit(PG_FUNCTION_ARGS); extern Datum spg_kd_inner_consistent(PG_FUNCTION_ARGS); /* access/spgist/spgtextproc.c */ extern Datum spg_text_config(PG_FUNCTION_ARGS); extern Datum spg_text_choose(PG_FUNCTION_ARGS); extern Datum spg_text_picksplit(PG_FUNCTION_ARGS); extern Datum spg_text_inner_consistent(PG_FUNCTION_ARGS); extern Datum spg_text_leaf_consistent(PG_FUNCTION_ARGS); /* access/gin/ginarrayproc.c */ extern Datum ginarrayextract(PG_FUNCTION_ARGS); extern Datum ginarrayextract_2args(PG_FUNCTION_ARGS); extern Datum ginqueryarrayextract(PG_FUNCTION_ARGS); extern Datum ginarrayconsistent(PG_FUNCTION_ARGS); /* access/transam/twophase.c */ extern Datum pg_prepared_xact(PG_FUNCTION_ARGS); /* catalogs/dependency.c */ extern Datum pg_describe_object(PG_FUNCTION_ARGS); /* commands/constraint.c */ extern Datum unique_key_recheck(PG_FUNCTION_ARGS); /* commands/extension.c */ extern Datum pg_available_extensions(PG_FUNCTION_ARGS); extern Datum pg_available_extension_versions(PG_FUNCTION_ARGS); extern Datum pg_extension_update_paths(PG_FUNCTION_ARGS); extern Datum pg_extension_config_dump(PG_FUNCTION_ARGS); /* commands/prepare.c */ extern Datum pg_prepared_statement(PG_FUNCTION_ARGS); /* utils/mmgr/portalmem.c */ extern Datum pg_cursor(PG_FUNCTION_ARGS); #endif /* BUILTINS_H */ PKBiZ=YYserver/utils/snapmgr.hnu[/*------------------------------------------------------------------------- * * snapmgr.h * POSTGRES snapshot manager * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/snapmgr.h * *------------------------------------------------------------------------- */ #ifndef SNAPMGR_H #define SNAPMGR_H #include "utils/resowner.h" extern bool FirstSnapshotSet; extern TransactionId TransactionXmin; extern TransactionId RecentXmin; extern TransactionId RecentGlobalXmin; extern Snapshot GetTransactionSnapshot(void); extern Snapshot GetLatestSnapshot(void); extern void SnapshotSetCommandId(CommandId curcid); extern void PushActiveSnapshot(Snapshot snapshot); extern void PushCopiedSnapshot(Snapshot snapshot); extern void UpdateActiveSnapshotCommandId(void); extern void PopActiveSnapshot(void); extern Snapshot GetActiveSnapshot(void); extern bool ActiveSnapshotSet(void); extern Snapshot RegisterSnapshot(Snapshot snapshot); extern void UnregisterSnapshot(Snapshot snapshot); extern Snapshot RegisterSnapshotOnOwner(Snapshot snapshot, ResourceOwner owner); extern void UnregisterSnapshotFromOwner(Snapshot snapshot, ResourceOwner owner); extern void AtSubCommit_Snapshot(int level); extern void AtSubAbort_Snapshot(int level); extern void AtEOXact_Snapshot(bool isCommit); extern Datum pg_export_snapshot(PG_FUNCTION_ARGS); extern void ImportSnapshot(const char *idstr); extern bool XactHasExportedSnapshots(void); extern void DeleteAllExportedSnapshotFiles(void); #endif /* SNAPMGR_H */ PKBiZ_EEFFserver/utils/cash.hnu[/* * src/include/utils/cash.h * * * cash.h * Written by D'Arcy J.M. Cain * * Functions to allow input and output of money normally but store * and handle it as 64 bit integer. */ #ifndef CASH_H #define CASH_H #include "fmgr.h" typedef int64 Cash; /* Cash is pass-by-reference if and only if int64 is */ #define DatumGetCash(X) ((Cash) DatumGetInt64(X)) #define CashGetDatum(X) Int64GetDatum(X) #define PG_GETARG_CASH(n) DatumGetCash(PG_GETARG_DATUM(n)) #define PG_RETURN_CASH(x) return CashGetDatum(x) extern Datum cash_in(PG_FUNCTION_ARGS); extern Datum cash_out(PG_FUNCTION_ARGS); extern Datum cash_recv(PG_FUNCTION_ARGS); extern Datum cash_send(PG_FUNCTION_ARGS); extern Datum cash_eq(PG_FUNCTION_ARGS); extern Datum cash_ne(PG_FUNCTION_ARGS); extern Datum cash_lt(PG_FUNCTION_ARGS); extern Datum cash_le(PG_FUNCTION_ARGS); extern Datum cash_gt(PG_FUNCTION_ARGS); extern Datum cash_ge(PG_FUNCTION_ARGS); extern Datum cash_cmp(PG_FUNCTION_ARGS); extern Datum cash_pl(PG_FUNCTION_ARGS); extern Datum cash_mi(PG_FUNCTION_ARGS); extern Datum cash_div_cash(PG_FUNCTION_ARGS); extern Datum cash_mul_flt8(PG_FUNCTION_ARGS); extern Datum flt8_mul_cash(PG_FUNCTION_ARGS); extern Datum cash_div_flt8(PG_FUNCTION_ARGS); extern Datum cash_mul_flt4(PG_FUNCTION_ARGS); extern Datum flt4_mul_cash(PG_FUNCTION_ARGS); extern Datum cash_div_flt4(PG_FUNCTION_ARGS); extern Datum cash_mul_int8(PG_FUNCTION_ARGS); extern Datum int8_mul_cash(PG_FUNCTION_ARGS); extern Datum cash_div_int8(PG_FUNCTION_ARGS); extern Datum cash_mul_int4(PG_FUNCTION_ARGS); extern Datum int4_mul_cash(PG_FUNCTION_ARGS); extern Datum cash_div_int4(PG_FUNCTION_ARGS); extern Datum cash_mul_int2(PG_FUNCTION_ARGS); extern Datum int2_mul_cash(PG_FUNCTION_ARGS); extern Datum cash_div_int2(PG_FUNCTION_ARGS); extern Datum cashlarger(PG_FUNCTION_ARGS); extern Datum cashsmaller(PG_FUNCTION_ARGS); extern Datum cash_words(PG_FUNCTION_ARGS); extern Datum cash_numeric(PG_FUNCTION_ARGS); extern Datum numeric_cash(PG_FUNCTION_ARGS); extern Datum int4_cash(PG_FUNCTION_ARGS); extern Datum int8_cash(PG_FUNCTION_ARGS); #endif /* CASH_H */ PKBiZY99server/utils/inval.hnu[/*------------------------------------------------------------------------- * * inval.h * POSTGRES cache invalidation dispatcher definitions. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/inval.h * *------------------------------------------------------------------------- */ #ifndef INVAL_H #define INVAL_H #include "access/htup.h" #include "utils/relcache.h" typedef void (*SyscacheCallbackFunction) (Datum arg, int cacheid, uint32 hashvalue); typedef void (*RelcacheCallbackFunction) (Datum arg, Oid relid); extern void AcceptInvalidationMessages(void); extern void AtStart_Inval(void); extern void AtSubStart_Inval(void); extern void AtEOXact_Inval(bool isCommit); extern void AtEOSubXact_Inval(bool isCommit); extern void AtPrepare_Inval(void); extern void PostPrepare_Inval(void); extern void CommandEndInvalidationMessages(void); extern void CacheInvalidateHeapTuple(Relation relation, HeapTuple tuple, HeapTuple newtuple); extern void CacheInvalidateCatalog(Oid catalogId); extern void CacheInvalidateRelcache(Relation relation); extern void CacheInvalidateRelcacheByTuple(HeapTuple classTuple); extern void CacheInvalidateRelcacheByRelid(Oid relid); extern void CacheInvalidateSmgr(RelFileNodeBackend rnode); extern void CacheInvalidateRelmap(Oid databaseId); extern void CacheRegisterSyscacheCallback(int cacheid, SyscacheCallbackFunction func, Datum arg); extern void CacheRegisterRelcacheCallback(RelcacheCallbackFunction func, Datum arg); extern void CallSyscacheCallbacks(int cacheid, uint32 hashvalue); extern void inval_twophase_postcommit(TransactionId xid, uint16 info, void *recdata, uint32 len); #endif /* INVAL_H */ PKBiZϒ server/utils/tuplestore.hnu[/*------------------------------------------------------------------------- * * tuplestore.h * Generalized routines for temporary tuple storage. * * This module handles temporary storage of tuples for purposes such * as Materialize nodes, hashjoin batch files, etc. It is essentially * a dumbed-down version of tuplesort.c; it does no sorting of tuples * but can only store and regurgitate a sequence of tuples. However, * because no sort is required, it is allowed to start reading the sequence * before it has all been written. This is particularly useful for cursors, * because it allows random access within the already-scanned portion of * a query without having to process the underlying scan to completion. * Also, it is possible to support multiple independent read pointers. * * A temporary file is used to handle the data if it exceeds the * space limit specified by the caller. * * Beginning in Postgres 8.2, what is stored is just MinimalTuples; * callers cannot expect valid system columns in regurgitated tuples. * Also, we have changed the API to return tuples in TupleTableSlots, * so that there is a check to prevent attempted access to system columns. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/tuplestore.h * *------------------------------------------------------------------------- */ #ifndef TUPLESTORE_H #define TUPLESTORE_H #include "executor/tuptable.h" /* Tuplestorestate is an opaque type whose details are not known outside * tuplestore.c. */ typedef struct Tuplestorestate Tuplestorestate; /* * Currently we only need to store MinimalTuples, but it would be easy * to support the same behavior for IndexTuples and/or bare Datums. */ extern Tuplestorestate *tuplestore_begin_heap(bool randomAccess, bool interXact, int maxKBytes); extern void tuplestore_set_eflags(Tuplestorestate *state, int eflags); extern void tuplestore_puttupleslot(Tuplestorestate *state, TupleTableSlot *slot); extern void tuplestore_puttuple(Tuplestorestate *state, HeapTuple tuple); extern void tuplestore_putvalues(Tuplestorestate *state, TupleDesc tdesc, Datum *values, bool *isnull); /* tuplestore_donestoring() used to be required, but is no longer used */ #define tuplestore_donestoring(state) ((void) 0) extern int tuplestore_alloc_read_pointer(Tuplestorestate *state, int eflags); extern void tuplestore_select_read_pointer(Tuplestorestate *state, int ptr); extern void tuplestore_copy_read_pointer(Tuplestorestate *state, int srcptr, int destptr); extern void tuplestore_trim(Tuplestorestate *state); extern bool tuplestore_in_memory(Tuplestorestate *state); extern bool tuplestore_gettupleslot(Tuplestorestate *state, bool forward, bool copy, TupleTableSlot *slot); extern bool tuplestore_advance(Tuplestorestate *state, bool forward); extern bool tuplestore_ateof(Tuplestorestate *state); extern void tuplestore_rescan(Tuplestorestate *state); extern void tuplestore_clear(Tuplestorestate *state); extern void tuplestore_end(Tuplestorestate *state); #endif /* TUPLESTORE_H */ PKBiZpЉoNoNserver/utils/errcodes.hnu[/* autogenerated from src/backend/utils/errcodes.txt, do not edit */ /* there is deliberately not an #ifndef ERRCODES_H here */ /* Class 00 - Successful Completion */ #define ERRCODE_SUCCESSFUL_COMPLETION MAKE_SQLSTATE('0','0','0','0','0') /* Class 01 - Warning */ #define ERRCODE_WARNING MAKE_SQLSTATE('0','1','0','0','0') #define ERRCODE_WARNING_DYNAMIC_RESULT_SETS_RETURNED MAKE_SQLSTATE('0','1','0','0','C') #define ERRCODE_WARNING_IMPLICIT_ZERO_BIT_PADDING MAKE_SQLSTATE('0','1','0','0','8') #define ERRCODE_WARNING_NULL_VALUE_ELIMINATED_IN_SET_FUNCTION MAKE_SQLSTATE('0','1','0','0','3') #define ERRCODE_WARNING_PRIVILEGE_NOT_GRANTED MAKE_SQLSTATE('0','1','0','0','7') #define ERRCODE_WARNING_PRIVILEGE_NOT_REVOKED MAKE_SQLSTATE('0','1','0','0','6') #define ERRCODE_WARNING_STRING_DATA_RIGHT_TRUNCATION MAKE_SQLSTATE('0','1','0','0','4') #define ERRCODE_WARNING_DEPRECATED_FEATURE MAKE_SQLSTATE('0','1','P','0','1') /* Class 02 - No Data (this is also a warning class per the SQL standard) */ #define ERRCODE_NO_DATA MAKE_SQLSTATE('0','2','0','0','0') #define ERRCODE_NO_ADDITIONAL_DYNAMIC_RESULT_SETS_RETURNED MAKE_SQLSTATE('0','2','0','0','1') /* Class 03 - SQL Statement Not Yet Complete */ #define ERRCODE_SQL_STATEMENT_NOT_YET_COMPLETE MAKE_SQLSTATE('0','3','0','0','0') /* Class 08 - Connection Exception */ #define ERRCODE_CONNECTION_EXCEPTION MAKE_SQLSTATE('0','8','0','0','0') #define ERRCODE_CONNECTION_DOES_NOT_EXIST MAKE_SQLSTATE('0','8','0','0','3') #define ERRCODE_CONNECTION_FAILURE MAKE_SQLSTATE('0','8','0','0','6') #define ERRCODE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION MAKE_SQLSTATE('0','8','0','0','1') #define ERRCODE_SQLSERVER_REJECTED_ESTABLISHMENT_OF_SQLCONNECTION MAKE_SQLSTATE('0','8','0','0','4') #define ERRCODE_TRANSACTION_RESOLUTION_UNKNOWN MAKE_SQLSTATE('0','8','0','0','7') #define ERRCODE_PROTOCOL_VIOLATION MAKE_SQLSTATE('0','8','P','0','1') /* Class 09 - Triggered Action Exception */ #define ERRCODE_TRIGGERED_ACTION_EXCEPTION MAKE_SQLSTATE('0','9','0','0','0') /* Class 0A - Feature Not Supported */ #define ERRCODE_FEATURE_NOT_SUPPORTED MAKE_SQLSTATE('0','A','0','0','0') /* Class 0B - Invalid Transaction Initiation */ #define ERRCODE_INVALID_TRANSACTION_INITIATION MAKE_SQLSTATE('0','B','0','0','0') /* Class 0F - Locator Exception */ #define ERRCODE_LOCATOR_EXCEPTION MAKE_SQLSTATE('0','F','0','0','0') #define ERRCODE_L_E_INVALID_SPECIFICATION MAKE_SQLSTATE('0','F','0','0','1') /* Class 0L - Invalid Grantor */ #define ERRCODE_INVALID_GRANTOR MAKE_SQLSTATE('0','L','0','0','0') #define ERRCODE_INVALID_GRANT_OPERATION MAKE_SQLSTATE('0','L','P','0','1') /* Class 0P - Invalid Role Specification */ #define ERRCODE_INVALID_ROLE_SPECIFICATION MAKE_SQLSTATE('0','P','0','0','0') /* Class 0Z - Diagnostics Exception */ #define ERRCODE_DIAGNOSTICS_EXCEPTION MAKE_SQLSTATE('0','Z','0','0','0') #define ERRCODE_STACKED_DIAGNOSTICS_ACCESSED_WITHOUT_ACTIVE_HANDLER MAKE_SQLSTATE('0','Z','0','0','2') /* Class 20 - Case Not Found */ #define ERRCODE_CASE_NOT_FOUND MAKE_SQLSTATE('2','0','0','0','0') /* Class 21 - Cardinality Violation */ #define ERRCODE_CARDINALITY_VIOLATION MAKE_SQLSTATE('2','1','0','0','0') /* Class 22 - Data Exception */ #define ERRCODE_DATA_EXCEPTION MAKE_SQLSTATE('2','2','0','0','0') #define ERRCODE_ARRAY_ELEMENT_ERROR MAKE_SQLSTATE('2','2','0','2','E') #define ERRCODE_ARRAY_SUBSCRIPT_ERROR MAKE_SQLSTATE('2','2','0','2','E') #define ERRCODE_CHARACTER_NOT_IN_REPERTOIRE MAKE_SQLSTATE('2','2','0','2','1') #define ERRCODE_DATETIME_FIELD_OVERFLOW MAKE_SQLSTATE('2','2','0','0','8') #define ERRCODE_DATETIME_VALUE_OUT_OF_RANGE MAKE_SQLSTATE('2','2','0','0','8') #define ERRCODE_DIVISION_BY_ZERO MAKE_SQLSTATE('2','2','0','1','2') #define ERRCODE_ERROR_IN_ASSIGNMENT MAKE_SQLSTATE('2','2','0','0','5') #define ERRCODE_ESCAPE_CHARACTER_CONFLICT MAKE_SQLSTATE('2','2','0','0','B') #define ERRCODE_INDICATOR_OVERFLOW MAKE_SQLSTATE('2','2','0','2','2') #define ERRCODE_INTERVAL_FIELD_OVERFLOW MAKE_SQLSTATE('2','2','0','1','5') #define ERRCODE_INVALID_ARGUMENT_FOR_LOG MAKE_SQLSTATE('2','2','0','1','E') #define ERRCODE_INVALID_ARGUMENT_FOR_NTILE MAKE_SQLSTATE('2','2','0','1','4') #define ERRCODE_INVALID_ARGUMENT_FOR_NTH_VALUE MAKE_SQLSTATE('2','2','0','1','6') #define ERRCODE_INVALID_ARGUMENT_FOR_POWER_FUNCTION MAKE_SQLSTATE('2','2','0','1','F') #define ERRCODE_INVALID_ARGUMENT_FOR_WIDTH_BUCKET_FUNCTION MAKE_SQLSTATE('2','2','0','1','G') #define ERRCODE_INVALID_CHARACTER_VALUE_FOR_CAST MAKE_SQLSTATE('2','2','0','1','8') #define ERRCODE_INVALID_DATETIME_FORMAT MAKE_SQLSTATE('2','2','0','0','7') #define ERRCODE_INVALID_ESCAPE_CHARACTER MAKE_SQLSTATE('2','2','0','1','9') #define ERRCODE_INVALID_ESCAPE_OCTET MAKE_SQLSTATE('2','2','0','0','D') #define ERRCODE_INVALID_ESCAPE_SEQUENCE MAKE_SQLSTATE('2','2','0','2','5') #define ERRCODE_NONSTANDARD_USE_OF_ESCAPE_CHARACTER MAKE_SQLSTATE('2','2','P','0','6') #define ERRCODE_INVALID_INDICATOR_PARAMETER_VALUE MAKE_SQLSTATE('2','2','0','1','0') #define ERRCODE_INVALID_PARAMETER_VALUE MAKE_SQLSTATE('2','2','0','2','3') #define ERRCODE_INVALID_REGULAR_EXPRESSION MAKE_SQLSTATE('2','2','0','1','B') #define ERRCODE_INVALID_ROW_COUNT_IN_LIMIT_CLAUSE MAKE_SQLSTATE('2','2','0','1','W') #define ERRCODE_INVALID_ROW_COUNT_IN_RESULT_OFFSET_CLAUSE MAKE_SQLSTATE('2','2','0','1','X') #define ERRCODE_INVALID_TIME_ZONE_DISPLACEMENT_VALUE MAKE_SQLSTATE('2','2','0','0','9') #define ERRCODE_INVALID_USE_OF_ESCAPE_CHARACTER MAKE_SQLSTATE('2','2','0','0','C') #define ERRCODE_MOST_SPECIFIC_TYPE_MISMATCH MAKE_SQLSTATE('2','2','0','0','G') #define ERRCODE_NULL_VALUE_NOT_ALLOWED MAKE_SQLSTATE('2','2','0','0','4') #define ERRCODE_NULL_VALUE_NO_INDICATOR_PARAMETER MAKE_SQLSTATE('2','2','0','0','2') #define ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE MAKE_SQLSTATE('2','2','0','0','3') #define ERRCODE_STRING_DATA_LENGTH_MISMATCH MAKE_SQLSTATE('2','2','0','2','6') #define ERRCODE_STRING_DATA_RIGHT_TRUNCATION MAKE_SQLSTATE('2','2','0','0','1') #define ERRCODE_SUBSTRING_ERROR MAKE_SQLSTATE('2','2','0','1','1') #define ERRCODE_TRIM_ERROR MAKE_SQLSTATE('2','2','0','2','7') #define ERRCODE_UNTERMINATED_C_STRING MAKE_SQLSTATE('2','2','0','2','4') #define ERRCODE_ZERO_LENGTH_CHARACTER_STRING MAKE_SQLSTATE('2','2','0','0','F') #define ERRCODE_FLOATING_POINT_EXCEPTION MAKE_SQLSTATE('2','2','P','0','1') #define ERRCODE_INVALID_TEXT_REPRESENTATION MAKE_SQLSTATE('2','2','P','0','2') #define ERRCODE_INVALID_BINARY_REPRESENTATION MAKE_SQLSTATE('2','2','P','0','3') #define ERRCODE_BAD_COPY_FILE_FORMAT MAKE_SQLSTATE('2','2','P','0','4') #define ERRCODE_UNTRANSLATABLE_CHARACTER MAKE_SQLSTATE('2','2','P','0','5') #define ERRCODE_NOT_AN_XML_DOCUMENT MAKE_SQLSTATE('2','2','0','0','L') #define ERRCODE_INVALID_XML_DOCUMENT MAKE_SQLSTATE('2','2','0','0','M') #define ERRCODE_INVALID_XML_CONTENT MAKE_SQLSTATE('2','2','0','0','N') #define ERRCODE_INVALID_XML_COMMENT MAKE_SQLSTATE('2','2','0','0','S') #define ERRCODE_INVALID_XML_PROCESSING_INSTRUCTION MAKE_SQLSTATE('2','2','0','0','T') /* Class 23 - Integrity Constraint Violation */ #define ERRCODE_INTEGRITY_CONSTRAINT_VIOLATION MAKE_SQLSTATE('2','3','0','0','0') #define ERRCODE_RESTRICT_VIOLATION MAKE_SQLSTATE('2','3','0','0','1') #define ERRCODE_NOT_NULL_VIOLATION MAKE_SQLSTATE('2','3','5','0','2') #define ERRCODE_FOREIGN_KEY_VIOLATION MAKE_SQLSTATE('2','3','5','0','3') #define ERRCODE_UNIQUE_VIOLATION MAKE_SQLSTATE('2','3','5','0','5') #define ERRCODE_CHECK_VIOLATION MAKE_SQLSTATE('2','3','5','1','4') #define ERRCODE_EXCLUSION_VIOLATION MAKE_SQLSTATE('2','3','P','0','1') /* Class 24 - Invalid Cursor State */ #define ERRCODE_INVALID_CURSOR_STATE MAKE_SQLSTATE('2','4','0','0','0') /* Class 25 - Invalid Transaction State */ #define ERRCODE_INVALID_TRANSACTION_STATE MAKE_SQLSTATE('2','5','0','0','0') #define ERRCODE_ACTIVE_SQL_TRANSACTION MAKE_SQLSTATE('2','5','0','0','1') #define ERRCODE_BRANCH_TRANSACTION_ALREADY_ACTIVE MAKE_SQLSTATE('2','5','0','0','2') #define ERRCODE_HELD_CURSOR_REQUIRES_SAME_ISOLATION_LEVEL MAKE_SQLSTATE('2','5','0','0','8') #define ERRCODE_INAPPROPRIATE_ACCESS_MODE_FOR_BRANCH_TRANSACTION MAKE_SQLSTATE('2','5','0','0','3') #define ERRCODE_INAPPROPRIATE_ISOLATION_LEVEL_FOR_BRANCH_TRANSACTION MAKE_SQLSTATE('2','5','0','0','4') #define ERRCODE_NO_ACTIVE_SQL_TRANSACTION_FOR_BRANCH_TRANSACTION MAKE_SQLSTATE('2','5','0','0','5') #define ERRCODE_READ_ONLY_SQL_TRANSACTION MAKE_SQLSTATE('2','5','0','0','6') #define ERRCODE_SCHEMA_AND_DATA_STATEMENT_MIXING_NOT_SUPPORTED MAKE_SQLSTATE('2','5','0','0','7') #define ERRCODE_NO_ACTIVE_SQL_TRANSACTION MAKE_SQLSTATE('2','5','P','0','1') #define ERRCODE_IN_FAILED_SQL_TRANSACTION MAKE_SQLSTATE('2','5','P','0','2') /* Class 26 - Invalid SQL Statement Name */ #define ERRCODE_INVALID_SQL_STATEMENT_NAME MAKE_SQLSTATE('2','6','0','0','0') /* Class 27 - Triggered Data Change Violation */ #define ERRCODE_TRIGGERED_DATA_CHANGE_VIOLATION MAKE_SQLSTATE('2','7','0','0','0') /* Class 28 - Invalid Authorization Specification */ #define ERRCODE_INVALID_AUTHORIZATION_SPECIFICATION MAKE_SQLSTATE('2','8','0','0','0') #define ERRCODE_INVALID_PASSWORD MAKE_SQLSTATE('2','8','P','0','1') /* Class 2B - Dependent Privilege Descriptors Still Exist */ #define ERRCODE_DEPENDENT_PRIVILEGE_DESCRIPTORS_STILL_EXIST MAKE_SQLSTATE('2','B','0','0','0') #define ERRCODE_DEPENDENT_OBJECTS_STILL_EXIST MAKE_SQLSTATE('2','B','P','0','1') /* Class 2D - Invalid Transaction Termination */ #define ERRCODE_INVALID_TRANSACTION_TERMINATION MAKE_SQLSTATE('2','D','0','0','0') /* Class 2F - SQL Routine Exception */ #define ERRCODE_SQL_ROUTINE_EXCEPTION MAKE_SQLSTATE('2','F','0','0','0') #define ERRCODE_S_R_E_FUNCTION_EXECUTED_NO_RETURN_STATEMENT MAKE_SQLSTATE('2','F','0','0','5') #define ERRCODE_S_R_E_MODIFYING_SQL_DATA_NOT_PERMITTED MAKE_SQLSTATE('2','F','0','0','2') #define ERRCODE_S_R_E_PROHIBITED_SQL_STATEMENT_ATTEMPTED MAKE_SQLSTATE('2','F','0','0','3') #define ERRCODE_S_R_E_READING_SQL_DATA_NOT_PERMITTED MAKE_SQLSTATE('2','F','0','0','4') /* Class 34 - Invalid Cursor Name */ #define ERRCODE_INVALID_CURSOR_NAME MAKE_SQLSTATE('3','4','0','0','0') /* Class 38 - External Routine Exception */ #define ERRCODE_EXTERNAL_ROUTINE_EXCEPTION MAKE_SQLSTATE('3','8','0','0','0') #define ERRCODE_E_R_E_CONTAINING_SQL_NOT_PERMITTED MAKE_SQLSTATE('3','8','0','0','1') #define ERRCODE_E_R_E_MODIFYING_SQL_DATA_NOT_PERMITTED MAKE_SQLSTATE('3','8','0','0','2') #define ERRCODE_E_R_E_PROHIBITED_SQL_STATEMENT_ATTEMPTED MAKE_SQLSTATE('3','8','0','0','3') #define ERRCODE_E_R_E_READING_SQL_DATA_NOT_PERMITTED MAKE_SQLSTATE('3','8','0','0','4') /* Class 39 - External Routine Invocation Exception */ #define ERRCODE_EXTERNAL_ROUTINE_INVOCATION_EXCEPTION MAKE_SQLSTATE('3','9','0','0','0') #define ERRCODE_E_R_I_E_INVALID_SQLSTATE_RETURNED MAKE_SQLSTATE('3','9','0','0','1') #define ERRCODE_E_R_I_E_NULL_VALUE_NOT_ALLOWED MAKE_SQLSTATE('3','9','0','0','4') #define ERRCODE_E_R_I_E_TRIGGER_PROTOCOL_VIOLATED MAKE_SQLSTATE('3','9','P','0','1') #define ERRCODE_E_R_I_E_SRF_PROTOCOL_VIOLATED MAKE_SQLSTATE('3','9','P','0','2') /* Class 3B - Savepoint Exception */ #define ERRCODE_SAVEPOINT_EXCEPTION MAKE_SQLSTATE('3','B','0','0','0') #define ERRCODE_S_E_INVALID_SPECIFICATION MAKE_SQLSTATE('3','B','0','0','1') /* Class 3D - Invalid Catalog Name */ #define ERRCODE_INVALID_CATALOG_NAME MAKE_SQLSTATE('3','D','0','0','0') /* Class 3F - Invalid Schema Name */ #define ERRCODE_INVALID_SCHEMA_NAME MAKE_SQLSTATE('3','F','0','0','0') /* Class 40 - Transaction Rollback */ #define ERRCODE_TRANSACTION_ROLLBACK MAKE_SQLSTATE('4','0','0','0','0') #define ERRCODE_T_R_INTEGRITY_CONSTRAINT_VIOLATION MAKE_SQLSTATE('4','0','0','0','2') #define ERRCODE_T_R_SERIALIZATION_FAILURE MAKE_SQLSTATE('4','0','0','0','1') #define ERRCODE_T_R_STATEMENT_COMPLETION_UNKNOWN MAKE_SQLSTATE('4','0','0','0','3') #define ERRCODE_T_R_DEADLOCK_DETECTED MAKE_SQLSTATE('4','0','P','0','1') /* Class 42 - Syntax Error or Access Rule Violation */ #define ERRCODE_SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION MAKE_SQLSTATE('4','2','0','0','0') #define ERRCODE_SYNTAX_ERROR MAKE_SQLSTATE('4','2','6','0','1') #define ERRCODE_INSUFFICIENT_PRIVILEGE MAKE_SQLSTATE('4','2','5','0','1') #define ERRCODE_CANNOT_COERCE MAKE_SQLSTATE('4','2','8','4','6') #define ERRCODE_GROUPING_ERROR MAKE_SQLSTATE('4','2','8','0','3') #define ERRCODE_WINDOWING_ERROR MAKE_SQLSTATE('4','2','P','2','0') #define ERRCODE_INVALID_RECURSION MAKE_SQLSTATE('4','2','P','1','9') #define ERRCODE_INVALID_FOREIGN_KEY MAKE_SQLSTATE('4','2','8','3','0') #define ERRCODE_INVALID_NAME MAKE_SQLSTATE('4','2','6','0','2') #define ERRCODE_NAME_TOO_LONG MAKE_SQLSTATE('4','2','6','2','2') #define ERRCODE_RESERVED_NAME MAKE_SQLSTATE('4','2','9','3','9') #define ERRCODE_DATATYPE_MISMATCH MAKE_SQLSTATE('4','2','8','0','4') #define ERRCODE_INDETERMINATE_DATATYPE MAKE_SQLSTATE('4','2','P','1','8') #define ERRCODE_COLLATION_MISMATCH MAKE_SQLSTATE('4','2','P','2','1') #define ERRCODE_INDETERMINATE_COLLATION MAKE_SQLSTATE('4','2','P','2','2') #define ERRCODE_WRONG_OBJECT_TYPE MAKE_SQLSTATE('4','2','8','0','9') #define ERRCODE_UNDEFINED_COLUMN MAKE_SQLSTATE('4','2','7','0','3') #define ERRCODE_UNDEFINED_CURSOR MAKE_SQLSTATE('3','4','0','0','0') #define ERRCODE_UNDEFINED_DATABASE MAKE_SQLSTATE('3','D','0','0','0') #define ERRCODE_UNDEFINED_FUNCTION MAKE_SQLSTATE('4','2','8','8','3') #define ERRCODE_UNDEFINED_PSTATEMENT MAKE_SQLSTATE('2','6','0','0','0') #define ERRCODE_UNDEFINED_SCHEMA MAKE_SQLSTATE('3','F','0','0','0') #define ERRCODE_UNDEFINED_TABLE MAKE_SQLSTATE('4','2','P','0','1') #define ERRCODE_UNDEFINED_PARAMETER MAKE_SQLSTATE('4','2','P','0','2') #define ERRCODE_UNDEFINED_OBJECT MAKE_SQLSTATE('4','2','7','0','4') #define ERRCODE_DUPLICATE_COLUMN MAKE_SQLSTATE('4','2','7','0','1') #define ERRCODE_DUPLICATE_CURSOR MAKE_SQLSTATE('4','2','P','0','3') #define ERRCODE_DUPLICATE_DATABASE MAKE_SQLSTATE('4','2','P','0','4') #define ERRCODE_DUPLICATE_FUNCTION MAKE_SQLSTATE('4','2','7','2','3') #define ERRCODE_DUPLICATE_PSTATEMENT MAKE_SQLSTATE('4','2','P','0','5') #define ERRCODE_DUPLICATE_SCHEMA MAKE_SQLSTATE('4','2','P','0','6') #define ERRCODE_DUPLICATE_TABLE MAKE_SQLSTATE('4','2','P','0','7') #define ERRCODE_DUPLICATE_ALIAS MAKE_SQLSTATE('4','2','7','1','2') #define ERRCODE_DUPLICATE_OBJECT MAKE_SQLSTATE('4','2','7','1','0') #define ERRCODE_AMBIGUOUS_COLUMN MAKE_SQLSTATE('4','2','7','0','2') #define ERRCODE_AMBIGUOUS_FUNCTION MAKE_SQLSTATE('4','2','7','2','5') #define ERRCODE_AMBIGUOUS_PARAMETER MAKE_SQLSTATE('4','2','P','0','8') #define ERRCODE_AMBIGUOUS_ALIAS MAKE_SQLSTATE('4','2','P','0','9') #define ERRCODE_INVALID_COLUMN_REFERENCE MAKE_SQLSTATE('4','2','P','1','0') #define ERRCODE_INVALID_COLUMN_DEFINITION MAKE_SQLSTATE('4','2','6','1','1') #define ERRCODE_INVALID_CURSOR_DEFINITION MAKE_SQLSTATE('4','2','P','1','1') #define ERRCODE_INVALID_DATABASE_DEFINITION MAKE_SQLSTATE('4','2','P','1','2') #define ERRCODE_INVALID_FUNCTION_DEFINITION MAKE_SQLSTATE('4','2','P','1','3') #define ERRCODE_INVALID_PSTATEMENT_DEFINITION MAKE_SQLSTATE('4','2','P','1','4') #define ERRCODE_INVALID_SCHEMA_DEFINITION MAKE_SQLSTATE('4','2','P','1','5') #define ERRCODE_INVALID_TABLE_DEFINITION MAKE_SQLSTATE('4','2','P','1','6') #define ERRCODE_INVALID_OBJECT_DEFINITION MAKE_SQLSTATE('4','2','P','1','7') /* Class 44 - WITH CHECK OPTION Violation */ #define ERRCODE_WITH_CHECK_OPTION_VIOLATION MAKE_SQLSTATE('4','4','0','0','0') /* Class 53 - Insufficient Resources */ #define ERRCODE_INSUFFICIENT_RESOURCES MAKE_SQLSTATE('5','3','0','0','0') #define ERRCODE_DISK_FULL MAKE_SQLSTATE('5','3','1','0','0') #define ERRCODE_OUT_OF_MEMORY MAKE_SQLSTATE('5','3','2','0','0') #define ERRCODE_TOO_MANY_CONNECTIONS MAKE_SQLSTATE('5','3','3','0','0') #define ERRCODE_CONFIGURATION_LIMIT_EXCEEDED MAKE_SQLSTATE('5','3','4','0','0') /* Class 54 - Program Limit Exceeded */ #define ERRCODE_PROGRAM_LIMIT_EXCEEDED MAKE_SQLSTATE('5','4','0','0','0') #define ERRCODE_STATEMENT_TOO_COMPLEX MAKE_SQLSTATE('5','4','0','0','1') #define ERRCODE_TOO_MANY_COLUMNS MAKE_SQLSTATE('5','4','0','1','1') #define ERRCODE_TOO_MANY_ARGUMENTS MAKE_SQLSTATE('5','4','0','2','3') /* Class 55 - Object Not In Prerequisite State */ #define ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE MAKE_SQLSTATE('5','5','0','0','0') #define ERRCODE_OBJECT_IN_USE MAKE_SQLSTATE('5','5','0','0','6') #define ERRCODE_CANT_CHANGE_RUNTIME_PARAM MAKE_SQLSTATE('5','5','P','0','2') #define ERRCODE_LOCK_NOT_AVAILABLE MAKE_SQLSTATE('5','5','P','0','3') /* Class 57 - Operator Intervention */ #define ERRCODE_OPERATOR_INTERVENTION MAKE_SQLSTATE('5','7','0','0','0') #define ERRCODE_QUERY_CANCELED MAKE_SQLSTATE('5','7','0','1','4') #define ERRCODE_ADMIN_SHUTDOWN MAKE_SQLSTATE('5','7','P','0','1') #define ERRCODE_CRASH_SHUTDOWN MAKE_SQLSTATE('5','7','P','0','2') #define ERRCODE_CANNOT_CONNECT_NOW MAKE_SQLSTATE('5','7','P','0','3') #define ERRCODE_DATABASE_DROPPED MAKE_SQLSTATE('5','7','P','0','4') /* Class 58 - System Error (errors external to PostgreSQL itself) */ #define ERRCODE_SYSTEM_ERROR MAKE_SQLSTATE('5','8','0','0','0') #define ERRCODE_IO_ERROR MAKE_SQLSTATE('5','8','0','3','0') #define ERRCODE_UNDEFINED_FILE MAKE_SQLSTATE('5','8','P','0','1') #define ERRCODE_DUPLICATE_FILE MAKE_SQLSTATE('5','8','P','0','2') /* Class F0 - Configuration File Error */ #define ERRCODE_CONFIG_FILE_ERROR MAKE_SQLSTATE('F','0','0','0','0') #define ERRCODE_LOCK_FILE_EXISTS MAKE_SQLSTATE('F','0','0','0','1') /* Class HV - Foreign Data Wrapper Error (SQL/MED) */ #define ERRCODE_FDW_ERROR MAKE_SQLSTATE('H','V','0','0','0') #define ERRCODE_FDW_COLUMN_NAME_NOT_FOUND MAKE_SQLSTATE('H','V','0','0','5') #define ERRCODE_FDW_DYNAMIC_PARAMETER_VALUE_NEEDED MAKE_SQLSTATE('H','V','0','0','2') #define ERRCODE_FDW_FUNCTION_SEQUENCE_ERROR MAKE_SQLSTATE('H','V','0','1','0') #define ERRCODE_FDW_INCONSISTENT_DESCRIPTOR_INFORMATION MAKE_SQLSTATE('H','V','0','2','1') #define ERRCODE_FDW_INVALID_ATTRIBUTE_VALUE MAKE_SQLSTATE('H','V','0','2','4') #define ERRCODE_FDW_INVALID_COLUMN_NAME MAKE_SQLSTATE('H','V','0','0','7') #define ERRCODE_FDW_INVALID_COLUMN_NUMBER MAKE_SQLSTATE('H','V','0','0','8') #define ERRCODE_FDW_INVALID_DATA_TYPE MAKE_SQLSTATE('H','V','0','0','4') #define ERRCODE_FDW_INVALID_DATA_TYPE_DESCRIPTORS MAKE_SQLSTATE('H','V','0','0','6') #define ERRCODE_FDW_INVALID_DESCRIPTOR_FIELD_IDENTIFIER MAKE_SQLSTATE('H','V','0','9','1') #define ERRCODE_FDW_INVALID_HANDLE MAKE_SQLSTATE('H','V','0','0','B') #define ERRCODE_FDW_INVALID_OPTION_INDEX MAKE_SQLSTATE('H','V','0','0','C') #define ERRCODE_FDW_INVALID_OPTION_NAME MAKE_SQLSTATE('H','V','0','0','D') #define ERRCODE_FDW_INVALID_STRING_LENGTH_OR_BUFFER_LENGTH MAKE_SQLSTATE('H','V','0','9','0') #define ERRCODE_FDW_INVALID_STRING_FORMAT MAKE_SQLSTATE('H','V','0','0','A') #define ERRCODE_FDW_INVALID_USE_OF_NULL_POINTER MAKE_SQLSTATE('H','V','0','0','9') #define ERRCODE_FDW_TOO_MANY_HANDLES MAKE_SQLSTATE('H','V','0','1','4') #define ERRCODE_FDW_OUT_OF_MEMORY MAKE_SQLSTATE('H','V','0','0','1') #define ERRCODE_FDW_NO_SCHEMAS MAKE_SQLSTATE('H','V','0','0','P') #define ERRCODE_FDW_OPTION_NAME_NOT_FOUND MAKE_SQLSTATE('H','V','0','0','J') #define ERRCODE_FDW_REPLY_HANDLE MAKE_SQLSTATE('H','V','0','0','K') #define ERRCODE_FDW_SCHEMA_NOT_FOUND MAKE_SQLSTATE('H','V','0','0','Q') #define ERRCODE_FDW_TABLE_NOT_FOUND MAKE_SQLSTATE('H','V','0','0','R') #define ERRCODE_FDW_UNABLE_TO_CREATE_EXECUTION MAKE_SQLSTATE('H','V','0','0','L') #define ERRCODE_FDW_UNABLE_TO_CREATE_REPLY MAKE_SQLSTATE('H','V','0','0','M') #define ERRCODE_FDW_UNABLE_TO_ESTABLISH_CONNECTION MAKE_SQLSTATE('H','V','0','0','N') /* Class P0 - PL/pgSQL Error */ #define ERRCODE_PLPGSQL_ERROR MAKE_SQLSTATE('P','0','0','0','0') #define ERRCODE_RAISE_EXCEPTION MAKE_SQLSTATE('P','0','0','0','1') #define ERRCODE_NO_DATA_FOUND MAKE_SQLSTATE('P','0','0','0','2') #define ERRCODE_TOO_MANY_ROWS MAKE_SQLSTATE('P','0','0','0','3') /* Class XX - Internal Error */ #define ERRCODE_INTERNAL_ERROR MAKE_SQLSTATE('X','X','0','0','0') #define ERRCODE_DATA_CORRUPTED MAKE_SQLSTATE('X','X','0','0','1') #define ERRCODE_INDEX_CORRUPTED MAKE_SQLSTATE('X','X','0','0','2') PKBiZڮ7  server/utils/plancache.hnu[/*------------------------------------------------------------------------- * * plancache.h * Plan cache definitions. * * See plancache.c for comments. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/plancache.h * *------------------------------------------------------------------------- */ #ifndef PLANCACHE_H #define PLANCACHE_H #include "access/tupdesc.h" #include "nodes/params.h" #define CACHEDPLANSOURCE_MAGIC 195726186 #define CACHEDPLAN_MAGIC 953717834 /* * CachedPlanSource (which might better have been called CachedQuery) * represents a SQL query that we expect to use multiple times. It stores * the query source text, the raw parse tree, and the analyzed-and-rewritten * query tree, as well as adjunct data. Cache invalidation can happen as a * result of DDL affecting objects used by the query. In that case we discard * the analyzed-and-rewritten query tree, and rebuild it when next needed. * * An actual execution plan, represented by CachedPlan, is derived from the * CachedPlanSource when we need to execute the query. The plan could be * either generic (usable with any set of plan parameters) or custom (for a * specific set of parameters). plancache.c contains the logic that decides * which way to do it for any particular execution. If we are using a generic * cached plan then it is meant to be re-used across multiple executions, so * callers must always treat CachedPlans as read-only. * * Once successfully built and "saved", CachedPlanSources typically live * for the life of the backend, although they can be dropped explicitly. * CachedPlans are reference-counted and go away automatically when the last * reference is dropped. A CachedPlan can outlive the CachedPlanSource it * was created from. * * An "unsaved" CachedPlanSource can be used for generating plans, but it * lives in transient storage and will not be updated in response to sinval * events. * * CachedPlans made from saved CachedPlanSources are likewise in permanent * storage, so to avoid memory leaks, the reference-counted references to them * must be held in permanent data structures or ResourceOwners. CachedPlans * made from unsaved CachedPlanSources are in children of the caller's * memory context, so references to them should not be longer-lived than * that context. (Reference counting is somewhat pro forma in that case, * though it may be useful if the CachedPlan can be discarded early.) * * A CachedPlanSource has two associated memory contexts: one that holds the * struct itself, the query source text and the raw parse tree, and another * context that holds the rewritten query tree and associated data. This * allows the query tree to be discarded easily when it is invalidated. * * Some callers wish to use the CachedPlan API even with one-shot queries * that have no reason to be saved at all. We therefore support a "oneshot" * variant that does no data copying or invalidation checking. In this case * there are no separate memory contexts: the CachedPlanSource struct and * all subsidiary data live in the caller's CurrentMemoryContext, and there * is no way to free memory short of clearing that entire context. A oneshot * plan is always treated as unsaved. * * Note: the string referenced by commandTag is not subsidiary storage; * it is assumed to be a compile-time-constant string. As with portals, * commandTag shall be NULL if and only if the original query string (before * rewriting) was an empty string. */ typedef struct CachedPlanSource { int magic; /* should equal CACHEDPLANSOURCE_MAGIC */ Node *raw_parse_tree; /* output of raw_parser(), or NULL */ const char *query_string; /* source text of query */ const char *commandTag; /* command tag (a constant!), or NULL */ Oid *param_types; /* array of parameter type OIDs, or NULL */ int num_params; /* length of param_types array */ ParserSetupHook parserSetup; /* alternative parameter spec method */ void *parserSetupArg; int cursor_options; /* cursor options used for planning */ bool fixed_result; /* disallow change in result tupdesc? */ TupleDesc resultDesc; /* result type; NULL = doesn't return tuples */ struct OverrideSearchPath *search_path; /* saved search_path */ MemoryContext context; /* memory context holding all above */ /* These fields describe the current analyzed-and-rewritten query tree: */ List *query_list; /* list of Query nodes, or NIL if not valid */ List *relationOids; /* OIDs of relations the queries depend on */ List *invalItems; /* other dependencies, as PlanInvalItems */ MemoryContext query_context; /* context holding the above, or NULL */ /* If we have a generic plan, this is a reference-counted link to it: */ struct CachedPlan *gplan; /* generic plan, or NULL if not valid */ /* Some state flags: */ bool is_complete; /* has CompleteCachedPlan been done? */ bool is_saved; /* has CachedPlanSource been "saved"? */ bool is_valid; /* is the query_list currently valid? */ bool is_oneshot; /* is it a "oneshot" plan? */ int generation; /* increments each time we create a plan */ /* If CachedPlanSource has been saved, it is a member of a global list */ struct CachedPlanSource *next_saved; /* list link, if so */ /* State kept to help decide whether to use custom or generic plans: */ double generic_cost; /* cost of generic plan, or -1 if not known */ double total_custom_cost; /* total cost of custom plans so far */ int num_custom_plans; /* number of plans included in total */ } CachedPlanSource; /* * CachedPlan represents an execution plan derived from a CachedPlanSource. * The reference count includes both the link from the parent CachedPlanSource * (if any), and any active plan executions, so the plan can be discarded * exactly when refcount goes to zero. Both the struct itself and the * subsidiary data live in the context denoted by the context field. * This makes it easy to free a no-longer-needed cached plan. (However, * if is_oneshot is true, the context does not belong solely to the CachedPlan * so no freeing is possible.) */ typedef struct CachedPlan { int magic; /* should equal CACHEDPLAN_MAGIC */ List *stmt_list; /* list of statement nodes (PlannedStmts and * bare utility statements) */ bool is_saved; /* is CachedPlan in a long-lived context? */ bool is_valid; /* is the stmt_list currently valid? */ bool is_oneshot; /* is it a "oneshot" plan? */ TransactionId saved_xmin; /* if valid, replan when TransactionXmin * changes from this value */ int generation; /* parent's generation number for this plan */ int refcount; /* count of live references to this struct */ MemoryContext context; /* context containing this CachedPlan */ } CachedPlan; extern void InitPlanCache(void); extern void ResetPlanCache(void); extern CachedPlanSource *CreateCachedPlan(Node *raw_parse_tree, const char *query_string, const char *commandTag); extern CachedPlanSource *CreateOneShotCachedPlan(Node *raw_parse_tree, const char *query_string, const char *commandTag); extern void CompleteCachedPlan(CachedPlanSource *plansource, List *querytree_list, MemoryContext querytree_context, Oid *param_types, int num_params, ParserSetupHook parserSetup, void *parserSetupArg, int cursor_options, bool fixed_result); extern void SaveCachedPlan(CachedPlanSource *plansource); extern void DropCachedPlan(CachedPlanSource *plansource); extern void CachedPlanSetParentContext(CachedPlanSource *plansource, MemoryContext newcontext); extern CachedPlanSource *CopyCachedPlan(CachedPlanSource *plansource); extern bool CachedPlanIsValid(CachedPlanSource *plansource); extern List *CachedPlanGetTargetList(CachedPlanSource *plansource); extern CachedPlan *GetCachedPlan(CachedPlanSource *plansource, ParamListInfo boundParams, bool useResOwner); extern void ReleaseCachedPlan(CachedPlan *plan, bool useResOwner); #endif /* PLANCACHE_H */ PKBiZOU3""server/utils/int8.hnu[/*------------------------------------------------------------------------- * * int8.h * Declarations for operations on 64-bit integers. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/int8.h * * NOTES * These data types are supported on all 64-bit architectures, and may * be supported through libraries on some 32-bit machines. If your machine * is not currently supported, then please try to make it so, then post * patches to the postgresql.org hackers mailing list. * *------------------------------------------------------------------------- */ #ifndef INT8_H #define INT8_H #include "fmgr.h" extern bool scanint8(const char *str, bool errorOK, int64 *result); extern Datum int8in(PG_FUNCTION_ARGS); extern Datum int8out(PG_FUNCTION_ARGS); extern Datum int8recv(PG_FUNCTION_ARGS); extern Datum int8send(PG_FUNCTION_ARGS); extern Datum int8eq(PG_FUNCTION_ARGS); extern Datum int8ne(PG_FUNCTION_ARGS); extern Datum int8lt(PG_FUNCTION_ARGS); extern Datum int8gt(PG_FUNCTION_ARGS); extern Datum int8le(PG_FUNCTION_ARGS); extern Datum int8ge(PG_FUNCTION_ARGS); extern Datum int84eq(PG_FUNCTION_ARGS); extern Datum int84ne(PG_FUNCTION_ARGS); extern Datum int84lt(PG_FUNCTION_ARGS); extern Datum int84gt(PG_FUNCTION_ARGS); extern Datum int84le(PG_FUNCTION_ARGS); extern Datum int84ge(PG_FUNCTION_ARGS); extern Datum int48eq(PG_FUNCTION_ARGS); extern Datum int48ne(PG_FUNCTION_ARGS); extern Datum int48lt(PG_FUNCTION_ARGS); extern Datum int48gt(PG_FUNCTION_ARGS); extern Datum int48le(PG_FUNCTION_ARGS); extern Datum int48ge(PG_FUNCTION_ARGS); extern Datum int82eq(PG_FUNCTION_ARGS); extern Datum int82ne(PG_FUNCTION_ARGS); extern Datum int82lt(PG_FUNCTION_ARGS); extern Datum int82gt(PG_FUNCTION_ARGS); extern Datum int82le(PG_FUNCTION_ARGS); extern Datum int82ge(PG_FUNCTION_ARGS); extern Datum int28eq(PG_FUNCTION_ARGS); extern Datum int28ne(PG_FUNCTION_ARGS); extern Datum int28lt(PG_FUNCTION_ARGS); extern Datum int28gt(PG_FUNCTION_ARGS); extern Datum int28le(PG_FUNCTION_ARGS); extern Datum int28ge(PG_FUNCTION_ARGS); extern Datum int8um(PG_FUNCTION_ARGS); extern Datum int8up(PG_FUNCTION_ARGS); extern Datum int8pl(PG_FUNCTION_ARGS); extern Datum int8mi(PG_FUNCTION_ARGS); extern Datum int8mul(PG_FUNCTION_ARGS); extern Datum int8div(PG_FUNCTION_ARGS); extern Datum int8abs(PG_FUNCTION_ARGS); extern Datum int8mod(PG_FUNCTION_ARGS); extern Datum int8inc(PG_FUNCTION_ARGS); extern Datum int8inc_any(PG_FUNCTION_ARGS); extern Datum int8inc_float8_float8(PG_FUNCTION_ARGS); extern Datum int8larger(PG_FUNCTION_ARGS); extern Datum int8smaller(PG_FUNCTION_ARGS); extern Datum int8and(PG_FUNCTION_ARGS); extern Datum int8or(PG_FUNCTION_ARGS); extern Datum int8xor(PG_FUNCTION_ARGS); extern Datum int8not(PG_FUNCTION_ARGS); extern Datum int8shl(PG_FUNCTION_ARGS); extern Datum int8shr(PG_FUNCTION_ARGS); extern Datum int84pl(PG_FUNCTION_ARGS); extern Datum int84mi(PG_FUNCTION_ARGS); extern Datum int84mul(PG_FUNCTION_ARGS); extern Datum int84div(PG_FUNCTION_ARGS); extern Datum int48pl(PG_FUNCTION_ARGS); extern Datum int48mi(PG_FUNCTION_ARGS); extern Datum int48mul(PG_FUNCTION_ARGS); extern Datum int48div(PG_FUNCTION_ARGS); extern Datum int82pl(PG_FUNCTION_ARGS); extern Datum int82mi(PG_FUNCTION_ARGS); extern Datum int82mul(PG_FUNCTION_ARGS); extern Datum int82div(PG_FUNCTION_ARGS); extern Datum int28pl(PG_FUNCTION_ARGS); extern Datum int28mi(PG_FUNCTION_ARGS); extern Datum int28mul(PG_FUNCTION_ARGS); extern Datum int28div(PG_FUNCTION_ARGS); extern Datum int48(PG_FUNCTION_ARGS); extern Datum int84(PG_FUNCTION_ARGS); extern Datum int28(PG_FUNCTION_ARGS); extern Datum int82(PG_FUNCTION_ARGS); extern Datum i8tod(PG_FUNCTION_ARGS); extern Datum dtoi8(PG_FUNCTION_ARGS); extern Datum i8tof(PG_FUNCTION_ARGS); extern Datum ftoi8(PG_FUNCTION_ARGS); extern Datum i8tooid(PG_FUNCTION_ARGS); extern Datum oidtoi8(PG_FUNCTION_ARGS); extern Datum generate_series_int8(PG_FUNCTION_ARGS); extern Datum generate_series_step_int8(PG_FUNCTION_ARGS); #endif /* INT8_H */ PKBiZserver/utils/dynamic_loader.hnu[/*------------------------------------------------------------------------- * * dynamic_loader.h * * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/dynamic_loader.h * *------------------------------------------------------------------------- */ #ifndef DYNAMIC_LOADER_H #define DYNAMIC_LOADER_H #include "fmgr.h" extern void *pg_dlopen(char *filename); extern PGFunction pg_dlsym(void *handle, char *funcname); extern void pg_dlclose(void *handle); extern char *pg_dlerror(void); #endif /* DYNAMIC_LOADER_H */ PKBiZC(aeFFserver/utils/resowner.hnu[/*------------------------------------------------------------------------- * * resowner.h * POSTGRES resource owner definitions. * * Query-lifespan resources are tracked by associating them with * ResourceOwner objects. This provides a simple mechanism for ensuring * that such resources are freed at the right time. * See utils/resowner/README for more info. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/resowner.h * *------------------------------------------------------------------------- */ #ifndef RESOWNER_H #define RESOWNER_H #include "storage/fd.h" #include "storage/lock.h" #include "utils/catcache.h" #include "utils/plancache.h" #include "utils/snapshot.h" /* * ResourceOwner objects are an opaque data structure known only within * resowner.c. */ typedef struct ResourceOwnerData *ResourceOwner; /* * Globally known ResourceOwners */ extern PGDLLIMPORT ResourceOwner CurrentResourceOwner; extern PGDLLIMPORT ResourceOwner CurTransactionResourceOwner; extern PGDLLIMPORT ResourceOwner TopTransactionResourceOwner; /* * Resource releasing is done in three phases: pre-locks, locks, and * post-locks. The pre-lock phase must release any resources that are * visible to other backends (such as pinned buffers); this ensures that * when we release a lock that another backend may be waiting on, it will * see us as being fully out of our transaction. The post-lock phase * should be used for backend-internal cleanup. */ typedef enum { RESOURCE_RELEASE_BEFORE_LOCKS, RESOURCE_RELEASE_LOCKS, RESOURCE_RELEASE_AFTER_LOCKS } ResourceReleasePhase; /* * Dynamically loaded modules can get control during ResourceOwnerRelease * by providing a callback of this form. */ typedef void (*ResourceReleaseCallback) (ResourceReleasePhase phase, bool isCommit, bool isTopLevel, void *arg); /* * Functions in resowner.c */ /* generic routines */ extern ResourceOwner ResourceOwnerCreate(ResourceOwner parent, const char *name); extern void ResourceOwnerRelease(ResourceOwner owner, ResourceReleasePhase phase, bool isCommit, bool isTopLevel); extern void ResourceOwnerDelete(ResourceOwner owner); extern ResourceOwner ResourceOwnerGetParent(ResourceOwner owner); extern void ResourceOwnerNewParent(ResourceOwner owner, ResourceOwner newparent); extern void RegisterResourceReleaseCallback(ResourceReleaseCallback callback, void *arg); extern void UnregisterResourceReleaseCallback(ResourceReleaseCallback callback, void *arg); /* support for buffer refcount management */ extern void ResourceOwnerEnlargeBuffers(ResourceOwner owner); extern void ResourceOwnerRememberBuffer(ResourceOwner owner, Buffer buffer); extern void ResourceOwnerForgetBuffer(ResourceOwner owner, Buffer buffer); /* support for local lock management */ extern void ResourceOwnerRememberLock(ResourceOwner owner, LOCALLOCK *locallock); extern void ResourceOwnerForgetLock(ResourceOwner owner, LOCALLOCK *locallock); /* support for catcache refcount management */ extern void ResourceOwnerEnlargeCatCacheRefs(ResourceOwner owner); extern void ResourceOwnerRememberCatCacheRef(ResourceOwner owner, HeapTuple tuple); extern void ResourceOwnerForgetCatCacheRef(ResourceOwner owner, HeapTuple tuple); extern void ResourceOwnerEnlargeCatCacheListRefs(ResourceOwner owner); extern void ResourceOwnerRememberCatCacheListRef(ResourceOwner owner, CatCList *list); extern void ResourceOwnerForgetCatCacheListRef(ResourceOwner owner, CatCList *list); /* support for relcache refcount management */ extern void ResourceOwnerEnlargeRelationRefs(ResourceOwner owner); extern void ResourceOwnerRememberRelationRef(ResourceOwner owner, Relation rel); extern void ResourceOwnerForgetRelationRef(ResourceOwner owner, Relation rel); /* support for plancache refcount management */ extern void ResourceOwnerEnlargePlanCacheRefs(ResourceOwner owner); extern void ResourceOwnerRememberPlanCacheRef(ResourceOwner owner, CachedPlan *plan); extern void ResourceOwnerForgetPlanCacheRef(ResourceOwner owner, CachedPlan *plan); /* support for tupledesc refcount management */ extern void ResourceOwnerEnlargeTupleDescs(ResourceOwner owner); extern void ResourceOwnerRememberTupleDesc(ResourceOwner owner, TupleDesc tupdesc); extern void ResourceOwnerForgetTupleDesc(ResourceOwner owner, TupleDesc tupdesc); /* support for snapshot refcount management */ extern void ResourceOwnerEnlargeSnapshots(ResourceOwner owner); extern void ResourceOwnerRememberSnapshot(ResourceOwner owner, Snapshot snapshot); extern void ResourceOwnerForgetSnapshot(ResourceOwner owner, Snapshot snapshot); /* support for temporary file management */ extern void ResourceOwnerEnlargeFiles(ResourceOwner owner); extern void ResourceOwnerRememberFile(ResourceOwner owner, File file); extern void ResourceOwnerForgetFile(ResourceOwner owner, File file); #endif /* RESOWNER_H */ PKBiZI{  server/utils/typcache.hnu[/*------------------------------------------------------------------------- * * typcache.h * Type cache definitions. * * The type cache exists to speed lookup of certain information about data * types that is not directly available from a type's pg_type row. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/typcache.h * *------------------------------------------------------------------------- */ #ifndef TYPCACHE_H #define TYPCACHE_H #include "access/tupdesc.h" #include "fmgr.h" /* TypeCacheEnumData is an opaque struct known only within typcache.c */ struct TypeCacheEnumData; typedef struct TypeCacheEntry { /* typeId is the hash lookup key and MUST BE FIRST */ Oid type_id; /* OID of the data type */ /* some subsidiary information copied from the pg_type row */ int16 typlen; bool typbyval; char typalign; char typstorage; char typtype; Oid typrelid; /* * Information obtained from opfamily entries * * These will be InvalidOid if no match could be found, or if the * information hasn't yet been requested. Also note that for array and * composite types, typcache.c checks that the contained types are * comparable or hashable before allowing eq_opr etc to become set. */ Oid btree_opf; /* the default btree opclass' family */ Oid btree_opintype; /* the default btree opclass' opcintype */ Oid hash_opf; /* the default hash opclass' family */ Oid hash_opintype; /* the default hash opclass' opcintype */ Oid eq_opr; /* the equality operator */ Oid lt_opr; /* the less-than operator */ Oid gt_opr; /* the greater-than operator */ Oid cmp_proc; /* the btree comparison function */ Oid hash_proc; /* the hash calculation function */ /* * Pre-set-up fmgr call info for the equality operator, the btree * comparison function, and the hash calculation function. These are kept * in the type cache to avoid problems with memory leaks in repeated calls * to functions such as array_eq, array_cmp, hash_array. There is not * currently a need to maintain call info for the lt_opr or gt_opr. */ FmgrInfo eq_opr_finfo; FmgrInfo cmp_proc_finfo; FmgrInfo hash_proc_finfo; /* * Tuple descriptor if it's a composite type (row type). NULL if not * composite or information hasn't yet been requested. (NOTE: this is a * reference-counted tupledesc.) */ TupleDesc tupDesc; /* * Fields computed when TYPECACHE_RANGE_INFO is requested. Zeroes if not * a range type or information hasn't yet been requested. Note that * rng_cmp_proc_finfo could be different from the element type's default * btree comparison function. */ struct TypeCacheEntry *rngelemtype; /* range's element type */ Oid rng_collation; /* collation for comparisons, if any */ FmgrInfo rng_cmp_proc_finfo; /* comparison function */ FmgrInfo rng_canonical_finfo; /* canonicalization function, if any */ FmgrInfo rng_subdiff_finfo; /* difference function, if any */ /* Private data, for internal use of typcache.c only */ int flags; /* flags about what we've computed */ /* * Private information about an enum type. NULL if not enum or * information hasn't been requested. */ struct TypeCacheEnumData *enumData; } TypeCacheEntry; /* Bit flags to indicate which fields a given caller needs to have set */ #define TYPECACHE_EQ_OPR 0x0001 #define TYPECACHE_LT_OPR 0x0002 #define TYPECACHE_GT_OPR 0x0004 #define TYPECACHE_CMP_PROC 0x0008 #define TYPECACHE_HASH_PROC 0x0010 #define TYPECACHE_EQ_OPR_FINFO 0x0020 #define TYPECACHE_CMP_PROC_FINFO 0x0040 #define TYPECACHE_HASH_PROC_FINFO 0x0080 #define TYPECACHE_TUPDESC 0x0100 #define TYPECACHE_BTREE_OPFAMILY 0x0200 #define TYPECACHE_HASH_OPFAMILY 0x0400 #define TYPECACHE_RANGE_INFO 0x0800 extern TypeCacheEntry *lookup_type_cache(Oid type_id, int flags); extern TupleDesc lookup_rowtype_tupdesc(Oid type_id, int32 typmod); extern TupleDesc lookup_rowtype_tupdesc_noerror(Oid type_id, int32 typmod, bool noError); extern TupleDesc lookup_rowtype_tupdesc_copy(Oid type_id, int32 typmod); extern void assign_record_type_typmod(TupleDesc tupDesc); extern int compare_values_of_enum(TypeCacheEntry *tcache, Oid arg1, Oid arg2); #endif /* TYPCACHE_H */ PKBiZserver/utils/dynahash.hnu[/*------------------------------------------------------------------------- * * dynahash * POSTGRES dynahash.h file definitions * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/dynahash.h * *------------------------------------------------------------------------- */ #ifndef DYNAHASH_H #define DYNAHASH_H extern int my_log2(long num); #endif /* DYNAHASH_H */ PKBiZ$ server/utils/rangetypes.hnu[/*------------------------------------------------------------------------- * * rangetypes.h * Declarations for Postgres range types. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/rangetypes.h * *------------------------------------------------------------------------- */ #ifndef RANGETYPES_H #define RANGETYPES_H #include "utils/typcache.h" /* * Ranges are varlena objects, so must meet the varlena convention that * the first int32 of the object contains the total object size in bytes. * Be sure to use VARSIZE() and SET_VARSIZE() to access it, though! */ typedef struct { int32 vl_len_; /* varlena header (do not touch directly!) */ Oid rangetypid; /* range type's own OID */ /* Following the OID are zero to two bound values, then a flags byte */ } RangeType; /* Use this macro in preference to fetching rangetypid field directly */ #define RangeTypeGetOid(r) ((r)->rangetypid) /* A range's flags byte contains these bits: */ #define RANGE_EMPTY 0x01 /* range is empty */ #define RANGE_LB_INC 0x02 /* lower bound is inclusive */ #define RANGE_UB_INC 0x04 /* upper bound is inclusive */ #define RANGE_LB_INF 0x08 /* lower bound is -infinity */ #define RANGE_UB_INF 0x10 /* upper bound is +infinity */ #define RANGE_LB_NULL 0x20 /* lower bound is null (NOT USED) */ #define RANGE_UB_NULL 0x40 /* upper bound is null (NOT USED) */ #define RANGE_CONTAIN_EMPTY 0x80/* marks a GiST internal-page entry whose * subtree contains some empty ranges */ #define RANGE_HAS_LBOUND(flags) (!((flags) & (RANGE_EMPTY | \ RANGE_LB_NULL | \ RANGE_LB_INF))) #define RANGE_HAS_UBOUND(flags) (!((flags) & (RANGE_EMPTY | \ RANGE_UB_NULL | \ RANGE_UB_INF))) #define RangeIsEmpty(r) ((range_get_flags(r) & RANGE_EMPTY) != 0) #define RangeIsOrContainsEmpty(r) \ ((range_get_flags(r) & (RANGE_EMPTY | RANGE_CONTAIN_EMPTY)) != 0) /* Internal representation of either bound of a range (not what's on disk) */ typedef struct { Datum val; /* the bound value, if any */ bool infinite; /* bound is +/- infinity */ bool inclusive; /* bound is inclusive (vs exclusive) */ bool lower; /* this is the lower (vs upper) bound */ } RangeBound; /* * fmgr macros for range type objects */ #define DatumGetRangeType(X) ((RangeType *) PG_DETOAST_DATUM(X)) #define DatumGetRangeTypeCopy(X) ((RangeType *) PG_DETOAST_DATUM_COPY(X)) #define RangeTypeGetDatum(X) PointerGetDatum(X) #define PG_GETARG_RANGE(n) DatumGetRangeType(PG_GETARG_DATUM(n)) #define PG_GETARG_RANGE_COPY(n) DatumGetRangeTypeCopy(PG_GETARG_DATUM(n)) #define PG_RETURN_RANGE(x) return RangeTypeGetDatum(x) /* * prototypes for functions defined in rangetypes.c */ /* I/O */ extern Datum range_in(PG_FUNCTION_ARGS); extern Datum range_out(PG_FUNCTION_ARGS); extern Datum range_recv(PG_FUNCTION_ARGS); extern Datum range_send(PG_FUNCTION_ARGS); /* constructors */ extern Datum range_constructor2(PG_FUNCTION_ARGS); extern Datum range_constructor3(PG_FUNCTION_ARGS); /* range -> subtype */ extern Datum range_lower(PG_FUNCTION_ARGS); extern Datum range_upper(PG_FUNCTION_ARGS); /* range -> bool */ extern Datum range_empty(PG_FUNCTION_ARGS); extern Datum range_lower_inc(PG_FUNCTION_ARGS); extern Datum range_upper_inc(PG_FUNCTION_ARGS); extern Datum range_lower_inf(PG_FUNCTION_ARGS); extern Datum range_upper_inf(PG_FUNCTION_ARGS); /* range, element -> bool */ extern Datum range_contains_elem(PG_FUNCTION_ARGS); extern Datum elem_contained_by_range(PG_FUNCTION_ARGS); extern bool range_contains_elem_internal(TypeCacheEntry *typcache, RangeType *r, Datum val); /* range, range -> bool */ extern Datum range_eq(PG_FUNCTION_ARGS); extern Datum range_ne(PG_FUNCTION_ARGS); extern Datum range_contains(PG_FUNCTION_ARGS); extern Datum range_contained_by(PG_FUNCTION_ARGS); extern Datum range_before(PG_FUNCTION_ARGS); extern Datum range_after(PG_FUNCTION_ARGS); extern Datum range_adjacent(PG_FUNCTION_ARGS); extern Datum range_overlaps(PG_FUNCTION_ARGS); extern Datum range_overleft(PG_FUNCTION_ARGS); extern Datum range_overright(PG_FUNCTION_ARGS); /* internal versions of the above */ extern bool range_eq_internal(TypeCacheEntry *typcache, RangeType *r1, RangeType *r2); extern bool range_ne_internal(TypeCacheEntry *typcache, RangeType *r1, RangeType *r2); extern bool range_contains_internal(TypeCacheEntry *typcache, RangeType *r1, RangeType *r2); extern bool range_contained_by_internal(TypeCacheEntry *typcache, RangeType *r1, RangeType *r2); extern bool range_before_internal(TypeCacheEntry *typcache, RangeType *r1, RangeType *r2); extern bool range_after_internal(TypeCacheEntry *typcache, RangeType *r1, RangeType *r2); extern bool range_adjacent_internal(TypeCacheEntry *typcache, RangeType *r1, RangeType *r2); extern bool range_overlaps_internal(TypeCacheEntry *typcache, RangeType *r1, RangeType *r2); extern bool range_overleft_internal(TypeCacheEntry *typcache, RangeType *r1, RangeType *r2); extern bool range_overright_internal(TypeCacheEntry *typcache, RangeType *r1, RangeType *r2); /* range, range -> range */ extern Datum range_minus(PG_FUNCTION_ARGS); extern Datum range_union(PG_FUNCTION_ARGS); extern Datum range_intersect(PG_FUNCTION_ARGS); /* BTree support */ extern Datum range_cmp(PG_FUNCTION_ARGS); extern Datum range_lt(PG_FUNCTION_ARGS); extern Datum range_le(PG_FUNCTION_ARGS); extern Datum range_ge(PG_FUNCTION_ARGS); extern Datum range_gt(PG_FUNCTION_ARGS); /* Hash support */ extern Datum hash_range(PG_FUNCTION_ARGS); /* ANALYZE support */ extern Datum range_typanalyze(PG_FUNCTION_ARGS); /* Canonical functions */ extern Datum int4range_canonical(PG_FUNCTION_ARGS); extern Datum int8range_canonical(PG_FUNCTION_ARGS); extern Datum daterange_canonical(PG_FUNCTION_ARGS); /* Subtype Difference functions */ extern Datum int4range_subdiff(PG_FUNCTION_ARGS); extern Datum int8range_subdiff(PG_FUNCTION_ARGS); extern Datum numrange_subdiff(PG_FUNCTION_ARGS); extern Datum daterange_subdiff(PG_FUNCTION_ARGS); extern Datum tsrange_subdiff(PG_FUNCTION_ARGS); extern Datum tstzrange_subdiff(PG_FUNCTION_ARGS); /* assorted support functions */ extern TypeCacheEntry *range_get_typcache(FunctionCallInfo fcinfo, Oid rngtypid); extern RangeType *range_serialize(TypeCacheEntry *typcache, RangeBound *lower, RangeBound *upper, bool empty); extern void range_deserialize(TypeCacheEntry *typcache, RangeType *range, RangeBound *lower, RangeBound *upper, bool *empty); extern char range_get_flags(RangeType *range); extern void range_set_contain_empty(RangeType *range); extern RangeType *make_range(TypeCacheEntry *typcache, RangeBound *lower, RangeBound *upper, bool empty); extern int range_cmp_bounds(TypeCacheEntry *typcache, RangeBound *b1, RangeBound *b2); extern int range_cmp_bound_values(TypeCacheEntry *typcache, RangeBound *b1, RangeBound *b2); extern RangeType *make_empty_range(TypeCacheEntry *typcache); /* GiST support (in rangetypes_gist.c) */ extern Datum range_gist_consistent(PG_FUNCTION_ARGS); extern Datum range_gist_compress(PG_FUNCTION_ARGS); extern Datum range_gist_decompress(PG_FUNCTION_ARGS); extern Datum range_gist_union(PG_FUNCTION_ARGS); extern Datum range_gist_penalty(PG_FUNCTION_ARGS); extern Datum range_gist_picksplit(PG_FUNCTION_ARGS); extern Datum range_gist_same(PG_FUNCTION_ARGS); #endif /* RANGETYPES_H */ PKBiZGt server/utils/tqual.hnu[/*------------------------------------------------------------------------- * * tqual.h * POSTGRES "time qualification" definitions, ie, tuple visibility rules. * * Should be moved/renamed... - vadim 07/28/98 * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/tqual.h * *------------------------------------------------------------------------- */ #ifndef TQUAL_H #define TQUAL_H #include "utils/snapshot.h" /* Static variables representing various special snapshot semantics */ extern PGDLLIMPORT SnapshotData SnapshotNowData; extern PGDLLIMPORT SnapshotData SnapshotSelfData; extern PGDLLIMPORT SnapshotData SnapshotAnyData; extern PGDLLIMPORT SnapshotData SnapshotToastData; #define SnapshotNow (&SnapshotNowData) #define SnapshotSelf (&SnapshotSelfData) #define SnapshotAny (&SnapshotAnyData) #define SnapshotToast (&SnapshotToastData) /* * We don't provide a static SnapshotDirty variable because it would be * non-reentrant. Instead, users of that snapshot type should declare a * local variable of type SnapshotData, and initialize it with this macro. */ #define InitDirtySnapshot(snapshotdata) \ ((snapshotdata).satisfies = HeapTupleSatisfiesDirty) /* This macro encodes the knowledge of which snapshots are MVCC-safe */ #define IsMVCCSnapshot(snapshot) \ ((snapshot)->satisfies == HeapTupleSatisfiesMVCC) /* * HeapTupleSatisfiesVisibility * True iff heap tuple satisfies a time qual. * * Notes: * Assumes heap tuple is valid. * Beware of multiple evaluations of snapshot argument. * Hint bits in the HeapTuple's t_infomask may be updated as a side effect; * if so, the indicated buffer is marked dirty. */ #define HeapTupleSatisfiesVisibility(tuple, snapshot, buffer) \ ((*(snapshot)->satisfies) ((tuple)->t_data, snapshot, buffer)) /* Result codes for HeapTupleSatisfiesVacuum */ typedef enum { HEAPTUPLE_DEAD, /* tuple is dead and deletable */ HEAPTUPLE_LIVE, /* tuple is live (committed, no deleter) */ HEAPTUPLE_RECENTLY_DEAD, /* tuple is dead, but not deletable yet */ HEAPTUPLE_INSERT_IN_PROGRESS, /* inserting xact is still in progress */ HEAPTUPLE_DELETE_IN_PROGRESS /* deleting xact is still in progress */ } HTSV_Result; /* These are the "satisfies" test routines for the various snapshot types */ extern bool HeapTupleSatisfiesMVCC(HeapTupleHeader tuple, Snapshot snapshot, Buffer buffer); extern bool HeapTupleSatisfiesNow(HeapTupleHeader tuple, Snapshot snapshot, Buffer buffer); extern bool HeapTupleSatisfiesSelf(HeapTupleHeader tuple, Snapshot snapshot, Buffer buffer); extern bool HeapTupleSatisfiesAny(HeapTupleHeader tuple, Snapshot snapshot, Buffer buffer); extern bool HeapTupleSatisfiesToast(HeapTupleHeader tuple, Snapshot snapshot, Buffer buffer); extern bool HeapTupleSatisfiesDirty(HeapTupleHeader tuple, Snapshot snapshot, Buffer buffer); /* Special "satisfies" routines with different APIs */ extern HTSU_Result HeapTupleSatisfiesUpdate(HeapTupleHeader tuple, CommandId curcid, Buffer buffer); extern HTSV_Result HeapTupleSatisfiesVacuum(HeapTupleHeader tuple, TransactionId OldestXmin, Buffer buffer); extern bool HeapTupleIsSurelyDead(HeapTupleHeader tuple, TransactionId OldestXmin); extern bool XidInMVCCSnapshot(TransactionId xid, Snapshot snapshot); extern void HeapTupleSetHintBits(HeapTupleHeader tuple, Buffer buffer, uint16 infomask, TransactionId xid); #endif /* TQUAL_H */ PKBiZ;(BNNserver/utils/pg_crc_tables.hnu[/*------------------------------------------------------------------------- * * pg_crc_tables.h * Polynomial lookup tables for CRC macros * * We make these tables available as a .h file so that programs not linked * with libpgport can still use the macros in pg_crc.h. They just need * to #include this header as well. * * See Ross Williams' excellent introduction * A PAINLESS GUIDE TO CRC ERROR DETECTION ALGORITHMS, available from * http://www.ross.net/crc/download/crc_v3.txt or several other net sites. * * We use a normal (not "reflected", in Williams' terms) CRC, using initial * all-ones register contents and a final bit inversion. * * The 64-bit variant is not used as of PostgreSQL 8.1, but we retain the * code for possible future use. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/pg_crc_tables.h * *------------------------------------------------------------------------- */ #ifndef PG_CRC_TABLES_H #define PG_CRC_TABLES_H /* * This table is based on the polynomial * x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1. * (This is the same polynomial used in Ethernet checksums, for instance.) */ const uint32 pg_crc32_table[256] = { 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D }; #ifdef PROVIDE_64BIT_CRC /* * This table is based on the polynomial * * x^64 + x^62 + x^57 + x^55 + x^54 + x^53 + x^52 + x^47 + x^46 + x^45 + * x^40 + x^39 + x^38 + x^37 + x^35 + x^33 + x^32 + x^31 + x^29 + x^27 + * x^24 + x^23 + x^22 + x^21 + x^19 + x^17 + x^13 + x^12 + x^10 + x^9 + * x^7 + x^4 + x + 1 * * which is borrowed from the DLT1 spec * (ECMA-182, available from http://www.ecma.ch/ecma1/STAND/ECMA-182.HTM) */ #if SIZEOF_VOID_P < 8 /* this test must match the one in pg_crc.h */ const uint32 pg_crc64_table0[256] = { 0x00000000, 0xA9EA3693, 0x53D46D26, 0xFA3E5BB5, 0x0E42ECDF, 0xA7A8DA4C, 0x5D9681F9, 0xF47CB76A, 0x1C85D9BE, 0xB56FEF2D, 0x4F51B498, 0xE6BB820B, 0x12C73561, 0xBB2D03F2, 0x41135847, 0xE8F96ED4, 0x90E185EF, 0x390BB37C, 0xC335E8C9, 0x6ADFDE5A, 0x9EA36930, 0x37495FA3, 0xCD770416, 0x649D3285, 0x8C645C51, 0x258E6AC2, 0xDFB03177, 0x765A07E4, 0x8226B08E, 0x2BCC861D, 0xD1F2DDA8, 0x7818EB3B, 0x21C30BDE, 0x88293D4D, 0x721766F8, 0xDBFD506B, 0x2F81E701, 0x866BD192, 0x7C558A27, 0xD5BFBCB4, 0x3D46D260, 0x94ACE4F3, 0x6E92BF46, 0xC77889D5, 0x33043EBF, 0x9AEE082C, 0x60D05399, 0xC93A650A, 0xB1228E31, 0x18C8B8A2, 0xE2F6E317, 0x4B1CD584, 0xBF6062EE, 0x168A547D, 0xECB40FC8, 0x455E395B, 0xADA7578F, 0x044D611C, 0xFE733AA9, 0x57990C3A, 0xA3E5BB50, 0x0A0F8DC3, 0xF031D676, 0x59DBE0E5, 0xEA6C212F, 0x438617BC, 0xB9B84C09, 0x10527A9A, 0xE42ECDF0, 0x4DC4FB63, 0xB7FAA0D6, 0x1E109645, 0xF6E9F891, 0x5F03CE02, 0xA53D95B7, 0x0CD7A324, 0xF8AB144E, 0x514122DD, 0xAB7F7968, 0x02954FFB, 0x7A8DA4C0, 0xD3679253, 0x2959C9E6, 0x80B3FF75, 0x74CF481F, 0xDD257E8C, 0x271B2539, 0x8EF113AA, 0x66087D7E, 0xCFE24BED, 0x35DC1058, 0x9C3626CB, 0x684A91A1, 0xC1A0A732, 0x3B9EFC87, 0x9274CA14, 0xCBAF2AF1, 0x62451C62, 0x987B47D7, 0x31917144, 0xC5EDC62E, 0x6C07F0BD, 0x9639AB08, 0x3FD39D9B, 0xD72AF34F, 0x7EC0C5DC, 0x84FE9E69, 0x2D14A8FA, 0xD9681F90, 0x70822903, 0x8ABC72B6, 0x23564425, 0x5B4EAF1E, 0xF2A4998D, 0x089AC238, 0xA170F4AB, 0x550C43C1, 0xFCE67552, 0x06D82EE7, 0xAF321874, 0x47CB76A0, 0xEE214033, 0x141F1B86, 0xBDF52D15, 0x49899A7F, 0xE063ACEC, 0x1A5DF759, 0xB3B7C1CA, 0x7D3274CD, 0xD4D8425E, 0x2EE619EB, 0x870C2F78, 0x73709812, 0xDA9AAE81, 0x20A4F534, 0x894EC3A7, 0x61B7AD73, 0xC85D9BE0, 0x3263C055, 0x9B89F6C6, 0x6FF541AC, 0xC61F773F, 0x3C212C8A, 0x95CB1A19, 0xEDD3F122, 0x4439C7B1, 0xBE079C04, 0x17EDAA97, 0xE3911DFD, 0x4A7B2B6E, 0xB04570DB, 0x19AF4648, 0xF156289C, 0x58BC1E0F, 0xA28245BA, 0x0B687329, 0xFF14C443, 0x56FEF2D0, 0xACC0A965, 0x052A9FF6, 0x5CF17F13, 0xF51B4980, 0x0F251235, 0xA6CF24A6, 0x52B393CC, 0xFB59A55F, 0x0167FEEA, 0xA88DC879, 0x4074A6AD, 0xE99E903E, 0x13A0CB8B, 0xBA4AFD18, 0x4E364A72, 0xE7DC7CE1, 0x1DE22754, 0xB40811C7, 0xCC10FAFC, 0x65FACC6F, 0x9FC497DA, 0x362EA149, 0xC2521623, 0x6BB820B0, 0x91867B05, 0x386C4D96, 0xD0952342, 0x797F15D1, 0x83414E64, 0x2AAB78F7, 0xDED7CF9D, 0x773DF90E, 0x8D03A2BB, 0x24E99428, 0x975E55E2, 0x3EB46371, 0xC48A38C4, 0x6D600E57, 0x991CB93D, 0x30F68FAE, 0xCAC8D41B, 0x6322E288, 0x8BDB8C5C, 0x2231BACF, 0xD80FE17A, 0x71E5D7E9, 0x85996083, 0x2C735610, 0xD64D0DA5, 0x7FA73B36, 0x07BFD00D, 0xAE55E69E, 0x546BBD2B, 0xFD818BB8, 0x09FD3CD2, 0xA0170A41, 0x5A2951F4, 0xF3C36767, 0x1B3A09B3, 0xB2D03F20, 0x48EE6495, 0xE1045206, 0x1578E56C, 0xBC92D3FF, 0x46AC884A, 0xEF46BED9, 0xB69D5E3C, 0x1F7768AF, 0xE549331A, 0x4CA30589, 0xB8DFB2E3, 0x11358470, 0xEB0BDFC5, 0x42E1E956, 0xAA188782, 0x03F2B111, 0xF9CCEAA4, 0x5026DC37, 0xA45A6B5D, 0x0DB05DCE, 0xF78E067B, 0x5E6430E8, 0x267CDBD3, 0x8F96ED40, 0x75A8B6F5, 0xDC428066, 0x283E370C, 0x81D4019F, 0x7BEA5A2A, 0xD2006CB9, 0x3AF9026D, 0x931334FE, 0x692D6F4B, 0xC0C759D8, 0x34BBEEB2, 0x9D51D821, 0x676F8394, 0xCE85B507 }; const uint32 pg_crc64_table1[256] = { 0x00000000, 0x42F0E1EB, 0x85E1C3D7, 0xC711223C, 0x49336645, 0x0BC387AE, 0xCCD2A592, 0x8E224479, 0x9266CC8A, 0xD0962D61, 0x17870F5D, 0x5577EEB6, 0xDB55AACF, 0x99A54B24, 0x5EB46918, 0x1C4488F3, 0x663D78FF, 0x24CD9914, 0xE3DCBB28, 0xA12C5AC3, 0x2F0E1EBA, 0x6DFEFF51, 0xAAEFDD6D, 0xE81F3C86, 0xF45BB475, 0xB6AB559E, 0x71BA77A2, 0x334A9649, 0xBD68D230, 0xFF9833DB, 0x388911E7, 0x7A79F00C, 0xCC7AF1FF, 0x8E8A1014, 0x499B3228, 0x0B6BD3C3, 0x854997BA, 0xC7B97651, 0x00A8546D, 0x4258B586, 0x5E1C3D75, 0x1CECDC9E, 0xDBFDFEA2, 0x990D1F49, 0x172F5B30, 0x55DFBADB, 0x92CE98E7, 0xD03E790C, 0xAA478900, 0xE8B768EB, 0x2FA64AD7, 0x6D56AB3C, 0xE374EF45, 0xA1840EAE, 0x66952C92, 0x2465CD79, 0x3821458A, 0x7AD1A461, 0xBDC0865D, 0xFF3067B6, 0x711223CF, 0x33E2C224, 0xF4F3E018, 0xB60301F3, 0xDA050215, 0x98F5E3FE, 0x5FE4C1C2, 0x1D142029, 0x93366450, 0xD1C685BB, 0x16D7A787, 0x5427466C, 0x4863CE9F, 0x0A932F74, 0xCD820D48, 0x8F72ECA3, 0x0150A8DA, 0x43A04931, 0x84B16B0D, 0xC6418AE6, 0xBC387AEA, 0xFEC89B01, 0x39D9B93D, 0x7B2958D6, 0xF50B1CAF, 0xB7FBFD44, 0x70EADF78, 0x321A3E93, 0x2E5EB660, 0x6CAE578B, 0xABBF75B7, 0xE94F945C, 0x676DD025, 0x259D31CE, 0xE28C13F2, 0xA07CF219, 0x167FF3EA, 0x548F1201, 0x939E303D, 0xD16ED1D6, 0x5F4C95AF, 0x1DBC7444, 0xDAAD5678, 0x985DB793, 0x84193F60, 0xC6E9DE8B, 0x01F8FCB7, 0x43081D5C, 0xCD2A5925, 0x8FDAB8CE, 0x48CB9AF2, 0x0A3B7B19, 0x70428B15, 0x32B26AFE, 0xF5A348C2, 0xB753A929, 0x3971ED50, 0x7B810CBB, 0xBC902E87, 0xFE60CF6C, 0xE224479F, 0xA0D4A674, 0x67C58448, 0x253565A3, 0xAB1721DA, 0xE9E7C031, 0x2EF6E20D, 0x6C0603E6, 0xF6FAE5C0, 0xB40A042B, 0x731B2617, 0x31EBC7FC, 0xBFC98385, 0xFD39626E, 0x3A284052, 0x78D8A1B9, 0x649C294A, 0x266CC8A1, 0xE17DEA9D, 0xA38D0B76, 0x2DAF4F0F, 0x6F5FAEE4, 0xA84E8CD8, 0xEABE6D33, 0x90C79D3F, 0xD2377CD4, 0x15265EE8, 0x57D6BF03, 0xD9F4FB7A, 0x9B041A91, 0x5C1538AD, 0x1EE5D946, 0x02A151B5, 0x4051B05E, 0x87409262, 0xC5B07389, 0x4B9237F0, 0x0962D61B, 0xCE73F427, 0x8C8315CC, 0x3A80143F, 0x7870F5D4, 0xBF61D7E8, 0xFD913603, 0x73B3727A, 0x31439391, 0xF652B1AD, 0xB4A25046, 0xA8E6D8B5, 0xEA16395E, 0x2D071B62, 0x6FF7FA89, 0xE1D5BEF0, 0xA3255F1B, 0x64347D27, 0x26C49CCC, 0x5CBD6CC0, 0x1E4D8D2B, 0xD95CAF17, 0x9BAC4EFC, 0x158E0A85, 0x577EEB6E, 0x906FC952, 0xD29F28B9, 0xCEDBA04A, 0x8C2B41A1, 0x4B3A639D, 0x09CA8276, 0x87E8C60F, 0xC51827E4, 0x020905D8, 0x40F9E433, 0x2CFFE7D5, 0x6E0F063E, 0xA91E2402, 0xEBEEC5E9, 0x65CC8190, 0x273C607B, 0xE02D4247, 0xA2DDA3AC, 0xBE992B5F, 0xFC69CAB4, 0x3B78E888, 0x79880963, 0xF7AA4D1A, 0xB55AACF1, 0x724B8ECD, 0x30BB6F26, 0x4AC29F2A, 0x08327EC1, 0xCF235CFD, 0x8DD3BD16, 0x03F1F96F, 0x41011884, 0x86103AB8, 0xC4E0DB53, 0xD8A453A0, 0x9A54B24B, 0x5D459077, 0x1FB5719C, 0x919735E5, 0xD367D40E, 0x1476F632, 0x568617D9, 0xE085162A, 0xA275F7C1, 0x6564D5FD, 0x27943416, 0xA9B6706F, 0xEB469184, 0x2C57B3B8, 0x6EA75253, 0x72E3DAA0, 0x30133B4B, 0xF7021977, 0xB5F2F89C, 0x3BD0BCE5, 0x79205D0E, 0xBE317F32, 0xFCC19ED9, 0x86B86ED5, 0xC4488F3E, 0x0359AD02, 0x41A94CE9, 0xCF8B0890, 0x8D7BE97B, 0x4A6ACB47, 0x089A2AAC, 0x14DEA25F, 0x562E43B4, 0x913F6188, 0xD3CF8063, 0x5DEDC41A, 0x1F1D25F1, 0xD80C07CD, 0x9AFCE626 }; #else /* use int64 implementation */ const uint64 pg_crc64_table[256] = { UINT64CONST(0x0000000000000000), UINT64CONST(0x42F0E1EBA9EA3693), UINT64CONST(0x85E1C3D753D46D26), UINT64CONST(0xC711223CFA3E5BB5), UINT64CONST(0x493366450E42ECDF), UINT64CONST(0x0BC387AEA7A8DA4C), UINT64CONST(0xCCD2A5925D9681F9), UINT64CONST(0x8E224479F47CB76A), UINT64CONST(0x9266CC8A1C85D9BE), UINT64CONST(0xD0962D61B56FEF2D), UINT64CONST(0x17870F5D4F51B498), UINT64CONST(0x5577EEB6E6BB820B), UINT64CONST(0xDB55AACF12C73561), UINT64CONST(0x99A54B24BB2D03F2), UINT64CONST(0x5EB4691841135847), UINT64CONST(0x1C4488F3E8F96ED4), UINT64CONST(0x663D78FF90E185EF), UINT64CONST(0x24CD9914390BB37C), UINT64CONST(0xE3DCBB28C335E8C9), UINT64CONST(0xA12C5AC36ADFDE5A), UINT64CONST(0x2F0E1EBA9EA36930), UINT64CONST(0x6DFEFF5137495FA3), UINT64CONST(0xAAEFDD6DCD770416), UINT64CONST(0xE81F3C86649D3285), UINT64CONST(0xF45BB4758C645C51), UINT64CONST(0xB6AB559E258E6AC2), UINT64CONST(0x71BA77A2DFB03177), UINT64CONST(0x334A9649765A07E4), UINT64CONST(0xBD68D2308226B08E), UINT64CONST(0xFF9833DB2BCC861D), UINT64CONST(0x388911E7D1F2DDA8), UINT64CONST(0x7A79F00C7818EB3B), UINT64CONST(0xCC7AF1FF21C30BDE), UINT64CONST(0x8E8A101488293D4D), UINT64CONST(0x499B3228721766F8), UINT64CONST(0x0B6BD3C3DBFD506B), UINT64CONST(0x854997BA2F81E701), UINT64CONST(0xC7B97651866BD192), UINT64CONST(0x00A8546D7C558A27), UINT64CONST(0x4258B586D5BFBCB4), UINT64CONST(0x5E1C3D753D46D260), UINT64CONST(0x1CECDC9E94ACE4F3), UINT64CONST(0xDBFDFEA26E92BF46), UINT64CONST(0x990D1F49C77889D5), UINT64CONST(0x172F5B3033043EBF), UINT64CONST(0x55DFBADB9AEE082C), UINT64CONST(0x92CE98E760D05399), UINT64CONST(0xD03E790CC93A650A), UINT64CONST(0xAA478900B1228E31), UINT64CONST(0xE8B768EB18C8B8A2), UINT64CONST(0x2FA64AD7E2F6E317), UINT64CONST(0x6D56AB3C4B1CD584), UINT64CONST(0xE374EF45BF6062EE), UINT64CONST(0xA1840EAE168A547D), UINT64CONST(0x66952C92ECB40FC8), UINT64CONST(0x2465CD79455E395B), UINT64CONST(0x3821458AADA7578F), UINT64CONST(0x7AD1A461044D611C), UINT64CONST(0xBDC0865DFE733AA9), UINT64CONST(0xFF3067B657990C3A), UINT64CONST(0x711223CFA3E5BB50), UINT64CONST(0x33E2C2240A0F8DC3), UINT64CONST(0xF4F3E018F031D676), UINT64CONST(0xB60301F359DBE0E5), UINT64CONST(0xDA050215EA6C212F), UINT64CONST(0x98F5E3FE438617BC), UINT64CONST(0x5FE4C1C2B9B84C09), UINT64CONST(0x1D14202910527A9A), UINT64CONST(0x93366450E42ECDF0), UINT64CONST(0xD1C685BB4DC4FB63), UINT64CONST(0x16D7A787B7FAA0D6), UINT64CONST(0x5427466C1E109645), UINT64CONST(0x4863CE9FF6E9F891), UINT64CONST(0x0A932F745F03CE02), UINT64CONST(0xCD820D48A53D95B7), UINT64CONST(0x8F72ECA30CD7A324), UINT64CONST(0x0150A8DAF8AB144E), UINT64CONST(0x43A04931514122DD), UINT64CONST(0x84B16B0DAB7F7968), UINT64CONST(0xC6418AE602954FFB), UINT64CONST(0xBC387AEA7A8DA4C0), UINT64CONST(0xFEC89B01D3679253), UINT64CONST(0x39D9B93D2959C9E6), UINT64CONST(0x7B2958D680B3FF75), UINT64CONST(0xF50B1CAF74CF481F), UINT64CONST(0xB7FBFD44DD257E8C), UINT64CONST(0x70EADF78271B2539), UINT64CONST(0x321A3E938EF113AA), UINT64CONST(0x2E5EB66066087D7E), UINT64CONST(0x6CAE578BCFE24BED), UINT64CONST(0xABBF75B735DC1058), UINT64CONST(0xE94F945C9C3626CB), UINT64CONST(0x676DD025684A91A1), UINT64CONST(0x259D31CEC1A0A732), UINT64CONST(0xE28C13F23B9EFC87), UINT64CONST(0xA07CF2199274CA14), UINT64CONST(0x167FF3EACBAF2AF1), UINT64CONST(0x548F120162451C62), UINT64CONST(0x939E303D987B47D7), UINT64CONST(0xD16ED1D631917144), UINT64CONST(0x5F4C95AFC5EDC62E), UINT64CONST(0x1DBC74446C07F0BD), UINT64CONST(0xDAAD56789639AB08), UINT64CONST(0x985DB7933FD39D9B), UINT64CONST(0x84193F60D72AF34F), UINT64CONST(0xC6E9DE8B7EC0C5DC), UINT64CONST(0x01F8FCB784FE9E69), UINT64CONST(0x43081D5C2D14A8FA), UINT64CONST(0xCD2A5925D9681F90), UINT64CONST(0x8FDAB8CE70822903), UINT64CONST(0x48CB9AF28ABC72B6), UINT64CONST(0x0A3B7B1923564425), UINT64CONST(0x70428B155B4EAF1E), UINT64CONST(0x32B26AFEF2A4998D), UINT64CONST(0xF5A348C2089AC238), UINT64CONST(0xB753A929A170F4AB), UINT64CONST(0x3971ED50550C43C1), UINT64CONST(0x7B810CBBFCE67552), UINT64CONST(0xBC902E8706D82EE7), UINT64CONST(0xFE60CF6CAF321874), UINT64CONST(0xE224479F47CB76A0), UINT64CONST(0xA0D4A674EE214033), UINT64CONST(0x67C58448141F1B86), UINT64CONST(0x253565A3BDF52D15), UINT64CONST(0xAB1721DA49899A7F), UINT64CONST(0xE9E7C031E063ACEC), UINT64CONST(0x2EF6E20D1A5DF759), UINT64CONST(0x6C0603E6B3B7C1CA), UINT64CONST(0xF6FAE5C07D3274CD), UINT64CONST(0xB40A042BD4D8425E), UINT64CONST(0x731B26172EE619EB), UINT64CONST(0x31EBC7FC870C2F78), UINT64CONST(0xBFC9838573709812), UINT64CONST(0xFD39626EDA9AAE81), UINT64CONST(0x3A28405220A4F534), UINT64CONST(0x78D8A1B9894EC3A7), UINT64CONST(0x649C294A61B7AD73), UINT64CONST(0x266CC8A1C85D9BE0), UINT64CONST(0xE17DEA9D3263C055), UINT64CONST(0xA38D0B769B89F6C6), UINT64CONST(0x2DAF4F0F6FF541AC), UINT64CONST(0x6F5FAEE4C61F773F), UINT64CONST(0xA84E8CD83C212C8A), UINT64CONST(0xEABE6D3395CB1A19), UINT64CONST(0x90C79D3FEDD3F122), UINT64CONST(0xD2377CD44439C7B1), UINT64CONST(0x15265EE8BE079C04), UINT64CONST(0x57D6BF0317EDAA97), UINT64CONST(0xD9F4FB7AE3911DFD), UINT64CONST(0x9B041A914A7B2B6E), UINT64CONST(0x5C1538ADB04570DB), UINT64CONST(0x1EE5D94619AF4648), UINT64CONST(0x02A151B5F156289C), UINT64CONST(0x4051B05E58BC1E0F), UINT64CONST(0x87409262A28245BA), UINT64CONST(0xC5B073890B687329), UINT64CONST(0x4B9237F0FF14C443), UINT64CONST(0x0962D61B56FEF2D0), UINT64CONST(0xCE73F427ACC0A965), UINT64CONST(0x8C8315CC052A9FF6), UINT64CONST(0x3A80143F5CF17F13), UINT64CONST(0x7870F5D4F51B4980), UINT64CONST(0xBF61D7E80F251235), UINT64CONST(0xFD913603A6CF24A6), UINT64CONST(0x73B3727A52B393CC), UINT64CONST(0x31439391FB59A55F), UINT64CONST(0xF652B1AD0167FEEA), UINT64CONST(0xB4A25046A88DC879), UINT64CONST(0xA8E6D8B54074A6AD), UINT64CONST(0xEA16395EE99E903E), UINT64CONST(0x2D071B6213A0CB8B), UINT64CONST(0x6FF7FA89BA4AFD18), UINT64CONST(0xE1D5BEF04E364A72), UINT64CONST(0xA3255F1BE7DC7CE1), UINT64CONST(0x64347D271DE22754), UINT64CONST(0x26C49CCCB40811C7), UINT64CONST(0x5CBD6CC0CC10FAFC), UINT64CONST(0x1E4D8D2B65FACC6F), UINT64CONST(0xD95CAF179FC497DA), UINT64CONST(0x9BAC4EFC362EA149), UINT64CONST(0x158E0A85C2521623), UINT64CONST(0x577EEB6E6BB820B0), UINT64CONST(0x906FC95291867B05), UINT64CONST(0xD29F28B9386C4D96), UINT64CONST(0xCEDBA04AD0952342), UINT64CONST(0x8C2B41A1797F15D1), UINT64CONST(0x4B3A639D83414E64), UINT64CONST(0x09CA82762AAB78F7), UINT64CONST(0x87E8C60FDED7CF9D), UINT64CONST(0xC51827E4773DF90E), UINT64CONST(0x020905D88D03A2BB), UINT64CONST(0x40F9E43324E99428), UINT64CONST(0x2CFFE7D5975E55E2), UINT64CONST(0x6E0F063E3EB46371), UINT64CONST(0xA91E2402C48A38C4), UINT64CONST(0xEBEEC5E96D600E57), UINT64CONST(0x65CC8190991CB93D), UINT64CONST(0x273C607B30F68FAE), UINT64CONST(0xE02D4247CAC8D41B), UINT64CONST(0xA2DDA3AC6322E288), UINT64CONST(0xBE992B5F8BDB8C5C), UINT64CONST(0xFC69CAB42231BACF), UINT64CONST(0x3B78E888D80FE17A), UINT64CONST(0x7988096371E5D7E9), UINT64CONST(0xF7AA4D1A85996083), UINT64CONST(0xB55AACF12C735610), UINT64CONST(0x724B8ECDD64D0DA5), UINT64CONST(0x30BB6F267FA73B36), UINT64CONST(0x4AC29F2A07BFD00D), UINT64CONST(0x08327EC1AE55E69E), UINT64CONST(0xCF235CFD546BBD2B), UINT64CONST(0x8DD3BD16FD818BB8), UINT64CONST(0x03F1F96F09FD3CD2), UINT64CONST(0x41011884A0170A41), UINT64CONST(0x86103AB85A2951F4), UINT64CONST(0xC4E0DB53F3C36767), UINT64CONST(0xD8A453A01B3A09B3), UINT64CONST(0x9A54B24BB2D03F20), UINT64CONST(0x5D45907748EE6495), UINT64CONST(0x1FB5719CE1045206), UINT64CONST(0x919735E51578E56C), UINT64CONST(0xD367D40EBC92D3FF), UINT64CONST(0x1476F63246AC884A), UINT64CONST(0x568617D9EF46BED9), UINT64CONST(0xE085162AB69D5E3C), UINT64CONST(0xA275F7C11F7768AF), UINT64CONST(0x6564D5FDE549331A), UINT64CONST(0x279434164CA30589), UINT64CONST(0xA9B6706FB8DFB2E3), UINT64CONST(0xEB46918411358470), UINT64CONST(0x2C57B3B8EB0BDFC5), UINT64CONST(0x6EA7525342E1E956), UINT64CONST(0x72E3DAA0AA188782), UINT64CONST(0x30133B4B03F2B111), UINT64CONST(0xF7021977F9CCEAA4), UINT64CONST(0xB5F2F89C5026DC37), UINT64CONST(0x3BD0BCE5A45A6B5D), UINT64CONST(0x79205D0E0DB05DCE), UINT64CONST(0xBE317F32F78E067B), UINT64CONST(0xFCC19ED95E6430E8), UINT64CONST(0x86B86ED5267CDBD3), UINT64CONST(0xC4488F3E8F96ED40), UINT64CONST(0x0359AD0275A8B6F5), UINT64CONST(0x41A94CE9DC428066), UINT64CONST(0xCF8B0890283E370C), UINT64CONST(0x8D7BE97B81D4019F), UINT64CONST(0x4A6ACB477BEA5A2A), UINT64CONST(0x089A2AACD2006CB9), UINT64CONST(0x14DEA25F3AF9026D), UINT64CONST(0x562E43B4931334FE), UINT64CONST(0x913F6188692D6F4B), UINT64CONST(0xD3CF8063C0C759D8), UINT64CONST(0x5DEDC41A34BBEEB2), UINT64CONST(0x1F1D25F19D51D821), UINT64CONST(0xD80C07CD676F8394), UINT64CONST(0x9AFCE626CE85B507) }; #endif /* SIZEOF_VOID_P < 8 */ #endif /* PROVIDE_64BIT_CRC */ #endif /* PG_CRC_TABLES_H */ PKBiZ2mserver/utils/reltrigger.hnu[/*------------------------------------------------------------------------- * * reltrigger.h * POSTGRES relation trigger definitions. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/reltrigger.h * *------------------------------------------------------------------------- */ #ifndef RELTRIGGER_H #define RELTRIGGER_H /* * These struct really belongs to trigger.h, but we put it separately so that * it can be cleanly included in rel.h and other places. */ typedef struct Trigger { Oid tgoid; /* OID of trigger (pg_trigger row) */ /* Remaining fields are copied from pg_trigger, see pg_trigger.h */ char *tgname; Oid tgfoid; int16 tgtype; char tgenabled; bool tgisinternal; Oid tgconstrrelid; Oid tgconstrindid; Oid tgconstraint; bool tgdeferrable; bool tginitdeferred; int16 tgnargs; int16 tgnattr; int16 *tgattr; char **tgargs; char *tgqual; } Trigger; typedef struct TriggerDesc { Trigger *triggers; /* array of Trigger structs */ int numtriggers; /* number of array entries */ /* * These flags indicate whether the array contains at least one of each * type of trigger. We use these to skip searching the array if not. */ bool trig_insert_before_row; bool trig_insert_after_row; bool trig_insert_instead_row; bool trig_insert_before_statement; bool trig_insert_after_statement; bool trig_update_before_row; bool trig_update_after_row; bool trig_update_instead_row; bool trig_update_before_statement; bool trig_update_after_statement; bool trig_delete_before_row; bool trig_delete_after_row; bool trig_delete_instead_row; bool trig_delete_before_statement; bool trig_delete_after_statement; /* there are no row-level truncate triggers */ bool trig_truncate_before_statement; bool trig_truncate_after_statement; } TriggerDesc; #endif /* RELTRIGGER_H */ PKBiZ server/utils/relcache.hnu[/*------------------------------------------------------------------------- * * relcache.h * Relation descriptor cache definitions. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/relcache.h * *------------------------------------------------------------------------- */ #ifndef RELCACHE_H #define RELCACHE_H #include "access/tupdesc.h" #include "nodes/bitmapset.h" typedef struct RelationData *Relation; /* ---------------- * RelationPtr is used in the executor to support index scans * where we have to keep track of several index relations in an * array. -cim 9/10/89 * ---------------- */ typedef Relation *RelationPtr; /* * Routines to open (lookup) and close a relcache entry */ extern Relation RelationIdGetRelation(Oid relationId); extern void RelationClose(Relation relation); /* * Routines to compute/retrieve additional cached information */ extern List *RelationGetIndexList(Relation relation); extern Oid RelationGetOidIndex(Relation relation); extern List *RelationGetIndexExpressions(Relation relation); extern List *RelationGetIndexPredicate(Relation relation); extern Bitmapset *RelationGetIndexAttrBitmap(Relation relation); extern void RelationGetExclusionInfo(Relation indexRelation, Oid **operators, Oid **procs, uint16 **strategies); extern void RelationSetIndexList(Relation relation, List *indexIds, Oid oidIndex); extern void RelationInitIndexAccessInfo(Relation relation); /* * Routines for backend startup */ extern void RelationCacheInitialize(void); extern void RelationCacheInitializePhase2(void); extern void RelationCacheInitializePhase3(void); /* * Routine to create a relcache entry for an about-to-be-created relation */ extern Relation RelationBuildLocalRelation(const char *relname, Oid relnamespace, TupleDesc tupDesc, Oid relid, Oid relfilenode, Oid reltablespace, bool shared_relation, bool mapped_relation, char relpersistence); /* * Routine to manage assignment of new relfilenode to a relation */ extern void RelationSetNewRelfilenode(Relation relation, TransactionId freezeXid); /* * Routines for flushing/rebuilding relcache entries in various scenarios */ extern void RelationForgetRelation(Oid rid); extern void RelationCacheInvalidateEntry(Oid relationId); extern void RelationCacheInvalidate(void); extern void RelationCloseSmgrByOid(Oid relationId); extern void AtEOXact_RelationCache(bool isCommit); extern void AtEOSubXact_RelationCache(bool isCommit, SubTransactionId mySubid, SubTransactionId parentSubid); /* * Routines to help manage rebuilding of relcache init files */ extern bool RelationIdIsInInitFile(Oid relationId); extern void RelationCacheInitFilePreInvalidate(void); extern void RelationCacheInitFilePostInvalidate(void); extern void RelationCacheInitFileRemove(void); /* should be used only by relcache.c and catcache.c */ extern bool criticalRelcachesBuilt; /* should be used only by relcache.c and postinit.c */ extern bool criticalSharedRelcachesBuilt; #endif /* RELCACHE_H */ PKBiZserver/utils/guc_tables.hnu[/*------------------------------------------------------------------------- * * guc_tables.h * Declarations of tables used by GUC. * * See src/backend/utils/misc/README for design notes. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * * src/include/utils/guc_tables.h * *------------------------------------------------------------------------- */ #ifndef GUC_TABLES_H #define GUC_TABLES_H 1 #include "utils/guc.h" /* * GUC supports these types of variables: */ enum config_type { PGC_BOOL, PGC_INT, PGC_REAL, PGC_STRING, PGC_ENUM }; union config_var_val { bool boolval; int intval; double realval; char *stringval; int enumval; }; /* * The actual value of a GUC variable can include a malloc'd opaque struct * "extra", which is created by its check_hook and used by its assign_hook. */ typedef struct config_var_value { union config_var_val val; void *extra; } config_var_value; /* * Groupings to help organize all the run-time options for display */ enum config_group { UNGROUPED, FILE_LOCATIONS, CONN_AUTH, CONN_AUTH_SETTINGS, CONN_AUTH_SECURITY, RESOURCES, RESOURCES_MEM, RESOURCES_DISK, RESOURCES_KERNEL, RESOURCES_VACUUM_DELAY, RESOURCES_BGWRITER, RESOURCES_ASYNCHRONOUS, WAL, WAL_SETTINGS, WAL_CHECKPOINTS, WAL_ARCHIVING, REPLICATION, REPLICATION_SENDING, REPLICATION_MASTER, REPLICATION_STANDBY, QUERY_TUNING, QUERY_TUNING_METHOD, QUERY_TUNING_COST, QUERY_TUNING_GEQO, QUERY_TUNING_OTHER, LOGGING, LOGGING_WHERE, LOGGING_WHEN, LOGGING_WHAT, STATS, STATS_MONITORING, STATS_COLLECTOR, AUTOVACUUM, CLIENT_CONN, CLIENT_CONN_STATEMENT, CLIENT_CONN_LOCALE, CLIENT_CONN_OTHER, LOCK_MANAGEMENT, COMPAT_OPTIONS, COMPAT_OPTIONS_PREVIOUS, COMPAT_OPTIONS_CLIENT, ERROR_HANDLING_OPTIONS, PRESET_OPTIONS, CUSTOM_OPTIONS, DEVELOPER_OPTIONS }; /* * Stack entry for saving the state a variable had prior to an uncommitted * transactional change */ typedef enum { /* This is almost GucAction, but we need a fourth state for SET+LOCAL */ GUC_SAVE, /* entry caused by function SET option */ GUC_SET, /* entry caused by plain SET command */ GUC_LOCAL, /* entry caused by SET LOCAL command */ GUC_SET_LOCAL /* entry caused by SET then SET LOCAL */ } GucStackState; typedef struct guc_stack { struct guc_stack *prev; /* previous stack item, if any */ int nest_level; /* nesting depth at which we made entry */ GucStackState state; /* see enum above */ GucSource source; /* source of the prior value */ /* masked value's source must be PGC_S_SESSION, so no need to store it */ GucContext scontext; /* context that set the prior value */ GucContext masked_scontext; /* context that set the masked value */ config_var_value prior; /* previous value of variable */ config_var_value masked; /* SET value in a GUC_SET_LOCAL entry */ } GucStack; /* * Generic fields applicable to all types of variables * * The short description should be less than 80 chars in length. Some * applications may use the long description as well, and will append * it to the short description. (separated by a newline or '. ') * * Note that sourcefile/sourceline are kept here, and not pushed into stacked * values, although in principle they belong with some stacked value if the * active value is session- or transaction-local. This is to avoid bloating * stack entries. We know they are only relevant when source == PGC_S_FILE. */ struct config_generic { /* constant fields, must be set correctly in initial value: */ const char *name; /* name of variable - MUST BE FIRST */ GucContext context; /* context required to set the variable */ enum config_group group; /* to help organize variables by function */ const char *short_desc; /* short desc. of this variable's purpose */ const char *long_desc; /* long desc. of this variable's purpose */ int flags; /* flag bits, see guc.h */ /* variable fields, initialized at runtime: */ enum config_type vartype; /* type of variable (set only at startup) */ int status; /* status bits, see below */ GucSource source; /* source of the current actual value */ GucSource reset_source; /* source of the reset_value */ GucContext scontext; /* context that set the current value */ GucContext reset_scontext; /* context that set the reset value */ GucStack *stack; /* stacked prior values */ void *extra; /* "extra" pointer for current actual value */ char *sourcefile; /* file current setting is from (NULL if not * set in config file) */ int sourceline; /* line in source file */ }; /* bit values in status field */ #define GUC_IS_IN_FILE 0x0001 /* found it in config file */ /* * Caution: the GUC_IS_IN_FILE bit is transient state for ProcessConfigFile. * Do not assume that its value represents useful information elsewhere. */ /* GUC records for specific variable types */ struct config_bool { struct config_generic gen; /* constant fields, must be set correctly in initial value: */ bool *variable; bool boot_val; GucBoolCheckHook check_hook; GucBoolAssignHook assign_hook; GucShowHook show_hook; /* variable fields, initialized at runtime: */ bool reset_val; void *reset_extra; }; struct config_int { struct config_generic gen; /* constant fields, must be set correctly in initial value: */ int *variable; int boot_val; int min; int max; GucIntCheckHook check_hook; GucIntAssignHook assign_hook; GucShowHook show_hook; /* variable fields, initialized at runtime: */ int reset_val; void *reset_extra; }; struct config_real { struct config_generic gen; /* constant fields, must be set correctly in initial value: */ double *variable; double boot_val; double min; double max; GucRealCheckHook check_hook; GucRealAssignHook assign_hook; GucShowHook show_hook; /* variable fields, initialized at runtime: */ double reset_val; void *reset_extra; }; struct config_string { struct config_generic gen; /* constant fields, must be set correctly in initial value: */ char **variable; const char *boot_val; GucStringCheckHook check_hook; GucStringAssignHook assign_hook; GucShowHook show_hook; /* variable fields, initialized at runtime: */ char *reset_val; void *reset_extra; }; struct config_enum { struct config_generic gen; /* constant fields, must be set correctly in initial value: */ int *variable; int boot_val; const struct config_enum_entry *options; GucEnumCheckHook check_hook; GucEnumAssignHook assign_hook; GucShowHook show_hook; /* variable fields, initialized at runtime: */ int reset_val; void *reset_extra; }; /* constant tables corresponding to enums above and in guc.h */ extern const char *const config_group_names[]; extern const char *const config_type_names[]; extern const char *const GucContext_Names[]; extern const char *const GucSource_Names[]; /* get the current set of variables */ extern struct config_generic **get_guc_variables(void); extern void build_guc_variables(void); /* search in enum options */ extern const char *config_enum_lookup_by_value(struct config_enum * record, int val); extern bool config_enum_lookup_by_name(struct config_enum * record, const char *value, int *retval); #endif /* GUC_TABLES_H */ PKBiZ%P̃]]server/utils/uuid.hnu[/*------------------------------------------------------------------------- * * uuid.h * Header file for the "uuid" ADT. In C, we use the name pg_uuid_t, * to avoid conflicts with any uuid_t type that might be defined by * the system headers. * * Copyright (c) 2007-2012, PostgreSQL Global Development Group * * src/include/utils/uuid.h * *------------------------------------------------------------------------- */ #ifndef UUID_H #define UUID_H /* guid size in bytes */ #define UUID_LEN 16 /* opaque struct; defined in uuid.c */ typedef struct pg_uuid_t pg_uuid_t; /* fmgr interface macros */ #define UUIDPGetDatum(X) PointerGetDatum(X) #define PG_RETURN_UUID_P(X) return UUIDPGetDatum(X) #define DatumGetUUIDP(X) ((pg_uuid_t *) DatumGetPointer(X)) #define PG_GETARG_UUID_P(X) DatumGetUUIDP(PG_GETARG_DATUM(X)) #endif /* UUID_H */ PKBiZY;server/utils/xml.hnu[/*------------------------------------------------------------------------- * * xml.h * Declarations for XML data type support. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/xml.h * *------------------------------------------------------------------------- */ #ifndef XML_H #define XML_H #include "fmgr.h" #include "nodes/execnodes.h" #include "nodes/primnodes.h" typedef struct varlena xmltype; typedef enum { XML_STANDALONE_YES, XML_STANDALONE_NO, XML_STANDALONE_NO_VALUE, XML_STANDALONE_OMITTED } XmlStandaloneType; typedef enum { XMLBINARY_BASE64, XMLBINARY_HEX } XmlBinaryType; typedef enum { PG_XML_STRICTNESS_LEGACY, /* ignore errors unless function result * indicates error condition */ PG_XML_STRICTNESS_WELLFORMED, /* ignore non-parser messages */ PG_XML_STRICTNESS_ALL /* report all notices/warnings/errors */ } PgXmlStrictness; /* struct PgXmlErrorContext is private to xml.c */ typedef struct PgXmlErrorContext PgXmlErrorContext; #define DatumGetXmlP(X) ((xmltype *) PG_DETOAST_DATUM(X)) #define XmlPGetDatum(X) PointerGetDatum(X) #define PG_GETARG_XML_P(n) DatumGetXmlP(PG_GETARG_DATUM(n)) #define PG_RETURN_XML_P(x) PG_RETURN_POINTER(x) extern Datum xml_in(PG_FUNCTION_ARGS); extern Datum xml_out(PG_FUNCTION_ARGS); extern Datum xml_recv(PG_FUNCTION_ARGS); extern Datum xml_send(PG_FUNCTION_ARGS); extern Datum xmlcomment(PG_FUNCTION_ARGS); extern Datum xmlconcat2(PG_FUNCTION_ARGS); extern Datum texttoxml(PG_FUNCTION_ARGS); extern Datum xmltotext(PG_FUNCTION_ARGS); extern Datum xmlvalidate(PG_FUNCTION_ARGS); extern Datum xpath(PG_FUNCTION_ARGS); extern Datum xpath_exists(PG_FUNCTION_ARGS); extern Datum xmlexists(PG_FUNCTION_ARGS); extern Datum xml_is_well_formed(PG_FUNCTION_ARGS); extern Datum xml_is_well_formed_document(PG_FUNCTION_ARGS); extern Datum xml_is_well_formed_content(PG_FUNCTION_ARGS); extern Datum table_to_xml(PG_FUNCTION_ARGS); extern Datum query_to_xml(PG_FUNCTION_ARGS); extern Datum cursor_to_xml(PG_FUNCTION_ARGS); extern Datum table_to_xmlschema(PG_FUNCTION_ARGS); extern Datum query_to_xmlschema(PG_FUNCTION_ARGS); extern Datum cursor_to_xmlschema(PG_FUNCTION_ARGS); extern Datum table_to_xml_and_xmlschema(PG_FUNCTION_ARGS); extern Datum query_to_xml_and_xmlschema(PG_FUNCTION_ARGS); extern Datum schema_to_xml(PG_FUNCTION_ARGS); extern Datum schema_to_xmlschema(PG_FUNCTION_ARGS); extern Datum schema_to_xml_and_xmlschema(PG_FUNCTION_ARGS); extern Datum database_to_xml(PG_FUNCTION_ARGS); extern Datum database_to_xmlschema(PG_FUNCTION_ARGS); extern Datum database_to_xml_and_xmlschema(PG_FUNCTION_ARGS); extern void pg_xml_init_library(void); extern PgXmlErrorContext *pg_xml_init(PgXmlStrictness strictness); extern void pg_xml_done(PgXmlErrorContext *errcxt, bool isError); extern bool pg_xml_error_occurred(PgXmlErrorContext *errcxt); extern void xml_ereport(PgXmlErrorContext *errcxt, int level, int sqlcode, const char *msg); extern xmltype *xmlconcat(List *args); extern xmltype *xmlelement(XmlExprState *xmlExpr, ExprContext *econtext); extern xmltype *xmlparse(text *data, XmlOptionType xmloption, bool preserve_whitespace); extern xmltype *xmlpi(char *target, text *arg, bool arg_is_null, bool *result_is_null); extern xmltype *xmlroot(xmltype *data, text *version, int standalone); extern bool xml_is_document(xmltype *arg); extern text *xmltotext_with_xmloption(xmltype *data, XmlOptionType xmloption_arg); extern char *escape_xml(const char *str); extern char *map_sql_identifier_to_xml_name(char *ident, bool fully_escaped, bool escape_period); extern char *map_xml_name_to_sql_identifier(char *name); extern char *map_sql_value_to_xml_value(Datum value, Oid type, bool xml_escape_strings); extern int xmlbinary; /* XmlBinaryType, but int for guc enum */ extern int xmloption; /* XmlOptionType, but int for guc enum */ #endif /* XML_H */ PKBiZ244server/utils/guc.hnu[/*-------------------------------------------------------------------- * guc.h * * External declarations pertaining to backend/utils/misc/guc.c and * backend/utils/misc/guc-file.l * * Copyright (c) 2000-2012, PostgreSQL Global Development Group * Written by Peter Eisentraut . * * src/include/utils/guc.h *-------------------------------------------------------------------- */ #ifndef GUC_H #define GUC_H #include "nodes/parsenodes.h" #include "tcop/dest.h" #include "utils/array.h" /* * Certain options can only be set at certain times. The rules are * like this: * * INTERNAL options cannot be set by the user at all, but only through * internal processes ("server_version" is an example). These are GUC * variables only so they can be shown by SHOW, etc. * * POSTMASTER options can only be set when the postmaster starts, * either from the configuration file or the command line. * * SIGHUP options can only be set at postmaster startup or by changing * the configuration file and sending the HUP signal to the postmaster * or a backend process. (Notice that the signal receipt will not be * evaluated immediately. The postmaster and the backend check it at a * certain point in their main loop. It's safer to wait than to read a * file asynchronously.) * * BACKEND options can only be set at postmaster startup, from the * configuration file, or by client request in the connection startup * packet (e.g., from libpq's PGOPTIONS variable). Furthermore, an * already-started backend will ignore changes to such an option in the * configuration file. The idea is that these options are fixed for a * given backend once it's started, but they can vary across backends. * * SUSET options can be set at postmaster startup, with the SIGHUP * mechanism, or from SQL if you're a superuser. * * USERSET options can be set by anyone any time. */ typedef enum { PGC_INTERNAL, PGC_POSTMASTER, PGC_SIGHUP, PGC_BACKEND, PGC_SUSET, PGC_USERSET } GucContext; /* * The following type records the source of the current setting. A * new setting can only take effect if the previous setting had the * same or lower level. (E.g, changing the config file doesn't * override the postmaster command line.) Tracking the source allows us * to process sources in any convenient order without affecting results. * Sources <= PGC_S_OVERRIDE will set the default used by RESET, as well * as the current value. Note that source == PGC_S_OVERRIDE should be * used when setting a PGC_INTERNAL option. * * PGC_S_INTERACTIVE isn't actually a source value, but is the * dividing line between "interactive" and "non-interactive" sources for * error reporting purposes. * * PGC_S_TEST is used when testing values to be stored as per-database or * per-user defaults ("doit" will always be false, so this never gets stored * as the actual source of any value). This is an interactive case, but * it needs its own source value because some assign hooks need to make * different validity checks in this case. * * NB: see GucSource_Names in guc.c if you change this. */ typedef enum { PGC_S_DEFAULT, /* hard-wired default ("boot_val") */ PGC_S_DYNAMIC_DEFAULT, /* default computed during initialization */ PGC_S_ENV_VAR, /* postmaster environment variable */ PGC_S_FILE, /* postgresql.conf */ PGC_S_ARGV, /* postmaster command line */ PGC_S_DATABASE, /* per-database setting */ PGC_S_USER, /* per-user setting */ PGC_S_DATABASE_USER, /* per-user-and-database setting */ PGC_S_CLIENT, /* from client connection request */ PGC_S_OVERRIDE, /* special case to forcibly set default */ PGC_S_INTERACTIVE, /* dividing line for error reporting */ PGC_S_TEST, /* test per-database or per-user setting */ PGC_S_SESSION /* SET command */ } GucSource; /* * Parsing the configuration file will return a list of name-value pairs * with source location info. */ typedef struct ConfigVariable { char *name; char *value; char *filename; int sourceline; struct ConfigVariable *next; } ConfigVariable; extern bool ParseConfigFile(const char *config_file, const char *calling_file, bool strict, int depth, int elevel, ConfigVariable **head_p, ConfigVariable **tail_p); extern bool ParseConfigFp(FILE *fp, const char *config_file, int depth, int elevel, ConfigVariable **head_p, ConfigVariable **tail_p); extern void FreeConfigVariables(ConfigVariable *list); /* * The possible values of an enum variable are specified by an array of * name-value pairs. The "hidden" flag means the value is accepted but * won't be displayed when guc.c is asked for a list of acceptable values. */ struct config_enum_entry { const char *name; int val; bool hidden; }; /* * Signatures for per-variable check/assign/show hook functions */ typedef bool (*GucBoolCheckHook) (bool *newval, void **extra, GucSource source); typedef bool (*GucIntCheckHook) (int *newval, void **extra, GucSource source); typedef bool (*GucRealCheckHook) (double *newval, void **extra, GucSource source); typedef bool (*GucStringCheckHook) (char **newval, void **extra, GucSource source); typedef bool (*GucEnumCheckHook) (int *newval, void **extra, GucSource source); typedef void (*GucBoolAssignHook) (bool newval, void *extra); typedef void (*GucIntAssignHook) (int newval, void *extra); typedef void (*GucRealAssignHook) (double newval, void *extra); typedef void (*GucStringAssignHook) (const char *newval, void *extra); typedef void (*GucEnumAssignHook) (int newval, void *extra); typedef const char *(*GucShowHook) (void); /* * Miscellaneous */ typedef enum { /* Types of set_config_option actions */ GUC_ACTION_SET, /* regular SET command */ GUC_ACTION_LOCAL, /* SET LOCAL command */ GUC_ACTION_SAVE /* function SET option, or temp assignment */ } GucAction; #define GUC_QUALIFIER_SEPARATOR '.' /* * bit values in "flags" of a GUC variable */ #define GUC_LIST_INPUT 0x0001 /* input can be list format */ #define GUC_LIST_QUOTE 0x0002 /* double-quote list elements */ #define GUC_NO_SHOW_ALL 0x0004 /* exclude from SHOW ALL */ #define GUC_NO_RESET_ALL 0x0008 /* exclude from RESET ALL */ #define GUC_REPORT 0x0010 /* auto-report changes to client */ #define GUC_NOT_IN_SAMPLE 0x0020 /* not in postgresql.conf.sample */ #define GUC_DISALLOW_IN_FILE 0x0040 /* can't set in postgresql.conf */ #define GUC_CUSTOM_PLACEHOLDER 0x0080 /* placeholder for custom variable */ #define GUC_SUPERUSER_ONLY 0x0100 /* show only to superusers */ #define GUC_IS_NAME 0x0200 /* limit string to NAMEDATALEN-1 */ #define GUC_UNIT_KB 0x0400 /* value is in kilobytes */ #define GUC_UNIT_BLOCKS 0x0800 /* value is in blocks */ #define GUC_UNIT_XBLOCKS 0x0C00 /* value is in xlog blocks */ #define GUC_UNIT_MEMORY 0x0C00 /* mask for KB, BLOCKS, XBLOCKS */ #define GUC_UNIT_MS 0x1000 /* value is in milliseconds */ #define GUC_UNIT_S 0x2000 /* value is in seconds */ #define GUC_UNIT_MIN 0x4000 /* value is in minutes */ #define GUC_UNIT_TIME 0x7000 /* mask for MS, S, MIN */ #define GUC_NOT_WHILE_SEC_REST 0x8000 /* can't set if security restricted */ /* GUC vars that are actually declared in guc.c, rather than elsewhere */ extern bool log_duration; extern bool Debug_print_plan; extern bool Debug_print_parse; extern bool Debug_print_rewritten; extern bool Debug_pretty_print; extern bool log_parser_stats; extern bool log_planner_stats; extern bool log_executor_stats; extern bool log_statement_stats; extern bool log_btree_build_stats; extern PGDLLIMPORT bool check_function_bodies; extern bool default_with_oids; extern bool SQL_inheritance; extern int log_min_error_statement; extern int log_min_messages; extern int client_min_messages; extern int log_min_duration_statement; extern int log_temp_files; extern int temp_file_limit; extern int num_temp_buffers; extern char *data_directory; extern char *ConfigFileName; extern char *HbaFileName; extern char *IdentFileName; extern char *external_pid_file; extern char *application_name; extern int tcp_keepalives_idle; extern int tcp_keepalives_interval; extern int tcp_keepalives_count; /* * Functions exported by guc.c */ extern void SetConfigOption(const char *name, const char *value, GucContext context, GucSource source); extern void DefineCustomBoolVariable( const char *name, const char *short_desc, const char *long_desc, bool *valueAddr, bool bootValue, GucContext context, int flags, GucBoolCheckHook check_hook, GucBoolAssignHook assign_hook, GucShowHook show_hook); extern void DefineCustomIntVariable( const char *name, const char *short_desc, const char *long_desc, int *valueAddr, int bootValue, int minValue, int maxValue, GucContext context, int flags, GucIntCheckHook check_hook, GucIntAssignHook assign_hook, GucShowHook show_hook); extern void DefineCustomRealVariable( const char *name, const char *short_desc, const char *long_desc, double *valueAddr, double bootValue, double minValue, double maxValue, GucContext context, int flags, GucRealCheckHook check_hook, GucRealAssignHook assign_hook, GucShowHook show_hook); extern void DefineCustomStringVariable( const char *name, const char *short_desc, const char *long_desc, char **valueAddr, const char *bootValue, GucContext context, int flags, GucStringCheckHook check_hook, GucStringAssignHook assign_hook, GucShowHook show_hook); extern void DefineCustomEnumVariable( const char *name, const char *short_desc, const char *long_desc, int *valueAddr, int bootValue, const struct config_enum_entry * options, GucContext context, int flags, GucEnumCheckHook check_hook, GucEnumAssignHook assign_hook, GucShowHook show_hook); extern void EmitWarningsOnPlaceholders(const char *className); extern const char *GetConfigOption(const char *name, bool missing_ok, bool restrict_superuser); extern const char *GetConfigOptionResetString(const char *name); extern void ProcessConfigFile(GucContext context); extern void InitializeGUCOptions(void); extern bool SelectConfigFiles(const char *userDoption, const char *progname); extern void ResetAllOptions(void); extern void AtStart_GUC(void); extern int NewGUCNestLevel(void); extern void AtEOXact_GUC(bool isCommit, int nestLevel); extern void BeginReportingGUCOptions(void); extern void ParseLongOption(const char *string, char **name, char **value); extern bool parse_int(const char *value, int *result, int flags, const char **hintmsg); extern bool parse_real(const char *value, double *result); extern int set_config_option(const char *name, const char *value, GucContext context, GucSource source, GucAction action, bool changeVal, int elevel); extern char *GetConfigOptionByName(const char *name, const char **varname); extern void GetConfigOptionByNum(int varnum, const char **values, bool *noshow); extern int GetNumConfigOptions(void); extern void SetPGVariable(const char *name, List *args, bool is_local); extern void GetPGVariable(const char *name, DestReceiver *dest); extern TupleDesc GetPGVariableResultDesc(const char *name); extern void ExecSetVariableStmt(VariableSetStmt *stmt); extern char *ExtractSetVariableArgs(VariableSetStmt *stmt); extern void ProcessGUCArray(ArrayType *array, GucContext context, GucSource source, GucAction action); extern ArrayType *GUCArrayAdd(ArrayType *array, const char *name, const char *value); extern ArrayType *GUCArrayDelete(ArrayType *array, const char *name); extern ArrayType *GUCArrayReset(ArrayType *array); #ifdef EXEC_BACKEND extern void write_nondefault_variables(GucContext context); extern void read_nondefault_variables(void); #endif /* Support for messages reported from GUC check hooks */ extern PGDLLIMPORT char *GUC_check_errmsg_string; extern PGDLLIMPORT char *GUC_check_errdetail_string; extern PGDLLIMPORT char *GUC_check_errhint_string; extern void GUC_check_errcode(int sqlerrcode); #define GUC_check_errmsg \ pre_format_elog_string(errno, TEXTDOMAIN), \ GUC_check_errmsg_string = format_elog_string #define GUC_check_errdetail \ pre_format_elog_string(errno, TEXTDOMAIN), \ GUC_check_errdetail_string = format_elog_string #define GUC_check_errhint \ pre_format_elog_string(errno, TEXTDOMAIN), \ GUC_check_errhint_string = format_elog_string /* * The following functions are not in guc.c, but are declared here to avoid * having to include guc.h in some widely used headers that it really doesn't * belong in. */ /* in commands/tablespace.c */ extern bool check_default_tablespace(char **newval, void **extra, GucSource source); extern bool check_temp_tablespaces(char **newval, void **extra, GucSource source); extern void assign_temp_tablespaces(const char *newval, void *extra); /* in catalog/namespace.c */ extern bool check_search_path(char **newval, void **extra, GucSource source); extern void assign_search_path(const char *newval, void *extra); /* in access/transam/xlog.c */ extern bool check_wal_buffers(int *newval, void **extra, GucSource source); extern void assign_xlog_sync_method(int new_sync_method, void *extra); #endif /* GUC_H */ PKBiZH.44server/utils/sortsupport.hnu[/*------------------------------------------------------------------------- * * sortsupport.h * Framework for accelerated sorting. * * Traditionally, PostgreSQL has implemented sorting by repeatedly invoking * an SQL-callable comparison function "cmp(x, y) returns int" on pairs of * values to be compared, where the comparison function is the BTORDER_PROC * pg_amproc support function of the appropriate btree index opclass. * * This file defines alternative APIs that allow sorting to be performed with * reduced overhead. To support lower-overhead sorting, a btree opclass may * provide a BTSORTSUPPORT_PROC pg_amproc entry, which must take a single * argument of type internal and return void. The argument is actually a * pointer to a SortSupportData struct, which is defined below. * * If provided, the BTSORTSUPPORT function will be called during sort setup, * and it must initialize the provided struct with pointers to function(s) * that can be called to perform sorting. This API is defined to allow * multiple acceleration mechanisms to be supported, but no opclass is * required to provide all of them. The BTSORTSUPPORT function should * simply not set any function pointers for mechanisms it doesn't support. * (However, all opclasses that provide BTSORTSUPPORT are required to provide * the comparator function.) * * All sort support functions will be passed the address of the * SortSupportData struct when called, so they can use it to store * additional private data as needed. In particular, for collation-aware * datatypes, the ssup_collation field is set before calling BTSORTSUPPORT * and is available to all support functions. Additional opclass-dependent * data can be stored using the ssup_extra field. Any such data * should be allocated in the ssup_cxt memory context. * * Note: since pg_amproc functions are indexed by (lefttype, righttype) * it is possible to associate a BTSORTSUPPORT function with a cross-type * comparison. This could sensibly be used to provide a fast comparator * function for such cases, but probably not any other acceleration method. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/sortsupport.h * *------------------------------------------------------------------------- */ #ifndef SORTSUPPORT_H #define SORTSUPPORT_H #include "access/attnum.h" typedef struct SortSupportData *SortSupport; typedef struct SortSupportData { /* * These fields are initialized before calling the BTSORTSUPPORT function * and should not be changed later. */ MemoryContext ssup_cxt; /* Context containing sort info */ Oid ssup_collation; /* Collation to use, or InvalidOid */ /* * Additional sorting parameters; but unlike ssup_collation, these can be * changed after BTSORTSUPPORT is called, so don't use them in selecting * sort support functions. */ bool ssup_reverse; /* descending-order sort? */ bool ssup_nulls_first; /* sort nulls first? */ /* * These fields are workspace for callers, and should not be touched by * opclass-specific functions. */ AttrNumber ssup_attno; /* column number to sort */ /* * ssup_extra is zeroed before calling the BTSORTSUPPORT function, and is * not touched subsequently by callers. */ void *ssup_extra; /* Workspace for opclass functions */ /* * Function pointers are zeroed before calling the BTSORTSUPPORT function, * and must be set by it for any acceleration methods it wants to supply. * The comparator pointer must be set, others are optional. */ /* * Comparator function has the same API as the traditional btree * comparison function, ie, return <0, 0, or >0 according as x is less * than, equal to, or greater than y. Note that x and y are guaranteed * not null, and there is no way to return null either. Do not return * INT_MIN, as callers are allowed to negate the result before using it. */ int (*comparator) (Datum x, Datum y, SortSupport ssup); /* * Additional sort-acceleration functions might be added here later. */ } SortSupportData; /* ApplySortComparator should be inlined if possible */ #ifdef USE_INLINE /* * Apply a sort comparator function and return a 3-way comparison result. * This takes care of handling reverse-sort and NULLs-ordering properly. */ static inline int ApplySortComparator(Datum datum1, bool isNull1, Datum datum2, bool isNull2, SortSupport ssup) { int compare; if (isNull1) { if (isNull2) compare = 0; /* NULL "=" NULL */ else if (ssup->ssup_nulls_first) compare = -1; /* NULL "<" NOT_NULL */ else compare = 1; /* NULL ">" NOT_NULL */ } else if (isNull2) { if (ssup->ssup_nulls_first) compare = 1; /* NOT_NULL ">" NULL */ else compare = -1; /* NOT_NULL "<" NULL */ } else { compare = (*ssup->comparator) (datum1, datum2, ssup); if (ssup->ssup_reverse) compare = -compare; } return compare; } #else extern int ApplySortComparator(Datum datum1, bool isNull1, Datum datum2, bool isNull2, SortSupport ssup); #endif /* USE_INLINE */ /* Other functions in utils/sort/sortsupport.c */ extern void PrepareSortSupportComparisonShim(Oid cmpFunc, SortSupport ssup); extern void PrepareSortSupportFromOrderingOp(Oid orderingOp, SortSupport ssup); #endif /* SORTSUPPORT_H */ PKBiZt #include "fmgr.h" #include "pgtime.h" /* ---------------------------------------------------------------- * * time types + support macros * * ---------------------------------------------------------------- */ /* * Although time_t generally is a long int on 64 bit systems, these two * types must be 4 bytes, because that's what pg_type.h assumes. They * should be yanked (long) before 2038 and be replaced by timestamp and * interval. */ typedef int32 AbsoluteTime; typedef int32 RelativeTime; typedef struct { int32 status; AbsoluteTime data[2]; } TimeIntervalData; typedef TimeIntervalData *TimeInterval; /* * Macros for fmgr-callable functions. */ #define DatumGetAbsoluteTime(X) ((AbsoluteTime) DatumGetInt32(X)) #define DatumGetRelativeTime(X) ((RelativeTime) DatumGetInt32(X)) #define DatumGetTimeInterval(X) ((TimeInterval) DatumGetPointer(X)) #define AbsoluteTimeGetDatum(X) Int32GetDatum(X) #define RelativeTimeGetDatum(X) Int32GetDatum(X) #define TimeIntervalGetDatum(X) PointerGetDatum(X) #define PG_GETARG_ABSOLUTETIME(n) DatumGetAbsoluteTime(PG_GETARG_DATUM(n)) #define PG_GETARG_RELATIVETIME(n) DatumGetRelativeTime(PG_GETARG_DATUM(n)) #define PG_GETARG_TIMEINTERVAL(n) DatumGetTimeInterval(PG_GETARG_DATUM(n)) #define PG_RETURN_ABSOLUTETIME(x) return AbsoluteTimeGetDatum(x) #define PG_RETURN_RELATIVETIME(x) return RelativeTimeGetDatum(x) #define PG_RETURN_TIMEINTERVAL(x) return TimeIntervalGetDatum(x) /* * Reserved values * Epoch is Unix system time zero, but needs to be kept as a reserved * value rather than converting to time since timezone calculations * might move it away from 1970-01-01 00:00:00Z - tgl 97/02/20 * * Pre-v6.1 code had large decimal numbers for reserved values. * These were chosen as special 32-bit bit patterns, * so redefine them explicitly using these bit patterns. - tgl 97/02/24 */ #define INVALID_ABSTIME ((AbsoluteTime) 0x7FFFFFFE) /* 2147483647 (2^31 - 1) */ #define NOEND_ABSTIME ((AbsoluteTime) 0x7FFFFFFC) /* 2147483645 (2^31 - 3) */ #define NOSTART_ABSTIME ((AbsoluteTime) INT_MIN) /* -2147483648 */ #define INVALID_RELTIME ((RelativeTime) 0x7FFFFFFE) /* 2147483647 (2^31 - 1) */ #define AbsoluteTimeIsValid(time) \ ((bool) ((time) != INVALID_ABSTIME)) /* * Because NOSTART_ABSTIME is defined as INT_MIN, there can't be any * AbsoluteTime values less than it. Therefore, we can code the test * "time > NOSTART_ABSTIME" as "time != NOSTART_ABSTIME", which avoids * compiler bugs on some platforms. --- tgl & az, 11/2000 */ #define AbsoluteTimeIsReal(time) \ ((bool) (((AbsoluteTime) (time)) < NOEND_ABSTIME && \ ((AbsoluteTime) (time)) != NOSTART_ABSTIME)) #define RelativeTimeIsValid(time) \ ((bool) (((RelativeTime) (time)) != INVALID_RELTIME)) /* * nabstime.c prototypes */ extern Datum abstimein(PG_FUNCTION_ARGS); extern Datum abstimeout(PG_FUNCTION_ARGS); extern Datum abstimerecv(PG_FUNCTION_ARGS); extern Datum abstimesend(PG_FUNCTION_ARGS); extern Datum abstimeeq(PG_FUNCTION_ARGS); extern Datum abstimene(PG_FUNCTION_ARGS); extern Datum abstimelt(PG_FUNCTION_ARGS); extern Datum abstimegt(PG_FUNCTION_ARGS); extern Datum abstimele(PG_FUNCTION_ARGS); extern Datum abstimege(PG_FUNCTION_ARGS); extern Datum abstime_finite(PG_FUNCTION_ARGS); extern Datum timestamp_abstime(PG_FUNCTION_ARGS); extern Datum abstime_timestamp(PG_FUNCTION_ARGS); extern Datum timestamptz_abstime(PG_FUNCTION_ARGS); extern Datum abstime_timestamptz(PG_FUNCTION_ARGS); extern Datum reltimein(PG_FUNCTION_ARGS); extern Datum reltimeout(PG_FUNCTION_ARGS); extern Datum reltimerecv(PG_FUNCTION_ARGS); extern Datum reltimesend(PG_FUNCTION_ARGS); extern Datum tintervalin(PG_FUNCTION_ARGS); extern Datum tintervalout(PG_FUNCTION_ARGS); extern Datum tintervalrecv(PG_FUNCTION_ARGS); extern Datum tintervalsend(PG_FUNCTION_ARGS); extern Datum interval_reltime(PG_FUNCTION_ARGS); extern Datum reltime_interval(PG_FUNCTION_ARGS); extern Datum mktinterval(PG_FUNCTION_ARGS); extern Datum timepl(PG_FUNCTION_ARGS); extern Datum timemi(PG_FUNCTION_ARGS); extern Datum intinterval(PG_FUNCTION_ARGS); extern Datum tintervalrel(PG_FUNCTION_ARGS); extern Datum timenow(PG_FUNCTION_ARGS); extern Datum reltimeeq(PG_FUNCTION_ARGS); extern Datum reltimene(PG_FUNCTION_ARGS); extern Datum reltimelt(PG_FUNCTION_ARGS); extern Datum reltimegt(PG_FUNCTION_ARGS); extern Datum reltimele(PG_FUNCTION_ARGS); extern Datum reltimege(PG_FUNCTION_ARGS); extern Datum tintervalsame(PG_FUNCTION_ARGS); extern Datum tintervaleq(PG_FUNCTION_ARGS); extern Datum tintervalne(PG_FUNCTION_ARGS); extern Datum tintervallt(PG_FUNCTION_ARGS); extern Datum tintervalgt(PG_FUNCTION_ARGS); extern Datum tintervalle(PG_FUNCTION_ARGS); extern Datum tintervalge(PG_FUNCTION_ARGS); extern Datum tintervalleneq(PG_FUNCTION_ARGS); extern Datum tintervallenne(PG_FUNCTION_ARGS); extern Datum tintervallenlt(PG_FUNCTION_ARGS); extern Datum tintervallengt(PG_FUNCTION_ARGS); extern Datum tintervallenle(PG_FUNCTION_ARGS); extern Datum tintervallenge(PG_FUNCTION_ARGS); extern Datum tintervalct(PG_FUNCTION_ARGS); extern Datum tintervalov(PG_FUNCTION_ARGS); extern Datum tintervalstart(PG_FUNCTION_ARGS); extern Datum tintervalend(PG_FUNCTION_ARGS); extern Datum timeofday(PG_FUNCTION_ARGS); /* non-fmgr-callable support routines */ extern AbsoluteTime GetCurrentAbsoluteTime(void); extern void abstime2tm(AbsoluteTime time, int *tzp, struct pg_tm * tm, char **tzn); #endif /* NABSTIME_H */ PKBiZ@L  server/utils/catcache.hnu[/*------------------------------------------------------------------------- * * catcache.h * Low-level catalog cache definitions. * * NOTE: every catalog cache must have a corresponding unique index on * the system table that it caches --- ie, the index must match the keys * used to do lookups in this cache. All cache fetches are done with * indexscans (under normal conditions). The index should be unique to * guarantee that there can only be one matching row for a key combination. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/catcache.h * *------------------------------------------------------------------------- */ #ifndef CATCACHE_H #define CATCACHE_H #include "access/htup.h" #include "access/skey.h" #include "lib/dllist.h" #include "utils/relcache.h" /* * struct catctup: individual tuple in the cache. * struct catclist: list of tuples matching a partial key. * struct catcache: information for managing a cache. * struct catcacheheader: information for managing all the caches. */ #define CATCACHE_MAXKEYS 4 typedef struct catcache { int id; /* cache identifier --- see syscache.h */ struct catcache *cc_next; /* link to next catcache */ const char *cc_relname; /* name of relation the tuples come from */ Oid cc_reloid; /* OID of relation the tuples come from */ Oid cc_indexoid; /* OID of index matching cache keys */ bool cc_relisshared; /* is relation shared across databases? */ TupleDesc cc_tupdesc; /* tuple descriptor (copied from reldesc) */ int cc_ntup; /* # of tuples currently in this cache */ int cc_nbuckets; /* # of hash buckets in this cache */ int cc_nkeys; /* # of keys (1..CATCACHE_MAXKEYS) */ int cc_key[CATCACHE_MAXKEYS]; /* AttrNumber of each key */ PGFunction cc_hashfunc[CATCACHE_MAXKEYS]; /* hash function for each key */ ScanKeyData cc_skey[CATCACHE_MAXKEYS]; /* precomputed key info for * heap scans */ bool cc_isname[CATCACHE_MAXKEYS]; /* flag "name" key columns */ Dllist cc_lists; /* list of CatCList structs */ #ifdef CATCACHE_STATS long cc_searches; /* total # searches against this cache */ long cc_hits; /* # of matches against existing entry */ long cc_neg_hits; /* # of matches against negative entry */ long cc_newloads; /* # of successful loads of new entry */ /* * cc_searches - (cc_hits + cc_neg_hits + cc_newloads) is number of failed * searches, each of which will result in loading a negative entry */ long cc_invals; /* # of entries invalidated from cache */ long cc_lsearches; /* total # list-searches */ long cc_lhits; /* # of matches against existing lists */ #endif Dllist cc_bucket[1]; /* hash buckets --- VARIABLE LENGTH ARRAY */ } CatCache; /* VARIABLE LENGTH STRUCT */ typedef struct catctup { int ct_magic; /* for identifying CatCTup entries */ #define CT_MAGIC 0x57261502 CatCache *my_cache; /* link to owning catcache */ /* * Each tuple in a cache is a member of a Dllist that stores the elements * of its hash bucket. We keep each Dllist in LRU order to speed repeated * lookups. */ Dlelem cache_elem; /* list member of per-bucket list */ /* * The tuple may also be a member of at most one CatCList. (If a single * catcache is list-searched with varying numbers of keys, we may have to * make multiple entries for the same tuple because of this restriction. * Currently, that's not expected to be common, so we accept the potential * inefficiency.) */ struct catclist *c_list; /* containing CatCList, or NULL if none */ /* * A tuple marked "dead" must not be returned by subsequent searches. * However, it won't be physically deleted from the cache until its * refcount goes to zero. (If it's a member of a CatCList, the list's * refcount must go to zero, too; also, remember to mark the list dead at * the same time the tuple is marked.) * * A negative cache entry is an assertion that there is no tuple matching * a particular key. This is just as useful as a normal entry so far as * avoiding catalog searches is concerned. Management of positive and * negative entries is identical. */ int refcount; /* number of active references */ bool dead; /* dead but not yet removed? */ bool negative; /* negative cache entry? */ uint32 hash_value; /* hash value for this tuple's keys */ HeapTupleData tuple; /* tuple management header */ } CatCTup; typedef struct catclist { int cl_magic; /* for identifying CatCList entries */ #define CL_MAGIC 0x52765103 CatCache *my_cache; /* link to owning catcache */ /* * A CatCList describes the result of a partial search, ie, a search using * only the first K key columns of an N-key cache. We form the keys used * into a tuple (with other attributes NULL) to represent the stored key * set. The CatCList object contains links to cache entries for all the * table rows satisfying the partial key. (Note: none of these will be * negative cache entries.) * * A CatCList is only a member of a per-cache list; we do not currently * divide them into hash buckets. * * A list marked "dead" must not be returned by subsequent searches. * However, it won't be physically deleted from the cache until its * refcount goes to zero. (A list should be marked dead if any of its * member entries are dead.) * * If "ordered" is true then the member tuples appear in the order of the * cache's underlying index. This will be true in normal operation, but * might not be true during bootstrap or recovery operations. (namespace.c * is able to save some cycles when it is true.) */ Dlelem cache_elem; /* list member of per-catcache list */ int refcount; /* number of active references */ bool dead; /* dead but not yet removed? */ bool ordered; /* members listed in index order? */ short nkeys; /* number of lookup keys specified */ uint32 hash_value; /* hash value for lookup keys */ HeapTupleData tuple; /* header for tuple holding keys */ int n_members; /* number of member tuples */ CatCTup *members[1]; /* members --- VARIABLE LENGTH ARRAY */ } CatCList; /* VARIABLE LENGTH STRUCT */ typedef struct catcacheheader { CatCache *ch_caches; /* head of list of CatCache structs */ int ch_ntup; /* # of tuples in all caches */ } CatCacheHeader; /* this extern duplicates utils/memutils.h... */ extern PGDLLIMPORT MemoryContext CacheMemoryContext; extern void CreateCacheMemoryContext(void); extern CatCache *InitCatCache(int id, Oid reloid, Oid indexoid, int nkeys, const int *key, int nbuckets); extern void InitCatCachePhase2(CatCache *cache, bool touch_index); extern HeapTuple SearchCatCache(CatCache *cache, Datum v1, Datum v2, Datum v3, Datum v4); extern void ReleaseCatCache(HeapTuple tuple); extern uint32 GetCatCacheHashValue(CatCache *cache, Datum v1, Datum v2, Datum v3, Datum v4); extern CatCList *SearchCatCacheList(CatCache *cache, int nkeys, Datum v1, Datum v2, Datum v3, Datum v4); extern void ReleaseCatCacheList(CatCList *list); extern void ResetCatalogCaches(void); extern void CatalogCacheFlushCatalog(Oid catId); extern void CatalogCacheIdInvalidate(int cacheId, uint32 hashValue); extern void PrepareToInvalidateCacheTuple(Relation relation, HeapTuple tuple, HeapTuple newtuple, void (*function) (int, uint32, Oid)); extern void PrintCatCacheLeakWarning(HeapTuple tuple); extern void PrintCatCacheListLeakWarning(CatCList *list); #endif /* CATCACHE_H */ PKBiZ2#``server/utils/fmgroids.hnu[/*------------------------------------------------------------------------- * * fmgroids.h * Macros that define the OIDs of built-in functions. * * These macros can be used to avoid a catalog lookup when a specific * fmgr-callable function needs to be referenced. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * NOTES * ****************************** * *** DO NOT EDIT THIS FILE! *** * ****************************** * * It has been GENERATED by Gen_fmgrtab.pl * from ../../../src/include/catalog/pg_proc.h * *------------------------------------------------------------------------- */ #ifndef FMGROIDS_H #define FMGROIDS_H /* * Constant macros for the OIDs of entries in pg_proc. * * NOTE: macros are named after the prosrc value, ie the actual C name * of the implementing function, not the proname which may be overloaded. * For example, we want to be able to assign different macro names to both * char_text() and name_text() even though these both appear with proname * 'text'. If the same C function appears in more than one pg_proc entry, * its equivalent macro will be defined with the lowest OID among those * entries. */ #define F_BYTEAOUT 31 #define F_CHAROUT 33 #define F_NAMEIN 34 #define F_NAMEOUT 35 #define F_INT2IN 38 #define F_INT2OUT 39 #define F_INT2VECTORIN 40 #define F_INT2VECTOROUT 41 #define F_INT4IN 42 #define F_INT4OUT 43 #define F_REGPROCIN 44 #define F_REGPROCOUT 45 #define F_TEXTIN 46 #define F_TEXTOUT 47 #define F_TIDIN 48 #define F_TIDOUT 49 #define F_XIDIN 50 #define F_XIDOUT 51 #define F_CIDIN 52 #define F_CIDOUT 53 #define F_OIDVECTORIN 54 #define F_OIDVECTOROUT 55 #define F_BOOLLT 56 #define F_BOOLGT 57 #define F_BOOLEQ 60 #define F_CHAREQ 61 #define F_NAMEEQ 62 #define F_INT2EQ 63 #define F_INT2LT 64 #define F_INT4EQ 65 #define F_INT4LT 66 #define F_TEXTEQ 67 #define F_XIDEQ 68 #define F_CIDEQ 69 #define F_CHARNE 70 #define F_CHARLE 72 #define F_CHARGT 73 #define F_CHARGE 74 #define F_CHARTOI4 77 #define F_I4TOCHAR 78 #define F_NAMEREGEXEQ 79 #define F_BOOLNE 84 #define F_PGSQL_VERSION 89 #define F_EQSEL 101 #define F_NEQSEL 102 #define F_SCALARLTSEL 103 #define F_SCALARGTSEL 104 #define F_EQJOINSEL 105 #define F_NEQJOINSEL 106 #define F_SCALARLTJOINSEL 107 #define F_SCALARGTJOINSEL 108 #define F_UNKNOWNIN 109 #define F_UNKNOWNOUT 110 #define F_NUMERIC_FAC 111 #define F_BOX_ABOVE_EQ 115 #define F_BOX_BELOW_EQ 116 #define F_POINT_IN 117 #define F_POINT_OUT 118 #define F_LSEG_IN 119 #define F_LSEG_OUT 120 #define F_PATH_IN 121 #define F_PATH_OUT 122 #define F_BOX_IN 123 #define F_BOX_OUT 124 #define F_BOX_OVERLAP 125 #define F_BOX_GE 126 #define F_BOX_GT 127 #define F_BOX_EQ 128 #define F_BOX_LT 129 #define F_BOX_LE 130 #define F_POINT_ABOVE 131 #define F_POINT_LEFT 132 #define F_POINT_RIGHT 133 #define F_POINT_BELOW 134 #define F_POINT_EQ 135 #define F_ON_PB 136 #define F_ON_PPATH 137 #define F_BOX_CENTER 138 #define F_AREASEL 139 #define F_AREAJOINSEL 140 #define F_INT4MUL 141 #define F_INT4NE 144 #define F_INT2NE 145 #define F_INT2GT 146 #define F_INT4GT 147 #define F_INT2LE 148 #define F_INT4LE 149 #define F_INT4GE 150 #define F_INT2GE 151 #define F_INT2MUL 152 #define F_INT2DIV 153 #define F_INT4DIV 154 #define F_INT2MOD 155 #define F_INT4MOD 156 #define F_TEXTNE 157 #define F_INT24EQ 158 #define F_INT42EQ 159 #define F_INT24LT 160 #define F_INT42LT 161 #define F_INT24GT 162 #define F_INT42GT 163 #define F_INT24NE 164 #define F_INT42NE 165 #define F_INT24LE 166 #define F_INT42LE 167 #define F_INT24GE 168 #define F_INT42GE 169 #define F_INT24MUL 170 #define F_INT42MUL 171 #define F_INT24DIV 172 #define F_INT42DIV 173 #define F_INT2PL 176 #define F_INT4PL 177 #define F_INT24PL 178 #define F_INT42PL 179 #define F_INT2MI 180 #define F_INT4MI 181 #define F_INT24MI 182 #define F_INT42MI 183 #define F_OIDEQ 184 #define F_OIDNE 185 #define F_BOX_SAME 186 #define F_BOX_CONTAIN 187 #define F_BOX_LEFT 188 #define F_BOX_OVERLEFT 189 #define F_BOX_OVERRIGHT 190 #define F_BOX_RIGHT 191 #define F_BOX_CONTAINED 192 #define F_BOX_CONTAIN_PT 193 #define F_PG_NODE_TREE_IN 195 #define F_PG_NODE_TREE_OUT 196 #define F_PG_NODE_TREE_RECV 197 #define F_PG_NODE_TREE_SEND 198 #define F_FLOAT4IN 200 #define F_FLOAT4OUT 201 #define F_FLOAT4MUL 202 #define F_FLOAT4DIV 203 #define F_FLOAT4PL 204 #define F_FLOAT4MI 205 #define F_FLOAT4UM 206 #define F_FLOAT4ABS 207 #define F_FLOAT4_ACCUM 208 #define F_FLOAT4LARGER 209 #define F_FLOAT4SMALLER 211 #define F_INT4UM 212 #define F_INT2UM 213 #define F_FLOAT8IN 214 #define F_FLOAT8OUT 215 #define F_FLOAT8MUL 216 #define F_FLOAT8DIV 217 #define F_FLOAT8PL 218 #define F_FLOAT8MI 219 #define F_FLOAT8UM 220 #define F_FLOAT8ABS 221 #define F_FLOAT8_ACCUM 222 #define F_FLOAT8LARGER 223 #define F_FLOAT8SMALLER 224 #define F_LSEG_CENTER 225 #define F_PATH_CENTER 226 #define F_POLY_CENTER 227 #define F_DROUND 228 #define F_DTRUNC 229 #define F_DSQRT 230 #define F_DCBRT 231 #define F_DPOW 232 #define F_DEXP 233 #define F_DLOG1 234 #define F_I2TOD 235 #define F_I2TOF 236 #define F_DTOI2 237 #define F_FTOI2 238 #define F_LINE_DISTANCE 239 #define F_ABSTIMEIN 240 #define F_ABSTIMEOUT 241 #define F_RELTIMEIN 242 #define F_RELTIMEOUT 243 #define F_TIMEPL 244 #define F_TIMEMI 245 #define F_TINTERVALIN 246 #define F_TINTERVALOUT 247 #define F_INTINTERVAL 248 #define F_TINTERVALREL 249 #define F_TIMENOW 250 #define F_ABSTIMEEQ 251 #define F_ABSTIMENE 252 #define F_ABSTIMELT 253 #define F_ABSTIMEGT 254 #define F_ABSTIMELE 255 #define F_ABSTIMEGE 256 #define F_RELTIMEEQ 257 #define F_RELTIMENE 258 #define F_RELTIMELT 259 #define F_RELTIMEGT 260 #define F_RELTIMELE 261 #define F_RELTIMEGE 262 #define F_TINTERVALSAME 263 #define F_TINTERVALCT 264 #define F_TINTERVALOV 265 #define F_TINTERVALLENEQ 266 #define F_TINTERVALLENNE 267 #define F_TINTERVALLENLT 268 #define F_TINTERVALLENGT 269 #define F_TINTERVALLENLE 270 #define F_TINTERVALLENGE 271 #define F_TINTERVALSTART 272 #define F_TINTERVALEND 273 #define F_TIMEOFDAY 274 #define F_ABSTIME_FINITE 275 #define F_BTCANRETURN 276 #define F_INTER_SL 277 #define F_INTER_LB 278 #define F_FLOAT48MUL 279 #define F_FLOAT48DIV 280 #define F_FLOAT48PL 281 #define F_FLOAT48MI 282 #define F_FLOAT84MUL 283 #define F_FLOAT84DIV 284 #define F_FLOAT84PL 285 #define F_FLOAT84MI 286 #define F_FLOAT4EQ 287 #define F_FLOAT4NE 288 #define F_FLOAT4LT 289 #define F_FLOAT4LE 290 #define F_FLOAT4GT 291 #define F_FLOAT4GE 292 #define F_FLOAT8EQ 293 #define F_FLOAT8NE 294 #define F_FLOAT8LT 295 #define F_FLOAT8LE 296 #define F_FLOAT8GT 297 #define F_FLOAT8GE 298 #define F_FLOAT48EQ 299 #define F_FLOAT48NE 300 #define F_FLOAT48LT 301 #define F_FLOAT48LE 302 #define F_FLOAT48GT 303 #define F_FLOAT48GE 304 #define F_FLOAT84EQ 305 #define F_FLOAT84NE 306 #define F_FLOAT84LT 307 #define F_FLOAT84LE 308 #define F_FLOAT84GT 309 #define F_FLOAT84GE 310 #define F_FTOD 311 #define F_DTOF 312 #define F_I2TOI4 313 #define F_I4TOI2 314 #define F_INT2VECTOREQ 315 #define F_I4TOD 316 #define F_DTOI4 317 #define F_I4TOF 318 #define F_FTOI4 319 #define F_WIDTH_BUCKET_FLOAT8 320 #define F_JSON_IN 321 #define F_JSON_OUT 322 #define F_JSON_RECV 323 #define F_JSON_SEND 324 #define F_GINBUILDEMPTY 325 #define F_GISTBUILDEMPTY 326 #define F_HASHBUILDEMPTY 327 #define F_BTBUILDEMPTY 328 #define F_HASH_ACLITEM 329 #define F_BTGETTUPLE 330 #define F_BTINSERT 331 #define F_BTBULKDELETE 332 #define F_BTBEGINSCAN 333 #define F_BTRESCAN 334 #define F_BTENDSCAN 335 #define F_BTMARKPOS 336 #define F_BTRESTRPOS 337 #define F_BTBUILD 338 #define F_POLY_SAME 339 #define F_POLY_CONTAIN 340 #define F_POLY_LEFT 341 #define F_POLY_OVERLEFT 342 #define F_POLY_OVERRIGHT 343 #define F_POLY_RIGHT 344 #define F_POLY_CONTAINED 345 #define F_POLY_OVERLAP 346 #define F_POLY_IN 347 #define F_POLY_OUT 348 #define F_BTINT2CMP 350 #define F_BTINT4CMP 351 #define F_BTFLOAT4CMP 354 #define F_BTFLOAT8CMP 355 #define F_BTOIDCMP 356 #define F_BTABSTIMECMP 357 #define F_BTCHARCMP 358 #define F_BTNAMECMP 359 #define F_BTTEXTCMP 360 #define F_LSEG_DISTANCE 361 #define F_LSEG_INTERPT 362 #define F_DIST_PS 363 #define F_DIST_PB 364 #define F_DIST_SB 365 #define F_CLOSE_PS 366 #define F_CLOSE_PB 367 #define F_CLOSE_SB 368 #define F_ON_PS 369 #define F_PATH_DISTANCE 370 #define F_DIST_PPATH 371 #define F_ON_SB 372 #define F_INTER_SB 373 #define F_TEXT_TO_ARRAY_NULL 376 #define F_CASH_CMP 377 #define F_ARRAY_PUSH 378 #define F_BTRELTIMECMP 380 #define F_BTTINTERVALCMP 381 #define F_BTARRAYCMP 382 #define F_ARRAY_CAT 383 #define F_ARRAY_TO_TEXT_NULL 384 #define F_ARRAY_NE 390 #define F_ARRAY_LT 391 #define F_ARRAY_GT 392 #define F_ARRAY_LE 393 #define F_TEXT_TO_ARRAY 394 #define F_ARRAY_TO_TEXT 395 #define F_ARRAY_GE 396 #define F_HASHINT2VECTOR 398 #define F_HASHMACADDR 399 #define F_HASHTEXT 400 #define F_RTRIM1 401 #define F_BTOIDVECTORCMP 404 #define F_NAME_TEXT 406 #define F_TEXT_NAME 407 #define F_NAME_BPCHAR 408 #define F_BPCHAR_NAME 409 #define F_HASHINET 422 #define F_HASHVACUUMCLEANUP 425 #define F_HASH_NUMERIC 432 #define F_MACADDR_IN 436 #define F_MACADDR_OUT 437 #define F_HASHCOSTESTIMATE 438 #define F_HASHGETTUPLE 440 #define F_HASHINSERT 441 #define F_HASHBULKDELETE 442 #define F_HASHBEGINSCAN 443 #define F_HASHRESCAN 444 #define F_HASHENDSCAN 445 #define F_HASHMARKPOS 446 #define F_HASHRESTRPOS 447 #define F_HASHBUILD 448 #define F_HASHINT2 449 #define F_HASHINT4 450 #define F_HASHFLOAT4 451 #define F_HASHFLOAT8 452 #define F_HASHOID 453 #define F_HASHCHAR 454 #define F_HASHNAME 455 #define F_HASHVARLENA 456 #define F_HASHOIDVECTOR 457 #define F_TEXT_LARGER 458 #define F_TEXT_SMALLER 459 #define F_INT8IN 460 #define F_INT8OUT 461 #define F_INT8UM 462 #define F_INT8PL 463 #define F_INT8MI 464 #define F_INT8MUL 465 #define F_INT8DIV 466 #define F_INT8EQ 467 #define F_INT8NE 468 #define F_INT8LT 469 #define F_INT8GT 470 #define F_INT8LE 471 #define F_INT8GE 472 #define F_INT84EQ 474 #define F_INT84NE 475 #define F_INT84LT 476 #define F_INT84GT 477 #define F_INT84LE 478 #define F_INT84GE 479 #define F_INT84 480 #define F_INT48 481 #define F_I8TOD 482 #define F_DTOI8 483 #define F_ARRAY_LARGER 515 #define F_ARRAY_SMALLER 516 #define F_INET_ABBREV 598 #define F_CIDR_ABBREV 599 #define F_INET_SET_MASKLEN 605 #define F_OIDVECTORNE 619 #define F_HASH_ARRAY 626 #define F_CIDR_SET_MASKLEN 635 #define F_BTGETBITMAP 636 #define F_HASHGETBITMAP 637 #define F_GISTGETBITMAP 638 #define F_I8TOF 652 #define F_FTOI8 653 #define F_NAMELT 655 #define F_NAMELE 656 #define F_NAMEGT 657 #define F_NAMEGE 658 #define F_NAMENE 659 #define F_BPCHAR 668 #define F_VARCHAR 669 #define F_MKTINTERVAL 676 #define F_OIDVECTORLT 677 #define F_OIDVECTORLE 678 #define F_OIDVECTOREQ 679 #define F_OIDVECTORGE 680 #define F_OIDVECTORGT 681 #define F_NETWORK_NETWORK 683 #define F_NETWORK_NETMASK 696 #define F_NETWORK_MASKLEN 697 #define F_NETWORK_BROADCAST 698 #define F_NETWORK_HOST 699 #define F_CURRENT_USER 710 #define F_NETWORK_FAMILY 711 #define F_INT82 714 #define F_LO_CREATE 715 #define F_OIDLT 716 #define F_OIDLE 717 #define F_BYTEAOCTETLEN 720 #define F_BYTEAGETBYTE 721 #define F_BYTEASETBYTE 722 #define F_BYTEAGETBIT 723 #define F_BYTEASETBIT 724 #define F_DIST_PL 725 #define F_DIST_LB 726 #define F_DIST_SL 727 #define F_DIST_CPOLY 728 #define F_POLY_DISTANCE 729 #define F_NETWORK_SHOW 730 #define F_TEXT_LT 740 #define F_TEXT_LE 741 #define F_TEXT_GT 742 #define F_TEXT_GE 743 #define F_ARRAY_EQ 744 #define F_SESSION_USER 746 #define F_ARRAY_DIMS 747 #define F_ARRAY_NDIMS 748 #define F_BYTEAOVERLAY 749 #define F_ARRAY_IN 750 #define F_ARRAY_OUT 751 #define F_BYTEAOVERLAY_NO_LEN 752 #define F_MACADDR_TRUNC 753 #define F_INT28 754 #define F_SMGRIN 760 #define F_SMGROUT 761 #define F_SMGREQ 762 #define F_SMGRNE 763 #define F_LO_IMPORT 764 #define F_LO_EXPORT 765 #define F_INT4INC 766 #define F_LO_IMPORT_WITH_OID 767 #define F_INT4LARGER 768 #define F_INT4SMALLER 769 #define F_INT2LARGER 770 #define F_INT2SMALLER 771 #define F_GISTCOSTESTIMATE 772 #define F_GISTGETTUPLE 774 #define F_GISTINSERT 775 #define F_GISTBULKDELETE 776 #define F_GISTBEGINSCAN 777 #define F_GISTRESCAN 778 #define F_GISTENDSCAN 779 #define F_GISTMARKPOS 780 #define F_GISTRESTRPOS 781 #define F_GISTBUILD 782 #define F_TINTERVALEQ 784 #define F_TINTERVALNE 785 #define F_TINTERVALLT 786 #define F_TINTERVALGT 787 #define F_TINTERVALLE 788 #define F_TINTERVALGE 789 #define F_PG_CLIENT_ENCODING 810 #define F_CURRENT_QUERY 817 #define F_MACADDR_EQ 830 #define F_MACADDR_LT 831 #define F_MACADDR_LE 832 #define F_MACADDR_GT 833 #define F_MACADDR_GE 834 #define F_MACADDR_NE 835 #define F_MACADDR_CMP 836 #define F_INT82PL 837 #define F_INT82MI 838 #define F_INT82MUL 839 #define F_INT82DIV 840 #define F_INT28PL 841 #define F_BTINT8CMP 842 #define F_CASH_MUL_FLT4 846 #define F_CASH_DIV_FLT4 847 #define F_FLT4_MUL_CASH 848 #define F_TEXTPOS 849 #define F_TEXTLIKE 850 #define F_TEXTNLIKE 851 #define F_INT48EQ 852 #define F_INT48NE 853 #define F_INT48LT 854 #define F_INT48GT 855 #define F_INT48LE 856 #define F_INT48GE 857 #define F_NAMELIKE 858 #define F_NAMENLIKE 859 #define F_CHAR_BPCHAR 860 #define F_CURRENT_DATABASE 861 #define F_INT4_MUL_CASH 862 #define F_INT2_MUL_CASH 863 #define F_CASH_MUL_INT4 864 #define F_CASH_DIV_INT4 865 #define F_CASH_MUL_INT2 866 #define F_CASH_DIV_INT2 867 #define F_LOWER 870 #define F_UPPER 871 #define F_INITCAP 872 #define F_LPAD 873 #define F_RPAD 874 #define F_LTRIM 875 #define F_RTRIM 876 #define F_TEXT_SUBSTR 877 #define F_TRANSLATE 878 #define F_LTRIM1 881 #define F_TEXT_SUBSTR_NO_LEN 883 #define F_BTRIM 884 #define F_BTRIM1 885 #define F_CASH_IN 886 #define F_CASH_OUT 887 #define F_CASH_EQ 888 #define F_CASH_NE 889 #define F_CASH_LT 890 #define F_CASH_LE 891 #define F_CASH_GT 892 #define F_CASH_GE 893 #define F_CASH_PL 894 #define F_CASH_MI 895 #define F_CASH_MUL_FLT8 896 #define F_CASH_DIV_FLT8 897 #define F_CASHLARGER 898 #define F_CASHSMALLER 899 #define F_INET_IN 910 #define F_INET_OUT 911 #define F_FLT8_MUL_CASH 919 #define F_NETWORK_EQ 920 #define F_NETWORK_LT 921 #define F_NETWORK_LE 922 #define F_NETWORK_GT 923 #define F_NETWORK_GE 924 #define F_NETWORK_NE 925 #define F_NETWORK_CMP 926 #define F_NETWORK_SUB 927 #define F_NETWORK_SUBEQ 928 #define F_NETWORK_SUP 929 #define F_NETWORK_SUPEQ 930 #define F_CASH_WORDS 935 #define F_GENERATE_SERIES_TIMESTAMP 938 #define F_GENERATE_SERIES_TIMESTAMPTZ 939 #define F_INT28MI 942 #define F_INT28MUL 943 #define F_TEXT_CHAR 944 #define F_INT8MOD 945 #define F_CHAR_TEXT 946 #define F_INT28DIV 948 #define F_HASHINT8 949 #define F_LO_OPEN 952 #define F_LO_CLOSE 953 #define F_LOREAD 954 #define F_LOWRITE 955 #define F_LO_LSEEK 956 #define F_LO_CREAT 957 #define F_LO_TELL 958 #define F_ON_PL 959 #define F_ON_SL 960 #define F_CLOSE_PL 961 #define F_CLOSE_SL 962 #define F_CLOSE_LB 963 #define F_LO_UNLINK 964 #define F_BTVACUUMCLEANUP 972 #define F_PATH_INTER 973 #define F_BOX_AREA 975 #define F_BOX_WIDTH 976 #define F_BOX_HEIGHT 977 #define F_BOX_DISTANCE 978 #define F_PATH_AREA 979 #define F_BOX_INTERSECT 980 #define F_BOX_DIAGONAL 981 #define F_PATH_N_LT 982 #define F_PATH_N_GT 983 #define F_PATH_N_EQ 984 #define F_PATH_N_LE 985 #define F_PATH_N_GE 986 #define F_PATH_LENGTH 987 #define F_POINT_NE 988 #define F_POINT_VERT 989 #define F_POINT_HORIZ 990 #define F_POINT_DISTANCE 991 #define F_POINT_SLOPE 992 #define F_LSEG_CONSTRUCT 993 #define F_LSEG_INTERSECT 994 #define F_LSEG_PARALLEL 995 #define F_LSEG_PERP 996 #define F_LSEG_VERTICAL 997 #define F_LSEG_HORIZONTAL 998 #define F_LSEG_EQ 999 #define F_LO_TRUNCATE 1004 #define F_TIMESTAMPTZ_IZONE 1026 #define F_GIST_POINT_COMPRESS 1030 #define F_ACLITEMIN 1031 #define F_ACLITEMOUT 1032 #define F_ACLINSERT 1035 #define F_ACLREMOVE 1036 #define F_ACLCONTAINS 1037 #define F_GETDATABASEENCODING 1039 #define F_BPCHARIN 1044 #define F_BPCHAROUT 1045 #define F_VARCHARIN 1046 #define F_VARCHAROUT 1047 #define F_BPCHAREQ 1048 #define F_BPCHARLT 1049 #define F_BPCHARLE 1050 #define F_BPCHARGT 1051 #define F_BPCHARGE 1052 #define F_BPCHARNE 1053 #define F_ACLITEM_EQ 1062 #define F_BPCHAR_LARGER 1063 #define F_BPCHAR_SMALLER 1064 #define F_PG_PREPARED_XACT 1065 #define F_GENERATE_SERIES_STEP_INT4 1066 #define F_GENERATE_SERIES_INT4 1067 #define F_GENERATE_SERIES_STEP_INT8 1068 #define F_GENERATE_SERIES_INT8 1069 #define F_BPCHARCMP 1078 #define F_TEXT_REGCLASS 1079 #define F_HASHBPCHAR 1080 #define F_FORMAT_TYPE 1081 #define F_DATE_IN 1084 #define F_DATE_OUT 1085 #define F_DATE_EQ 1086 #define F_DATE_LT 1087 #define F_DATE_LE 1088 #define F_DATE_GT 1089 #define F_DATE_GE 1090 #define F_DATE_NE 1091 #define F_DATE_CMP 1092 #define F_TIME_LT 1102 #define F_TIME_LE 1103 #define F_TIME_GT 1104 #define F_TIME_GE 1105 #define F_TIME_NE 1106 #define F_TIME_CMP 1107 #define F_DATE_LARGER 1138 #define F_DATE_SMALLER 1139 #define F_DATE_MI 1140 #define F_DATE_PLI 1141 #define F_DATE_MII 1142 #define F_TIME_IN 1143 #define F_TIME_OUT 1144 #define F_TIME_EQ 1145 #define F_CIRCLE_ADD_PT 1146 #define F_CIRCLE_SUB_PT 1147 #define F_CIRCLE_MUL_PT 1148 #define F_CIRCLE_DIV_PT 1149 #define F_TIMESTAMPTZ_IN 1150 #define F_TIMESTAMPTZ_OUT 1151 #define F_TIMESTAMP_EQ 1152 #define F_TIMESTAMP_NE 1153 #define F_TIMESTAMP_LT 1154 #define F_TIMESTAMP_LE 1155 #define F_TIMESTAMP_GE 1156 #define F_TIMESTAMP_GT 1157 #define F_TIMESTAMPTZ_ZONE 1159 #define F_INTERVAL_IN 1160 #define F_INTERVAL_OUT 1161 #define F_INTERVAL_EQ 1162 #define F_INTERVAL_NE 1163 #define F_INTERVAL_LT 1164 #define F_INTERVAL_LE 1165 #define F_INTERVAL_GE 1166 #define F_INTERVAL_GT 1167 #define F_INTERVAL_UM 1168 #define F_INTERVAL_PL 1169 #define F_INTERVAL_MI 1170 #define F_TIMESTAMPTZ_PART 1171 #define F_INTERVAL_PART 1172 #define F_ABSTIME_TIMESTAMPTZ 1173 #define F_DATE_TIMESTAMPTZ 1174 #define F_INTERVAL_JUSTIFY_HOURS 1175 #define F_RELTIME_INTERVAL 1177 #define F_TIMESTAMPTZ_DATE 1178 #define F_ABSTIME_DATE 1179 #define F_TIMESTAMPTZ_ABSTIME 1180 #define F_XID_AGE 1181 #define F_TIMESTAMP_MI 1188 #define F_TIMESTAMPTZ_PL_INTERVAL 1189 #define F_TIMESTAMPTZ_MI_INTERVAL 1190 #define F_GENERATE_SUBSCRIPTS 1191 #define F_GENERATE_SUBSCRIPTS_NODIR 1192 #define F_ARRAY_FILL 1193 #define F_INTERVAL_RELTIME 1194 #define F_TIMESTAMP_SMALLER 1195 #define F_TIMESTAMP_LARGER 1196 #define F_INTERVAL_SMALLER 1197 #define F_INTERVAL_LARGER 1198 #define F_TIMESTAMPTZ_AGE 1199 #define F_INTERVAL_SCALE 1200 #define F_TIMESTAMPTZ_TRUNC 1217 #define F_INTERVAL_TRUNC 1218 #define F_INT8INC 1219 #define F_INT8ABS 1230 #define F_INT8LARGER 1236 #define F_INT8SMALLER 1237 #define F_TEXTICREGEXEQ 1238 #define F_TEXTICREGEXNE 1239 #define F_NAMEICREGEXEQ 1240 #define F_NAMEICREGEXNE 1241 #define F_BOOLIN 1242 #define F_BOOLOUT 1243 #define F_BYTEAIN 1244 #define F_CHARIN 1245 #define F_CHARLT 1246 #define F_UNIQUE_KEY_RECHECK 1250 #define F_INT4ABS 1251 #define F_NAMEREGEXNE 1252 #define F_INT2ABS 1253 #define F_TEXTREGEXEQ 1254 #define F_TEXTREGEXNE 1256 #define F_TEXTLEN 1257 #define F_TEXTCAT 1258 #define F_PG_CHAR_TO_ENCODING 1264 #define F_TIDNE 1265 #define F_CIDR_IN 1267 #define F_BTCOSTESTIMATE 1268 #define F_PG_COLUMN_SIZE 1269 #define F_OVERLAPS_TIMETZ 1271 #define F_DATETIME_TIMESTAMP 1272 #define F_TIMETZ_PART 1273 #define F_INT84PL 1274 #define F_INT84MI 1275 #define F_INT84MUL 1276 #define F_INT84DIV 1277 #define F_INT48PL 1278 #define F_INT48MI 1279 #define F_INT48MUL 1280 #define F_INT48DIV 1281 #define F_QUOTE_IDENT 1282 #define F_QUOTE_LITERAL 1283 #define F_ARRAY_FILL_WITH_LOWER_BOUNDS 1286 #define F_I8TOOID 1287 #define F_OIDTOI8 1288 #define F_QUOTE_NULLABLE 1289 #define F_SUPPRESS_REDUNDANT_UPDATES_TRIGGER 1291 #define F_TIDEQ 1292 #define F_CURRTID_BYRELOID 1293 #define F_CURRTID_BYRELNAME 1294 #define F_INTERVAL_JUSTIFY_DAYS 1295 #define F_DATETIMETZ_TIMESTAMPTZ 1297 #define F_NOW 1299 #define F_POSITIONSEL 1300 #define F_POSITIONJOINSEL 1301 #define F_CONTSEL 1302 #define F_CONTJOINSEL 1303 #define F_OVERLAPS_TIMESTAMP 1304 #define F_OVERLAPS_TIME 1308 #define F_TIMESTAMP_IN 1312 #define F_TIMESTAMP_OUT 1313 #define F_TIMESTAMP_CMP 1314 #define F_INTERVAL_CMP 1315 #define F_TIMESTAMP_TIME 1316 #define F_BPCHARLEN 1318 #define F_INTERVAL_DIV 1326 #define F_DLOG10 1339 #define F_OIDVECTORTYPES 1349 #define F_TIMETZ_IN 1350 #define F_TIMETZ_OUT 1351 #define F_TIMETZ_EQ 1352 #define F_TIMETZ_NE 1353 #define F_TIMETZ_LT 1354 #define F_TIMETZ_LE 1355 #define F_TIMETZ_GE 1356 #define F_TIMETZ_GT 1357 #define F_TIMETZ_CMP 1358 #define F_NETWORK_HOSTMASK 1362 #define F_MAKEACLITEM 1365 #define F_TIME_INTERVAL 1370 #define F_PG_LOCK_STATUS 1371 #define F_DATE_FINITE 1373 #define F_TEXTOCTETLEN 1374 #define F_BPCHAROCTETLEN 1375 #define F_TIME_LARGER 1377 #define F_TIME_SMALLER 1378 #define F_TIMETZ_LARGER 1379 #define F_TIMETZ_SMALLER 1380 #define F_TIME_PART 1385 #define F_PG_GET_CONSTRAINTDEF 1387 #define F_TIMESTAMPTZ_TIMETZ 1388 #define F_TIMESTAMP_FINITE 1389 #define F_INTERVAL_FINITE 1390 #define F_PG_STAT_GET_BACKEND_START 1391 #define F_PG_STAT_GET_BACKEND_CLIENT_ADDR 1392 #define F_PG_STAT_GET_BACKEND_CLIENT_PORT 1393 #define F_CURRENT_SCHEMA 1402 #define F_CURRENT_SCHEMAS 1403 #define F_TEXTOVERLAY 1404 #define F_TEXTOVERLAY_NO_LEN 1405 #define F_LINE_PARALLEL 1412 #define F_LINE_PERP 1413 #define F_LINE_VERTICAL 1414 #define F_LINE_HORIZONTAL 1415 #define F_CIRCLE_CENTER 1416 #define F_INTERVAL_TIME 1419 #define F_POINTS_BOX 1421 #define F_BOX_ADD 1422 #define F_BOX_SUB 1423 #define F_BOX_MUL 1424 #define F_BOX_DIV 1425 #define F_CIDR_OUT 1427 #define F_POLY_CONTAIN_PT 1428 #define F_PT_CONTAINED_POLY 1429 #define F_PATH_ISCLOSED 1430 #define F_PATH_ISOPEN 1431 #define F_PATH_NPOINTS 1432 #define F_PATH_CLOSE 1433 #define F_PATH_OPEN 1434 #define F_PATH_ADD 1435 #define F_PATH_ADD_PT 1436 #define F_PATH_SUB_PT 1437 #define F_PATH_MUL_PT 1438 #define F_PATH_DIV_PT 1439 #define F_CONSTRUCT_POINT 1440 #define F_POINT_ADD 1441 #define F_POINT_SUB 1442 #define F_POINT_MUL 1443 #define F_POINT_DIV 1444 #define F_POLY_NPOINTS 1445 #define F_POLY_BOX 1446 #define F_POLY_PATH 1447 #define F_BOX_POLY 1448 #define F_PATH_POLY 1449 #define F_CIRCLE_IN 1450 #define F_CIRCLE_OUT 1451 #define F_CIRCLE_SAME 1452 #define F_CIRCLE_CONTAIN 1453 #define F_CIRCLE_LEFT 1454 #define F_CIRCLE_OVERLEFT 1455 #define F_CIRCLE_OVERRIGHT 1456 #define F_CIRCLE_RIGHT 1457 #define F_CIRCLE_CONTAINED 1458 #define F_CIRCLE_OVERLAP 1459 #define F_CIRCLE_BELOW 1460 #define F_CIRCLE_ABOVE 1461 #define F_CIRCLE_EQ 1462 #define F_CIRCLE_NE 1463 #define F_CIRCLE_LT 1464 #define F_CIRCLE_GT 1465 #define F_CIRCLE_LE 1466 #define F_CIRCLE_GE 1467 #define F_CIRCLE_AREA 1468 #define F_CIRCLE_DIAMETER 1469 #define F_CIRCLE_RADIUS 1470 #define F_CIRCLE_DISTANCE 1471 #define F_CR_CIRCLE 1473 #define F_POLY_CIRCLE 1474 #define F_CIRCLE_POLY 1475 #define F_DIST_PC 1476 #define F_CIRCLE_CONTAIN_PT 1477 #define F_PT_CONTAINED_CIRCLE 1478 #define F_BOX_CIRCLE 1479 #define F_CIRCLE_BOX 1480 #define F_LSEG_NE 1482 #define F_LSEG_LT 1483 #define F_LSEG_LE 1484 #define F_LSEG_GT 1485 #define F_LSEG_GE 1486 #define F_LSEG_LENGTH 1487 #define F_CLOSE_LS 1488 #define F_CLOSE_LSEG 1489 #define F_LINE_IN 1490 #define F_LINE_OUT 1491 #define F_LINE_EQ 1492 #define F_LINE_CONSTRUCT_PP 1493 #define F_LINE_INTERPT 1494 #define F_LINE_INTERSECT 1495 #define F_BIT_IN 1564 #define F_BIT_OUT 1565 #define F_PG_GET_RULEDEF 1573 #define F_NEXTVAL_OID 1574 #define F_CURRVAL_OID 1575 #define F_SETVAL_OID 1576 #define F_VARBIT_IN 1579 #define F_VARBIT_OUT 1580 #define F_BITEQ 1581 #define F_BITNE 1582 #define F_BITGE 1592 #define F_BITGT 1593 #define F_BITLE 1594 #define F_BITLT 1595 #define F_BITCMP 1596 #define F_PG_ENCODING_TO_CHAR 1597 #define F_DRANDOM 1598 #define F_SETSEED 1599 #define F_DASIN 1600 #define F_DACOS 1601 #define F_DATAN 1602 #define F_DATAN2 1603 #define F_DSIN 1604 #define F_DCOS 1605 #define F_DTAN 1606 #define F_DCOT 1607 #define F_DEGREES 1608 #define F_RADIANS 1609 #define F_DPI 1610 #define F_INTERVAL_MUL 1618 #define F_PG_TYPEOF 1619 #define F_ASCII 1620 #define F_CHR 1621 #define F_REPEAT 1622 #define F_SIMILAR_ESCAPE 1623 #define F_MUL_D_INTERVAL 1624 #define F_TEXTICLIKE 1633 #define F_TEXTICNLIKE 1634 #define F_NAMEICLIKE 1635 #define F_NAMEICNLIKE 1636 #define F_LIKE_ESCAPE 1637 #define F_OIDGT 1638 #define F_OIDGE 1639 #define F_PG_GET_VIEWDEF_NAME 1640 #define F_PG_GET_VIEWDEF 1641 #define F_PG_GET_USERBYID 1642 #define F_PG_GET_INDEXDEF 1643 #define F_RI_FKEY_CHECK_INS 1644 #define F_RI_FKEY_CHECK_UPD 1645 #define F_RI_FKEY_CASCADE_DEL 1646 #define F_RI_FKEY_CASCADE_UPD 1647 #define F_RI_FKEY_RESTRICT_DEL 1648 #define F_RI_FKEY_RESTRICT_UPD 1649 #define F_RI_FKEY_SETNULL_DEL 1650 #define F_RI_FKEY_SETNULL_UPD 1651 #define F_RI_FKEY_SETDEFAULT_DEL 1652 #define F_RI_FKEY_SETDEFAULT_UPD 1653 #define F_RI_FKEY_NOACTION_DEL 1654 #define F_RI_FKEY_NOACTION_UPD 1655 #define F_PG_GET_TRIGGERDEF 1662 #define F_PG_GET_SERIAL_SEQUENCE 1665 #define F_BIT_AND 1673 #define F_BIT_OR 1674 #define F_BITXOR 1675 #define F_BITNOT 1676 #define F_BITSHIFTLEFT 1677 #define F_BITSHIFTRIGHT 1678 #define F_BITCAT 1679 #define F_BITSUBSTR 1680 #define F_BITLENGTH 1681 #define F_BITOCTETLENGTH 1682 #define F_BITFROMINT4 1683 #define F_BITTOINT4 1684 #define F_BIT 1685 #define F_PG_GET_KEYWORDS 1686 #define F_VARBIT 1687 #define F_TIME_HASH 1688 #define F_ACLEXPLODE 1689 #define F_TIME_MI_TIME 1690 #define F_BOOLLE 1691 #define F_BOOLGE 1692 #define F_BTBOOLCMP 1693 #define F_TIMETZ_HASH 1696 #define F_INTERVAL_HASH 1697 #define F_BITPOSITION 1698 #define F_BITSUBSTR_NO_LEN 1699 #define F_NUMERIC_IN 1701 #define F_NUMERIC_OUT 1702 #define F_NUMERIC 1703 #define F_NUMERIC_ABS 1704 #define F_NUMERIC_SIGN 1706 #define F_NUMERIC_ROUND 1707 #define F_NUMERIC_TRUNC 1709 #define F_NUMERIC_CEIL 1711 #define F_NUMERIC_FLOOR 1712 #define F_LENGTH_IN_ENCODING 1713 #define F_PG_CONVERT_FROM 1714 #define F_INET_TO_CIDR 1715 #define F_PG_GET_EXPR 1716 #define F_PG_CONVERT_TO 1717 #define F_NUMERIC_EQ 1718 #define F_NUMERIC_NE 1719 #define F_NUMERIC_GT 1720 #define F_NUMERIC_GE 1721 #define F_NUMERIC_LT 1722 #define F_NUMERIC_LE 1723 #define F_NUMERIC_ADD 1724 #define F_NUMERIC_SUB 1725 #define F_NUMERIC_MUL 1726 #define F_NUMERIC_DIV 1727 #define F_NUMERIC_MOD 1728 #define F_NUMERIC_SQRT 1730 #define F_NUMERIC_EXP 1732 #define F_NUMERIC_LN 1734 #define F_NUMERIC_LOG 1736 #define F_NUMERIC_POWER 1738 #define F_INT4_NUMERIC 1740 #define F_FLOAT4_NUMERIC 1742 #define F_FLOAT8_NUMERIC 1743 #define F_NUMERIC_INT4 1744 #define F_NUMERIC_FLOAT4 1745 #define F_NUMERIC_FLOAT8 1746 #define F_TIME_PL_INTERVAL 1747 #define F_TIME_MI_INTERVAL 1748 #define F_TIMETZ_PL_INTERVAL 1749 #define F_TIMETZ_MI_INTERVAL 1750 #define F_NUMERIC_INC 1764 #define F_SETVAL3_OID 1765 #define F_NUMERIC_SMALLER 1766 #define F_NUMERIC_LARGER 1767 #define F_INTERVAL_TO_CHAR 1768 #define F_NUMERIC_CMP 1769 #define F_TIMESTAMPTZ_TO_CHAR 1770 #define F_NUMERIC_UMINUS 1771 #define F_NUMERIC_TO_CHAR 1772 #define F_INT4_TO_CHAR 1773 #define F_INT8_TO_CHAR 1774 #define F_FLOAT4_TO_CHAR 1775 #define F_FLOAT8_TO_CHAR 1776 #define F_NUMERIC_TO_NUMBER 1777 #define F_TO_TIMESTAMP 1778 #define F_NUMERIC_INT8 1779 #define F_TO_DATE 1780 #define F_INT8_NUMERIC 1781 #define F_INT2_NUMERIC 1782 #define F_NUMERIC_INT2 1783 #define F_OIDIN 1798 #define F_OIDOUT 1799 #define F_PG_CONVERT 1813 #define F_ICLIKESEL 1814 #define F_ICNLIKESEL 1815 #define F_ICLIKEJOINSEL 1816 #define F_ICNLIKEJOINSEL 1817 #define F_REGEXEQSEL 1818 #define F_LIKESEL 1819 #define F_ICREGEXEQSEL 1820 #define F_REGEXNESEL 1821 #define F_NLIKESEL 1822 #define F_ICREGEXNESEL 1823 #define F_REGEXEQJOINSEL 1824 #define F_LIKEJOINSEL 1825 #define F_ICREGEXEQJOINSEL 1826 #define F_REGEXNEJOINSEL 1827 #define F_NLIKEJOINSEL 1828 #define F_ICREGEXNEJOINSEL 1829 #define F_FLOAT8_AVG 1830 #define F_FLOAT8_VAR_SAMP 1831 #define F_FLOAT8_STDDEV_SAMP 1832 #define F_NUMERIC_ACCUM 1833 #define F_INT2_ACCUM 1834 #define F_INT4_ACCUM 1835 #define F_INT8_ACCUM 1836 #define F_NUMERIC_AVG 1837 #define F_NUMERIC_VAR_SAMP 1838 #define F_NUMERIC_STDDEV_SAMP 1839 #define F_INT2_SUM 1840 #define F_INT4_SUM 1841 #define F_INT8_SUM 1842 #define F_INTERVAL_ACCUM 1843 #define F_INTERVAL_AVG 1844 #define F_TO_ASCII_DEFAULT 1845 #define F_TO_ASCII_ENC 1846 #define F_TO_ASCII_ENCNAME 1847 #define F_INT28EQ 1850 #define F_INT28NE 1851 #define F_INT28LT 1852 #define F_INT28GT 1853 #define F_INT28LE 1854 #define F_INT28GE 1855 #define F_INT82EQ 1856 #define F_INT82NE 1857 #define F_INT82LT 1858 #define F_INT82GT 1859 #define F_INT82LE 1860 #define F_INT82GE 1861 #define F_INT2AND 1892 #define F_INT2OR 1893 #define F_INT2XOR 1894 #define F_INT2NOT 1895 #define F_INT2SHL 1896 #define F_INT2SHR 1897 #define F_INT4AND 1898 #define F_INT4OR 1899 #define F_INT4XOR 1900 #define F_INT4NOT 1901 #define F_INT4SHL 1902 #define F_INT4SHR 1903 #define F_INT8AND 1904 #define F_INT8OR 1905 #define F_INT8XOR 1906 #define F_INT8NOT 1907 #define F_INT8SHL 1908 #define F_INT8SHR 1909 #define F_INT8UP 1910 #define F_INT2UP 1911 #define F_INT4UP 1912 #define F_FLOAT4UP 1913 #define F_FLOAT8UP 1914 #define F_NUMERIC_UPLUS 1915 #define F_HAS_TABLE_PRIVILEGE_NAME_NAME 1922 #define F_HAS_TABLE_PRIVILEGE_NAME_ID 1923 #define F_HAS_TABLE_PRIVILEGE_ID_NAME 1924 #define F_HAS_TABLE_PRIVILEGE_ID_ID 1925 #define F_HAS_TABLE_PRIVILEGE_NAME 1926 #define F_HAS_TABLE_PRIVILEGE_ID 1927 #define F_PG_STAT_GET_NUMSCANS 1928 #define F_PG_STAT_GET_TUPLES_RETURNED 1929 #define F_PG_STAT_GET_TUPLES_FETCHED 1930 #define F_PG_STAT_GET_TUPLES_INSERTED 1931 #define F_PG_STAT_GET_TUPLES_UPDATED 1932 #define F_PG_STAT_GET_TUPLES_DELETED 1933 #define F_PG_STAT_GET_BLOCKS_FETCHED 1934 #define F_PG_STAT_GET_BLOCKS_HIT 1935 #define F_PG_STAT_GET_BACKEND_IDSET 1936 #define F_PG_STAT_GET_BACKEND_PID 1937 #define F_PG_STAT_GET_BACKEND_DBID 1938 #define F_PG_STAT_GET_BACKEND_USERID 1939 #define F_PG_STAT_GET_BACKEND_ACTIVITY 1940 #define F_PG_STAT_GET_DB_NUMBACKENDS 1941 #define F_PG_STAT_GET_DB_XACT_COMMIT 1942 #define F_PG_STAT_GET_DB_XACT_ROLLBACK 1943 #define F_PG_STAT_GET_DB_BLOCKS_FETCHED 1944 #define F_PG_STAT_GET_DB_BLOCKS_HIT 1945 #define F_BINARY_ENCODE 1946 #define F_BINARY_DECODE 1947 #define F_BYTEAEQ 1948 #define F_BYTEALT 1949 #define F_BYTEALE 1950 #define F_BYTEAGT 1951 #define F_BYTEAGE 1952 #define F_BYTEANE 1953 #define F_BYTEACMP 1954 #define F_TIMESTAMP_SCALE 1961 #define F_INT2_AVG_ACCUM 1962 #define F_INT4_AVG_ACCUM 1963 #define F_INT8_AVG 1964 #define F_OIDLARGER 1965 #define F_OIDSMALLER 1966 #define F_TIMESTAMPTZ_SCALE 1967 #define F_TIME_SCALE 1968 #define F_TIMETZ_SCALE 1969 #define F_PG_STAT_GET_TUPLES_HOT_UPDATED 1972 #define F_NUMERIC_DIV_TRUNC 1973 #define F_BYTEALIKE 2005 #define F_BYTEANLIKE 2006 #define F_LIKE_ESCAPE_BYTEA 2009 #define F_BYTEACAT 2011 #define F_BYTEA_SUBSTR 2012 #define F_BYTEA_SUBSTR_NO_LEN 2013 #define F_BYTEAPOS 2014 #define F_BYTEATRIM 2015 #define F_TIMESTAMPTZ_TIME 2019 #define F_TIMESTAMP_TRUNC 2020 #define F_TIMESTAMP_PART 2021 #define F_PG_STAT_GET_ACTIVITY 2022 #define F_ABSTIME_TIMESTAMP 2023 #define F_DATE_TIMESTAMP 2024 #define F_PG_BACKEND_PID 2026 #define F_TIMESTAMPTZ_TIMESTAMP 2027 #define F_TIMESTAMP_TIMESTAMPTZ 2028 #define F_TIMESTAMP_DATE 2029 #define F_TIMESTAMP_ABSTIME 2030 #define F_TIMESTAMP_PL_INTERVAL 2032 #define F_TIMESTAMP_MI_INTERVAL 2033 #define F_PG_CONF_LOAD_TIME 2034 #define F_TIMETZ_ZONE 2037 #define F_TIMETZ_IZONE 2038 #define F_TIMESTAMP_HASH 2039 #define F_TIMETZ_TIME 2046 #define F_TIME_TIMETZ 2047 #define F_TIMESTAMP_TO_CHAR 2049 #define F_AGGREGATE_DUMMY 2050 #define F_TIMESTAMP_AGE 2058 #define F_TIMESTAMP_ZONE 2069 #define F_TIMESTAMP_IZONE 2070 #define F_DATE_PL_INTERVAL 2071 #define F_DATE_MI_INTERVAL 2072 #define F_TEXTREGEXSUBSTR 2073 #define F_BITFROMINT8 2075 #define F_BITTOINT8 2076 #define F_SHOW_CONFIG_BY_NAME 2077 #define F_SET_CONFIG_BY_NAME 2078 #define F_PG_TABLE_IS_VISIBLE 2079 #define F_PG_TYPE_IS_VISIBLE 2080 #define F_PG_FUNCTION_IS_VISIBLE 2081 #define F_PG_OPERATOR_IS_VISIBLE 2082 #define F_PG_OPCLASS_IS_VISIBLE 2083 #define F_SHOW_ALL_SETTINGS 2084 #define F_REPLACE_TEXT 2087 #define F_SPLIT_TEXT 2088 #define F_TO_HEX32 2089 #define F_TO_HEX64 2090 #define F_ARRAY_LOWER 2091 #define F_ARRAY_UPPER 2092 #define F_PG_CONVERSION_IS_VISIBLE 2093 #define F_PG_STAT_GET_BACKEND_ACTIVITY_START 2094 #define F_PG_TERMINATE_BACKEND 2096 #define F_PG_GET_FUNCTIONDEF 2098 #define F_TEXT_PATTERN_LT 2160 #define F_TEXT_PATTERN_LE 2161 #define F_PG_GET_FUNCTION_ARGUMENTS 2162 #define F_TEXT_PATTERN_GE 2163 #define F_TEXT_PATTERN_GT 2164 #define F_PG_GET_FUNCTION_RESULT 2165 #define F_BTTEXT_PATTERN_CMP 2166 #define F_PG_DATABASE_SIZE_NAME 2168 #define F_WIDTH_BUCKET_NUMERIC 2170 #define F_PG_CANCEL_BACKEND 2171 #define F_PG_START_BACKUP 2172 #define F_PG_STOP_BACKUP 2173 #define F_BPCHAR_PATTERN_LT 2174 #define F_BPCHAR_PATTERN_LE 2175 #define F_ARRAY_LENGTH 2176 #define F_BPCHAR_PATTERN_GE 2177 #define F_BPCHAR_PATTERN_GT 2178 #define F_GIST_POINT_CONSISTENT 2179 #define F_BTBPCHAR_PATTERN_CMP 2180 #define F_HAS_SEQUENCE_PRIVILEGE_NAME_NAME 2181 #define F_HAS_SEQUENCE_PRIVILEGE_NAME_ID 2182 #define F_HAS_SEQUENCE_PRIVILEGE_ID_NAME 2183 #define F_HAS_SEQUENCE_PRIVILEGE_ID_ID 2184 #define F_HAS_SEQUENCE_PRIVILEGE_NAME 2185 #define F_HAS_SEQUENCE_PRIVILEGE_ID 2186 #define F_BTINT48CMP 2188 #define F_BTINT84CMP 2189 #define F_BTINT24CMP 2190 #define F_BTINT42CMP 2191 #define F_BTINT28CMP 2192 #define F_BTINT82CMP 2193 #define F_BTFLOAT48CMP 2194 #define F_BTFLOAT84CMP 2195 #define F_INET_CLIENT_ADDR 2196 #define F_INET_CLIENT_PORT 2197 #define F_INET_SERVER_ADDR 2198 #define F_INET_SERVER_PORT 2199 #define F_REGPROCEDUREIN 2212 #define F_REGPROCEDUREOUT 2213 #define F_REGOPERIN 2214 #define F_REGOPEROUT 2215 #define F_REGOPERATORIN 2216 #define F_REGOPERATOROUT 2217 #define F_REGCLASSIN 2218 #define F_REGCLASSOUT 2219 #define F_REGTYPEIN 2220 #define F_REGTYPEOUT 2221 #define F_PG_STAT_CLEAR_SNAPSHOT 2230 #define F_PG_GET_FUNCTION_IDENTITY_ARGUMENTS 2232 #define F_FMGR_INTERNAL_VALIDATOR 2246 #define F_FMGR_C_VALIDATOR 2247 #define F_FMGR_SQL_VALIDATOR 2248 #define F_HAS_DATABASE_PRIVILEGE_NAME_NAME 2250 #define F_HAS_DATABASE_PRIVILEGE_NAME_ID 2251 #define F_HAS_DATABASE_PRIVILEGE_ID_NAME 2252 #define F_HAS_DATABASE_PRIVILEGE_ID_ID 2253 #define F_HAS_DATABASE_PRIVILEGE_NAME 2254 #define F_HAS_DATABASE_PRIVILEGE_ID 2255 #define F_HAS_FUNCTION_PRIVILEGE_NAME_NAME 2256 #define F_HAS_FUNCTION_PRIVILEGE_NAME_ID 2257 #define F_HAS_FUNCTION_PRIVILEGE_ID_NAME 2258 #define F_HAS_FUNCTION_PRIVILEGE_ID_ID 2259 #define F_HAS_FUNCTION_PRIVILEGE_NAME 2260 #define F_HAS_FUNCTION_PRIVILEGE_ID 2261 #define F_HAS_LANGUAGE_PRIVILEGE_NAME_NAME 2262 #define F_HAS_LANGUAGE_PRIVILEGE_NAME_ID 2263 #define F_HAS_LANGUAGE_PRIVILEGE_ID_NAME 2264 #define F_HAS_LANGUAGE_PRIVILEGE_ID_ID 2265 #define F_HAS_LANGUAGE_PRIVILEGE_NAME 2266 #define F_HAS_LANGUAGE_PRIVILEGE_ID 2267 #define F_HAS_SCHEMA_PRIVILEGE_NAME_NAME 2268 #define F_HAS_SCHEMA_PRIVILEGE_NAME_ID 2269 #define F_HAS_SCHEMA_PRIVILEGE_ID_NAME 2270 #define F_HAS_SCHEMA_PRIVILEGE_ID_ID 2271 #define F_HAS_SCHEMA_PRIVILEGE_NAME 2272 #define F_HAS_SCHEMA_PRIVILEGE_ID 2273 #define F_PG_STAT_RESET 2274 #define F_TEXTREGEXREPLACE_NOOPT 2284 #define F_TEXTREGEXREPLACE 2285 #define F_PG_TOTAL_RELATION_SIZE 2286 #define F_PG_SIZE_PRETTY 2288 #define F_PG_OPTIONS_TO_TABLE 2289 #define F_RECORD_IN 2290 #define F_RECORD_OUT 2291 #define F_CSTRING_IN 2292 #define F_CSTRING_OUT 2293 #define F_ANY_IN 2294 #define F_ANY_OUT 2295 #define F_ANYARRAY_IN 2296 #define F_ANYARRAY_OUT 2297 #define F_VOID_IN 2298 #define F_VOID_OUT 2299 #define F_TRIGGER_IN 2300 #define F_TRIGGER_OUT 2301 #define F_LANGUAGE_HANDLER_IN 2302 #define F_LANGUAGE_HANDLER_OUT 2303 #define F_INTERNAL_IN 2304 #define F_INTERNAL_OUT 2305 #define F_OPAQUE_IN 2306 #define F_OPAQUE_OUT 2307 #define F_DCEIL 2308 #define F_DFLOOR 2309 #define F_DSIGN 2310 #define F_MD5_TEXT 2311 #define F_ANYELEMENT_IN 2312 #define F_ANYELEMENT_OUT 2313 #define F_POSTGRESQL_FDW_VALIDATOR 2316 #define F_PG_ENCODING_MAX_LENGTH_SQL 2319 #define F_MD5_BYTEA 2321 #define F_PG_TABLESPACE_SIZE_OID 2322 #define F_PG_TABLESPACE_SIZE_NAME 2323 #define F_PG_DATABASE_SIZE_OID 2324 #define F_ARRAY_UNNEST 2331 #define F_PG_RELATION_SIZE 2332 #define F_ARRAY_AGG_TRANSFN 2333 #define F_ARRAY_AGG_FINALFN 2334 #define F_DATE_LT_TIMESTAMP 2338 #define F_DATE_LE_TIMESTAMP 2339 #define F_DATE_EQ_TIMESTAMP 2340 #define F_DATE_GT_TIMESTAMP 2341 #define F_DATE_GE_TIMESTAMP 2342 #define F_DATE_NE_TIMESTAMP 2343 #define F_DATE_CMP_TIMESTAMP 2344 #define F_DATE_LT_TIMESTAMPTZ 2351 #define F_DATE_LE_TIMESTAMPTZ 2352 #define F_DATE_EQ_TIMESTAMPTZ 2353 #define F_DATE_GT_TIMESTAMPTZ 2354 #define F_DATE_GE_TIMESTAMPTZ 2355 #define F_DATE_NE_TIMESTAMPTZ 2356 #define F_DATE_CMP_TIMESTAMPTZ 2357 #define F_TIMESTAMP_LT_DATE 2364 #define F_TIMESTAMP_LE_DATE 2365 #define F_TIMESTAMP_EQ_DATE 2366 #define F_TIMESTAMP_GT_DATE 2367 #define F_TIMESTAMP_GE_DATE 2368 #define F_TIMESTAMP_NE_DATE 2369 #define F_TIMESTAMP_CMP_DATE 2370 #define F_TIMESTAMPTZ_LT_DATE 2377 #define F_TIMESTAMPTZ_LE_DATE 2378 #define F_TIMESTAMPTZ_EQ_DATE 2379 #define F_TIMESTAMPTZ_GT_DATE 2380 #define F_TIMESTAMPTZ_GE_DATE 2381 #define F_TIMESTAMPTZ_NE_DATE 2382 #define F_TIMESTAMPTZ_CMP_DATE 2383 #define F_HAS_TABLESPACE_PRIVILEGE_NAME_NAME 2390 #define F_HAS_TABLESPACE_PRIVILEGE_NAME_ID 2391 #define F_HAS_TABLESPACE_PRIVILEGE_ID_NAME 2392 #define F_HAS_TABLESPACE_PRIVILEGE_ID_ID 2393 #define F_HAS_TABLESPACE_PRIVILEGE_NAME 2394 #define F_HAS_TABLESPACE_PRIVILEGE_ID 2395 #define F_SHELL_IN 2398 #define F_SHELL_OUT 2399 #define F_ARRAY_RECV 2400 #define F_ARRAY_SEND 2401 #define F_RECORD_RECV 2402 #define F_RECORD_SEND 2403 #define F_INT2RECV 2404 #define F_INT2SEND 2405 #define F_INT4RECV 2406 #define F_INT4SEND 2407 #define F_INT8RECV 2408 #define F_INT8SEND 2409 #define F_INT2VECTORRECV 2410 #define F_INT2VECTORSEND 2411 #define F_BYTEARECV 2412 #define F_BYTEASEND 2413 #define F_TEXTRECV 2414 #define F_TEXTSEND 2415 #define F_UNKNOWNRECV 2416 #define F_UNKNOWNSEND 2417 #define F_OIDRECV 2418 #define F_OIDSEND 2419 #define F_OIDVECTORRECV 2420 #define F_OIDVECTORSEND 2421 #define F_NAMERECV 2422 #define F_NAMESEND 2423 #define F_FLOAT4RECV 2424 #define F_FLOAT4SEND 2425 #define F_FLOAT8RECV 2426 #define F_FLOAT8SEND 2427 #define F_POINT_RECV 2428 #define F_POINT_SEND 2429 #define F_BPCHARRECV 2430 #define F_BPCHARSEND 2431 #define F_VARCHARRECV 2432 #define F_VARCHARSEND 2433 #define F_CHARRECV 2434 #define F_CHARSEND 2435 #define F_BOOLRECV 2436 #define F_BOOLSEND 2437 #define F_TIDRECV 2438 #define F_TIDSEND 2439 #define F_XIDRECV 2440 #define F_XIDSEND 2441 #define F_CIDRECV 2442 #define F_CIDSEND 2443 #define F_REGPROCRECV 2444 #define F_REGPROCSEND 2445 #define F_REGPROCEDURERECV 2446 #define F_REGPROCEDURESEND 2447 #define F_REGOPERRECV 2448 #define F_REGOPERSEND 2449 #define F_REGOPERATORRECV 2450 #define F_REGOPERATORSEND 2451 #define F_REGCLASSRECV 2452 #define F_REGCLASSSEND 2453 #define F_REGTYPERECV 2454 #define F_REGTYPESEND 2455 #define F_BIT_RECV 2456 #define F_BIT_SEND 2457 #define F_VARBIT_RECV 2458 #define F_VARBIT_SEND 2459 #define F_NUMERIC_RECV 2460 #define F_NUMERIC_SEND 2461 #define F_ABSTIMERECV 2462 #define F_ABSTIMESEND 2463 #define F_RELTIMERECV 2464 #define F_RELTIMESEND 2465 #define F_TINTERVALRECV 2466 #define F_TINTERVALSEND 2467 #define F_DATE_RECV 2468 #define F_DATE_SEND 2469 #define F_TIME_RECV 2470 #define F_TIME_SEND 2471 #define F_TIMETZ_RECV 2472 #define F_TIMETZ_SEND 2473 #define F_TIMESTAMP_RECV 2474 #define F_TIMESTAMP_SEND 2475 #define F_TIMESTAMPTZ_RECV 2476 #define F_TIMESTAMPTZ_SEND 2477 #define F_INTERVAL_RECV 2478 #define F_INTERVAL_SEND 2479 #define F_LSEG_RECV 2480 #define F_LSEG_SEND 2481 #define F_PATH_RECV 2482 #define F_PATH_SEND 2483 #define F_BOX_RECV 2484 #define F_BOX_SEND 2485 #define F_POLY_RECV 2486 #define F_POLY_SEND 2487 #define F_LINE_RECV 2488 #define F_LINE_SEND 2489 #define F_CIRCLE_RECV 2490 #define F_CIRCLE_SEND 2491 #define F_CASH_RECV 2492 #define F_CASH_SEND 2493 #define F_MACADDR_RECV 2494 #define F_MACADDR_SEND 2495 #define F_INET_RECV 2496 #define F_INET_SEND 2497 #define F_CIDR_RECV 2498 #define F_CIDR_SEND 2499 #define F_CSTRING_RECV 2500 #define F_CSTRING_SEND 2501 #define F_ANYARRAY_RECV 2502 #define F_ANYARRAY_SEND 2503 #define F_PG_GET_RULEDEF_EXT 2504 #define F_PG_GET_VIEWDEF_NAME_EXT 2505 #define F_PG_GET_VIEWDEF_EXT 2506 #define F_PG_GET_INDEXDEF_EXT 2507 #define F_PG_GET_CONSTRAINTDEF_EXT 2508 #define F_PG_GET_EXPR_EXT 2509 #define F_PG_PREPARED_STATEMENT 2510 #define F_PG_CURSOR 2511 #define F_FLOAT8_VAR_POP 2512 #define F_FLOAT8_STDDEV_POP 2513 #define F_NUMERIC_VAR_POP 2514 #define F_BOOLAND_STATEFUNC 2515 #define F_BOOLOR_STATEFUNC 2516 #define F_TIMESTAMP_LT_TIMESTAMPTZ 2520 #define F_TIMESTAMP_LE_TIMESTAMPTZ 2521 #define F_TIMESTAMP_EQ_TIMESTAMPTZ 2522 #define F_TIMESTAMP_GT_TIMESTAMPTZ 2523 #define F_TIMESTAMP_GE_TIMESTAMPTZ 2524 #define F_TIMESTAMP_NE_TIMESTAMPTZ 2525 #define F_TIMESTAMP_CMP_TIMESTAMPTZ 2526 #define F_TIMESTAMPTZ_LT_TIMESTAMP 2527 #define F_TIMESTAMPTZ_LE_TIMESTAMP 2528 #define F_TIMESTAMPTZ_EQ_TIMESTAMP 2529 #define F_TIMESTAMPTZ_GT_TIMESTAMP 2530 #define F_TIMESTAMPTZ_GE_TIMESTAMP 2531 #define F_TIMESTAMPTZ_NE_TIMESTAMP 2532 #define F_TIMESTAMPTZ_CMP_TIMESTAMP 2533 #define F_PG_TABLESPACE_DATABASES 2556 #define F_INT4_BOOL 2557 #define F_BOOL_INT4 2558 #define F_LASTVAL 2559 #define F_PG_POSTMASTER_START_TIME 2560 #define F_GISTVACUUMCLEANUP 2561 #define F_BOX_BELOW 2562 #define F_BOX_OVERBELOW 2563 #define F_BOX_OVERABOVE 2564 #define F_BOX_ABOVE 2565 #define F_POLY_BELOW 2566 #define F_POLY_OVERBELOW 2567 #define F_POLY_OVERABOVE 2568 #define F_POLY_ABOVE 2569 #define F_GIST_BOX_CONSISTENT 2578 #define F_GIST_BOX_COMPRESS 2579 #define F_GIST_BOX_DECOMPRESS 2580 #define F_GIST_BOX_PENALTY 2581 #define F_GIST_BOX_PICKSPLIT 2582 #define F_GIST_BOX_UNION 2583 #define F_GIST_BOX_SAME 2584 #define F_GIST_POLY_CONSISTENT 2585 #define F_GIST_POLY_COMPRESS 2586 #define F_CIRCLE_OVERBELOW 2587 #define F_CIRCLE_OVERABOVE 2588 #define F_GIST_CIRCLE_CONSISTENT 2591 #define F_GIST_CIRCLE_COMPRESS 2592 #define F_NUMERIC_STDDEV_POP 2596 #define F_DOMAIN_IN 2597 #define F_DOMAIN_RECV 2598 #define F_PG_TIMEZONE_ABBREVS 2599 #define F_XMLEXISTS 2614 #define F_PG_RELOAD_CONF 2621 #define F_PG_ROTATE_LOGFILE 2622 #define F_PG_STAT_FILE 2623 #define F_PG_READ_FILE 2624 #define F_PG_LS_DIR 2625 #define F_PG_SLEEP 2626 #define F_INETNOT 2627 #define F_INETAND 2628 #define F_INETOR 2629 #define F_INETPL 2630 #define F_INETMI_INT8 2632 #define F_INETMI 2633 #define F_STATEMENT_TIMESTAMP 2648 #define F_CLOCK_TIMESTAMP 2649 #define F_GIN_CMP_PREFIX 2700 #define F_PG_HAS_ROLE_NAME_NAME 2705 #define F_PG_HAS_ROLE_NAME_ID 2706 #define F_PG_HAS_ROLE_ID_NAME 2707 #define F_PG_HAS_ROLE_ID_ID 2708 #define F_PG_HAS_ROLE_NAME 2709 #define F_PG_HAS_ROLE_ID 2710 #define F_INTERVAL_JUSTIFY_INTERVAL 2711 #define F_PG_GET_TRIGGERDEF_EXT 2730 #define F_GINGETBITMAP 2731 #define F_GININSERT 2732 #define F_GINBEGINSCAN 2733 #define F_GINRESCAN 2734 #define F_GINENDSCAN 2735 #define F_GINMARKPOS 2736 #define F_GINRESTRPOS 2737 #define F_GINBUILD 2738 #define F_GINBULKDELETE 2739 #define F_GINVACUUMCLEANUP 2740 #define F_GINCOSTESTIMATE 2741 #define F_GINARRAYEXTRACT 2743 #define F_GINARRAYCONSISTENT 2744 #define F_INT8_AVG_ACCUM 2746 #define F_ARRAYOVERLAP 2747 #define F_ARRAYCONTAINS 2748 #define F_ARRAYCONTAINED 2749 #define F_PG_STAT_GET_DB_TUPLES_RETURNED 2758 #define F_PG_STAT_GET_DB_TUPLES_FETCHED 2759 #define F_PG_STAT_GET_DB_TUPLES_INSERTED 2760 #define F_PG_STAT_GET_DB_TUPLES_UPDATED 2761 #define F_PG_STAT_GET_DB_TUPLES_DELETED 2762 #define F_REGEXP_MATCHES_NO_FLAGS 2763 #define F_REGEXP_MATCHES 2764 #define F_REGEXP_SPLIT_TO_TABLE_NO_FLAGS 2765 #define F_REGEXP_SPLIT_TO_TABLE 2766 #define F_REGEXP_SPLIT_TO_ARRAY_NO_FLAGS 2767 #define F_REGEXP_SPLIT_TO_ARRAY 2768 #define F_PG_STAT_GET_BGWRITER_TIMED_CHECKPOINTS 2769 #define F_PG_STAT_GET_BGWRITER_REQUESTED_CHECKPOINTS 2770 #define F_PG_STAT_GET_BGWRITER_BUF_WRITTEN_CHECKPOINTS 2771 #define F_PG_STAT_GET_BGWRITER_BUF_WRITTEN_CLEAN 2772 #define F_PG_STAT_GET_BGWRITER_MAXWRITTEN_CLEAN 2773 #define F_GINQUERYARRAYEXTRACT 2774 #define F_PG_STAT_GET_BUF_WRITTEN_BACKEND 2775 #define F_ANYNONARRAY_IN 2777 #define F_ANYNONARRAY_OUT 2778 #define F_PG_STAT_GET_LAST_VACUUM_TIME 2781 #define F_PG_STAT_GET_LAST_AUTOVACUUM_TIME 2782 #define F_PG_STAT_GET_LAST_ANALYZE_TIME 2783 #define F_PG_STAT_GET_LAST_AUTOANALYZE_TIME 2784 #define F_BTOPTIONS 2785 #define F_HASHOPTIONS 2786 #define F_GISTOPTIONS 2787 #define F_GINOPTIONS 2788 #define F_TIDGT 2790 #define F_TIDLT 2791 #define F_TIDGE 2792 #define F_TIDLE 2793 #define F_BTTIDCMP 2794 #define F_TIDLARGER 2795 #define F_TIDSMALLER 2796 #define F_INT8INC_ANY 2804 #define F_INT8INC_FLOAT8_FLOAT8 2805 #define F_FLOAT8_REGR_ACCUM 2806 #define F_FLOAT8_REGR_SXX 2807 #define F_FLOAT8_REGR_SYY 2808 #define F_FLOAT8_REGR_SXY 2809 #define F_FLOAT8_REGR_AVGX 2810 #define F_FLOAT8_REGR_AVGY 2811 #define F_FLOAT8_REGR_R2 2812 #define F_FLOAT8_REGR_SLOPE 2813 #define F_FLOAT8_REGR_INTERCEPT 2814 #define F_FLOAT8_COVAR_POP 2815 #define F_FLOAT8_COVAR_SAMP 2816 #define F_FLOAT8_CORR 2817 #define F_PG_STAT_GET_DB_BLK_READ_TIME 2844 #define F_PG_STAT_GET_DB_BLK_WRITE_TIME 2845 #define F_PG_SWITCH_XLOG 2848 #define F_PG_CURRENT_XLOG_LOCATION 2849 #define F_PG_XLOGFILE_NAME_OFFSET 2850 #define F_PG_XLOGFILE_NAME 2851 #define F_PG_CURRENT_XLOG_INSERT_LOCATION 2852 #define F_PG_STAT_GET_BACKEND_WAITING 2853 #define F_PG_MY_TEMP_SCHEMA 2854 #define F_PG_IS_OTHER_TEMP_SCHEMA 2855 #define F_PG_TIMEZONE_NAMES 2856 #define F_PG_STAT_GET_BACKEND_XACT_START 2857 #define F_NUMERIC_AVG_ACCUM 2858 #define F_PG_STAT_GET_BUF_ALLOC 2859 #define F_PG_STAT_GET_LIVE_TUPLES 2878 #define F_PG_STAT_GET_DEAD_TUPLES 2879 #define F_PG_ADVISORY_LOCK_INT8 2880 #define F_PG_ADVISORY_LOCK_SHARED_INT8 2881 #define F_PG_TRY_ADVISORY_LOCK_INT8 2882 #define F_PG_TRY_ADVISORY_LOCK_SHARED_INT8 2883 #define F_PG_ADVISORY_UNLOCK_INT8 2884 #define F_PG_ADVISORY_UNLOCK_SHARED_INT8 2885 #define F_PG_ADVISORY_LOCK_INT4 2886 #define F_PG_ADVISORY_LOCK_SHARED_INT4 2887 #define F_PG_TRY_ADVISORY_LOCK_INT4 2888 #define F_PG_TRY_ADVISORY_LOCK_SHARED_INT4 2889 #define F_PG_ADVISORY_UNLOCK_INT4 2890 #define F_PG_ADVISORY_UNLOCK_SHARED_INT4 2891 #define F_PG_ADVISORY_UNLOCK_ALL 2892 #define F_XML_IN 2893 #define F_XML_OUT 2894 #define F_XMLCOMMENT 2895 #define F_TEXTTOXML 2896 #define F_XMLVALIDATE 2897 #define F_XML_RECV 2898 #define F_XML_SEND 2899 #define F_XMLCONCAT2 2900 #define F_VARBITTYPMODIN 2902 #define F_INTERVALTYPMODIN 2903 #define F_INTERVALTYPMODOUT 2904 #define F_TIMESTAMPTYPMODIN 2905 #define F_TIMESTAMPTYPMODOUT 2906 #define F_TIMESTAMPTZTYPMODIN 2907 #define F_TIMESTAMPTZTYPMODOUT 2908 #define F_TIMETYPMODIN 2909 #define F_TIMETYPMODOUT 2910 #define F_TIMETZTYPMODIN 2911 #define F_TIMETZTYPMODOUT 2912 #define F_BPCHARTYPMODIN 2913 #define F_BPCHARTYPMODOUT 2914 #define F_VARCHARTYPMODIN 2915 #define F_VARCHARTYPMODOUT 2916 #define F_NUMERICTYPMODIN 2917 #define F_NUMERICTYPMODOUT 2918 #define F_BITTYPMODIN 2919 #define F_BITTYPMODOUT 2920 #define F_VARBITTYPMODOUT 2921 #define F_XMLTOTEXT 2922 #define F_TABLE_TO_XML 2923 #define F_QUERY_TO_XML 2924 #define F_CURSOR_TO_XML 2925 #define F_TABLE_TO_XMLSCHEMA 2926 #define F_QUERY_TO_XMLSCHEMA 2927 #define F_CURSOR_TO_XMLSCHEMA 2928 #define F_TABLE_TO_XML_AND_XMLSCHEMA 2929 #define F_QUERY_TO_XML_AND_XMLSCHEMA 2930 #define F_XPATH 2931 #define F_SCHEMA_TO_XML 2933 #define F_SCHEMA_TO_XMLSCHEMA 2934 #define F_SCHEMA_TO_XML_AND_XMLSCHEMA 2935 #define F_DATABASE_TO_XML 2936 #define F_DATABASE_TO_XMLSCHEMA 2937 #define F_DATABASE_TO_XML_AND_XMLSCHEMA 2938 #define F_TXID_SNAPSHOT_IN 2939 #define F_TXID_SNAPSHOT_OUT 2940 #define F_TXID_SNAPSHOT_RECV 2941 #define F_TXID_SNAPSHOT_SEND 2942 #define F_TXID_CURRENT 2943 #define F_TXID_CURRENT_SNAPSHOT 2944 #define F_TXID_SNAPSHOT_XMIN 2945 #define F_TXID_SNAPSHOT_XMAX 2946 #define F_TXID_SNAPSHOT_XIP 2947 #define F_TXID_VISIBLE_IN_SNAPSHOT 2948 #define F_UUID_IN 2952 #define F_UUID_OUT 2953 #define F_UUID_LT 2954 #define F_UUID_LE 2955 #define F_UUID_EQ 2956 #define F_UUID_GE 2957 #define F_UUID_GT 2958 #define F_UUID_NE 2959 #define F_UUID_CMP 2960 #define F_UUID_RECV 2961 #define F_UUID_SEND 2962 #define F_UUID_HASH 2963 #define F_BOOLTEXT 2971 #define F_PG_STAT_GET_FUNCTION_CALLS 2978 #define F_PG_STAT_GET_FUNCTION_TOTAL_TIME 2979 #define F_PG_STAT_GET_FUNCTION_SELF_TIME 2980 #define F_RECORD_EQ 2981 #define F_RECORD_NE 2982 #define F_RECORD_LT 2983 #define F_RECORD_GT 2984 #define F_RECORD_LE 2985 #define F_RECORD_GE 2986 #define F_BTRECORDCMP 2987 #define F_PG_TABLE_SIZE 2997 #define F_PG_INDEXES_SIZE 2998 #define F_PG_RELATION_FILENODE 2999 #define F_HAS_FOREIGN_DATA_WRAPPER_PRIVILEGE_NAME_NAME 3000 #define F_HAS_FOREIGN_DATA_WRAPPER_PRIVILEGE_NAME_ID 3001 #define F_HAS_FOREIGN_DATA_WRAPPER_PRIVILEGE_ID_NAME 3002 #define F_HAS_FOREIGN_DATA_WRAPPER_PRIVILEGE_ID_ID 3003 #define F_HAS_FOREIGN_DATA_WRAPPER_PRIVILEGE_NAME 3004 #define F_HAS_FOREIGN_DATA_WRAPPER_PRIVILEGE_ID 3005 #define F_HAS_SERVER_PRIVILEGE_NAME_NAME 3006 #define F_HAS_SERVER_PRIVILEGE_NAME_ID 3007 #define F_HAS_SERVER_PRIVILEGE_ID_NAME 3008 #define F_HAS_SERVER_PRIVILEGE_ID_ID 3009 #define F_HAS_SERVER_PRIVILEGE_NAME 3010 #define F_HAS_SERVER_PRIVILEGE_ID 3011 #define F_HAS_COLUMN_PRIVILEGE_NAME_NAME_NAME 3012 #define F_HAS_COLUMN_PRIVILEGE_NAME_NAME_ATTNUM 3013 #define F_HAS_COLUMN_PRIVILEGE_NAME_ID_NAME 3014 #define F_HAS_COLUMN_PRIVILEGE_NAME_ID_ATTNUM 3015 #define F_HAS_COLUMN_PRIVILEGE_ID_NAME_NAME 3016 #define F_HAS_COLUMN_PRIVILEGE_ID_NAME_ATTNUM 3017 #define F_HAS_COLUMN_PRIVILEGE_ID_ID_NAME 3018 #define F_HAS_COLUMN_PRIVILEGE_ID_ID_ATTNUM 3019 #define F_HAS_COLUMN_PRIVILEGE_NAME_NAME 3020 #define F_HAS_COLUMN_PRIVILEGE_NAME_ATTNUM 3021 #define F_HAS_COLUMN_PRIVILEGE_ID_NAME 3022 #define F_HAS_COLUMN_PRIVILEGE_ID_ATTNUM 3023 #define F_HAS_ANY_COLUMN_PRIVILEGE_NAME_NAME 3024 #define F_HAS_ANY_COLUMN_PRIVILEGE_NAME_ID 3025 #define F_HAS_ANY_COLUMN_PRIVILEGE_ID_NAME 3026 #define F_HAS_ANY_COLUMN_PRIVILEGE_ID_ID 3027 #define F_HAS_ANY_COLUMN_PRIVILEGE_NAME 3028 #define F_HAS_ANY_COLUMN_PRIVILEGE_ID 3029 #define F_BITOVERLAY 3030 #define F_BITOVERLAY_NO_LEN 3031 #define F_BITGETBIT 3032 #define F_BITSETBIT 3033 #define F_PG_RELATION_FILEPATH 3034 #define F_PG_LISTENING_CHANNELS 3035 #define F_PG_NOTIFY 3036 #define F_PG_STAT_GET_XACT_NUMSCANS 3037 #define F_PG_STAT_GET_XACT_TUPLES_RETURNED 3038 #define F_PG_STAT_GET_XACT_TUPLES_FETCHED 3039 #define F_PG_STAT_GET_XACT_TUPLES_INSERTED 3040 #define F_PG_STAT_GET_XACT_TUPLES_UPDATED 3041 #define F_PG_STAT_GET_XACT_TUPLES_DELETED 3042 #define F_PG_STAT_GET_XACT_TUPLES_HOT_UPDATED 3043 #define F_PG_STAT_GET_XACT_BLOCKS_FETCHED 3044 #define F_PG_STAT_GET_XACT_BLOCKS_HIT 3045 #define F_PG_STAT_GET_XACT_FUNCTION_CALLS 3046 #define F_PG_STAT_GET_XACT_FUNCTION_TOTAL_TIME 3047 #define F_PG_STAT_GET_XACT_FUNCTION_SELF_TIME 3048 #define F_XPATH_EXISTS 3049 #define F_XML_IS_WELL_FORMED 3051 #define F_XML_IS_WELL_FORMED_DOCUMENT 3052 #define F_XML_IS_WELL_FORMED_CONTENT 3053 #define F_PG_STAT_GET_VACUUM_COUNT 3054 #define F_PG_STAT_GET_AUTOVACUUM_COUNT 3055 #define F_PG_STAT_GET_ANALYZE_COUNT 3056 #define F_PG_STAT_GET_AUTOANALYZE_COUNT 3057 #define F_TEXT_CONCAT 3058 #define F_TEXT_CONCAT_WS 3059 #define F_TEXT_LEFT 3060 #define F_TEXT_RIGHT 3061 #define F_TEXT_REVERSE 3062 #define F_PG_STAT_GET_BUF_FSYNC_BACKEND 3063 #define F_GIST_POINT_DISTANCE 3064 #define F_PG_STAT_GET_DB_CONFLICT_TABLESPACE 3065 #define F_PG_STAT_GET_DB_CONFLICT_LOCK 3066 #define F_PG_STAT_GET_DB_CONFLICT_SNAPSHOT 3067 #define F_PG_STAT_GET_DB_CONFLICT_BUFFERPIN 3068 #define F_PG_STAT_GET_DB_CONFLICT_STARTUP_DEADLOCK 3069 #define F_PG_STAT_GET_DB_CONFLICT_ALL 3070 #define F_PG_XLOG_REPLAY_PAUSE 3071 #define F_PG_XLOG_REPLAY_RESUME 3072 #define F_PG_IS_XLOG_REPLAY_PAUSED 3073 #define F_PG_STAT_GET_DB_STAT_RESET_TIME 3074 #define F_PG_STAT_GET_BGWRITER_STAT_RESET_TIME 3075 #define F_GINARRAYEXTRACT_2ARGS 3076 #define F_GIN_EXTRACT_TSVECTOR_2ARGS 3077 #define F_PG_SEQUENCE_PARAMETERS 3078 #define F_PG_AVAILABLE_EXTENSIONS 3082 #define F_PG_AVAILABLE_EXTENSION_VERSIONS 3083 #define F_PG_EXTENSION_UPDATE_PATHS 3084 #define F_PG_EXTENSION_CONFIG_DUMP 3086 #define F_GIN_EXTRACT_TSQUERY_5ARGS 3087 #define F_GIN_TSQUERY_CONSISTENT_6ARGS 3088 #define F_PG_ADVISORY_XACT_LOCK_INT8 3089 #define F_PG_ADVISORY_XACT_LOCK_SHARED_INT8 3090 #define F_PG_TRY_ADVISORY_XACT_LOCK_INT8 3091 #define F_PG_TRY_ADVISORY_XACT_LOCK_SHARED_INT8 3092 #define F_PG_ADVISORY_XACT_LOCK_INT4 3093 #define F_PG_ADVISORY_XACT_LOCK_SHARED_INT4 3094 #define F_PG_TRY_ADVISORY_XACT_LOCK_INT4 3095 #define F_PG_TRY_ADVISORY_XACT_LOCK_SHARED_INT4 3096 #define F_VARCHAR_TRANSFORM 3097 #define F_PG_CREATE_RESTORE_POINT 3098 #define F_PG_STAT_GET_WAL_SENDERS 3099 #define F_WINDOW_ROW_NUMBER 3100 #define F_WINDOW_RANK 3101 #define F_WINDOW_DENSE_RANK 3102 #define F_WINDOW_PERCENT_RANK 3103 #define F_WINDOW_CUME_DIST 3104 #define F_WINDOW_NTILE 3105 #define F_WINDOW_LAG 3106 #define F_WINDOW_LAG_WITH_OFFSET 3107 #define F_WINDOW_LAG_WITH_OFFSET_AND_DEFAULT 3108 #define F_WINDOW_LEAD 3109 #define F_WINDOW_LEAD_WITH_OFFSET 3110 #define F_WINDOW_LEAD_WITH_OFFSET_AND_DEFAULT 3111 #define F_WINDOW_FIRST_VALUE 3112 #define F_WINDOW_LAST_VALUE 3113 #define F_WINDOW_NTH_VALUE 3114 #define F_FDW_HANDLER_IN 3116 #define F_FDW_HANDLER_OUT 3117 #define F_VOID_RECV 3120 #define F_VOID_SEND 3121 #define F_BTINT2SORTSUPPORT 3129 #define F_BTINT4SORTSUPPORT 3130 #define F_BTINT8SORTSUPPORT 3131 #define F_BTFLOAT4SORTSUPPORT 3132 #define F_BTFLOAT8SORTSUPPORT 3133 #define F_BTOIDSORTSUPPORT 3134 #define F_BTNAMESORTSUPPORT 3135 #define F_DATE_SORTSUPPORT 3136 #define F_TIMESTAMP_SORTSUPPORT 3137 #define F_HAS_TYPE_PRIVILEGE_NAME_NAME 3138 #define F_HAS_TYPE_PRIVILEGE_NAME_ID 3139 #define F_HAS_TYPE_PRIVILEGE_ID_NAME 3140 #define F_HAS_TYPE_PRIVILEGE_ID_ID 3141 #define F_HAS_TYPE_PRIVILEGE_NAME 3142 #define F_HAS_TYPE_PRIVILEGE_ID 3143 #define F_MACADDR_NOT 3144 #define F_MACADDR_AND 3145 #define F_MACADDR_OR 3146 #define F_PG_STAT_GET_DB_TEMP_FILES 3150 #define F_PG_STAT_GET_DB_TEMP_BYTES 3151 #define F_PG_STAT_GET_DB_DEADLOCKS 3152 #define F_ARRAY_TO_JSON 3153 #define F_ARRAY_TO_JSON_PRETTY 3154 #define F_ROW_TO_JSON 3155 #define F_ROW_TO_JSON_PRETTY 3156 #define F_NUMERIC_TRANSFORM 3157 #define F_VARBIT_TRANSFORM 3158 #define F_PG_GET_VIEWDEF_WRAP 3159 #define F_PG_STAT_GET_CHECKPOINT_WRITE_TIME 3160 #define F_PG_STAT_GET_CHECKPOINT_SYNC_TIME 3161 #define F_PG_COLLATION_FOR 3162 #define F_PG_TRIGGER_DEPTH 3163 #define F_PG_XLOG_LOCATION_DIFF 3165 #define F_PG_SIZE_PRETTY_NUMERIC 3166 #define F_ANYENUM_IN 3504 #define F_ANYENUM_OUT 3505 #define F_ENUM_IN 3506 #define F_ENUM_OUT 3507 #define F_ENUM_EQ 3508 #define F_ENUM_NE 3509 #define F_ENUM_LT 3510 #define F_ENUM_GT 3511 #define F_ENUM_LE 3512 #define F_ENUM_GE 3513 #define F_ENUM_CMP 3514 #define F_HASHENUM 3515 #define F_ENUM_SMALLER 3524 #define F_ENUM_LARGER 3525 #define F_ENUM_FIRST 3528 #define F_ENUM_LAST 3529 #define F_ENUM_RANGE_BOUNDS 3530 #define F_ENUM_RANGE_ALL 3531 #define F_ENUM_RECV 3532 #define F_ENUM_SEND 3533 #define F_STRING_AGG_TRANSFN 3535 #define F_STRING_AGG_FINALFN 3536 #define F_PG_DESCRIBE_OBJECT 3537 #define F_TEXT_FORMAT 3539 #define F_TEXT_FORMAT_NV 3540 #define F_BYTEA_STRING_AGG_TRANSFN 3543 #define F_BYTEA_STRING_AGG_FINALFN 3544 #define F_TSVECTORIN 3610 #define F_TSVECTOROUT 3611 #define F_TSQUERYIN 3612 #define F_TSQUERYOUT 3613 #define F_TSVECTOR_LT 3616 #define F_TSVECTOR_LE 3617 #define F_TSVECTOR_EQ 3618 #define F_TSVECTOR_NE 3619 #define F_TSVECTOR_GE 3620 #define F_TSVECTOR_GT 3621 #define F_TSVECTOR_CMP 3622 #define F_TSVECTOR_STRIP 3623 #define F_TSVECTOR_SETWEIGHT 3624 #define F_TSVECTOR_CONCAT 3625 #define F_TS_MATCH_VQ 3634 #define F_TS_MATCH_QV 3635 #define F_TSVECTORSEND 3638 #define F_TSVECTORRECV 3639 #define F_TSQUERYSEND 3640 #define F_TSQUERYRECV 3641 #define F_GTSVECTORIN 3646 #define F_GTSVECTOROUT 3647 #define F_GTSVECTOR_COMPRESS 3648 #define F_GTSVECTOR_DECOMPRESS 3649 #define F_GTSVECTOR_PICKSPLIT 3650 #define F_GTSVECTOR_UNION 3651 #define F_GTSVECTOR_SAME 3652 #define F_GTSVECTOR_PENALTY 3653 #define F_GTSVECTOR_CONSISTENT 3654 #define F_GIN_EXTRACT_TSVECTOR 3656 #define F_GIN_EXTRACT_TSQUERY 3657 #define F_GIN_TSQUERY_CONSISTENT 3658 #define F_TSQUERY_LT 3662 #define F_TSQUERY_LE 3663 #define F_TSQUERY_EQ 3664 #define F_TSQUERY_NE 3665 #define F_TSQUERY_GE 3666 #define F_TSQUERY_GT 3667 #define F_TSQUERY_CMP 3668 #define F_TSQUERY_AND 3669 #define F_TSQUERY_OR 3670 #define F_TSQUERY_NOT 3671 #define F_TSQUERY_NUMNODE 3672 #define F_TSQUERYTREE 3673 #define F_TSQUERY_REWRITE 3684 #define F_TSQUERY_REWRITE_QUERY 3685 #define F_TSMATCHSEL 3686 #define F_TSMATCHJOINSEL 3687 #define F_TS_TYPANALYZE 3688 #define F_TS_STAT1 3689 #define F_TS_STAT2 3690 #define F_TSQ_MCONTAINS 3691 #define F_TSQ_MCONTAINED 3692 #define F_GTSQUERY_COMPRESS 3695 #define F_GTSQUERY_DECOMPRESS 3696 #define F_GTSQUERY_PICKSPLIT 3697 #define F_GTSQUERY_UNION 3698 #define F_GTSQUERY_SAME 3699 #define F_GTSQUERY_PENALTY 3700 #define F_GTSQUERY_CONSISTENT 3701 #define F_TS_RANK_WTTF 3703 #define F_TS_RANK_WTT 3704 #define F_TS_RANK_TTF 3705 #define F_TS_RANK_TT 3706 #define F_TS_RANKCD_WTTF 3707 #define F_TS_RANKCD_WTT 3708 #define F_TS_RANKCD_TTF 3709 #define F_TS_RANKCD_TT 3710 #define F_TSVECTOR_LENGTH 3711 #define F_TS_TOKEN_TYPE_BYID 3713 #define F_TS_TOKEN_TYPE_BYNAME 3714 #define F_TS_PARSE_BYID 3715 #define F_TS_PARSE_BYNAME 3716 #define F_PRSD_START 3717 #define F_PRSD_NEXTTOKEN 3718 #define F_PRSD_END 3719 #define F_PRSD_HEADLINE 3720 #define F_PRSD_LEXTYPE 3721 #define F_TS_LEXIZE 3723 #define F_GIN_CMP_TSLEXEME 3724 #define F_DSIMPLE_INIT 3725 #define F_DSIMPLE_LEXIZE 3726 #define F_DSYNONYM_INIT 3728 #define F_DSYNONYM_LEXIZE 3729 #define F_DISPELL_INIT 3731 #define F_DISPELL_LEXIZE 3732 #define F_REGCONFIGIN 3736 #define F_REGCONFIGOUT 3737 #define F_REGCONFIGRECV 3738 #define F_REGCONFIGSEND 3739 #define F_THESAURUS_INIT 3740 #define F_THESAURUS_LEXIZE 3741 #define F_TS_HEADLINE_BYID_OPT 3743 #define F_TS_HEADLINE_BYID 3744 #define F_TO_TSVECTOR_BYID 3745 #define F_TO_TSQUERY_BYID 3746 #define F_PLAINTO_TSQUERY_BYID 3747 #define F_TO_TSVECTOR 3749 #define F_TO_TSQUERY 3750 #define F_PLAINTO_TSQUERY 3751 #define F_TSVECTOR_UPDATE_TRIGGER_BYID 3752 #define F_TSVECTOR_UPDATE_TRIGGER_BYCOLUMN 3753 #define F_TS_HEADLINE_OPT 3754 #define F_TS_HEADLINE 3755 #define F_PG_TS_PARSER_IS_VISIBLE 3756 #define F_PG_TS_DICT_IS_VISIBLE 3757 #define F_PG_TS_CONFIG_IS_VISIBLE 3758 #define F_GET_CURRENT_TS_CONFIG 3759 #define F_TS_MATCH_TT 3760 #define F_TS_MATCH_TQ 3761 #define F_PG_TS_TEMPLATE_IS_VISIBLE 3768 #define F_REGDICTIONARYIN 3771 #define F_REGDICTIONARYOUT 3772 #define F_REGDICTIONARYRECV 3773 #define F_REGDICTIONARYSEND 3774 #define F_PG_STAT_RESET_SHARED 3775 #define F_PG_STAT_RESET_SINGLE_TABLE_COUNTERS 3776 #define F_PG_STAT_RESET_SINGLE_FUNCTION_COUNTERS 3777 #define F_PG_TABLESPACE_LOCATION 3778 #define F_PG_EXPORT_SNAPSHOT 3809 #define F_PG_IS_IN_RECOVERY 3810 #define F_INT4_CASH 3811 #define F_INT8_CASH 3812 #define F_PG_COLLATION_IS_VISIBLE 3815 #define F_ARRAY_TYPANALYZE 3816 #define F_ARRAYCONTSEL 3817 #define F_ARRAYCONTJOINSEL 3818 #define F_PG_LAST_XLOG_RECEIVE_LOCATION 3820 #define F_PG_LAST_XLOG_REPLAY_LOCATION 3821 #define F_CASH_DIV_CASH 3822 #define F_CASH_NUMERIC 3823 #define F_NUMERIC_CASH 3824 #define F_PG_READ_FILE_ALL 3826 #define F_PG_READ_BINARY_FILE 3827 #define F_PG_READ_BINARY_FILE_ALL 3828 #define F_PG_OPFAMILY_IS_VISIBLE 3829 #define F_PG_LAST_XACT_REPLAY_TIMESTAMP 3830 #define F_ANYRANGE_IN 3832 #define F_ANYRANGE_OUT 3833 #define F_RANGE_IN 3834 #define F_RANGE_OUT 3835 #define F_RANGE_RECV 3836 #define F_RANGE_SEND 3837 #define F_RANGE_CONSTRUCTOR2 3840 #define F_RANGE_CONSTRUCTOR3 3841 #define F_RANGE_LOWER 3848 #define F_RANGE_UPPER 3849 #define F_RANGE_EMPTY 3850 #define F_RANGE_LOWER_INC 3851 #define F_RANGE_UPPER_INC 3852 #define F_RANGE_LOWER_INF 3853 #define F_RANGE_UPPER_INF 3854 #define F_RANGE_EQ 3855 #define F_RANGE_NE 3856 #define F_RANGE_OVERLAPS 3857 #define F_RANGE_CONTAINS_ELEM 3858 #define F_RANGE_CONTAINS 3859 #define F_ELEM_CONTAINED_BY_RANGE 3860 #define F_RANGE_CONTAINED_BY 3861 #define F_RANGE_ADJACENT 3862 #define F_RANGE_BEFORE 3863 #define F_RANGE_AFTER 3864 #define F_RANGE_OVERLEFT 3865 #define F_RANGE_OVERRIGHT 3866 #define F_RANGE_UNION 3867 #define F_RANGE_INTERSECT 3868 #define F_RANGE_MINUS 3869 #define F_RANGE_CMP 3870 #define F_RANGE_LT 3871 #define F_RANGE_LE 3872 #define F_RANGE_GE 3873 #define F_RANGE_GT 3874 #define F_RANGE_GIST_CONSISTENT 3875 #define F_RANGE_GIST_UNION 3876 #define F_RANGE_GIST_COMPRESS 3877 #define F_RANGE_GIST_DECOMPRESS 3878 #define F_RANGE_GIST_PENALTY 3879 #define F_RANGE_GIST_PICKSPLIT 3880 #define F_RANGE_GIST_SAME 3881 #define F_HASH_RANGE 3902 #define F_INT4RANGE_CANONICAL 3914 #define F_DATERANGE_CANONICAL 3915 #define F_RANGE_TYPANALYZE 3916 #define F_TIMESTAMP_TRANSFORM 3917 #define F_INTERVAL_TRANSFORM 3918 #define F_INT4RANGE_SUBDIFF 3922 #define F_INT8RANGE_SUBDIFF 3923 #define F_NUMRANGE_SUBDIFF 3924 #define F_DATERANGE_SUBDIFF 3925 #define F_INT8RANGE_CANONICAL 3928 #define F_TSRANGE_SUBDIFF 3929 #define F_TSTZRANGE_SUBDIFF 3930 #define F_ACLDEFAULT_SQL 3943 #define F_TIME_TRANSFORM 3944 #define F_SPGGETTUPLE 4001 #define F_SPGGETBITMAP 4002 #define F_SPGINSERT 4003 #define F_SPGBEGINSCAN 4004 #define F_SPGRESCAN 4005 #define F_SPGENDSCAN 4006 #define F_SPGMARKPOS 4007 #define F_SPGRESTRPOS 4008 #define F_SPGBUILD 4009 #define F_SPGBUILDEMPTY 4010 #define F_SPGBULKDELETE 4011 #define F_SPGVACUUMCLEANUP 4012 #define F_SPGCOSTESTIMATE 4013 #define F_SPGOPTIONS 4014 #define F_SPG_QUAD_CONFIG 4018 #define F_SPG_QUAD_CHOOSE 4019 #define F_SPG_QUAD_PICKSPLIT 4020 #define F_SPG_QUAD_INNER_CONSISTENT 4021 #define F_SPG_QUAD_LEAF_CONSISTENT 4022 #define F_SPG_KD_CONFIG 4023 #define F_SPG_KD_CHOOSE 4024 #define F_SPG_KD_PICKSPLIT 4025 #define F_SPG_KD_INNER_CONSISTENT 4026 #define F_SPG_TEXT_CONFIG 4027 #define F_SPG_TEXT_CHOOSE 4028 #define F_SPG_TEXT_PICKSPLIT 4029 #define F_SPG_TEXT_INNER_CONSISTENT 4030 #define F_SPG_TEXT_LEAF_CONSISTENT 4031 #define F_SPGCANRETURN 4032 #endif /* FMGROIDS_H */ PKBiZ%f++server/utils/array.hnu[/*------------------------------------------------------------------------- * * array.h * Declarations for Postgres arrays. * * A standard varlena array has the following internal structure: * - standard varlena header word * - number of dimensions of the array * - offset to stored data, or 0 if no nulls bitmap * - element type OID * - length of each array axis (C array of int) * - lower boundary of each dimension (C array of int) * - bitmap showing locations of nulls (OPTIONAL) * - whatever is the stored data * * The and arrays each have ndim elements. * * The may be omitted if the array contains no NULL elements. * If it is absent, the field is zero and the offset to the * stored data must be computed on-the-fly. If the bitmap is present, * is nonzero and is equal to the offset from the array start * to the first data element (including any alignment padding). The bitmap * follows the same conventions as tuple null bitmaps, ie, a 1 indicates * a non-null entry and the LSB of each bitmap byte is used first. * * The actual data starts on a MAXALIGN boundary. Individual items in the * array are aligned as specified by the array element type. They are * stored in row-major order (last subscript varies most rapidly). * * NOTE: it is important that array elements of toastable datatypes NOT be * toasted, since the tupletoaster won't know they are there. (We could * support compressed toasted items; only out-of-line items are dangerous. * However, it seems preferable to store such items uncompressed and allow * the toaster to compress the whole array as one input.) * * * The OIDVECTOR and INT2VECTOR datatypes are storage-compatible with * generic arrays, but they support only one-dimensional arrays with no * nulls (and no null bitmap). * * There are also some "fixed-length array" datatypes, such as NAME and * POINT. These are simply a sequence of a fixed number of items each * of a fixed-length datatype, with no overhead; the item size must be * a multiple of its alignment requirement, because we do no padding. * We support subscripting on these types, but array_in() and array_out() * only work with varlena arrays. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/array.h * *------------------------------------------------------------------------- */ #ifndef ARRAY_H #define ARRAY_H #include "fmgr.h" /* * Maximum number of elements in an array. We limit this to at most about a * quarter billion elements, so that it's not necessary to check for overflow * in quite so many places --- for instance when palloc'ing Datum arrays. */ #define MaxArraySize ((Size) (MaxAllocSize / sizeof(Datum))) /* * Arrays are varlena objects, so must meet the varlena convention that * the first int32 of the object contains the total object size in bytes. * Be sure to use VARSIZE() and SET_VARSIZE() to access it, though! * * CAUTION: if you change the header for ordinary arrays you will also * need to change the headers for oidvector and int2vector! */ typedef struct { int32 vl_len_; /* varlena header (do not touch directly!) */ int ndim; /* # of dimensions */ int32 dataoffset; /* offset to data, or 0 if no bitmap */ Oid elemtype; /* element type OID */ } ArrayType; /* * working state for accumArrayResult() and friends */ typedef struct ArrayBuildState { MemoryContext mcontext; /* where all the temp stuff is kept */ Datum *dvalues; /* array of accumulated Datums */ bool *dnulls; /* array of is-null flags for Datums */ int alen; /* allocated length of above arrays */ int nelems; /* number of valid entries in above arrays */ Oid element_type; /* data type of the Datums */ int16 typlen; /* needed info about datatype */ bool typbyval; char typalign; } ArrayBuildState; /* * structure to cache type metadata needed for array manipulation */ typedef struct ArrayMetaState { Oid element_type; int16 typlen; bool typbyval; char typalign; char typdelim; Oid typioparam; Oid typiofunc; FmgrInfo proc; } ArrayMetaState; /* * private state needed by array_map (here because caller must provide it) */ typedef struct ArrayMapState { ArrayMetaState inp_extra; ArrayMetaState ret_extra; } ArrayMapState; /* ArrayIteratorData is private in arrayfuncs.c */ typedef struct ArrayIteratorData *ArrayIterator; /* * fmgr macros for array objects */ #define DatumGetArrayTypeP(X) ((ArrayType *) PG_DETOAST_DATUM(X)) #define DatumGetArrayTypePCopy(X) ((ArrayType *) PG_DETOAST_DATUM_COPY(X)) #define PG_GETARG_ARRAYTYPE_P(n) DatumGetArrayTypeP(PG_GETARG_DATUM(n)) #define PG_GETARG_ARRAYTYPE_P_COPY(n) DatumGetArrayTypePCopy(PG_GETARG_DATUM(n)) #define PG_RETURN_ARRAYTYPE_P(x) PG_RETURN_POINTER(x) /* * Access macros for array header fields. * * ARR_DIMS returns a pointer to an array of array dimensions (number of * elements along the various array axes). * * ARR_LBOUND returns a pointer to an array of array lower bounds. * * That is: if the third axis of an array has elements 5 through 8, then * ARR_DIMS(a)[2] == 4 and ARR_LBOUND(a)[2] == 5. * * Unlike C, the default lower bound is 1. */ #define ARR_SIZE(a) VARSIZE(a) #define ARR_NDIM(a) ((a)->ndim) #define ARR_HASNULL(a) ((a)->dataoffset != 0) #define ARR_ELEMTYPE(a) ((a)->elemtype) #define ARR_DIMS(a) \ ((int *) (((char *) (a)) + sizeof(ArrayType))) #define ARR_LBOUND(a) \ ((int *) (((char *) (a)) + sizeof(ArrayType) + \ sizeof(int) * ARR_NDIM(a))) #define ARR_NULLBITMAP(a) \ (ARR_HASNULL(a) ? \ (bits8 *) (((char *) (a)) + sizeof(ArrayType) + \ 2 * sizeof(int) * ARR_NDIM(a)) \ : (bits8 *) NULL) /* * The total array header size (in bytes) for an array with the specified * number of dimensions and total number of items. */ #define ARR_OVERHEAD_NONULLS(ndims) \ MAXALIGN(sizeof(ArrayType) + 2 * sizeof(int) * (ndims)) #define ARR_OVERHEAD_WITHNULLS(ndims, nitems) \ MAXALIGN(sizeof(ArrayType) + 2 * sizeof(int) * (ndims) + \ ((nitems) + 7) / 8) #define ARR_DATA_OFFSET(a) \ (ARR_HASNULL(a) ? (a)->dataoffset : ARR_OVERHEAD_NONULLS(ARR_NDIM(a))) /* * Returns a pointer to the actual array data. */ #define ARR_DATA_PTR(a) \ (((char *) (a)) + ARR_DATA_OFFSET(a)) /* * GUC parameter */ extern bool Array_nulls; /* * prototypes for functions defined in arrayfuncs.c */ extern Datum array_in(PG_FUNCTION_ARGS); extern Datum array_out(PG_FUNCTION_ARGS); extern Datum array_recv(PG_FUNCTION_ARGS); extern Datum array_send(PG_FUNCTION_ARGS); extern Datum array_eq(PG_FUNCTION_ARGS); extern Datum array_ne(PG_FUNCTION_ARGS); extern Datum array_lt(PG_FUNCTION_ARGS); extern Datum array_gt(PG_FUNCTION_ARGS); extern Datum array_le(PG_FUNCTION_ARGS); extern Datum array_ge(PG_FUNCTION_ARGS); extern Datum btarraycmp(PG_FUNCTION_ARGS); extern Datum hash_array(PG_FUNCTION_ARGS); extern Datum arrayoverlap(PG_FUNCTION_ARGS); extern Datum arraycontains(PG_FUNCTION_ARGS); extern Datum arraycontained(PG_FUNCTION_ARGS); extern Datum array_ndims(PG_FUNCTION_ARGS); extern Datum array_dims(PG_FUNCTION_ARGS); extern Datum array_lower(PG_FUNCTION_ARGS); extern Datum array_upper(PG_FUNCTION_ARGS); extern Datum array_length(PG_FUNCTION_ARGS); extern Datum array_larger(PG_FUNCTION_ARGS); extern Datum array_smaller(PG_FUNCTION_ARGS); extern Datum generate_subscripts(PG_FUNCTION_ARGS); extern Datum generate_subscripts_nodir(PG_FUNCTION_ARGS); extern Datum array_fill(PG_FUNCTION_ARGS); extern Datum array_fill_with_lower_bounds(PG_FUNCTION_ARGS); extern Datum array_unnest(PG_FUNCTION_ARGS); extern Datum array_ref(ArrayType *array, int nSubscripts, int *indx, int arraytyplen, int elmlen, bool elmbyval, char elmalign, bool *isNull); extern ArrayType *array_set(ArrayType *array, int nSubscripts, int *indx, Datum dataValue, bool isNull, int arraytyplen, int elmlen, bool elmbyval, char elmalign); extern ArrayType *array_get_slice(ArrayType *array, int nSubscripts, int *upperIndx, int *lowerIndx, int arraytyplen, int elmlen, bool elmbyval, char elmalign); extern ArrayType *array_set_slice(ArrayType *array, int nSubscripts, int *upperIndx, int *lowerIndx, ArrayType *srcArray, bool isNull, int arraytyplen, int elmlen, bool elmbyval, char elmalign); extern Datum array_map(FunctionCallInfo fcinfo, Oid inpType, Oid retType, ArrayMapState *amstate); extern void array_bitmap_copy(bits8 *destbitmap, int destoffset, const bits8 *srcbitmap, int srcoffset, int nitems); extern ArrayType *construct_array(Datum *elems, int nelems, Oid elmtype, int elmlen, bool elmbyval, char elmalign); extern ArrayType *construct_md_array(Datum *elems, bool *nulls, int ndims, int *dims, int *lbs, Oid elmtype, int elmlen, bool elmbyval, char elmalign); extern ArrayType *construct_empty_array(Oid elmtype); extern void deconstruct_array(ArrayType *array, Oid elmtype, int elmlen, bool elmbyval, char elmalign, Datum **elemsp, bool **nullsp, int *nelemsp); extern bool array_contains_nulls(ArrayType *array); extern ArrayBuildState *accumArrayResult(ArrayBuildState *astate, Datum dvalue, bool disnull, Oid element_type, MemoryContext rcontext); extern Datum makeArrayResult(ArrayBuildState *astate, MemoryContext rcontext); extern Datum makeMdArrayResult(ArrayBuildState *astate, int ndims, int *dims, int *lbs, MemoryContext rcontext, bool release); extern ArrayIterator array_create_iterator(ArrayType *arr, int slice_ndim); extern bool array_iterate(ArrayIterator iterator, Datum *value, bool *isnull); extern void array_free_iterator(ArrayIterator iterator); /* * prototypes for functions defined in arrayutils.c */ extern int ArrayGetOffset(int n, const int *dim, const int *lb, const int *indx); extern int ArrayGetOffset0(int n, const int *tup, const int *scale); extern int ArrayGetNItems(int ndim, const int *dims); extern void mda_get_range(int n, int *span, const int *st, const int *endp); extern void mda_get_prod(int n, const int *range, int *prod); extern void mda_get_offset_values(int n, int *dist, const int *prod, const int *span); extern int mda_next_tuple(int n, int *curr, const int *span); extern int32 *ArrayGetIntegerTypmods(ArrayType *arr, int *n); extern void ArrayCheckBounds(int ndim, const int *dims, const int *lb); /* * prototypes for functions defined in array_userfuncs.c */ extern Datum array_push(PG_FUNCTION_ARGS); extern Datum array_cat(PG_FUNCTION_ARGS); extern ArrayType *create_singleton_array(FunctionCallInfo fcinfo, Oid element_type, Datum element, bool isNull, int ndims); extern Datum array_agg_transfn(PG_FUNCTION_ARGS); extern Datum array_agg_finalfn(PG_FUNCTION_ARGS); /* * prototypes for functions defined in array_typanalyze.c */ extern Datum array_typanalyze(PG_FUNCTION_ARGS); #endif /* ARRAY_H */ PKBiZl%r?r?server/utils/geo_decls.hnu[/*------------------------------------------------------------------------- * * geo_decls.h - Declarations for various 2D constructs. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/geo_decls.h * * NOTE * These routines do *not* use the float types from adt/. * * XXX These routines were not written by a numerical analyst. * * XXX I have made some attempt to flesh out the operators * and data types. There are still some more to do. - tgl 97/04/19 * *------------------------------------------------------------------------- */ #ifndef GEO_DECLS_H #define GEO_DECLS_H #include #include "fmgr.h" /*-------------------------------------------------------------------- * Useful floating point utilities and constants. *-------------------------------------------------------------------*/ #define EPSILON 1.0E-06 #ifdef EPSILON #define FPzero(A) (fabs(A) <= EPSILON) #define FPeq(A,B) (fabs((A) - (B)) <= EPSILON) #define FPne(A,B) (fabs((A) - (B)) > EPSILON) #define FPlt(A,B) ((B) - (A) > EPSILON) #define FPle(A,B) ((A) - (B) <= EPSILON) #define FPgt(A,B) ((A) - (B) > EPSILON) #define FPge(A,B) ((B) - (A) <= EPSILON) #else #define FPzero(A) ((A) == 0) #define FPeq(A,B) ((A) == (B)) #define FPne(A,B) ((A) != (B)) #define FPlt(A,B) ((A) < (B)) #define FPle(A,B) ((A) <= (B)) #define FPgt(A,B) ((A) > (B)) #define FPge(A,B) ((A) >= (B)) #endif #define HYPOT(A, B) pg_hypot(A, B) /*--------------------------------------------------------------------- * Point - (x,y) *-------------------------------------------------------------------*/ typedef struct { double x, y; } Point; /*--------------------------------------------------------------------- * LSEG - A straight line, specified by endpoints. *-------------------------------------------------------------------*/ typedef struct { Point p[2]; double m; /* precomputed to save time, not in tuple */ } LSEG; /*--------------------------------------------------------------------- * PATH - Specified by vertex points. *-------------------------------------------------------------------*/ typedef struct { int32 vl_len_; /* varlena header (do not touch directly!) */ int32 npts; int32 closed; /* is this a closed polygon? */ int32 dummy; /* padding to make it double align */ Point p[1]; /* variable length array of POINTs */ } PATH; /*--------------------------------------------------------------------- * LINE - Specified by its general equation (Ax+By+C=0). * If there is a y-intercept, it is C, which * incidentally gives a freebie point on the line * (if B=0, then C is the x-intercept). * Slope m is precalculated to save time; if * the line is not vertical, m == A. *-------------------------------------------------------------------*/ typedef struct { double A, B, C; double m; } LINE; /*--------------------------------------------------------------------- * BOX - Specified by two corner points, which are * sorted to save calculation time later. *-------------------------------------------------------------------*/ typedef struct { Point high, low; /* corner POINTs */ } BOX; /*--------------------------------------------------------------------- * POLYGON - Specified by an array of doubles defining the points, * keeping the number of points and the bounding box for * speed purposes. *-------------------------------------------------------------------*/ typedef struct { int32 vl_len_; /* varlena header (do not touch directly!) */ int32 npts; BOX boundbox; Point p[1]; /* variable length array of POINTs */ } POLYGON; /*--------------------------------------------------------------------- * CIRCLE - Specified by a center point and radius. *-------------------------------------------------------------------*/ typedef struct { Point center; double radius; } CIRCLE; /* * fmgr interface macros * * Path and Polygon are toastable varlena types, the others are just * fixed-size pass-by-reference types. */ #define DatumGetPointP(X) ((Point *) DatumGetPointer(X)) #define PointPGetDatum(X) PointerGetDatum(X) #define PG_GETARG_POINT_P(n) DatumGetPointP(PG_GETARG_DATUM(n)) #define PG_RETURN_POINT_P(x) return PointPGetDatum(x) #define DatumGetLsegP(X) ((LSEG *) DatumGetPointer(X)) #define LsegPGetDatum(X) PointerGetDatum(X) #define PG_GETARG_LSEG_P(n) DatumGetLsegP(PG_GETARG_DATUM(n)) #define PG_RETURN_LSEG_P(x) return LsegPGetDatum(x) #define DatumGetPathP(X) ((PATH *) PG_DETOAST_DATUM(X)) #define DatumGetPathPCopy(X) ((PATH *) PG_DETOAST_DATUM_COPY(X)) #define PathPGetDatum(X) PointerGetDatum(X) #define PG_GETARG_PATH_P(n) DatumGetPathP(PG_GETARG_DATUM(n)) #define PG_GETARG_PATH_P_COPY(n) DatumGetPathPCopy(PG_GETARG_DATUM(n)) #define PG_RETURN_PATH_P(x) return PathPGetDatum(x) #define DatumGetLineP(X) ((LINE *) DatumGetPointer(X)) #define LinePGetDatum(X) PointerGetDatum(X) #define PG_GETARG_LINE_P(n) DatumGetLineP(PG_GETARG_DATUM(n)) #define PG_RETURN_LINE_P(x) return LinePGetDatum(x) #define DatumGetBoxP(X) ((BOX *) DatumGetPointer(X)) #define BoxPGetDatum(X) PointerGetDatum(X) #define PG_GETARG_BOX_P(n) DatumGetBoxP(PG_GETARG_DATUM(n)) #define PG_RETURN_BOX_P(x) return BoxPGetDatum(x) #define DatumGetPolygonP(X) ((POLYGON *) PG_DETOAST_DATUM(X)) #define DatumGetPolygonPCopy(X) ((POLYGON *) PG_DETOAST_DATUM_COPY(X)) #define PolygonPGetDatum(X) PointerGetDatum(X) #define PG_GETARG_POLYGON_P(n) DatumGetPolygonP(PG_GETARG_DATUM(n)) #define PG_GETARG_POLYGON_P_COPY(n) DatumGetPolygonPCopy(PG_GETARG_DATUM(n)) #define PG_RETURN_POLYGON_P(x) return PolygonPGetDatum(x) #define DatumGetCircleP(X) ((CIRCLE *) DatumGetPointer(X)) #define CirclePGetDatum(X) PointerGetDatum(X) #define PG_GETARG_CIRCLE_P(n) DatumGetCircleP(PG_GETARG_DATUM(n)) #define PG_RETURN_CIRCLE_P(x) return CirclePGetDatum(x) /* * in geo_ops.h */ /* public point routines */ extern Datum point_in(PG_FUNCTION_ARGS); extern Datum point_out(PG_FUNCTION_ARGS); extern Datum point_recv(PG_FUNCTION_ARGS); extern Datum point_send(PG_FUNCTION_ARGS); extern Datum construct_point(PG_FUNCTION_ARGS); extern Datum point_left(PG_FUNCTION_ARGS); extern Datum point_right(PG_FUNCTION_ARGS); extern Datum point_above(PG_FUNCTION_ARGS); extern Datum point_below(PG_FUNCTION_ARGS); extern Datum point_vert(PG_FUNCTION_ARGS); extern Datum point_horiz(PG_FUNCTION_ARGS); extern Datum point_eq(PG_FUNCTION_ARGS); extern Datum point_ne(PG_FUNCTION_ARGS); extern Datum point_distance(PG_FUNCTION_ARGS); extern Datum point_slope(PG_FUNCTION_ARGS); extern Datum point_add(PG_FUNCTION_ARGS); extern Datum point_sub(PG_FUNCTION_ARGS); extern Datum point_mul(PG_FUNCTION_ARGS); extern Datum point_div(PG_FUNCTION_ARGS); /* private routines */ extern double point_dt(Point *pt1, Point *pt2); extern double point_sl(Point *pt1, Point *pt2); extern double pg_hypot(double x, double y); /* public lseg routines */ extern Datum lseg_in(PG_FUNCTION_ARGS); extern Datum lseg_out(PG_FUNCTION_ARGS); extern Datum lseg_recv(PG_FUNCTION_ARGS); extern Datum lseg_send(PG_FUNCTION_ARGS); extern Datum lseg_intersect(PG_FUNCTION_ARGS); extern Datum lseg_parallel(PG_FUNCTION_ARGS); extern Datum lseg_perp(PG_FUNCTION_ARGS); extern Datum lseg_vertical(PG_FUNCTION_ARGS); extern Datum lseg_horizontal(PG_FUNCTION_ARGS); extern Datum lseg_eq(PG_FUNCTION_ARGS); extern Datum lseg_ne(PG_FUNCTION_ARGS); extern Datum lseg_lt(PG_FUNCTION_ARGS); extern Datum lseg_le(PG_FUNCTION_ARGS); extern Datum lseg_gt(PG_FUNCTION_ARGS); extern Datum lseg_ge(PG_FUNCTION_ARGS); extern Datum lseg_construct(PG_FUNCTION_ARGS); extern Datum lseg_length(PG_FUNCTION_ARGS); extern Datum lseg_distance(PG_FUNCTION_ARGS); extern Datum lseg_center(PG_FUNCTION_ARGS); extern Datum lseg_interpt(PG_FUNCTION_ARGS); extern Datum dist_pl(PG_FUNCTION_ARGS); extern Datum dist_ps(PG_FUNCTION_ARGS); extern Datum dist_ppath(PG_FUNCTION_ARGS); extern Datum dist_pb(PG_FUNCTION_ARGS); extern Datum dist_sl(PG_FUNCTION_ARGS); extern Datum dist_sb(PG_FUNCTION_ARGS); extern Datum dist_lb(PG_FUNCTION_ARGS); extern Datum close_lseg(PG_FUNCTION_ARGS); extern Datum close_pl(PG_FUNCTION_ARGS); extern Datum close_ps(PG_FUNCTION_ARGS); extern Datum close_pb(PG_FUNCTION_ARGS); extern Datum close_sl(PG_FUNCTION_ARGS); extern Datum close_sb(PG_FUNCTION_ARGS); extern Datum close_ls(PG_FUNCTION_ARGS); extern Datum close_lb(PG_FUNCTION_ARGS); extern Datum on_pl(PG_FUNCTION_ARGS); extern Datum on_ps(PG_FUNCTION_ARGS); extern Datum on_pb(PG_FUNCTION_ARGS); extern Datum on_ppath(PG_FUNCTION_ARGS); extern Datum on_sl(PG_FUNCTION_ARGS); extern Datum on_sb(PG_FUNCTION_ARGS); extern Datum inter_sl(PG_FUNCTION_ARGS); extern Datum inter_sb(PG_FUNCTION_ARGS); extern Datum inter_lb(PG_FUNCTION_ARGS); /* public line routines */ extern Datum line_in(PG_FUNCTION_ARGS); extern Datum line_out(PG_FUNCTION_ARGS); extern Datum line_recv(PG_FUNCTION_ARGS); extern Datum line_send(PG_FUNCTION_ARGS); extern Datum line_interpt(PG_FUNCTION_ARGS); extern Datum line_distance(PG_FUNCTION_ARGS); extern Datum line_construct_pp(PG_FUNCTION_ARGS); extern Datum line_intersect(PG_FUNCTION_ARGS); extern Datum line_parallel(PG_FUNCTION_ARGS); extern Datum line_perp(PG_FUNCTION_ARGS); extern Datum line_vertical(PG_FUNCTION_ARGS); extern Datum line_horizontal(PG_FUNCTION_ARGS); extern Datum line_eq(PG_FUNCTION_ARGS); /* public box routines */ extern Datum box_in(PG_FUNCTION_ARGS); extern Datum box_out(PG_FUNCTION_ARGS); extern Datum box_recv(PG_FUNCTION_ARGS); extern Datum box_send(PG_FUNCTION_ARGS); extern Datum box_same(PG_FUNCTION_ARGS); extern Datum box_overlap(PG_FUNCTION_ARGS); extern Datum box_left(PG_FUNCTION_ARGS); extern Datum box_overleft(PG_FUNCTION_ARGS); extern Datum box_right(PG_FUNCTION_ARGS); extern Datum box_overright(PG_FUNCTION_ARGS); extern Datum box_below(PG_FUNCTION_ARGS); extern Datum box_overbelow(PG_FUNCTION_ARGS); extern Datum box_above(PG_FUNCTION_ARGS); extern Datum box_overabove(PG_FUNCTION_ARGS); extern Datum box_contained(PG_FUNCTION_ARGS); extern Datum box_contain(PG_FUNCTION_ARGS); extern Datum box_contain_pt(PG_FUNCTION_ARGS); extern Datum box_below_eq(PG_FUNCTION_ARGS); extern Datum box_above_eq(PG_FUNCTION_ARGS); extern Datum box_lt(PG_FUNCTION_ARGS); extern Datum box_gt(PG_FUNCTION_ARGS); extern Datum box_eq(PG_FUNCTION_ARGS); extern Datum box_le(PG_FUNCTION_ARGS); extern Datum box_ge(PG_FUNCTION_ARGS); extern Datum box_area(PG_FUNCTION_ARGS); extern Datum box_width(PG_FUNCTION_ARGS); extern Datum box_height(PG_FUNCTION_ARGS); extern Datum box_distance(PG_FUNCTION_ARGS); extern Datum box_center(PG_FUNCTION_ARGS); extern Datum box_intersect(PG_FUNCTION_ARGS); extern Datum box_diagonal(PG_FUNCTION_ARGS); extern Datum points_box(PG_FUNCTION_ARGS); extern Datum box_add(PG_FUNCTION_ARGS); extern Datum box_sub(PG_FUNCTION_ARGS); extern Datum box_mul(PG_FUNCTION_ARGS); extern Datum box_div(PG_FUNCTION_ARGS); /* public path routines */ extern Datum path_area(PG_FUNCTION_ARGS); extern Datum path_in(PG_FUNCTION_ARGS); extern Datum path_out(PG_FUNCTION_ARGS); extern Datum path_recv(PG_FUNCTION_ARGS); extern Datum path_send(PG_FUNCTION_ARGS); extern Datum path_n_lt(PG_FUNCTION_ARGS); extern Datum path_n_gt(PG_FUNCTION_ARGS); extern Datum path_n_eq(PG_FUNCTION_ARGS); extern Datum path_n_le(PG_FUNCTION_ARGS); extern Datum path_n_ge(PG_FUNCTION_ARGS); extern Datum path_inter(PG_FUNCTION_ARGS); extern Datum path_distance(PG_FUNCTION_ARGS); extern Datum path_length(PG_FUNCTION_ARGS); extern Datum path_isclosed(PG_FUNCTION_ARGS); extern Datum path_isopen(PG_FUNCTION_ARGS); extern Datum path_npoints(PG_FUNCTION_ARGS); extern Datum path_close(PG_FUNCTION_ARGS); extern Datum path_open(PG_FUNCTION_ARGS); extern Datum path_add(PG_FUNCTION_ARGS); extern Datum path_add_pt(PG_FUNCTION_ARGS); extern Datum path_sub_pt(PG_FUNCTION_ARGS); extern Datum path_mul_pt(PG_FUNCTION_ARGS); extern Datum path_div_pt(PG_FUNCTION_ARGS); extern Datum path_center(PG_FUNCTION_ARGS); extern Datum path_poly(PG_FUNCTION_ARGS); /* public polygon routines */ extern Datum poly_in(PG_FUNCTION_ARGS); extern Datum poly_out(PG_FUNCTION_ARGS); extern Datum poly_recv(PG_FUNCTION_ARGS); extern Datum poly_send(PG_FUNCTION_ARGS); extern Datum poly_left(PG_FUNCTION_ARGS); extern Datum poly_overleft(PG_FUNCTION_ARGS); extern Datum poly_right(PG_FUNCTION_ARGS); extern Datum poly_overright(PG_FUNCTION_ARGS); extern Datum poly_below(PG_FUNCTION_ARGS); extern Datum poly_overbelow(PG_FUNCTION_ARGS); extern Datum poly_above(PG_FUNCTION_ARGS); extern Datum poly_overabove(PG_FUNCTION_ARGS); extern Datum poly_same(PG_FUNCTION_ARGS); extern Datum poly_overlap(PG_FUNCTION_ARGS); extern Datum poly_contain(PG_FUNCTION_ARGS); extern Datum poly_contained(PG_FUNCTION_ARGS); extern Datum poly_contain_pt(PG_FUNCTION_ARGS); extern Datum pt_contained_poly(PG_FUNCTION_ARGS); extern Datum poly_distance(PG_FUNCTION_ARGS); extern Datum poly_npoints(PG_FUNCTION_ARGS); extern Datum poly_center(PG_FUNCTION_ARGS); extern Datum poly_box(PG_FUNCTION_ARGS); extern Datum poly_path(PG_FUNCTION_ARGS); extern Datum box_poly(PG_FUNCTION_ARGS); /* public circle routines */ extern Datum circle_in(PG_FUNCTION_ARGS); extern Datum circle_out(PG_FUNCTION_ARGS); extern Datum circle_recv(PG_FUNCTION_ARGS); extern Datum circle_send(PG_FUNCTION_ARGS); extern Datum circle_same(PG_FUNCTION_ARGS); extern Datum circle_overlap(PG_FUNCTION_ARGS); extern Datum circle_overleft(PG_FUNCTION_ARGS); extern Datum circle_left(PG_FUNCTION_ARGS); extern Datum circle_right(PG_FUNCTION_ARGS); extern Datum circle_overright(PG_FUNCTION_ARGS); extern Datum circle_contained(PG_FUNCTION_ARGS); extern Datum circle_contain(PG_FUNCTION_ARGS); extern Datum circle_below(PG_FUNCTION_ARGS); extern Datum circle_above(PG_FUNCTION_ARGS); extern Datum circle_overbelow(PG_FUNCTION_ARGS); extern Datum circle_overabove(PG_FUNCTION_ARGS); extern Datum circle_eq(PG_FUNCTION_ARGS); extern Datum circle_ne(PG_FUNCTION_ARGS); extern Datum circle_lt(PG_FUNCTION_ARGS); extern Datum circle_gt(PG_FUNCTION_ARGS); extern Datum circle_le(PG_FUNCTION_ARGS); extern Datum circle_ge(PG_FUNCTION_ARGS); extern Datum circle_contain_pt(PG_FUNCTION_ARGS); extern Datum pt_contained_circle(PG_FUNCTION_ARGS); extern Datum circle_add_pt(PG_FUNCTION_ARGS); extern Datum circle_sub_pt(PG_FUNCTION_ARGS); extern Datum circle_mul_pt(PG_FUNCTION_ARGS); extern Datum circle_div_pt(PG_FUNCTION_ARGS); extern Datum circle_diameter(PG_FUNCTION_ARGS); extern Datum circle_radius(PG_FUNCTION_ARGS); extern Datum circle_distance(PG_FUNCTION_ARGS); extern Datum dist_pc(PG_FUNCTION_ARGS); extern Datum dist_cpoly(PG_FUNCTION_ARGS); extern Datum circle_center(PG_FUNCTION_ARGS); extern Datum cr_circle(PG_FUNCTION_ARGS); extern Datum box_circle(PG_FUNCTION_ARGS); extern Datum circle_box(PG_FUNCTION_ARGS); extern Datum poly_circle(PG_FUNCTION_ARGS); extern Datum circle_poly(PG_FUNCTION_ARGS); extern Datum circle_area(PG_FUNCTION_ARGS); /* support routines for the GiST access method (access/gist/gistproc.c) */ extern Datum gist_box_compress(PG_FUNCTION_ARGS); extern Datum gist_box_decompress(PG_FUNCTION_ARGS); extern Datum gist_box_union(PG_FUNCTION_ARGS); extern Datum gist_box_picksplit(PG_FUNCTION_ARGS); extern Datum gist_box_consistent(PG_FUNCTION_ARGS); extern Datum gist_box_penalty(PG_FUNCTION_ARGS); extern Datum gist_box_same(PG_FUNCTION_ARGS); extern Datum gist_poly_compress(PG_FUNCTION_ARGS); extern Datum gist_poly_consistent(PG_FUNCTION_ARGS); extern Datum gist_circle_compress(PG_FUNCTION_ARGS); extern Datum gist_circle_consistent(PG_FUNCTION_ARGS); extern Datum gist_point_compress(PG_FUNCTION_ARGS); extern Datum gist_point_consistent(PG_FUNCTION_ARGS); extern Datum gist_point_distance(PG_FUNCTION_ARGS); /* geo_selfuncs.c */ extern Datum areasel(PG_FUNCTION_ARGS); extern Datum areajoinsel(PG_FUNCTION_ARGS); extern Datum positionsel(PG_FUNCTION_ARGS); extern Datum positionjoinsel(PG_FUNCTION_ARGS); extern Datum contsel(PG_FUNCTION_ARGS); extern Datum contjoinsel(PG_FUNCTION_ARGS); #endif /* GEO_DECLS_H */ PKBiZ6server/utils/palloc.hnu[/*------------------------------------------------------------------------- * * palloc.h * POSTGRES memory allocator definitions. * * This file contains the basic memory allocation interface that is * needed by almost every backend module. It is included directly by * postgres.h, so the definitions here are automatically available * everywhere. Keep it lean! * * Memory allocation occurs within "contexts". Every chunk obtained from * palloc()/MemoryContextAlloc() is allocated within a specific context. * The entire contents of a context can be freed easily and quickly by * resetting or deleting the context --- this is both faster and less * prone to memory-leakage bugs than releasing chunks individually. * We organize contexts into context trees to allow fine-grain control * over chunk lifetime while preserving the certainty that we will free * everything that should be freed. See utils/mmgr/README for more info. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/palloc.h * *------------------------------------------------------------------------- */ #ifndef PALLOC_H #define PALLOC_H /* * Type MemoryContextData is declared in nodes/memnodes.h. Most users * of memory allocation should just treat it as an abstract type, so we * do not provide the struct contents here. */ typedef struct MemoryContextData *MemoryContext; /* * CurrentMemoryContext is the default allocation context for palloc(). * We declare it here so that palloc() can be a macro. Avoid accessing it * directly! Instead, use MemoryContextSwitchTo() to change the setting. */ extern PGDLLIMPORT MemoryContext CurrentMemoryContext; /* * Fundamental memory-allocation operations (more are in utils/memutils.h) */ extern void *MemoryContextAlloc(MemoryContext context, Size size); extern void *MemoryContextAllocZero(MemoryContext context, Size size); extern void *MemoryContextAllocZeroAligned(MemoryContext context, Size size); #define palloc(sz) MemoryContextAlloc(CurrentMemoryContext, (sz)) #define palloc0(sz) MemoryContextAllocZero(CurrentMemoryContext, (sz)) /* * The result of palloc() is always word-aligned, so we can skip testing * alignment of the pointer when deciding which MemSet variant to use. * Note that this variant does not offer any advantage, and should not be * used, unless its "sz" argument is a compile-time constant; therefore, the * issue that it evaluates the argument multiple times isn't a problem in * practice. */ #define palloc0fast(sz) \ ( MemSetTest(0, sz) ? \ MemoryContextAllocZeroAligned(CurrentMemoryContext, sz) : \ MemoryContextAllocZero(CurrentMemoryContext, sz) ) extern void pfree(void *pointer); extern void *repalloc(void *pointer, Size size); /* * MemoryContextSwitchTo can't be a macro in standard C compilers. * But we can make it an inline function if the compiler supports it. * * This file has to be includable by some non-backend code such as * pg_resetxlog, so don't expose the CurrentMemoryContext reference * if FRONTEND is defined. */ #if defined(USE_INLINE) && !defined(FRONTEND) static inline MemoryContext MemoryContextSwitchTo(MemoryContext context) { MemoryContext old = CurrentMemoryContext; CurrentMemoryContext = context; return old; } #else extern MemoryContext MemoryContextSwitchTo(MemoryContext context); #endif /* USE_INLINE && !FRONTEND */ /* * These are like standard strdup() except the copied string is * allocated in a context, not with malloc(). */ extern char *MemoryContextStrdup(MemoryContext context, const char *string); #define pstrdup(str) MemoryContextStrdup(CurrentMemoryContext, (str)) extern char *pnstrdup(const char *in, Size len); #if defined(WIN32) || defined(__CYGWIN__) extern void *pgport_palloc(Size sz); extern char *pgport_pstrdup(const char *str); extern void pgport_pfree(void *pointer); #endif #endif /* PALLOC_H */ PKBiZqserver/utils/fmgrtab.hnu[/*------------------------------------------------------------------------- * * fmgrtab.h * The function manager's table of internal functions. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/fmgrtab.h * *------------------------------------------------------------------------- */ #ifndef FMGRTAB_H #define FMGRTAB_H #include "fmgr.h" /* * This table stores info about all the built-in functions (ie, functions * that are compiled into the Postgres executable). The table entries are * required to appear in Oid order, so that binary search can be used. */ typedef struct { Oid foid; /* OID of the function */ const char *funcName; /* C name of the function */ short nargs; /* 0..FUNC_MAX_ARGS, or -1 if variable count */ bool strict; /* T if function is "strict" */ bool retset; /* T if function returns a set */ PGFunction func; /* pointer to compiled function */ } FmgrBuiltin; extern const FmgrBuiltin fmgr_builtins[]; extern const int fmgr_nbuiltins; /* number of entries in table */ #endif /* FMGRTAB_H */ PKBiZOOserver/utils/pg_rusage.hnu[/*------------------------------------------------------------------------- * * pg_rusage.h * header file for resource usage measurement support routines * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/pg_rusage.h * *------------------------------------------------------------------------- */ #ifndef PG_RUSAGE_H #define PG_RUSAGE_H #include #ifdef HAVE_SYS_RESOURCE_H #include #else #include "rusagestub.h" #endif /* State structure for pg_rusage_init/pg_rusage_show */ typedef struct PGRUsage { struct timeval tv; struct rusage ru; } PGRUsage; extern void pg_rusage_init(PGRUsage *ru0); extern const char *pg_rusage_show(const PGRUsage *ru0); #endif /* PG_RUSAGE_H */ PKBiZ d server/utils/pg_lzcompress.hnu[/* ---------- * pg_lzcompress.h - * * Definitions for the builtin LZ compressor * * src/include/utils/pg_lzcompress.h * ---------- */ #ifndef _PG_LZCOMPRESS_H_ #define _PG_LZCOMPRESS_H_ /* ---------- * PGLZ_Header - * * The information at the start of the compressed data. * ---------- */ typedef struct PGLZ_Header { int32 vl_len_; /* varlena header (do not touch directly!) */ int32 rawsize; } PGLZ_Header; /* ---------- * PGLZ_MAX_OUTPUT - * * Macro to compute the buffer size required by pglz_compress(). * We allow 4 bytes for overrun before detecting compression failure. * ---------- */ #define PGLZ_MAX_OUTPUT(_dlen) ((_dlen) + 4 + sizeof(PGLZ_Header)) /* ---------- * PGLZ_RAW_SIZE - * * Macro to determine the uncompressed data size contained * in the entry. * ---------- */ #define PGLZ_RAW_SIZE(_lzdata) ((_lzdata)->rawsize) /* ---------- * PGLZ_Strategy - * * Some values that control the compression algorithm. * * min_input_size Minimum input data size to consider compression. * * max_input_size Maximum input data size to consider compression. * * min_comp_rate Minimum compression rate (0-99%) to require. * Regardless of min_comp_rate, the output must be * smaller than the input, else we don't store * compressed. * * first_success_by Abandon compression if we find no compressible * data within the first this-many bytes. * * match_size_good The initial GOOD match size when starting history * lookup. When looking up the history to find a * match that could be expressed as a tag, the * algorithm does not always walk back entirely. * A good match fast is usually better than the * best possible one very late. For each iteration * in the lookup, this value is lowered so the * longer the lookup takes, the smaller matches * are considered good. * * match_size_drop The percentage by which match_size_good is lowered * after each history check. Allowed values are * 0 (no change until end) to 100 (only check * latest history entry at all). * ---------- */ typedef struct PGLZ_Strategy { int32 min_input_size; int32 max_input_size; int32 min_comp_rate; int32 first_success_by; int32 match_size_good; int32 match_size_drop; } PGLZ_Strategy; /* ---------- * The standard strategies * * PGLZ_strategy_default Recommended default strategy for TOAST. * * PGLZ_strategy_always Try to compress inputs of any length. * Fallback to uncompressed storage only if * output would be larger than input. * ---------- */ extern const PGLZ_Strategy *const PGLZ_strategy_default; extern const PGLZ_Strategy *const PGLZ_strategy_always; /* ---------- * Global function declarations * ---------- */ extern bool pglz_compress(const char *source, int32 slen, PGLZ_Header *dest, const PGLZ_Strategy *strategy); extern void pglz_decompress(const PGLZ_Header *source, char *dest); #endif /* _PG_LZCOMPRESS_H_ */ PKBiZ@qserver/utils/combocid.hnu[/*------------------------------------------------------------------------- * * combocid.h * Combo command ID support routines * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/combocid.h * *------------------------------------------------------------------------- */ #ifndef COMBOCID_H #define COMBOCID_H /* * HeapTupleHeaderGetCmin and HeapTupleHeaderGetCmax function prototypes * are in access/htup.h, because that's where the macro definitions that * those functions replaced used to be. */ extern void AtEOXact_ComboCid(void); #endif /* COMBOCID_H */ PKBiZQC,3,3server/utils/acl.hnu[/*------------------------------------------------------------------------- * * acl.h * Definition of (and support for) access control list data structures. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/acl.h * * NOTES * An ACL array is simply an array of AclItems, representing the union * of the privileges represented by the individual items. A zero-length * array represents "no privileges". There are no assumptions about the * ordering of the items, but we do expect that there are no two entries * in the array with the same grantor and grantee. * * For backward-compatibility purposes we have to allow null ACL entries * in system catalogs. A null ACL will be treated as meaning "default * protection" (i.e., whatever acldefault() returns). *------------------------------------------------------------------------- */ #ifndef ACL_H #define ACL_H #include "nodes/parsenodes.h" #include "utils/array.h" #include "utils/snapshot.h" /* * typedef AclMode is declared in parsenodes.h, also the individual privilege * bit meanings are defined there */ #define ACL_ID_PUBLIC 0 /* placeholder for id in a PUBLIC acl item */ /* * AclItem * * Note: must be same size on all platforms, because the size is hardcoded * in the pg_type.h entry for aclitem. */ typedef struct AclItem { Oid ai_grantee; /* ID that this item grants privs to */ Oid ai_grantor; /* grantor of privs */ AclMode ai_privs; /* privilege bits */ } AclItem; /* * The upper 16 bits of the ai_privs field of an AclItem are the grant option * bits, and the lower 16 bits are the actual privileges. We use "rights" * to mean the combined grant option and privilege bits fields. */ #define ACLITEM_GET_PRIVS(item) ((item).ai_privs & 0xFFFF) #define ACLITEM_GET_GOPTIONS(item) (((item).ai_privs >> 16) & 0xFFFF) #define ACLITEM_GET_RIGHTS(item) ((item).ai_privs) #define ACL_GRANT_OPTION_FOR(privs) (((AclMode) (privs) & 0xFFFF) << 16) #define ACL_OPTION_TO_PRIVS(privs) (((AclMode) (privs) >> 16) & 0xFFFF) #define ACLITEM_SET_PRIVS(item,privs) \ ((item).ai_privs = ((item).ai_privs & ~((AclMode) 0xFFFF)) | \ ((AclMode) (privs) & 0xFFFF)) #define ACLITEM_SET_GOPTIONS(item,goptions) \ ((item).ai_privs = ((item).ai_privs & ~(((AclMode) 0xFFFF) << 16)) | \ (((AclMode) (goptions) & 0xFFFF) << 16)) #define ACLITEM_SET_RIGHTS(item,rights) \ ((item).ai_privs = (AclMode) (rights)) #define ACLITEM_SET_PRIVS_GOPTIONS(item,privs,goptions) \ ((item).ai_privs = ((AclMode) (privs) & 0xFFFF) | \ (((AclMode) (goptions) & 0xFFFF) << 16)) #define ACLITEM_ALL_PRIV_BITS ((AclMode) 0xFFFF) #define ACLITEM_ALL_GOPTION_BITS ((AclMode) 0xFFFF << 16) /* * Definitions for convenient access to Acl (array of AclItem). * These are standard PostgreSQL arrays, but are restricted to have one * dimension and no nulls. We also ignore the lower bound when reading, * and set it to one when writing. * * CAUTION: as of PostgreSQL 7.1, these arrays are toastable (just like all * other array types). Therefore, be careful to detoast them with the * macros provided, unless you know for certain that a particular array * can't have been toasted. */ /* * Acl a one-dimensional array of AclItem */ typedef ArrayType Acl; #define ACL_NUM(ACL) (ARR_DIMS(ACL)[0]) #define ACL_DAT(ACL) ((AclItem *) ARR_DATA_PTR(ACL)) #define ACL_N_SIZE(N) (ARR_OVERHEAD_NONULLS(1) + ((N) * sizeof(AclItem))) #define ACL_SIZE(ACL) ARR_SIZE(ACL) /* * fmgr macros for these types */ #define DatumGetAclItemP(X) ((AclItem *) DatumGetPointer(X)) #define PG_GETARG_ACLITEM_P(n) DatumGetAclItemP(PG_GETARG_DATUM(n)) #define PG_RETURN_ACLITEM_P(x) PG_RETURN_POINTER(x) #define DatumGetAclP(X) ((Acl *) PG_DETOAST_DATUM(X)) #define DatumGetAclPCopy(X) ((Acl *) PG_DETOAST_DATUM_COPY(X)) #define PG_GETARG_ACL_P(n) DatumGetAclP(PG_GETARG_DATUM(n)) #define PG_GETARG_ACL_P_COPY(n) DatumGetAclPCopy(PG_GETARG_DATUM(n)) #define PG_RETURN_ACL_P(x) PG_RETURN_POINTER(x) /* * ACL modification opcodes for aclupdate */ #define ACL_MODECHG_ADD 1 #define ACL_MODECHG_DEL 2 #define ACL_MODECHG_EQL 3 /* * External representations of the privilege bits --- aclitemin/aclitemout * represent each possible privilege bit with a distinct 1-character code */ #define ACL_INSERT_CHR 'a' /* formerly known as "append" */ #define ACL_SELECT_CHR 'r' /* formerly known as "read" */ #define ACL_UPDATE_CHR 'w' /* formerly known as "write" */ #define ACL_DELETE_CHR 'd' #define ACL_TRUNCATE_CHR 'D' /* super-delete, as it were */ #define ACL_REFERENCES_CHR 'x' #define ACL_TRIGGER_CHR 't' #define ACL_EXECUTE_CHR 'X' #define ACL_USAGE_CHR 'U' #define ACL_CREATE_CHR 'C' #define ACL_CREATE_TEMP_CHR 'T' #define ACL_CONNECT_CHR 'c' /* string holding all privilege code chars, in order by bitmask position */ #define ACL_ALL_RIGHTS_STR "arwdDxtXUCTc" /* * Bitmasks defining "all rights" for each supported object type */ #define ACL_ALL_RIGHTS_COLUMN (ACL_INSERT|ACL_SELECT|ACL_UPDATE|ACL_REFERENCES) #define ACL_ALL_RIGHTS_RELATION (ACL_INSERT|ACL_SELECT|ACL_UPDATE|ACL_DELETE|ACL_TRUNCATE|ACL_REFERENCES|ACL_TRIGGER) #define ACL_ALL_RIGHTS_SEQUENCE (ACL_USAGE|ACL_SELECT|ACL_UPDATE) #define ACL_ALL_RIGHTS_DATABASE (ACL_CREATE|ACL_CREATE_TEMP|ACL_CONNECT) #define ACL_ALL_RIGHTS_FDW (ACL_USAGE) #define ACL_ALL_RIGHTS_FOREIGN_SERVER (ACL_USAGE) #define ACL_ALL_RIGHTS_FUNCTION (ACL_EXECUTE) #define ACL_ALL_RIGHTS_LANGUAGE (ACL_USAGE) #define ACL_ALL_RIGHTS_LARGEOBJECT (ACL_SELECT|ACL_UPDATE) #define ACL_ALL_RIGHTS_NAMESPACE (ACL_USAGE|ACL_CREATE) #define ACL_ALL_RIGHTS_TABLESPACE (ACL_CREATE) #define ACL_ALL_RIGHTS_TYPE (ACL_USAGE) /* operation codes for pg_*_aclmask */ typedef enum { ACLMASK_ALL, /* normal case: compute all bits */ ACLMASK_ANY /* return when result is known nonzero */ } AclMaskHow; /* result codes for pg_*_aclcheck */ typedef enum { ACLCHECK_OK = 0, ACLCHECK_NO_PRIV, ACLCHECK_NOT_OWNER } AclResult; /* this enum covers all object types that can have privilege errors */ /* currently it's only used to tell aclcheck_error what to say */ typedef enum AclObjectKind { ACL_KIND_COLUMN, /* pg_attribute */ ACL_KIND_CLASS, /* pg_class */ ACL_KIND_SEQUENCE, /* pg_sequence */ ACL_KIND_DATABASE, /* pg_database */ ACL_KIND_PROC, /* pg_proc */ ACL_KIND_OPER, /* pg_operator */ ACL_KIND_TYPE, /* pg_type */ ACL_KIND_LANGUAGE, /* pg_language */ ACL_KIND_LARGEOBJECT, /* pg_largeobject */ ACL_KIND_NAMESPACE, /* pg_namespace */ ACL_KIND_OPCLASS, /* pg_opclass */ ACL_KIND_OPFAMILY, /* pg_opfamily */ ACL_KIND_COLLATION, /* pg_collation */ ACL_KIND_CONVERSION, /* pg_conversion */ ACL_KIND_TABLESPACE, /* pg_tablespace */ ACL_KIND_TSDICTIONARY, /* pg_ts_dict */ ACL_KIND_TSCONFIGURATION, /* pg_ts_config */ ACL_KIND_FDW, /* pg_foreign_data_wrapper */ ACL_KIND_FOREIGN_SERVER, /* pg_foreign_server */ ACL_KIND_EXTENSION, /* pg_extension */ MAX_ACL_KIND /* MUST BE LAST */ } AclObjectKind; /* * routines used internally */ extern Acl *acldefault(GrantObjectType objtype, Oid ownerId); extern Acl *get_user_default_acl(GrantObjectType objtype, Oid ownerId, Oid nsp_oid); extern Acl *aclupdate(const Acl *old_acl, const AclItem *mod_aip, int modechg, Oid ownerId, DropBehavior behavior); extern Acl *aclnewowner(const Acl *old_acl, Oid oldOwnerId, Oid newOwnerId); extern Acl *make_empty_acl(void); extern Acl *aclcopy(const Acl *orig_acl); extern Acl *aclconcat(const Acl *left_acl, const Acl *right_acl); extern Acl *aclmerge(const Acl *left_acl, const Acl *right_acl, Oid ownerId); extern void aclitemsort(Acl *acl); extern bool aclequal(const Acl *left_acl, const Acl *right_acl); extern AclMode aclmask(const Acl *acl, Oid roleid, Oid ownerId, AclMode mask, AclMaskHow how); extern int aclmembers(const Acl *acl, Oid **roleids); extern bool has_privs_of_role(Oid member, Oid role); extern bool is_member_of_role(Oid member, Oid role); extern bool is_member_of_role_nosuper(Oid member, Oid role); extern bool is_admin_of_role(Oid member, Oid role); extern void check_is_member_of_role(Oid member, Oid role); extern Oid get_role_oid(const char *rolname, bool missing_ok); extern void select_best_grantor(Oid roleId, AclMode privileges, const Acl *acl, Oid ownerId, Oid *grantorId, AclMode *grantOptions); extern void initialize_acl(void); /* * SQL functions (from acl.c) */ extern Datum aclitemin(PG_FUNCTION_ARGS); extern Datum aclitemout(PG_FUNCTION_ARGS); extern Datum aclinsert(PG_FUNCTION_ARGS); extern Datum aclremove(PG_FUNCTION_ARGS); extern Datum aclcontains(PG_FUNCTION_ARGS); extern Datum makeaclitem(PG_FUNCTION_ARGS); extern Datum aclitem_eq(PG_FUNCTION_ARGS); extern Datum hash_aclitem(PG_FUNCTION_ARGS); extern Datum acldefault_sql(PG_FUNCTION_ARGS); extern Datum aclexplode(PG_FUNCTION_ARGS); /* * prototypes for functions in aclchk.c */ extern void ExecuteGrantStmt(GrantStmt *stmt); extern void ExecAlterDefaultPrivilegesStmt(AlterDefaultPrivilegesStmt *stmt); extern void RemoveRoleFromObjectACL(Oid roleid, Oid classid, Oid objid); extern void RemoveDefaultACLById(Oid defaclOid); extern AclMode pg_attribute_aclmask(Oid table_oid, AttrNumber attnum, Oid roleid, AclMode mask, AclMaskHow how); extern AclMode pg_class_aclmask(Oid table_oid, Oid roleid, AclMode mask, AclMaskHow how); extern AclMode pg_database_aclmask(Oid db_oid, Oid roleid, AclMode mask, AclMaskHow how); extern AclMode pg_proc_aclmask(Oid proc_oid, Oid roleid, AclMode mask, AclMaskHow how); extern AclMode pg_language_aclmask(Oid lang_oid, Oid roleid, AclMode mask, AclMaskHow how); extern AclMode pg_largeobject_aclmask_snapshot(Oid lobj_oid, Oid roleid, AclMode mask, AclMaskHow how, Snapshot snapshot); extern AclMode pg_namespace_aclmask(Oid nsp_oid, Oid roleid, AclMode mask, AclMaskHow how); extern AclMode pg_tablespace_aclmask(Oid spc_oid, Oid roleid, AclMode mask, AclMaskHow how); extern AclMode pg_foreign_data_wrapper_aclmask(Oid fdw_oid, Oid roleid, AclMode mask, AclMaskHow how); extern AclMode pg_foreign_server_aclmask(Oid srv_oid, Oid roleid, AclMode mask, AclMaskHow how); extern AclMode pg_type_aclmask(Oid type_oid, Oid roleid, AclMode mask, AclMaskHow how); extern AclResult pg_attribute_aclcheck(Oid table_oid, AttrNumber attnum, Oid roleid, AclMode mode); extern AclResult pg_attribute_aclcheck_all(Oid table_oid, Oid roleid, AclMode mode, AclMaskHow how); extern AclResult pg_class_aclcheck(Oid table_oid, Oid roleid, AclMode mode); extern AclResult pg_database_aclcheck(Oid db_oid, Oid roleid, AclMode mode); extern AclResult pg_proc_aclcheck(Oid proc_oid, Oid roleid, AclMode mode); extern AclResult pg_language_aclcheck(Oid lang_oid, Oid roleid, AclMode mode); extern AclResult pg_largeobject_aclcheck_snapshot(Oid lang_oid, Oid roleid, AclMode mode, Snapshot snapshot); extern AclResult pg_namespace_aclcheck(Oid nsp_oid, Oid roleid, AclMode mode); extern AclResult pg_tablespace_aclcheck(Oid spc_oid, Oid roleid, AclMode mode); extern AclResult pg_foreign_data_wrapper_aclcheck(Oid fdw_oid, Oid roleid, AclMode mode); extern AclResult pg_foreign_server_aclcheck(Oid srv_oid, Oid roleid, AclMode mode); extern AclResult pg_type_aclcheck(Oid type_oid, Oid roleid, AclMode mode); extern void aclcheck_error(AclResult aclerr, AclObjectKind objectkind, const char *objectname); extern void aclcheck_error_col(AclResult aclerr, AclObjectKind objectkind, const char *objectname, const char *colname); extern void aclcheck_error_type(AclResult aclerr, Oid typeOid); /* ownercheck routines just return true (owner) or false (not) */ extern bool pg_class_ownercheck(Oid class_oid, Oid roleid); extern bool pg_type_ownercheck(Oid type_oid, Oid roleid); extern bool pg_oper_ownercheck(Oid oper_oid, Oid roleid); extern bool pg_proc_ownercheck(Oid proc_oid, Oid roleid); extern bool pg_language_ownercheck(Oid lan_oid, Oid roleid); extern bool pg_largeobject_ownercheck(Oid lobj_oid, Oid roleid); extern bool pg_namespace_ownercheck(Oid nsp_oid, Oid roleid); extern bool pg_tablespace_ownercheck(Oid spc_oid, Oid roleid); extern bool pg_opclass_ownercheck(Oid opc_oid, Oid roleid); extern bool pg_opfamily_ownercheck(Oid opf_oid, Oid roleid); extern bool pg_database_ownercheck(Oid db_oid, Oid roleid); extern bool pg_collation_ownercheck(Oid coll_oid, Oid roleid); extern bool pg_conversion_ownercheck(Oid conv_oid, Oid roleid); extern bool pg_ts_dict_ownercheck(Oid dict_oid, Oid roleid); extern bool pg_ts_config_ownercheck(Oid cfg_oid, Oid roleid); extern bool pg_foreign_data_wrapper_ownercheck(Oid srv_oid, Oid roleid); extern bool pg_foreign_server_ownercheck(Oid srv_oid, Oid roleid); extern bool pg_extension_ownercheck(Oid ext_oid, Oid roleid); extern bool has_createrole_privilege(Oid roleid); #endif /* ACL_H */ PKBiZ*9$$server/utils/portal.hnu[/*------------------------------------------------------------------------- * * portal.h * POSTGRES portal definitions. * * A portal is an abstraction which represents the execution state of * a running or runnable query. Portals support both SQL-level CURSORs * and protocol-level portals. * * Scrolling (nonsequential access) and suspension of execution are allowed * only for portals that contain a single SELECT-type query. We do not want * to let the client suspend an update-type query partway through! Because * the query rewriter does not allow arbitrary ON SELECT rewrite rules, * only queries that were originally update-type could produce multiple * plan trees; so the restriction to a single query is not a problem * in practice. * * For SQL cursors, we support three kinds of scroll behavior: * * (1) Neither NO SCROLL nor SCROLL was specified: to remain backward * compatible, we allow backward fetches here, unless it would * impose additional runtime overhead to do so. * * (2) NO SCROLL was specified: don't allow any backward fetches. * * (3) SCROLL was specified: allow all kinds of backward fetches, even * if we need to take a performance hit to do so. (The planner sticks * a Materialize node atop the query plan if needed.) * * Case #1 is converted to #2 or #3 by looking at the query itself and * determining if scrollability can be supported without additional * overhead. * * Protocol-level portals have no nonsequential-fetch API and so the * distinction doesn't matter for them. They are always initialized * to look like NO SCROLL cursors. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/portal.h * *------------------------------------------------------------------------- */ #ifndef PORTAL_H #define PORTAL_H #include "datatype/timestamp.h" #include "executor/execdesc.h" #include "utils/resowner.h" /* * We have several execution strategies for Portals, depending on what * query or queries are to be executed. (Note: in all cases, a Portal * executes just a single source-SQL query, and thus produces just a * single result from the user's viewpoint. However, the rule rewriter * may expand the single source query to zero or many actual queries.) * * PORTAL_ONE_SELECT: the portal contains one single SELECT query. We run * the Executor incrementally as results are demanded. This strategy also * supports holdable cursors (the Executor results can be dumped into a * tuplestore for access after transaction completion). * * PORTAL_ONE_RETURNING: the portal contains a single INSERT/UPDATE/DELETE * query with a RETURNING clause (plus possibly auxiliary queries added by * rule rewriting). On first execution, we run the portal to completion * and dump the primary query's results into the portal tuplestore; the * results are then returned to the client as demanded. (We can't support * suspension of the query partway through, because the AFTER TRIGGER code * can't cope, and also because we don't want to risk failing to execute * all the auxiliary queries.) * * PORTAL_ONE_MOD_WITH: the portal contains one single SELECT query, but * it has data-modifying CTEs. This is currently treated the same as the * PORTAL_ONE_RETURNING case because of the possibility of needing to fire * triggers. It may act more like PORTAL_ONE_SELECT in future. * * PORTAL_UTIL_SELECT: the portal contains a utility statement that returns * a SELECT-like result (for example, EXPLAIN or SHOW). On first execution, * we run the statement and dump its results into the portal tuplestore; * the results are then returned to the client as demanded. * * PORTAL_MULTI_QUERY: all other cases. Here, we do not support partial * execution: the portal's queries will be run to completion on first call. */ typedef enum PortalStrategy { PORTAL_ONE_SELECT, PORTAL_ONE_RETURNING, PORTAL_ONE_MOD_WITH, PORTAL_UTIL_SELECT, PORTAL_MULTI_QUERY } PortalStrategy; /* * A portal is always in one of these states. It is possible to transit * from ACTIVE back to READY if the query is not run to completion; * otherwise we never back up in status. */ typedef enum PortalStatus { PORTAL_NEW, /* freshly created */ PORTAL_DEFINED, /* PortalDefineQuery done */ PORTAL_READY, /* PortalStart complete, can run it */ PORTAL_ACTIVE, /* portal is running (can't delete it) */ PORTAL_DONE, /* portal is finished (don't re-run it) */ PORTAL_FAILED /* portal got error (can't re-run it) */ } PortalStatus; typedef struct PortalData *Portal; typedef struct PortalData { /* Bookkeeping data */ const char *name; /* portal's name */ const char *prepStmtName; /* source prepared statement (NULL if none) */ MemoryContext heap; /* subsidiary memory for portal */ ResourceOwner resowner; /* resources owned by portal */ void (*cleanup) (Portal portal); /* cleanup hook */ /* * State data for remembering which subtransaction(s) the portal was * created or used in. If the portal is held over from a previous * transaction, both subxids are InvalidSubTransactionId. Otherwise, * createSubid is the creating subxact and activeSubid is the last subxact * in which we ran the portal. */ SubTransactionId createSubid; /* the creating subxact */ /* The query or queries the portal will execute */ const char *sourceText; /* text of query (as of 8.4, never NULL) */ const char *commandTag; /* command tag for original query */ List *stmts; /* PlannedStmts and/or utility statements */ CachedPlan *cplan; /* CachedPlan, if stmts are from one */ ParamListInfo portalParams; /* params to pass to query */ /* Features/options */ PortalStrategy strategy; /* see above */ int cursorOptions; /* DECLARE CURSOR option bits */ /* Status data */ PortalStatus status; /* see above */ bool portalPinned; /* a pinned portal can't be dropped */ /* If not NULL, Executor is active; call ExecutorEnd eventually: */ QueryDesc *queryDesc; /* info needed for executor invocation */ /* If portal returns tuples, this is their tupdesc: */ TupleDesc tupDesc; /* descriptor for result tuples */ /* and these are the format codes to use for the columns: */ int16 *formats; /* a format code for each column */ /* * Where we store tuples for a held cursor or a PORTAL_ONE_RETURNING or * PORTAL_UTIL_SELECT query. (A cursor held past the end of its * transaction no longer has any active executor state.) */ Tuplestorestate *holdStore; /* store for holdable cursors */ MemoryContext holdContext; /* memory containing holdStore */ /* * atStart, atEnd and portalPos indicate the current cursor position. * portalPos is zero before the first row, N after fetching N'th row of * query. After we run off the end, portalPos = # of rows in query, and * atEnd is true. If portalPos overflows, set posOverflow (this causes us * to stop relying on its value for navigation). Note that atStart * implies portalPos == 0, but not the reverse (portalPos could have * overflowed). */ bool atStart; bool atEnd; bool posOverflow; long portalPos; /* Presentation data, primarily used by the pg_cursors system view */ TimestampTz creation_time; /* time at which this portal was defined */ bool visible; /* include this portal in pg_cursors? */ /* * This field belongs with createSubid, but in pre-9.5 branches, add it * at the end to avoid creating an ABI break for extensions that examine * Portal structs. */ SubTransactionId activeSubid; /* the last subxact with activity */ } PortalData; /* * PortalIsValid * True iff portal is valid. */ #define PortalIsValid(p) PointerIsValid(p) /* * Access macros for Portal ... use these in preference to field access. */ #define PortalGetQueryDesc(portal) ((portal)->queryDesc) #define PortalGetHeapMemory(portal) ((portal)->heap) #define PortalGetPrimaryStmt(portal) PortalListGetPrimaryStmt((portal)->stmts) /* Prototypes for functions in utils/mmgr/portalmem.c */ extern void EnablePortalManager(void); extern bool PreCommit_Portals(bool isPrepare); extern void AtAbort_Portals(void); extern void AtCleanup_Portals(void); extern void AtSubCommit_Portals(SubTransactionId mySubid, SubTransactionId parentSubid, ResourceOwner parentXactOwner); extern void AtSubAbort_Portals(SubTransactionId mySubid, SubTransactionId parentSubid, ResourceOwner myXactOwner, ResourceOwner parentXactOwner); extern void AtSubCleanup_Portals(SubTransactionId mySubid); extern Portal CreatePortal(const char *name, bool allowDup, bool dupSilent); extern Portal CreateNewPortal(void); extern void PinPortal(Portal portal); extern void UnpinPortal(Portal portal); extern void MarkPortalActive(Portal portal); extern void MarkPortalDone(Portal portal); extern void MarkPortalFailed(Portal portal); extern void PortalDrop(Portal portal, bool isTopCommit); extern Portal GetPortalByName(const char *name); extern void PortalDefineQuery(Portal portal, const char *prepStmtName, const char *sourceText, const char *commandTag, List *stmts, CachedPlan *cplan); extern Node *PortalListGetPrimaryStmt(List *stmts); extern void PortalCreateHoldStore(Portal portal); extern void PortalHashTableDeleteAll(void); #endif /* PORTAL_H */ PKBiZm)  server/utils/syscache.hnu[/*------------------------------------------------------------------------- * * syscache.h * System catalog cache definitions. * * See also lsyscache.h, which provides convenience routines for * common cache-lookup operations. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/syscache.h * *------------------------------------------------------------------------- */ #ifndef SYSCACHE_H #define SYSCACHE_H #include "utils/catcache.h" /* * SysCache identifiers. * * The order of these identifiers must match the order * of the entries in the array cacheinfo[] in syscache.c. * Keep them in alphabetical order (renumbering only costs a * backend rebuild). */ enum SysCacheIdentifier { AGGFNOID = 0, AMNAME, AMOID, AMOPOPID, AMOPSTRATEGY, AMPROCNUM, ATTNAME, ATTNUM, AUTHMEMMEMROLE, AUTHMEMROLEMEM, AUTHNAME, AUTHOID, CASTSOURCETARGET, CLAAMNAMENSP, CLAOID, COLLNAMEENCNSP, COLLOID, CONDEFAULT, CONNAMENSP, CONSTROID, CONVOID, DATABASEOID, DEFACLROLENSPOBJ, ENUMOID, ENUMTYPOIDNAME, FOREIGNDATAWRAPPERNAME, FOREIGNDATAWRAPPEROID, FOREIGNSERVERNAME, FOREIGNSERVEROID, FOREIGNTABLEREL, INDEXRELID, LANGNAME, LANGOID, NAMESPACENAME, NAMESPACEOID, OPERNAMENSP, OPEROID, OPFAMILYAMNAMENSP, OPFAMILYOID, PROCNAMEARGSNSP, PROCOID, RANGETYPE, RELNAMENSP, RELOID, RULERELNAME, STATRELATTINH, TABLESPACEOID, TSCONFIGMAP, TSCONFIGNAMENSP, TSCONFIGOID, TSDICTNAMENSP, TSDICTOID, TSPARSERNAMENSP, TSPARSEROID, TSTEMPLATENAMENSP, TSTEMPLATEOID, TYPENAMENSP, TYPEOID, USERMAPPINGOID, USERMAPPINGUSERSERVER }; extern void InitCatalogCache(void); extern void InitCatalogCachePhase2(void); extern HeapTuple SearchSysCache(int cacheId, Datum key1, Datum key2, Datum key3, Datum key4); extern void ReleaseSysCache(HeapTuple tuple); /* convenience routines */ extern HeapTuple SearchSysCacheCopy(int cacheId, Datum key1, Datum key2, Datum key3, Datum key4); extern bool SearchSysCacheExists(int cacheId, Datum key1, Datum key2, Datum key3, Datum key4); extern Oid GetSysCacheOid(int cacheId, Datum key1, Datum key2, Datum key3, Datum key4); extern HeapTuple SearchSysCacheAttName(Oid relid, const char *attname); extern HeapTuple SearchSysCacheCopyAttName(Oid relid, const char *attname); extern bool SearchSysCacheExistsAttName(Oid relid, const char *attname); extern Datum SysCacheGetAttr(int cacheId, HeapTuple tup, AttrNumber attributeNumber, bool *isNull); extern uint32 GetSysCacheHashValue(int cacheId, Datum key1, Datum key2, Datum key3, Datum key4); /* list-search interface. Users of this must import catcache.h too */ extern struct catclist *SearchSysCacheList(int cacheId, int nkeys, Datum key1, Datum key2, Datum key3, Datum key4); extern bool RelationSupportsSysCache(Oid relid); /* * The use of the macros below rather than direct calls to the corresponding * functions is encouraged, as it insulates the caller from changes in the * maximum number of keys. */ #define SearchSysCache1(cacheId, key1) \ SearchSysCache(cacheId, key1, 0, 0, 0) #define SearchSysCache2(cacheId, key1, key2) \ SearchSysCache(cacheId, key1, key2, 0, 0) #define SearchSysCache3(cacheId, key1, key2, key3) \ SearchSysCache(cacheId, key1, key2, key3, 0) #define SearchSysCache4(cacheId, key1, key2, key3, key4) \ SearchSysCache(cacheId, key1, key2, key3, key4) #define SearchSysCacheCopy1(cacheId, key1) \ SearchSysCacheCopy(cacheId, key1, 0, 0, 0) #define SearchSysCacheCopy2(cacheId, key1, key2) \ SearchSysCacheCopy(cacheId, key1, key2, 0, 0) #define SearchSysCacheCopy3(cacheId, key1, key2, key3) \ SearchSysCacheCopy(cacheId, key1, key2, key3, 0) #define SearchSysCacheCopy4(cacheId, key1, key2, key3, key4) \ SearchSysCacheCopy(cacheId, key1, key2, key3, key4) #define SearchSysCacheExists1(cacheId, key1) \ SearchSysCacheExists(cacheId, key1, 0, 0, 0) #define SearchSysCacheExists2(cacheId, key1, key2) \ SearchSysCacheExists(cacheId, key1, key2, 0, 0) #define SearchSysCacheExists3(cacheId, key1, key2, key3) \ SearchSysCacheExists(cacheId, key1, key2, key3, 0) #define SearchSysCacheExists4(cacheId, key1, key2, key3, key4) \ SearchSysCacheExists(cacheId, key1, key2, key3, key4) #define GetSysCacheOid1(cacheId, key1) \ GetSysCacheOid(cacheId, key1, 0, 0, 0) #define GetSysCacheOid2(cacheId, key1, key2) \ GetSysCacheOid(cacheId, key1, key2, 0, 0) #define GetSysCacheOid3(cacheId, key1, key2, key3) \ GetSysCacheOid(cacheId, key1, key2, key3, 0) #define GetSysCacheOid4(cacheId, key1, key2, key3, key4) \ GetSysCacheOid(cacheId, key1, key2, key3, key4) #define GetSysCacheHashValue1(cacheId, key1) \ GetSysCacheHashValue(cacheId, key1, 0, 0, 0) #define GetSysCacheHashValue2(cacheId, key1, key2) \ GetSysCacheHashValue(cacheId, key1, key2, 0, 0) #define GetSysCacheHashValue3(cacheId, key1, key2, key3) \ GetSysCacheHashValue(cacheId, key1, key2, key3, 0) #define GetSysCacheHashValue4(cacheId, key1, key2, key3, key4) \ GetSysCacheHashValue(cacheId, key1, key2, key3, key4) #define SearchSysCacheList1(cacheId, key1) \ SearchSysCacheList(cacheId, 1, key1, 0, 0, 0) #define SearchSysCacheList2(cacheId, key1, key2) \ SearchSysCacheList(cacheId, 2, key1, key2, 0, 0) #define SearchSysCacheList3(cacheId, key1, key2, key3) \ SearchSysCacheList(cacheId, 3, key1, key2, key3, 0) #define SearchSysCacheList4(cacheId, key1, key2, key3, key4) \ SearchSysCacheList(cacheId, 4, key1, key2, key3, key4) #define ReleaseSysCacheList(x) ReleaseCatCacheList(x) #endif /* SYSCACHE_H */ PKBiZzC>11server/utils/rel.hnu[/*------------------------------------------------------------------------- * * rel.h * POSTGRES relation descriptor (a/k/a relcache entry) definitions. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/rel.h * *------------------------------------------------------------------------- */ #ifndef REL_H #define REL_H #include "access/tupdesc.h" #include "catalog/pg_am.h" #include "catalog/pg_class.h" #include "catalog/pg_index.h" #include "fmgr.h" #include "nodes/bitmapset.h" #include "rewrite/prs2lock.h" #include "storage/block.h" #include "storage/relfilenode.h" #include "utils/relcache.h" #include "utils/reltrigger.h" /* * LockRelId and LockInfo really belong to lmgr.h, but it's more convenient * to declare them here so we can have a LockInfoData field in a Relation. */ typedef struct LockRelId { Oid relId; /* a relation identifier */ Oid dbId; /* a database identifier */ } LockRelId; typedef struct LockInfoData { LockRelId lockRelId; } LockInfoData; typedef LockInfoData *LockInfo; /* * Cached lookup information for the index access method functions defined * by the pg_am row associated with an index relation. */ typedef struct RelationAmInfo { FmgrInfo aminsert; FmgrInfo ambeginscan; FmgrInfo amgettuple; FmgrInfo amgetbitmap; FmgrInfo amrescan; FmgrInfo amendscan; FmgrInfo ammarkpos; FmgrInfo amrestrpos; FmgrInfo ambuild; FmgrInfo ambuildempty; FmgrInfo ambulkdelete; FmgrInfo amvacuumcleanup; FmgrInfo amcanreturn; FmgrInfo amcostestimate; FmgrInfo amoptions; } RelationAmInfo; /* * Here are the contents of a relation cache entry. */ typedef struct RelationData { RelFileNode rd_node; /* relation physical identifier */ /* use "struct" here to avoid needing to include smgr.h: */ struct SMgrRelationData *rd_smgr; /* cached file handle, or NULL */ int rd_refcnt; /* reference count */ BackendId rd_backend; /* owning backend id, if temporary relation */ bool rd_isnailed; /* rel is nailed in cache */ bool rd_isvalid; /* relcache entry is valid */ char rd_indexvalid; /* state of rd_indexlist: 0 = not valid, 1 = * valid, 2 = temporarily forced */ bool rd_islocaltemp; /* rel is a temp rel of this session */ /* * rd_createSubid is the ID of the highest subtransaction the rel has * survived into; or zero if the rel was not created in the current top * transaction. This should be relied on only for optimization purposes; * it is possible for new-ness to be "forgotten" (eg, after CLUSTER). * Likewise, rd_newRelfilenodeSubid is the ID of the highest * subtransaction the relfilenode change has survived into, or zero if not * changed in the current transaction (or we have forgotten changing it). */ SubTransactionId rd_createSubid; /* rel was created in current xact */ SubTransactionId rd_newRelfilenodeSubid; /* new relfilenode assigned in * current xact */ Form_pg_class rd_rel; /* RELATION tuple */ TupleDesc rd_att; /* tuple descriptor */ Oid rd_id; /* relation's object id */ List *rd_indexlist; /* list of OIDs of indexes on relation */ Bitmapset *rd_indexattr; /* identifies columns used in indexes */ Oid rd_oidindex; /* OID of unique index on OID, if any */ LockInfoData rd_lockInfo; /* lock mgr's info for locking relation */ RuleLock *rd_rules; /* rewrite rules */ MemoryContext rd_rulescxt; /* private memory cxt for rd_rules, if any */ TriggerDesc *trigdesc; /* Trigger info, or NULL if rel has none */ /* * rd_options is set whenever rd_rel is loaded into the relcache entry. * Note that you can NOT look into rd_rel for this data. NULL means "use * defaults". */ bytea *rd_options; /* parsed pg_class.reloptions */ /* These are non-NULL only for an index relation: */ Form_pg_index rd_index; /* pg_index tuple describing this index */ /* use "struct" here to avoid needing to include htup.h: */ struct HeapTupleData *rd_indextuple; /* all of pg_index tuple */ Form_pg_am rd_am; /* pg_am tuple for index's AM */ /* * index access support info (used only for an index relation) * * Note: only default support procs for each opclass are cached, namely * those with lefttype and righttype equal to the opclass's opcintype. The * arrays are indexed by support function number, which is a sufficient * identifier given that restriction. * * Note: rd_amcache is available for index AMs to cache private data about * an index. This must be just a cache since it may get reset at any time * (in particular, it will get reset by a relcache inval message for the * index). If used, it must point to a single memory chunk palloc'd in * rd_indexcxt. A relcache reset will include freeing that chunk and * setting rd_amcache = NULL. */ MemoryContext rd_indexcxt; /* private memory cxt for this stuff */ RelationAmInfo *rd_aminfo; /* lookup info for funcs found in pg_am */ Oid *rd_opfamily; /* OIDs of op families for each index col */ Oid *rd_opcintype; /* OIDs of opclass declared input data types */ RegProcedure *rd_support; /* OIDs of support procedures */ FmgrInfo *rd_supportinfo; /* lookup info for support procedures */ int16 *rd_indoption; /* per-column AM-specific flags */ List *rd_indexprs; /* index expression trees, if any */ List *rd_indpred; /* index predicate tree, if any */ Oid *rd_exclops; /* OIDs of exclusion operators, if any */ Oid *rd_exclprocs; /* OIDs of exclusion ops' procs, if any */ uint16 *rd_exclstrats; /* exclusion ops' strategy numbers, if any */ void *rd_amcache; /* available for use by index AM */ Oid *rd_indcollation; /* OIDs of index collations */ /* * Hack for CLUSTER, rewriting ALTER TABLE, etc: when writing a new * version of a table, we need to make any toast pointers inserted into it * have the existing toast table's OID, not the OID of the transient toast * table. If rd_toastoid isn't InvalidOid, it is the OID to place in * toast pointers inserted into this rel. (Note it's set on the new * version of the main heap, not the toast table itself.) This also * causes toast_save_datum() to try to preserve toast value OIDs. */ Oid rd_toastoid; /* Real TOAST table's OID, or InvalidOid */ /* use "struct" here to avoid needing to include pgstat.h: */ struct PgStat_TableStatus *pgstat_info; /* statistics collection area */ } RelationData; /* * StdRdOptions * Standard contents of rd_options for heaps and generic indexes. * * RelationGetFillFactor() and RelationGetTargetPageFreeSpace() can only * be applied to relations that use this format or a superset for * private options data. */ /* autovacuum-related reloptions. */ typedef struct AutoVacOpts { bool enabled; int vacuum_threshold; int analyze_threshold; int vacuum_cost_delay; int vacuum_cost_limit; int freeze_min_age; int freeze_max_age; int freeze_table_age; float8 vacuum_scale_factor; float8 analyze_scale_factor; } AutoVacOpts; typedef struct StdRdOptions { int32 vl_len_; /* varlena header (do not touch directly!) */ int fillfactor; /* page fill factor in percent (0..100) */ AutoVacOpts autovacuum; /* autovacuum-related options */ bool security_barrier; /* for views */ } StdRdOptions; #define HEAP_MIN_FILLFACTOR 10 #define HEAP_DEFAULT_FILLFACTOR 100 /* * RelationGetFillFactor * Returns the relation's fillfactor. Note multiple eval of argument! */ #define RelationGetFillFactor(relation, defaultff) \ ((relation)->rd_options ? \ ((StdRdOptions *) (relation)->rd_options)->fillfactor : (defaultff)) /* * RelationGetTargetPageUsage * Returns the relation's desired space usage per page in bytes. */ #define RelationGetTargetPageUsage(relation, defaultff) \ (BLCKSZ * RelationGetFillFactor(relation, defaultff) / 100) /* * RelationGetTargetPageFreeSpace * Returns the relation's desired freespace per page in bytes. */ #define RelationGetTargetPageFreeSpace(relation, defaultff) \ (BLCKSZ * (100 - RelationGetFillFactor(relation, defaultff)) / 100) /* * RelationIsSecurityView * Returns whether the relation is security view, or not */ #define RelationIsSecurityView(relation) \ ((relation)->rd_options ? \ ((StdRdOptions *) (relation)->rd_options)->security_barrier : false) /* * RelationIsValid * True iff relation descriptor is valid. */ #define RelationIsValid(relation) PointerIsValid(relation) #define InvalidRelation ((Relation) NULL) /* * RelationHasReferenceCountZero * True iff relation reference count is zero. * * Note: * Assumes relation descriptor is valid. */ #define RelationHasReferenceCountZero(relation) \ ((bool)((relation)->rd_refcnt == 0)) /* * RelationGetForm * Returns pg_class tuple for a relation. * * Note: * Assumes relation descriptor is valid. */ #define RelationGetForm(relation) ((relation)->rd_rel) /* * RelationGetRelid * Returns the OID of the relation */ #define RelationGetRelid(relation) ((relation)->rd_id) /* * RelationGetNumberOfAttributes * Returns the number of attributes in a relation. */ #define RelationGetNumberOfAttributes(relation) ((relation)->rd_rel->relnatts) /* * RelationGetDescr * Returns tuple descriptor for a relation. */ #define RelationGetDescr(relation) ((relation)->rd_att) /* * RelationGetRelationName * Returns the rel's name. * * Note that the name is only unique within the containing namespace. */ #define RelationGetRelationName(relation) \ (NameStr((relation)->rd_rel->relname)) /* * RelationGetNamespace * Returns the rel's namespace OID. */ #define RelationGetNamespace(relation) \ ((relation)->rd_rel->relnamespace) /* * RelationIsMapped * True if the relation uses the relfilenode map. * * NB: this is only meaningful for relkinds that have storage, else it * will misleadingly say "true". */ #define RelationIsMapped(relation) \ ((relation)->rd_rel->relfilenode == InvalidOid) /* * RelationOpenSmgr * Open the relation at the smgr level, if not already done. */ #define RelationOpenSmgr(relation) \ do { \ if ((relation)->rd_smgr == NULL) \ smgrsetowner(&((relation)->rd_smgr), smgropen((relation)->rd_node, (relation)->rd_backend)); \ } while (0) /* * RelationCloseSmgr * Close the relation at the smgr level, if not already done. * * Note: smgrclose should unhook from owner pointer, hence the Assert. */ #define RelationCloseSmgr(relation) \ do { \ if ((relation)->rd_smgr != NULL) \ { \ smgrclose((relation)->rd_smgr); \ Assert((relation)->rd_smgr == NULL); \ } \ } while (0) /* * RelationGetTargetBlock * Fetch relation's current insertion target block. * * Returns InvalidBlockNumber if there is no current target block. Note * that the target block status is discarded on any smgr-level invalidation. */ #define RelationGetTargetBlock(relation) \ ( (relation)->rd_smgr != NULL ? (relation)->rd_smgr->smgr_targblock : InvalidBlockNumber ) /* * RelationSetTargetBlock * Set relation's current insertion target block. */ #define RelationSetTargetBlock(relation, targblock) \ do { \ RelationOpenSmgr(relation); \ (relation)->rd_smgr->smgr_targblock = (targblock); \ } while (0) /* * RelationNeedsWAL * True if relation needs WAL. */ #define RelationNeedsWAL(relation) \ ((relation)->rd_rel->relpersistence == RELPERSISTENCE_PERMANENT) /* * RelationUsesLocalBuffers * True if relation's pages are stored in local buffers. */ #define RelationUsesLocalBuffers(relation) \ ((relation)->rd_rel->relpersistence == RELPERSISTENCE_TEMP) /* * RELATION_IS_LOCAL * If a rel is either temp or newly created in the current transaction, * it can be assumed to be accessible only to the current backend. * This is typically used to decide that we can skip acquiring locks. * * Beware of multiple eval of argument */ #define RELATION_IS_LOCAL(relation) \ ((relation)->rd_islocaltemp || \ (relation)->rd_createSubid != InvalidSubTransactionId) /* * RELATION_IS_OTHER_TEMP * Test for a temporary relation that belongs to some other session. * * Beware of multiple eval of argument */ #define RELATION_IS_OTHER_TEMP(relation) \ ((relation)->rd_rel->relpersistence == RELPERSISTENCE_TEMP && \ !(relation)->rd_islocaltemp) /* routines in utils/cache/relcache.c */ extern void RelationIncrementReferenceCount(Relation rel); extern void RelationDecrementReferenceCount(Relation rel); #endif /* REL_H */ PKBiZ~>|server/utils/date.hnu[/*------------------------------------------------------------------------- * * date.h * Definitions for the SQL92 "date" and "time" types. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/date.h * *------------------------------------------------------------------------- */ #ifndef DATE_H #define DATE_H #include #include "fmgr.h" typedef int32 DateADT; #ifdef HAVE_INT64_TIMESTAMP typedef int64 TimeADT; #else typedef float8 TimeADT; #endif typedef struct { TimeADT time; /* all time units other than months and years */ int32 zone; /* numeric time zone, in seconds */ } TimeTzADT; /* * Infinity and minus infinity must be the max and min values of DateADT. * We could use INT_MIN and INT_MAX here, but seems better to not assume that * int32 == int. */ #define DATEVAL_NOBEGIN ((DateADT) (-0x7fffffff - 1)) #define DATEVAL_NOEND ((DateADT) 0x7fffffff) #define DATE_NOBEGIN(j) ((j) = DATEVAL_NOBEGIN) #define DATE_IS_NOBEGIN(j) ((j) == DATEVAL_NOBEGIN) #define DATE_NOEND(j) ((j) = DATEVAL_NOEND) #define DATE_IS_NOEND(j) ((j) == DATEVAL_NOEND) #define DATE_NOT_FINITE(j) (DATE_IS_NOBEGIN(j) || DATE_IS_NOEND(j)) /* * Macros for fmgr-callable functions. * * For TimeADT, we make use of the same support routines as for float8 or int64. * Therefore TimeADT is pass-by-reference if and only if float8 or int64 is! */ #ifdef HAVE_INT64_TIMESTAMP #define MAX_TIME_PRECISION 6 #define DatumGetDateADT(X) ((DateADT) DatumGetInt32(X)) #define DatumGetTimeADT(X) ((TimeADT) DatumGetInt64(X)) #define DatumGetTimeTzADTP(X) ((TimeTzADT *) DatumGetPointer(X)) #define DateADTGetDatum(X) Int32GetDatum(X) #define TimeADTGetDatum(X) Int64GetDatum(X) #define TimeTzADTPGetDatum(X) PointerGetDatum(X) #else /* !HAVE_INT64_TIMESTAMP */ #define MAX_TIME_PRECISION 10 /* round off to MAX_TIME_PRECISION decimal places */ #define TIME_PREC_INV 10000000000.0 #define TIMEROUND(j) (rint(((double) (j)) * TIME_PREC_INV) / TIME_PREC_INV) #define DatumGetDateADT(X) ((DateADT) DatumGetInt32(X)) #define DatumGetTimeADT(X) ((TimeADT) DatumGetFloat8(X)) #define DatumGetTimeTzADTP(X) ((TimeTzADT *) DatumGetPointer(X)) #define DateADTGetDatum(X) Int32GetDatum(X) #define TimeADTGetDatum(X) Float8GetDatum(X) #define TimeTzADTPGetDatum(X) PointerGetDatum(X) #endif /* HAVE_INT64_TIMESTAMP */ #define PG_GETARG_DATEADT(n) DatumGetDateADT(PG_GETARG_DATUM(n)) #define PG_GETARG_TIMEADT(n) DatumGetTimeADT(PG_GETARG_DATUM(n)) #define PG_GETARG_TIMETZADT_P(n) DatumGetTimeTzADTP(PG_GETARG_DATUM(n)) #define PG_RETURN_DATEADT(x) return DateADTGetDatum(x) #define PG_RETURN_TIMEADT(x) return TimeADTGetDatum(x) #define PG_RETURN_TIMETZADT_P(x) return TimeTzADTPGetDatum(x) /* date.c */ extern double date2timestamp_no_overflow(DateADT dateVal); extern Datum date_in(PG_FUNCTION_ARGS); extern Datum date_out(PG_FUNCTION_ARGS); extern Datum date_recv(PG_FUNCTION_ARGS); extern Datum date_send(PG_FUNCTION_ARGS); extern Datum date_eq(PG_FUNCTION_ARGS); extern Datum date_ne(PG_FUNCTION_ARGS); extern Datum date_lt(PG_FUNCTION_ARGS); extern Datum date_le(PG_FUNCTION_ARGS); extern Datum date_gt(PG_FUNCTION_ARGS); extern Datum date_ge(PG_FUNCTION_ARGS); extern Datum date_cmp(PG_FUNCTION_ARGS); extern Datum date_sortsupport(PG_FUNCTION_ARGS); extern Datum date_finite(PG_FUNCTION_ARGS); extern Datum date_larger(PG_FUNCTION_ARGS); extern Datum date_smaller(PG_FUNCTION_ARGS); extern Datum date_mi(PG_FUNCTION_ARGS); extern Datum date_pli(PG_FUNCTION_ARGS); extern Datum date_mii(PG_FUNCTION_ARGS); extern Datum date_eq_timestamp(PG_FUNCTION_ARGS); extern Datum date_ne_timestamp(PG_FUNCTION_ARGS); extern Datum date_lt_timestamp(PG_FUNCTION_ARGS); extern Datum date_le_timestamp(PG_FUNCTION_ARGS); extern Datum date_gt_timestamp(PG_FUNCTION_ARGS); extern Datum date_ge_timestamp(PG_FUNCTION_ARGS); extern Datum date_cmp_timestamp(PG_FUNCTION_ARGS); extern Datum date_eq_timestamptz(PG_FUNCTION_ARGS); extern Datum date_ne_timestamptz(PG_FUNCTION_ARGS); extern Datum date_lt_timestamptz(PG_FUNCTION_ARGS); extern Datum date_le_timestamptz(PG_FUNCTION_ARGS); extern Datum date_gt_timestamptz(PG_FUNCTION_ARGS); extern Datum date_ge_timestamptz(PG_FUNCTION_ARGS); extern Datum date_cmp_timestamptz(PG_FUNCTION_ARGS); extern Datum timestamp_eq_date(PG_FUNCTION_ARGS); extern Datum timestamp_ne_date(PG_FUNCTION_ARGS); extern Datum timestamp_lt_date(PG_FUNCTION_ARGS); extern Datum timestamp_le_date(PG_FUNCTION_ARGS); extern Datum timestamp_gt_date(PG_FUNCTION_ARGS); extern Datum timestamp_ge_date(PG_FUNCTION_ARGS); extern Datum timestamp_cmp_date(PG_FUNCTION_ARGS); extern Datum timestamptz_eq_date(PG_FUNCTION_ARGS); extern Datum timestamptz_ne_date(PG_FUNCTION_ARGS); extern Datum timestamptz_lt_date(PG_FUNCTION_ARGS); extern Datum timestamptz_le_date(PG_FUNCTION_ARGS); extern Datum timestamptz_gt_date(PG_FUNCTION_ARGS); extern Datum timestamptz_ge_date(PG_FUNCTION_ARGS); extern Datum timestamptz_cmp_date(PG_FUNCTION_ARGS); extern Datum date_pl_interval(PG_FUNCTION_ARGS); extern Datum date_mi_interval(PG_FUNCTION_ARGS); extern Datum date_timestamp(PG_FUNCTION_ARGS); extern Datum timestamp_date(PG_FUNCTION_ARGS); extern Datum date_timestamptz(PG_FUNCTION_ARGS); extern Datum timestamptz_date(PG_FUNCTION_ARGS); extern Datum datetime_timestamp(PG_FUNCTION_ARGS); extern Datum abstime_date(PG_FUNCTION_ARGS); extern Datum time_in(PG_FUNCTION_ARGS); extern Datum time_out(PG_FUNCTION_ARGS); extern Datum time_recv(PG_FUNCTION_ARGS); extern Datum time_send(PG_FUNCTION_ARGS); extern Datum timetypmodin(PG_FUNCTION_ARGS); extern Datum timetypmodout(PG_FUNCTION_ARGS); extern Datum time_transform(PG_FUNCTION_ARGS); extern Datum time_scale(PG_FUNCTION_ARGS); extern Datum time_eq(PG_FUNCTION_ARGS); extern Datum time_ne(PG_FUNCTION_ARGS); extern Datum time_lt(PG_FUNCTION_ARGS); extern Datum time_le(PG_FUNCTION_ARGS); extern Datum time_gt(PG_FUNCTION_ARGS); extern Datum time_ge(PG_FUNCTION_ARGS); extern Datum time_cmp(PG_FUNCTION_ARGS); extern Datum time_hash(PG_FUNCTION_ARGS); extern Datum overlaps_time(PG_FUNCTION_ARGS); extern Datum time_larger(PG_FUNCTION_ARGS); extern Datum time_smaller(PG_FUNCTION_ARGS); extern Datum time_mi_time(PG_FUNCTION_ARGS); extern Datum timestamp_time(PG_FUNCTION_ARGS); extern Datum timestamptz_time(PG_FUNCTION_ARGS); extern Datum time_interval(PG_FUNCTION_ARGS); extern Datum interval_time(PG_FUNCTION_ARGS); extern Datum time_pl_interval(PG_FUNCTION_ARGS); extern Datum time_mi_interval(PG_FUNCTION_ARGS); extern Datum time_part(PG_FUNCTION_ARGS); extern Datum timetz_in(PG_FUNCTION_ARGS); extern Datum timetz_out(PG_FUNCTION_ARGS); extern Datum timetz_recv(PG_FUNCTION_ARGS); extern Datum timetz_send(PG_FUNCTION_ARGS); extern Datum timetztypmodin(PG_FUNCTION_ARGS); extern Datum timetztypmodout(PG_FUNCTION_ARGS); extern Datum timetz_scale(PG_FUNCTION_ARGS); extern Datum timetz_eq(PG_FUNCTION_ARGS); extern Datum timetz_ne(PG_FUNCTION_ARGS); extern Datum timetz_lt(PG_FUNCTION_ARGS); extern Datum timetz_le(PG_FUNCTION_ARGS); extern Datum timetz_gt(PG_FUNCTION_ARGS); extern Datum timetz_ge(PG_FUNCTION_ARGS); extern Datum timetz_cmp(PG_FUNCTION_ARGS); extern Datum timetz_hash(PG_FUNCTION_ARGS); extern Datum overlaps_timetz(PG_FUNCTION_ARGS); extern Datum timetz_larger(PG_FUNCTION_ARGS); extern Datum timetz_smaller(PG_FUNCTION_ARGS); extern Datum timetz_time(PG_FUNCTION_ARGS); extern Datum time_timetz(PG_FUNCTION_ARGS); extern Datum timestamptz_timetz(PG_FUNCTION_ARGS); extern Datum datetimetz_timestamptz(PG_FUNCTION_ARGS); extern Datum timetz_part(PG_FUNCTION_ARGS); extern Datum timetz_zone(PG_FUNCTION_ARGS); extern Datum timetz_izone(PG_FUNCTION_ARGS); extern Datum timetz_pl_interval(PG_FUNCTION_ARGS); extern Datum timetz_mi_interval(PG_FUNCTION_ARGS); #endif /* DATE_H */ PKBiZь[6server/utils/help_config.hnu[/*------------------------------------------------------------------------- * * help_config.h * Interface to the --help-config option of main.c * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * * src/include/utils/help_config.h * *------------------------------------------------------------------------- */ #ifndef HELP_CONFIG_H #define HELP_CONFIG_H 1 extern int GucInfoMain(void); #endif PKBiZgserver/utils/selfuncs.hnu[/*------------------------------------------------------------------------- * * selfuncs.h * Selectivity functions and index cost estimation functions for * standard operators and index access methods. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/selfuncs.h * *------------------------------------------------------------------------- */ #ifndef SELFUNCS_H #define SELFUNCS_H #include "fmgr.h" #include "access/htup.h" #include "nodes/relation.h" /* * Note: the default selectivity estimates are not chosen entirely at random. * We want them to be small enough to ensure that indexscans will be used if * available, for typical table densities of ~100 tuples/page. Thus, for * example, 0.01 is not quite small enough, since that makes it appear that * nearly all pages will be hit anyway. Also, since we sometimes estimate * eqsel as 1/num_distinct, we probably want DEFAULT_NUM_DISTINCT to equal * 1/DEFAULT_EQ_SEL. */ /* default selectivity estimate for equalities such as "A = b" */ #define DEFAULT_EQ_SEL 0.005 /* default selectivity estimate for inequalities such as "A < b" */ #define DEFAULT_INEQ_SEL 0.3333333333333333 /* default selectivity estimate for range inequalities "A > b AND A < c" */ #define DEFAULT_RANGE_INEQ_SEL 0.005 /* default selectivity estimate for pattern-match operators such as LIKE */ #define DEFAULT_MATCH_SEL 0.005 /* default number of distinct values in a table */ #define DEFAULT_NUM_DISTINCT 200 /* default selectivity estimate for boolean and null test nodes */ #define DEFAULT_UNK_SEL 0.005 #define DEFAULT_NOT_UNK_SEL (1.0 - DEFAULT_UNK_SEL) /* * Clamp a computed probability estimate (which may suffer from roundoff or * estimation errors) to valid range. Argument must be a float variable. */ #define CLAMP_PROBABILITY(p) \ do { \ if (p < 0.0) \ p = 0.0; \ else if (p > 1.0) \ p = 1.0; \ } while (0) /* Return data from examine_variable and friends */ typedef struct VariableStatData { Node *var; /* the Var or expression tree */ RelOptInfo *rel; /* Relation, or NULL if not identifiable */ HeapTuple statsTuple; /* pg_statistic tuple, or NULL if none */ /* NB: if statsTuple!=NULL, it must be freed when caller is done */ void (*freefunc) (HeapTuple tuple); /* how to free statsTuple */ Oid vartype; /* exposed type of expression */ Oid atttype; /* type to pass to get_attstatsslot */ int32 atttypmod; /* typmod to pass to get_attstatsslot */ bool isunique; /* matches unique index or DISTINCT clause */ bool acl_ok; /* result of ACL check on table or column */ } VariableStatData; #define ReleaseVariableStats(vardata) \ do { \ if (HeapTupleIsValid((vardata).statsTuple)) \ (* (vardata).freefunc) ((vardata).statsTuple); \ } while(0) typedef enum { Pattern_Type_Like, Pattern_Type_Like_IC, Pattern_Type_Regex, Pattern_Type_Regex_IC } Pattern_Type; typedef enum { Pattern_Prefix_None, Pattern_Prefix_Partial, Pattern_Prefix_Exact } Pattern_Prefix_Status; /* Hooks for plugins to get control when we ask for stats */ typedef bool (*get_relation_stats_hook_type) (PlannerInfo *root, RangeTblEntry *rte, AttrNumber attnum, VariableStatData *vardata); extern PGDLLIMPORT get_relation_stats_hook_type get_relation_stats_hook; typedef bool (*get_index_stats_hook_type) (PlannerInfo *root, Oid indexOid, AttrNumber indexattnum, VariableStatData *vardata); extern PGDLLIMPORT get_index_stats_hook_type get_index_stats_hook; /* Functions in selfuncs.c */ extern void examine_variable(PlannerInfo *root, Node *node, int varRelid, VariableStatData *vardata); extern bool statistic_proc_security_check(VariableStatData *vardata, Oid func_oid); extern bool get_restriction_variable(PlannerInfo *root, List *args, int varRelid, VariableStatData *vardata, Node **other, bool *varonleft); extern void get_join_variables(PlannerInfo *root, List *args, SpecialJoinInfo *sjinfo, VariableStatData *vardata1, VariableStatData *vardata2, bool *join_is_reversed); extern double get_variable_numdistinct(VariableStatData *vardata, bool *isdefault); extern double mcv_selectivity(VariableStatData *vardata, FmgrInfo *opproc, Datum constval, bool varonleft, double *sumcommonp); extern double histogram_selectivity(VariableStatData *vardata, FmgrInfo *opproc, Datum constval, bool varonleft, int min_hist_size, int n_skip, int *hist_size); extern Pattern_Prefix_Status pattern_fixed_prefix(Const *patt, Pattern_Type ptype, Oid collation, Const **prefix, Selectivity *rest_selec); extern Const *make_greater_string(const Const *str_const, FmgrInfo *ltproc, Oid collation); extern Datum eqsel(PG_FUNCTION_ARGS); extern Datum neqsel(PG_FUNCTION_ARGS); extern Datum scalarltsel(PG_FUNCTION_ARGS); extern Datum scalargtsel(PG_FUNCTION_ARGS); extern Datum regexeqsel(PG_FUNCTION_ARGS); extern Datum icregexeqsel(PG_FUNCTION_ARGS); extern Datum likesel(PG_FUNCTION_ARGS); extern Datum iclikesel(PG_FUNCTION_ARGS); extern Datum regexnesel(PG_FUNCTION_ARGS); extern Datum icregexnesel(PG_FUNCTION_ARGS); extern Datum nlikesel(PG_FUNCTION_ARGS); extern Datum icnlikesel(PG_FUNCTION_ARGS); extern Datum eqjoinsel(PG_FUNCTION_ARGS); extern Datum neqjoinsel(PG_FUNCTION_ARGS); extern Datum scalarltjoinsel(PG_FUNCTION_ARGS); extern Datum scalargtjoinsel(PG_FUNCTION_ARGS); extern Datum regexeqjoinsel(PG_FUNCTION_ARGS); extern Datum icregexeqjoinsel(PG_FUNCTION_ARGS); extern Datum likejoinsel(PG_FUNCTION_ARGS); extern Datum iclikejoinsel(PG_FUNCTION_ARGS); extern Datum regexnejoinsel(PG_FUNCTION_ARGS); extern Datum icregexnejoinsel(PG_FUNCTION_ARGS); extern Datum nlikejoinsel(PG_FUNCTION_ARGS); extern Datum icnlikejoinsel(PG_FUNCTION_ARGS); extern Selectivity booltestsel(PlannerInfo *root, BoolTestType booltesttype, Node *arg, int varRelid, JoinType jointype, SpecialJoinInfo *sjinfo); extern Selectivity nulltestsel(PlannerInfo *root, NullTestType nulltesttype, Node *arg, int varRelid, JoinType jointype, SpecialJoinInfo *sjinfo); extern Selectivity scalararraysel(PlannerInfo *root, ScalarArrayOpExpr *clause, bool is_join_clause, int varRelid, JoinType jointype, SpecialJoinInfo *sjinfo); extern int estimate_array_length(Node *arrayexpr); extern Selectivity rowcomparesel(PlannerInfo *root, RowCompareExpr *clause, int varRelid, JoinType jointype, SpecialJoinInfo *sjinfo); extern void mergejoinscansel(PlannerInfo *root, Node *clause, Oid opfamily, int strategy, bool nulls_first, Selectivity *leftstart, Selectivity *leftend, Selectivity *rightstart, Selectivity *rightend); extern double estimate_num_groups(PlannerInfo *root, List *groupExprs, double input_rows); extern Selectivity estimate_hash_bucketsize(PlannerInfo *root, Node *hashkey, double nbuckets); extern Datum btcostestimate(PG_FUNCTION_ARGS); extern Datum hashcostestimate(PG_FUNCTION_ARGS); extern Datum gistcostestimate(PG_FUNCTION_ARGS); extern Datum spgcostestimate(PG_FUNCTION_ARGS); extern Datum gincostestimate(PG_FUNCTION_ARGS); /* Functions in array_selfuncs.c */ extern Selectivity scalararraysel_containment(PlannerInfo *root, Node *leftop, Node *rightop, Oid elemtype, bool isEquality, bool useOr, int varRelid); extern Datum arraycontsel(PG_FUNCTION_ARGS); extern Datum arraycontjoinsel(PG_FUNCTION_ARGS); #endif /* SELFUNCS_H */ PKBiZcM5server/utils/logtape.hnu[/*------------------------------------------------------------------------- * * logtape.h * Management of "logical tapes" within temporary files. * * See logtape.c for explanations. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/logtape.h * *------------------------------------------------------------------------- */ #ifndef LOGTAPE_H #define LOGTAPE_H /* LogicalTapeSet is an opaque type whose details are not known outside logtape.c. */ typedef struct LogicalTapeSet LogicalTapeSet; /* * prototypes for functions in logtape.c */ extern LogicalTapeSet *LogicalTapeSetCreate(int ntapes); extern void LogicalTapeSetClose(LogicalTapeSet *lts); extern void LogicalTapeSetForgetFreeSpace(LogicalTapeSet *lts); extern size_t LogicalTapeRead(LogicalTapeSet *lts, int tapenum, void *ptr, size_t size); extern void LogicalTapeWrite(LogicalTapeSet *lts, int tapenum, void *ptr, size_t size); extern void LogicalTapeRewind(LogicalTapeSet *lts, int tapenum, bool forWrite); extern void LogicalTapeFreeze(LogicalTapeSet *lts, int tapenum); extern bool LogicalTapeBackspace(LogicalTapeSet *lts, int tapenum, size_t size); extern bool LogicalTapeSeek(LogicalTapeSet *lts, int tapenum, long blocknum, int offset); extern void LogicalTapeTell(LogicalTapeSet *lts, int tapenum, long *blocknum, int *offset); extern long LogicalTapeSetBlocks(LogicalTapeSet *lts); #endif /* LOGTAPE_H */ PKBiZ*+ɔserver/utils/json.hnu[/*------------------------------------------------------------------------- * * json.h * Declarations for JSON data type support. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/json.h * *------------------------------------------------------------------------- */ #ifndef JSON_H #define JSON_H #include "fmgr.h" #include "lib/stringinfo.h" extern Datum json_in(PG_FUNCTION_ARGS); extern Datum json_out(PG_FUNCTION_ARGS); extern Datum json_recv(PG_FUNCTION_ARGS); extern Datum json_send(PG_FUNCTION_ARGS); extern Datum array_to_json(PG_FUNCTION_ARGS); extern Datum array_to_json_pretty(PG_FUNCTION_ARGS); extern Datum row_to_json(PG_FUNCTION_ARGS); extern Datum row_to_json_pretty(PG_FUNCTION_ARGS); extern void escape_json(StringInfo buf, const char *str); #endif /* JSON_H */ PKBiZml''server/utils/datetime.hnu[/*------------------------------------------------------------------------- * * datetime.h * Definitions for date/time support code. * The support code is shared with other date data types, * including abstime, reltime, date, and time. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/datetime.h * *------------------------------------------------------------------------- */ #ifndef DATETIME_H #define DATETIME_H #include "nodes/nodes.h" #include "utils/timestamp.h" /* this struct is declared in utils/tzparser.h: */ struct tzEntry; /* ---------------------------------------------------------------- * time types + support macros * * String definitions for standard time quantities. * * These strings are the defaults used to form output time strings. * Other alternative forms are hardcoded into token tables in datetime.c. * ---------------------------------------------------------------- */ #define DAGO "ago" #define DCURRENT "current" #define EPOCH "epoch" #define INVALID "invalid" #define EARLY "-infinity" #define LATE "infinity" #define NOW "now" #define TODAY "today" #define TOMORROW "tomorrow" #define YESTERDAY "yesterday" #define ZULU "zulu" #define DMICROSEC "usecond" #define DMILLISEC "msecond" #define DSECOND "second" #define DMINUTE "minute" #define DHOUR "hour" #define DDAY "day" #define DWEEK "week" #define DMONTH "month" #define DQUARTER "quarter" #define DYEAR "year" #define DDECADE "decade" #define DCENTURY "century" #define DMILLENNIUM "millennium" #define DA_D "ad" #define DB_C "bc" #define DTIMEZONE "timezone" /* * Fundamental time field definitions for parsing. * * Meridian: am, pm, or 24-hour style. * Millennium: ad, bc */ #define AM 0 #define PM 1 #define HR24 2 #define AD 0 #define BC 1 /* * Field types for time decoding. * * Can't have more of these than there are bits in an unsigned int * since these are turned into bit masks during parsing and decoding. * * Furthermore, the values for YEAR, MONTH, DAY, HOUR, MINUTE, SECOND * must be in the range 0..14 so that the associated bitmasks can fit * into the left half of an INTERVAL's typmod value. Since those bits * are stored in typmods, you can't change them without initdb! */ #define RESERV 0 #define MONTH 1 #define YEAR 2 #define DAY 3 #define JULIAN 4 #define TZ 5 /* fixed-offset timezone abbreviation */ #define DTZ 6 /* fixed-offset timezone abbrev, DST */ #define DYNTZ 7 /* dynamic timezone abbreviation */ #define IGNORE_DTF 8 #define AMPM 9 #define HOUR 10 #define MINUTE 11 #define SECOND 12 #define MILLISECOND 13 #define MICROSECOND 14 #define DOY 15 #define DOW 16 #define UNITS 17 #define ADBC 18 /* these are only for relative dates */ #define AGO 19 #define ABS_BEFORE 20 #define ABS_AFTER 21 /* generic fields to help with parsing */ #define ISODATE 22 #define ISOTIME 23 /* these are only for parsing intervals */ #define WEEK 24 #define DECADE 25 #define CENTURY 26 #define MILLENNIUM 27 /* hack for parsing two-word timezone specs "MET DST" etc */ #define DTZMOD 28 /* "DST" as a separate word */ /* reserved for unrecognized string values */ #define UNKNOWN_FIELD 31 /* * Token field definitions for time parsing and decoding. * * Some field type codes (see above) use these as the "value" in datetktbl[]. * These are also used for bit masks in DecodeDateTime and friends * so actually restrict them to within [0,31] for now. * - thomas 97/06/19 * Not all of these fields are used for masks in DecodeDateTime * so allow some larger than 31. - thomas 1997-11-17 * * Caution: there are undocumented assumptions in the code that most of these * values are not equal to IGNORE_DTF nor RESERV. Be very careful when * renumbering values in either of these apparently-independent lists :-( */ #define DTK_NUMBER 0 #define DTK_STRING 1 #define DTK_DATE 2 #define DTK_TIME 3 #define DTK_TZ 4 #define DTK_AGO 5 #define DTK_SPECIAL 6 #define DTK_INVALID 7 #define DTK_CURRENT 8 #define DTK_EARLY 9 #define DTK_LATE 10 #define DTK_EPOCH 11 #define DTK_NOW 12 #define DTK_YESTERDAY 13 #define DTK_TODAY 14 #define DTK_TOMORROW 15 #define DTK_ZULU 16 #define DTK_DELTA 17 #define DTK_SECOND 18 #define DTK_MINUTE 19 #define DTK_HOUR 20 #define DTK_DAY 21 #define DTK_WEEK 22 #define DTK_MONTH 23 #define DTK_QUARTER 24 #define DTK_YEAR 25 #define DTK_DECADE 26 #define DTK_CENTURY 27 #define DTK_MILLENNIUM 28 #define DTK_MILLISEC 29 #define DTK_MICROSEC 30 #define DTK_JULIAN 31 #define DTK_DOW 32 #define DTK_DOY 33 #define DTK_TZ_HOUR 34 #define DTK_TZ_MINUTE 35 #define DTK_ISOYEAR 36 #define DTK_ISODOW 37 /* * Bit mask definitions for time parsing. */ #define DTK_M(t) (0x01 << (t)) /* Convenience: a second, plus any fractional component */ #define DTK_ALL_SECS_M (DTK_M(SECOND) | DTK_M(MILLISECOND) | DTK_M(MICROSECOND)) #define DTK_DATE_M (DTK_M(YEAR) | DTK_M(MONTH) | DTK_M(DAY)) #define DTK_TIME_M (DTK_M(HOUR) | DTK_M(MINUTE) | DTK_ALL_SECS_M) /* * Working buffer size for input and output of interval, timestamp, etc. * Inputs that need more working space will be rejected early. Longer outputs * will overrun buffers, so this must suffice for all possible output. As of * this writing, interval_out() needs the most space at ~90 bytes. */ #define MAXDATELEN 128 /* maximum possible number of fields in a date string */ #define MAXDATEFIELDS 25 /* only this many chars are stored in datetktbl */ #define TOKMAXLEN 10 /* keep this struct small; it gets used a lot */ typedef struct { char token[TOKMAXLEN + 1]; /* always NUL-terminated */ char type; /* see field type codes above */ int32 value; /* meaning depends on type */ } datetkn; /* one of its uses is in tables of time zone abbreviations */ typedef struct TimeZoneAbbrevTable { Size tblsize; /* size in bytes of TimeZoneAbbrevTable */ int numabbrevs; /* number of entries in abbrevs[] array */ datetkn abbrevs[1]; /* VARIABLE LENGTH ARRAY */ /* DynamicZoneAbbrev(s) may follow the abbrevs[] array */ } TimeZoneAbbrevTable; /* auxiliary data for a dynamic time zone abbreviation (non-fixed-offset) */ typedef struct DynamicZoneAbbrev { pg_tz *tz; /* NULL if not yet looked up */ char zone[1]; /* zone name (var length, NUL-terminated) */ } DynamicZoneAbbrev; /* FMODULO() * Macro to replace modf(), which is broken on some platforms. * t = input and remainder * q = integer part * u = divisor */ #define FMODULO(t,q,u) \ do { \ (q) = (((t) < 0) ? ceil((t) / (u)) : floor((t) / (u))); \ if ((q) != 0) (t) -= rint((q) * (u)); \ } while(0) /* TMODULO() * Like FMODULO(), but work on the timestamp datatype (either int64 or float8). * We assume that int64 follows the C99 semantics for division (negative * quotients truncate towards zero). */ #ifdef HAVE_INT64_TIMESTAMP #define TMODULO(t,q,u) \ do { \ (q) = ((t) / (u)); \ if ((q) != 0) (t) -= ((q) * (u)); \ } while(0) #else #define TMODULO(t,q,u) \ do { \ (q) = (((t) < 0) ? ceil((t) / (u)) : floor((t) / (u))); \ if ((q) != 0) (t) -= rint((q) * (u)); \ } while(0) #endif /* * Date/time validation * Include check for leap year. */ extern const int day_tab[2][13]; #define isleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0)) /* * Datetime input parsing routines (ParseDateTime, DecodeDateTime, etc) * return zero or a positive value on success. On failure, they return * one of these negative code values. DateTimeParseError may be used to * produce a correct ereport. */ #define DTERR_BAD_FORMAT (-1) #define DTERR_FIELD_OVERFLOW (-2) #define DTERR_MD_FIELD_OVERFLOW (-3) /* triggers hint about DateStyle */ #define DTERR_INTERVAL_OVERFLOW (-4) #define DTERR_TZDISP_OVERFLOW (-5) extern void GetCurrentDateTime(struct pg_tm * tm); extern void GetCurrentTimeUsec(struct pg_tm * tm, fsec_t *fsec, int *tzp); extern void j2date(int jd, int *year, int *month, int *day); extern int date2j(int year, int month, int day); extern int ParseDateTime(const char *timestr, char *workbuf, size_t buflen, char **field, int *ftype, int maxfields, int *numfields); extern int DecodeDateTime(char **field, int *ftype, int nf, int *dtype, struct pg_tm * tm, fsec_t *fsec, int *tzp); extern int DecodeTimeOnly(char **field, int *ftype, int nf, int *dtype, struct pg_tm * tm, fsec_t *fsec, int *tzp); extern int DecodeInterval(char **field, int *ftype, int nf, int range, int *dtype, struct pg_tm * tm, fsec_t *fsec); extern int DecodeISO8601Interval(char *str, int *dtype, struct pg_tm * tm, fsec_t *fsec); extern void DateTimeParseError(int dterr, const char *str, const char *datatype); extern int DetermineTimeZoneOffset(struct pg_tm * tm, pg_tz *tzp); extern int DetermineTimeZoneAbbrevOffset(struct pg_tm * tm, const char *abbr, pg_tz *tzp); extern int DetermineTimeZoneAbbrevOffsetTS(TimestampTz ts, const char *abbr, pg_tz *tzp, int *isdst); extern void EncodeDateOnly(struct pg_tm * tm, int style, char *str); extern void EncodeTimeOnly(struct pg_tm * tm, fsec_t fsec, bool print_tz, int tz, int style, char *str); extern void EncodeDateTime(struct pg_tm * tm, fsec_t fsec, bool print_tz, int tz, const char *tzn, int style, char *str); extern void EncodeInterval(struct pg_tm * tm, fsec_t fsec, int style, char *str); extern int DecodeTimezoneAbbrev(int field, char *lowtoken, int *offset, pg_tz **tz); extern int DecodeSpecial(int field, char *lowtoken, int *val); extern int DecodeUnits(int field, char *lowtoken, int *val); extern int j2day(int jd); extern Node *TemporalTransform(int32 max_precis, Node *node); extern bool CheckDateTokenTables(void); extern TimeZoneAbbrevTable *ConvertTimeZoneAbbrevs(struct tzEntry *abbrevs, int n); extern void InstallTimeZoneAbbrevs(TimeZoneAbbrevTable *tbl); extern Datum pg_timezone_abbrevs(PG_FUNCTION_ARGS); extern Datum pg_timezone_names(PG_FUNCTION_ARGS); #endif /* DATETIME_H */ PKBiZ server/utils/numeric.hnu[/*------------------------------------------------------------------------- * * numeric.h * Definitions for the exact numeric data type of Postgres * * Original coding 1998, Jan Wieck. Heavily revised 2003, Tom Lane. * * Copyright (c) 1998-2012, PostgreSQL Global Development Group * * src/include/utils/numeric.h * *------------------------------------------------------------------------- */ #ifndef _PG_NUMERIC_H_ #define _PG_NUMERIC_H_ #include "fmgr.h" /* * Limit on the precision (and hence scale) specifiable in a NUMERIC typmod. * Note that the implementation limit on the length of a numeric value is * much larger --- beware of what you use this for! */ #define NUMERIC_MAX_PRECISION 1000 /* * Internal limits on the scales chosen for calculation results */ #define NUMERIC_MAX_DISPLAY_SCALE NUMERIC_MAX_PRECISION #define NUMERIC_MIN_DISPLAY_SCALE 0 #define NUMERIC_MAX_RESULT_SCALE (NUMERIC_MAX_PRECISION * 2) /* * For inherently inexact calculations such as division and square root, * we try to get at least this many significant digits; the idea is to * deliver a result no worse than float8 would. */ #define NUMERIC_MIN_SIG_DIGITS 16 /* The actual contents of Numeric are private to numeric.c */ struct NumericData; typedef struct NumericData *Numeric; /* * fmgr interface macros */ #define DatumGetNumeric(X) ((Numeric) PG_DETOAST_DATUM(X)) #define DatumGetNumericCopy(X) ((Numeric) PG_DETOAST_DATUM_COPY(X)) #define NumericGetDatum(X) PointerGetDatum(X) #define PG_GETARG_NUMERIC(n) DatumGetNumeric(PG_GETARG_DATUM(n)) #define PG_GETARG_NUMERIC_COPY(n) DatumGetNumericCopy(PG_GETARG_DATUM(n)) #define PG_RETURN_NUMERIC(x) return NumericGetDatum(x) /* * Utility functions in numeric.c */ extern bool numeric_is_nan(Numeric num); int32 numeric_maximum_size(int32 typmod); extern char *numeric_out_sci(Numeric num, int scale); #endif /* _PG_NUMERIC_H_ */ PKBiZ server/utils/probes.hnu[/* Generated by the Systemtap dtrace wrapper */ #define _SDT_HAS_SEMAPHORES 1 #define STAP_HAS_SEMAPHORES 1 /* deprecated */ #include /* TRACE_POSTGRESQL_TRANSACTION_START ( unsigned int ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_TRANSACTION_START_ENABLED() __builtin_expect (transaction__start_semaphore, 0) #define postgresql_transaction__start_semaphore transaction__start_semaphore #else #define TRACE_POSTGRESQL_TRANSACTION_START_ENABLED() __builtin_expect (postgresql_transaction__start_semaphore, 0) #endif __extension__ extern unsigned short postgresql_transaction__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_TRANSACTION_START(arg1) \ DTRACE_PROBE1 (postgresql, transaction__start, arg1) /* TRACE_POSTGRESQL_TRANSACTION_COMMIT ( unsigned int ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_TRANSACTION_COMMIT_ENABLED() __builtin_expect (transaction__commit_semaphore, 0) #define postgresql_transaction__commit_semaphore transaction__commit_semaphore #else #define TRACE_POSTGRESQL_TRANSACTION_COMMIT_ENABLED() __builtin_expect (postgresql_transaction__commit_semaphore, 0) #endif __extension__ extern unsigned short postgresql_transaction__commit_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_TRANSACTION_COMMIT(arg1) \ DTRACE_PROBE1 (postgresql, transaction__commit, arg1) /* TRACE_POSTGRESQL_TRANSACTION_ABORT ( unsigned int ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_TRANSACTION_ABORT_ENABLED() __builtin_expect (transaction__abort_semaphore, 0) #define postgresql_transaction__abort_semaphore transaction__abort_semaphore #else #define TRACE_POSTGRESQL_TRANSACTION_ABORT_ENABLED() __builtin_expect (postgresql_transaction__abort_semaphore, 0) #endif __extension__ extern unsigned short postgresql_transaction__abort_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_TRANSACTION_ABORT(arg1) \ DTRACE_PROBE1 (postgresql, transaction__abort, arg1) /* TRACE_POSTGRESQL_LWLOCK_ACQUIRE ( int, int ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_LWLOCK_ACQUIRE_ENABLED() __builtin_expect (lwlock__acquire_semaphore, 0) #define postgresql_lwlock__acquire_semaphore lwlock__acquire_semaphore #else #define TRACE_POSTGRESQL_LWLOCK_ACQUIRE_ENABLED() __builtin_expect (postgresql_lwlock__acquire_semaphore, 0) #endif __extension__ extern unsigned short postgresql_lwlock__acquire_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_LWLOCK_ACQUIRE(arg1, arg2) \ DTRACE_PROBE2 (postgresql, lwlock__acquire, arg1, arg2) /* TRACE_POSTGRESQL_LWLOCK_RELEASE ( int ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_LWLOCK_RELEASE_ENABLED() __builtin_expect (lwlock__release_semaphore, 0) #define postgresql_lwlock__release_semaphore lwlock__release_semaphore #else #define TRACE_POSTGRESQL_LWLOCK_RELEASE_ENABLED() __builtin_expect (postgresql_lwlock__release_semaphore, 0) #endif __extension__ extern unsigned short postgresql_lwlock__release_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_LWLOCK_RELEASE(arg1) \ DTRACE_PROBE1 (postgresql, lwlock__release, arg1) /* TRACE_POSTGRESQL_LWLOCK_WAIT_START ( int, int ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_LWLOCK_WAIT_START_ENABLED() __builtin_expect (lwlock__wait__start_semaphore, 0) #define postgresql_lwlock__wait__start_semaphore lwlock__wait__start_semaphore #else #define TRACE_POSTGRESQL_LWLOCK_WAIT_START_ENABLED() __builtin_expect (postgresql_lwlock__wait__start_semaphore, 0) #endif __extension__ extern unsigned short postgresql_lwlock__wait__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_LWLOCK_WAIT_START(arg1, arg2) \ DTRACE_PROBE2 (postgresql, lwlock__wait__start, arg1, arg2) /* TRACE_POSTGRESQL_LWLOCK_WAIT_DONE ( int, int ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_LWLOCK_WAIT_DONE_ENABLED() __builtin_expect (lwlock__wait__done_semaphore, 0) #define postgresql_lwlock__wait__done_semaphore lwlock__wait__done_semaphore #else #define TRACE_POSTGRESQL_LWLOCK_WAIT_DONE_ENABLED() __builtin_expect (postgresql_lwlock__wait__done_semaphore, 0) #endif __extension__ extern unsigned short postgresql_lwlock__wait__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_LWLOCK_WAIT_DONE(arg1, arg2) \ DTRACE_PROBE2 (postgresql, lwlock__wait__done, arg1, arg2) /* TRACE_POSTGRESQL_LWLOCK_CONDACQUIRE ( int, int ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_LWLOCK_CONDACQUIRE_ENABLED() __builtin_expect (lwlock__condacquire_semaphore, 0) #define postgresql_lwlock__condacquire_semaphore lwlock__condacquire_semaphore #else #define TRACE_POSTGRESQL_LWLOCK_CONDACQUIRE_ENABLED() __builtin_expect (postgresql_lwlock__condacquire_semaphore, 0) #endif __extension__ extern unsigned short postgresql_lwlock__condacquire_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_LWLOCK_CONDACQUIRE(arg1, arg2) \ DTRACE_PROBE2 (postgresql, lwlock__condacquire, arg1, arg2) /* TRACE_POSTGRESQL_LWLOCK_CONDACQUIRE_FAIL ( int, int ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_LWLOCK_CONDACQUIRE_FAIL_ENABLED() __builtin_expect (lwlock__condacquire__fail_semaphore, 0) #define postgresql_lwlock__condacquire__fail_semaphore lwlock__condacquire__fail_semaphore #else #define TRACE_POSTGRESQL_LWLOCK_CONDACQUIRE_FAIL_ENABLED() __builtin_expect (postgresql_lwlock__condacquire__fail_semaphore, 0) #endif __extension__ extern unsigned short postgresql_lwlock__condacquire__fail_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_LWLOCK_CONDACQUIRE_FAIL(arg1, arg2) \ DTRACE_PROBE2 (postgresql, lwlock__condacquire__fail, arg1, arg2) /* TRACE_POSTGRESQL_LWLOCK_WAIT_UNTIL_FREE ( int, int ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_LWLOCK_WAIT_UNTIL_FREE_ENABLED() __builtin_expect (lwlock__wait__until__free_semaphore, 0) #define postgresql_lwlock__wait__until__free_semaphore lwlock__wait__until__free_semaphore #else #define TRACE_POSTGRESQL_LWLOCK_WAIT_UNTIL_FREE_ENABLED() __builtin_expect (postgresql_lwlock__wait__until__free_semaphore, 0) #endif __extension__ extern unsigned short postgresql_lwlock__wait__until__free_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_LWLOCK_WAIT_UNTIL_FREE(arg1, arg2) \ DTRACE_PROBE2 (postgresql, lwlock__wait__until__free, arg1, arg2) /* TRACE_POSTGRESQL_LWLOCK_WAIT_UNTIL_FREE_FAIL ( int, int ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_LWLOCK_WAIT_UNTIL_FREE_FAIL_ENABLED() __builtin_expect (lwlock__wait__until__free__fail_semaphore, 0) #define postgresql_lwlock__wait__until__free__fail_semaphore lwlock__wait__until__free__fail_semaphore #else #define TRACE_POSTGRESQL_LWLOCK_WAIT_UNTIL_FREE_FAIL_ENABLED() __builtin_expect (postgresql_lwlock__wait__until__free__fail_semaphore, 0) #endif __extension__ extern unsigned short postgresql_lwlock__wait__until__free__fail_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_LWLOCK_WAIT_UNTIL_FREE_FAIL(arg1, arg2) \ DTRACE_PROBE2 (postgresql, lwlock__wait__until__free__fail, arg1, arg2) /* TRACE_POSTGRESQL_LOCK_WAIT_START ( unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, int ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_LOCK_WAIT_START_ENABLED() __builtin_expect (lock__wait__start_semaphore, 0) #define postgresql_lock__wait__start_semaphore lock__wait__start_semaphore #else #define TRACE_POSTGRESQL_LOCK_WAIT_START_ENABLED() __builtin_expect (postgresql_lock__wait__start_semaphore, 0) #endif __extension__ extern unsigned short postgresql_lock__wait__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_LOCK_WAIT_START(arg1, arg2, arg3, arg4, arg5, arg6) \ DTRACE_PROBE6 (postgresql, lock__wait__start, arg1, arg2, arg3, arg4, arg5, arg6) /* TRACE_POSTGRESQL_LOCK_WAIT_DONE ( unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, int ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_LOCK_WAIT_DONE_ENABLED() __builtin_expect (lock__wait__done_semaphore, 0) #define postgresql_lock__wait__done_semaphore lock__wait__done_semaphore #else #define TRACE_POSTGRESQL_LOCK_WAIT_DONE_ENABLED() __builtin_expect (postgresql_lock__wait__done_semaphore, 0) #endif __extension__ extern unsigned short postgresql_lock__wait__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_LOCK_WAIT_DONE(arg1, arg2, arg3, arg4, arg5, arg6) \ DTRACE_PROBE6 (postgresql, lock__wait__done, arg1, arg2, arg3, arg4, arg5, arg6) /* TRACE_POSTGRESQL_QUERY_PARSE_START ( const char * ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_QUERY_PARSE_START_ENABLED() __builtin_expect (query__parse__start_semaphore, 0) #define postgresql_query__parse__start_semaphore query__parse__start_semaphore #else #define TRACE_POSTGRESQL_QUERY_PARSE_START_ENABLED() __builtin_expect (postgresql_query__parse__start_semaphore, 0) #endif __extension__ extern unsigned short postgresql_query__parse__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_QUERY_PARSE_START(arg1) \ DTRACE_PROBE1 (postgresql, query__parse__start, arg1) /* TRACE_POSTGRESQL_QUERY_PARSE_DONE ( const char * ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_QUERY_PARSE_DONE_ENABLED() __builtin_expect (query__parse__done_semaphore, 0) #define postgresql_query__parse__done_semaphore query__parse__done_semaphore #else #define TRACE_POSTGRESQL_QUERY_PARSE_DONE_ENABLED() __builtin_expect (postgresql_query__parse__done_semaphore, 0) #endif __extension__ extern unsigned short postgresql_query__parse__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_QUERY_PARSE_DONE(arg1) \ DTRACE_PROBE1 (postgresql, query__parse__done, arg1) /* TRACE_POSTGRESQL_QUERY_REWRITE_START ( const char * ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_QUERY_REWRITE_START_ENABLED() __builtin_expect (query__rewrite__start_semaphore, 0) #define postgresql_query__rewrite__start_semaphore query__rewrite__start_semaphore #else #define TRACE_POSTGRESQL_QUERY_REWRITE_START_ENABLED() __builtin_expect (postgresql_query__rewrite__start_semaphore, 0) #endif __extension__ extern unsigned short postgresql_query__rewrite__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_QUERY_REWRITE_START(arg1) \ DTRACE_PROBE1 (postgresql, query__rewrite__start, arg1) /* TRACE_POSTGRESQL_QUERY_REWRITE_DONE ( const char * ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_QUERY_REWRITE_DONE_ENABLED() __builtin_expect (query__rewrite__done_semaphore, 0) #define postgresql_query__rewrite__done_semaphore query__rewrite__done_semaphore #else #define TRACE_POSTGRESQL_QUERY_REWRITE_DONE_ENABLED() __builtin_expect (postgresql_query__rewrite__done_semaphore, 0) #endif __extension__ extern unsigned short postgresql_query__rewrite__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_QUERY_REWRITE_DONE(arg1) \ DTRACE_PROBE1 (postgresql, query__rewrite__done, arg1) /* TRACE_POSTGRESQL_QUERY_PLAN_START ( ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_QUERY_PLAN_START_ENABLED() __builtin_expect (query__plan__start_semaphore, 0) #define postgresql_query__plan__start_semaphore query__plan__start_semaphore #else #define TRACE_POSTGRESQL_QUERY_PLAN_START_ENABLED() __builtin_expect (postgresql_query__plan__start_semaphore, 0) #endif __extension__ extern unsigned short postgresql_query__plan__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_QUERY_PLAN_START() \ DTRACE_PROBE (postgresql, query__plan__start) /* TRACE_POSTGRESQL_QUERY_PLAN_DONE ( ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_QUERY_PLAN_DONE_ENABLED() __builtin_expect (query__plan__done_semaphore, 0) #define postgresql_query__plan__done_semaphore query__plan__done_semaphore #else #define TRACE_POSTGRESQL_QUERY_PLAN_DONE_ENABLED() __builtin_expect (postgresql_query__plan__done_semaphore, 0) #endif __extension__ extern unsigned short postgresql_query__plan__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_QUERY_PLAN_DONE() \ DTRACE_PROBE (postgresql, query__plan__done) /* TRACE_POSTGRESQL_QUERY_EXECUTE_START ( ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_QUERY_EXECUTE_START_ENABLED() __builtin_expect (query__execute__start_semaphore, 0) #define postgresql_query__execute__start_semaphore query__execute__start_semaphore #else #define TRACE_POSTGRESQL_QUERY_EXECUTE_START_ENABLED() __builtin_expect (postgresql_query__execute__start_semaphore, 0) #endif __extension__ extern unsigned short postgresql_query__execute__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_QUERY_EXECUTE_START() \ DTRACE_PROBE (postgresql, query__execute__start) /* TRACE_POSTGRESQL_QUERY_EXECUTE_DONE ( ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_QUERY_EXECUTE_DONE_ENABLED() __builtin_expect (query__execute__done_semaphore, 0) #define postgresql_query__execute__done_semaphore query__execute__done_semaphore #else #define TRACE_POSTGRESQL_QUERY_EXECUTE_DONE_ENABLED() __builtin_expect (postgresql_query__execute__done_semaphore, 0) #endif __extension__ extern unsigned short postgresql_query__execute__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_QUERY_EXECUTE_DONE() \ DTRACE_PROBE (postgresql, query__execute__done) /* TRACE_POSTGRESQL_QUERY_START ( const char * ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_QUERY_START_ENABLED() __builtin_expect (query__start_semaphore, 0) #define postgresql_query__start_semaphore query__start_semaphore #else #define TRACE_POSTGRESQL_QUERY_START_ENABLED() __builtin_expect (postgresql_query__start_semaphore, 0) #endif __extension__ extern unsigned short postgresql_query__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_QUERY_START(arg1) \ DTRACE_PROBE1 (postgresql, query__start, arg1) /* TRACE_POSTGRESQL_QUERY_DONE ( const char * ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_QUERY_DONE_ENABLED() __builtin_expect (query__done_semaphore, 0) #define postgresql_query__done_semaphore query__done_semaphore #else #define TRACE_POSTGRESQL_QUERY_DONE_ENABLED() __builtin_expect (postgresql_query__done_semaphore, 0) #endif __extension__ extern unsigned short postgresql_query__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_QUERY_DONE(arg1) \ DTRACE_PROBE1 (postgresql, query__done, arg1) /* TRACE_POSTGRESQL_STATEMENT_STATUS ( const char * ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_STATEMENT_STATUS_ENABLED() __builtin_expect (statement__status_semaphore, 0) #define postgresql_statement__status_semaphore statement__status_semaphore #else #define TRACE_POSTGRESQL_STATEMENT_STATUS_ENABLED() __builtin_expect (postgresql_statement__status_semaphore, 0) #endif __extension__ extern unsigned short postgresql_statement__status_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_STATEMENT_STATUS(arg1) \ DTRACE_PROBE1 (postgresql, statement__status, arg1) /* TRACE_POSTGRESQL_SORT_START ( int, char, int, int, char ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_SORT_START_ENABLED() __builtin_expect (sort__start_semaphore, 0) #define postgresql_sort__start_semaphore sort__start_semaphore #else #define TRACE_POSTGRESQL_SORT_START_ENABLED() __builtin_expect (postgresql_sort__start_semaphore, 0) #endif __extension__ extern unsigned short postgresql_sort__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_SORT_START(arg1, arg2, arg3, arg4, arg5) \ DTRACE_PROBE5 (postgresql, sort__start, arg1, arg2, arg3, arg4, arg5) /* TRACE_POSTGRESQL_SORT_DONE ( char, long ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_SORT_DONE_ENABLED() __builtin_expect (sort__done_semaphore, 0) #define postgresql_sort__done_semaphore sort__done_semaphore #else #define TRACE_POSTGRESQL_SORT_DONE_ENABLED() __builtin_expect (postgresql_sort__done_semaphore, 0) #endif __extension__ extern unsigned short postgresql_sort__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_SORT_DONE(arg1, arg2) \ DTRACE_PROBE2 (postgresql, sort__done, arg1, arg2) /* TRACE_POSTGRESQL_BUFFER_READ_START ( int, unsigned int, unsigned int, unsigned int, unsigned int, int, char ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_BUFFER_READ_START_ENABLED() __builtin_expect (buffer__read__start_semaphore, 0) #define postgresql_buffer__read__start_semaphore buffer__read__start_semaphore #else #define TRACE_POSTGRESQL_BUFFER_READ_START_ENABLED() __builtin_expect (postgresql_buffer__read__start_semaphore, 0) #endif __extension__ extern unsigned short postgresql_buffer__read__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_BUFFER_READ_START(arg1, arg2, arg3, arg4, arg5, arg6, arg7) \ DTRACE_PROBE7 (postgresql, buffer__read__start, arg1, arg2, arg3, arg4, arg5, arg6, arg7) /* TRACE_POSTGRESQL_BUFFER_READ_DONE ( int, unsigned int, unsigned int, unsigned int, unsigned int, int, char, char ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_BUFFER_READ_DONE_ENABLED() __builtin_expect (buffer__read__done_semaphore, 0) #define postgresql_buffer__read__done_semaphore buffer__read__done_semaphore #else #define TRACE_POSTGRESQL_BUFFER_READ_DONE_ENABLED() __builtin_expect (postgresql_buffer__read__done_semaphore, 0) #endif __extension__ extern unsigned short postgresql_buffer__read__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_BUFFER_READ_DONE(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \ DTRACE_PROBE8 (postgresql, buffer__read__done, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) /* TRACE_POSTGRESQL_BUFFER_FLUSH_START ( int, unsigned int, unsigned int, unsigned int, unsigned int ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_BUFFER_FLUSH_START_ENABLED() __builtin_expect (buffer__flush__start_semaphore, 0) #define postgresql_buffer__flush__start_semaphore buffer__flush__start_semaphore #else #define TRACE_POSTGRESQL_BUFFER_FLUSH_START_ENABLED() __builtin_expect (postgresql_buffer__flush__start_semaphore, 0) #endif __extension__ extern unsigned short postgresql_buffer__flush__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_BUFFER_FLUSH_START(arg1, arg2, arg3, arg4, arg5) \ DTRACE_PROBE5 (postgresql, buffer__flush__start, arg1, arg2, arg3, arg4, arg5) /* TRACE_POSTGRESQL_BUFFER_FLUSH_DONE ( int, unsigned int, unsigned int, unsigned int, unsigned int ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_BUFFER_FLUSH_DONE_ENABLED() __builtin_expect (buffer__flush__done_semaphore, 0) #define postgresql_buffer__flush__done_semaphore buffer__flush__done_semaphore #else #define TRACE_POSTGRESQL_BUFFER_FLUSH_DONE_ENABLED() __builtin_expect (postgresql_buffer__flush__done_semaphore, 0) #endif __extension__ extern unsigned short postgresql_buffer__flush__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_BUFFER_FLUSH_DONE(arg1, arg2, arg3, arg4, arg5) \ DTRACE_PROBE5 (postgresql, buffer__flush__done, arg1, arg2, arg3, arg4, arg5) /* TRACE_POSTGRESQL_BUFFER_CHECKPOINT_START ( int ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_BUFFER_CHECKPOINT_START_ENABLED() __builtin_expect (buffer__checkpoint__start_semaphore, 0) #define postgresql_buffer__checkpoint__start_semaphore buffer__checkpoint__start_semaphore #else #define TRACE_POSTGRESQL_BUFFER_CHECKPOINT_START_ENABLED() __builtin_expect (postgresql_buffer__checkpoint__start_semaphore, 0) #endif __extension__ extern unsigned short postgresql_buffer__checkpoint__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_BUFFER_CHECKPOINT_START(arg1) \ DTRACE_PROBE1 (postgresql, buffer__checkpoint__start, arg1) /* TRACE_POSTGRESQL_BUFFER_CHECKPOINT_SYNC_START ( ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_BUFFER_CHECKPOINT_SYNC_START_ENABLED() __builtin_expect (buffer__checkpoint__sync__start_semaphore, 0) #define postgresql_buffer__checkpoint__sync__start_semaphore buffer__checkpoint__sync__start_semaphore #else #define TRACE_POSTGRESQL_BUFFER_CHECKPOINT_SYNC_START_ENABLED() __builtin_expect (postgresql_buffer__checkpoint__sync__start_semaphore, 0) #endif __extension__ extern unsigned short postgresql_buffer__checkpoint__sync__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_BUFFER_CHECKPOINT_SYNC_START() \ DTRACE_PROBE (postgresql, buffer__checkpoint__sync__start) /* TRACE_POSTGRESQL_BUFFER_CHECKPOINT_DONE ( ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_BUFFER_CHECKPOINT_DONE_ENABLED() __builtin_expect (buffer__checkpoint__done_semaphore, 0) #define postgresql_buffer__checkpoint__done_semaphore buffer__checkpoint__done_semaphore #else #define TRACE_POSTGRESQL_BUFFER_CHECKPOINT_DONE_ENABLED() __builtin_expect (postgresql_buffer__checkpoint__done_semaphore, 0) #endif __extension__ extern unsigned short postgresql_buffer__checkpoint__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_BUFFER_CHECKPOINT_DONE() \ DTRACE_PROBE (postgresql, buffer__checkpoint__done) /* TRACE_POSTGRESQL_BUFFER_SYNC_START ( int, int ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_BUFFER_SYNC_START_ENABLED() __builtin_expect (buffer__sync__start_semaphore, 0) #define postgresql_buffer__sync__start_semaphore buffer__sync__start_semaphore #else #define TRACE_POSTGRESQL_BUFFER_SYNC_START_ENABLED() __builtin_expect (postgresql_buffer__sync__start_semaphore, 0) #endif __extension__ extern unsigned short postgresql_buffer__sync__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_BUFFER_SYNC_START(arg1, arg2) \ DTRACE_PROBE2 (postgresql, buffer__sync__start, arg1, arg2) /* TRACE_POSTGRESQL_BUFFER_SYNC_WRITTEN ( int ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_BUFFER_SYNC_WRITTEN_ENABLED() __builtin_expect (buffer__sync__written_semaphore, 0) #define postgresql_buffer__sync__written_semaphore buffer__sync__written_semaphore #else #define TRACE_POSTGRESQL_BUFFER_SYNC_WRITTEN_ENABLED() __builtin_expect (postgresql_buffer__sync__written_semaphore, 0) #endif __extension__ extern unsigned short postgresql_buffer__sync__written_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_BUFFER_SYNC_WRITTEN(arg1) \ DTRACE_PROBE1 (postgresql, buffer__sync__written, arg1) /* TRACE_POSTGRESQL_BUFFER_SYNC_DONE ( int, int, int ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_BUFFER_SYNC_DONE_ENABLED() __builtin_expect (buffer__sync__done_semaphore, 0) #define postgresql_buffer__sync__done_semaphore buffer__sync__done_semaphore #else #define TRACE_POSTGRESQL_BUFFER_SYNC_DONE_ENABLED() __builtin_expect (postgresql_buffer__sync__done_semaphore, 0) #endif __extension__ extern unsigned short postgresql_buffer__sync__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_BUFFER_SYNC_DONE(arg1, arg2, arg3) \ DTRACE_PROBE3 (postgresql, buffer__sync__done, arg1, arg2, arg3) /* TRACE_POSTGRESQL_BUFFER_WRITE_DIRTY_START ( int, unsigned int, unsigned int, unsigned int, unsigned int ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_BUFFER_WRITE_DIRTY_START_ENABLED() __builtin_expect (buffer__write__dirty__start_semaphore, 0) #define postgresql_buffer__write__dirty__start_semaphore buffer__write__dirty__start_semaphore #else #define TRACE_POSTGRESQL_BUFFER_WRITE_DIRTY_START_ENABLED() __builtin_expect (postgresql_buffer__write__dirty__start_semaphore, 0) #endif __extension__ extern unsigned short postgresql_buffer__write__dirty__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_BUFFER_WRITE_DIRTY_START(arg1, arg2, arg3, arg4, arg5) \ DTRACE_PROBE5 (postgresql, buffer__write__dirty__start, arg1, arg2, arg3, arg4, arg5) /* TRACE_POSTGRESQL_BUFFER_WRITE_DIRTY_DONE ( int, unsigned int, unsigned int, unsigned int, unsigned int ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_BUFFER_WRITE_DIRTY_DONE_ENABLED() __builtin_expect (buffer__write__dirty__done_semaphore, 0) #define postgresql_buffer__write__dirty__done_semaphore buffer__write__dirty__done_semaphore #else #define TRACE_POSTGRESQL_BUFFER_WRITE_DIRTY_DONE_ENABLED() __builtin_expect (postgresql_buffer__write__dirty__done_semaphore, 0) #endif __extension__ extern unsigned short postgresql_buffer__write__dirty__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_BUFFER_WRITE_DIRTY_DONE(arg1, arg2, arg3, arg4, arg5) \ DTRACE_PROBE5 (postgresql, buffer__write__dirty__done, arg1, arg2, arg3, arg4, arg5) /* TRACE_POSTGRESQL_DEADLOCK_FOUND ( ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_DEADLOCK_FOUND_ENABLED() __builtin_expect (deadlock__found_semaphore, 0) #define postgresql_deadlock__found_semaphore deadlock__found_semaphore #else #define TRACE_POSTGRESQL_DEADLOCK_FOUND_ENABLED() __builtin_expect (postgresql_deadlock__found_semaphore, 0) #endif __extension__ extern unsigned short postgresql_deadlock__found_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_DEADLOCK_FOUND() \ DTRACE_PROBE (postgresql, deadlock__found) /* TRACE_POSTGRESQL_CHECKPOINT_START ( int ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_CHECKPOINT_START_ENABLED() __builtin_expect (checkpoint__start_semaphore, 0) #define postgresql_checkpoint__start_semaphore checkpoint__start_semaphore #else #define TRACE_POSTGRESQL_CHECKPOINT_START_ENABLED() __builtin_expect (postgresql_checkpoint__start_semaphore, 0) #endif __extension__ extern unsigned short postgresql_checkpoint__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_CHECKPOINT_START(arg1) \ DTRACE_PROBE1 (postgresql, checkpoint__start, arg1) /* TRACE_POSTGRESQL_CHECKPOINT_DONE ( int, int, int, int, int ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_CHECKPOINT_DONE_ENABLED() __builtin_expect (checkpoint__done_semaphore, 0) #define postgresql_checkpoint__done_semaphore checkpoint__done_semaphore #else #define TRACE_POSTGRESQL_CHECKPOINT_DONE_ENABLED() __builtin_expect (postgresql_checkpoint__done_semaphore, 0) #endif __extension__ extern unsigned short postgresql_checkpoint__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_CHECKPOINT_DONE(arg1, arg2, arg3, arg4, arg5) \ DTRACE_PROBE5 (postgresql, checkpoint__done, arg1, arg2, arg3, arg4, arg5) /* TRACE_POSTGRESQL_CLOG_CHECKPOINT_START ( char ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_CLOG_CHECKPOINT_START_ENABLED() __builtin_expect (clog__checkpoint__start_semaphore, 0) #define postgresql_clog__checkpoint__start_semaphore clog__checkpoint__start_semaphore #else #define TRACE_POSTGRESQL_CLOG_CHECKPOINT_START_ENABLED() __builtin_expect (postgresql_clog__checkpoint__start_semaphore, 0) #endif __extension__ extern unsigned short postgresql_clog__checkpoint__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_CLOG_CHECKPOINT_START(arg1) \ DTRACE_PROBE1 (postgresql, clog__checkpoint__start, arg1) /* TRACE_POSTGRESQL_CLOG_CHECKPOINT_DONE ( char ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_CLOG_CHECKPOINT_DONE_ENABLED() __builtin_expect (clog__checkpoint__done_semaphore, 0) #define postgresql_clog__checkpoint__done_semaphore clog__checkpoint__done_semaphore #else #define TRACE_POSTGRESQL_CLOG_CHECKPOINT_DONE_ENABLED() __builtin_expect (postgresql_clog__checkpoint__done_semaphore, 0) #endif __extension__ extern unsigned short postgresql_clog__checkpoint__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_CLOG_CHECKPOINT_DONE(arg1) \ DTRACE_PROBE1 (postgresql, clog__checkpoint__done, arg1) /* TRACE_POSTGRESQL_SUBTRANS_CHECKPOINT_START ( char ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_SUBTRANS_CHECKPOINT_START_ENABLED() __builtin_expect (subtrans__checkpoint__start_semaphore, 0) #define postgresql_subtrans__checkpoint__start_semaphore subtrans__checkpoint__start_semaphore #else #define TRACE_POSTGRESQL_SUBTRANS_CHECKPOINT_START_ENABLED() __builtin_expect (postgresql_subtrans__checkpoint__start_semaphore, 0) #endif __extension__ extern unsigned short postgresql_subtrans__checkpoint__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_SUBTRANS_CHECKPOINT_START(arg1) \ DTRACE_PROBE1 (postgresql, subtrans__checkpoint__start, arg1) /* TRACE_POSTGRESQL_SUBTRANS_CHECKPOINT_DONE ( char ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_SUBTRANS_CHECKPOINT_DONE_ENABLED() __builtin_expect (subtrans__checkpoint__done_semaphore, 0) #define postgresql_subtrans__checkpoint__done_semaphore subtrans__checkpoint__done_semaphore #else #define TRACE_POSTGRESQL_SUBTRANS_CHECKPOINT_DONE_ENABLED() __builtin_expect (postgresql_subtrans__checkpoint__done_semaphore, 0) #endif __extension__ extern unsigned short postgresql_subtrans__checkpoint__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_SUBTRANS_CHECKPOINT_DONE(arg1) \ DTRACE_PROBE1 (postgresql, subtrans__checkpoint__done, arg1) /* TRACE_POSTGRESQL_MULTIXACT_CHECKPOINT_START ( char ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_MULTIXACT_CHECKPOINT_START_ENABLED() __builtin_expect (multixact__checkpoint__start_semaphore, 0) #define postgresql_multixact__checkpoint__start_semaphore multixact__checkpoint__start_semaphore #else #define TRACE_POSTGRESQL_MULTIXACT_CHECKPOINT_START_ENABLED() __builtin_expect (postgresql_multixact__checkpoint__start_semaphore, 0) #endif __extension__ extern unsigned short postgresql_multixact__checkpoint__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_MULTIXACT_CHECKPOINT_START(arg1) \ DTRACE_PROBE1 (postgresql, multixact__checkpoint__start, arg1) /* TRACE_POSTGRESQL_MULTIXACT_CHECKPOINT_DONE ( char ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_MULTIXACT_CHECKPOINT_DONE_ENABLED() __builtin_expect (multixact__checkpoint__done_semaphore, 0) #define postgresql_multixact__checkpoint__done_semaphore multixact__checkpoint__done_semaphore #else #define TRACE_POSTGRESQL_MULTIXACT_CHECKPOINT_DONE_ENABLED() __builtin_expect (postgresql_multixact__checkpoint__done_semaphore, 0) #endif __extension__ extern unsigned short postgresql_multixact__checkpoint__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_MULTIXACT_CHECKPOINT_DONE(arg1) \ DTRACE_PROBE1 (postgresql, multixact__checkpoint__done, arg1) /* TRACE_POSTGRESQL_TWOPHASE_CHECKPOINT_START ( ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_TWOPHASE_CHECKPOINT_START_ENABLED() __builtin_expect (twophase__checkpoint__start_semaphore, 0) #define postgresql_twophase__checkpoint__start_semaphore twophase__checkpoint__start_semaphore #else #define TRACE_POSTGRESQL_TWOPHASE_CHECKPOINT_START_ENABLED() __builtin_expect (postgresql_twophase__checkpoint__start_semaphore, 0) #endif __extension__ extern unsigned short postgresql_twophase__checkpoint__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_TWOPHASE_CHECKPOINT_START() \ DTRACE_PROBE (postgresql, twophase__checkpoint__start) /* TRACE_POSTGRESQL_TWOPHASE_CHECKPOINT_DONE ( ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_TWOPHASE_CHECKPOINT_DONE_ENABLED() __builtin_expect (twophase__checkpoint__done_semaphore, 0) #define postgresql_twophase__checkpoint__done_semaphore twophase__checkpoint__done_semaphore #else #define TRACE_POSTGRESQL_TWOPHASE_CHECKPOINT_DONE_ENABLED() __builtin_expect (postgresql_twophase__checkpoint__done_semaphore, 0) #endif __extension__ extern unsigned short postgresql_twophase__checkpoint__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_TWOPHASE_CHECKPOINT_DONE() \ DTRACE_PROBE (postgresql, twophase__checkpoint__done) /* TRACE_POSTGRESQL_SMGR_MD_READ_START ( int, unsigned int, unsigned int, unsigned int, unsigned int, int ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_SMGR_MD_READ_START_ENABLED() __builtin_expect (smgr__md__read__start_semaphore, 0) #define postgresql_smgr__md__read__start_semaphore smgr__md__read__start_semaphore #else #define TRACE_POSTGRESQL_SMGR_MD_READ_START_ENABLED() __builtin_expect (postgresql_smgr__md__read__start_semaphore, 0) #endif __extension__ extern unsigned short postgresql_smgr__md__read__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_SMGR_MD_READ_START(arg1, arg2, arg3, arg4, arg5, arg6) \ DTRACE_PROBE6 (postgresql, smgr__md__read__start, arg1, arg2, arg3, arg4, arg5, arg6) /* TRACE_POSTGRESQL_SMGR_MD_READ_DONE ( int, unsigned int, unsigned int, unsigned int, unsigned int, int, int, int ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_SMGR_MD_READ_DONE_ENABLED() __builtin_expect (smgr__md__read__done_semaphore, 0) #define postgresql_smgr__md__read__done_semaphore smgr__md__read__done_semaphore #else #define TRACE_POSTGRESQL_SMGR_MD_READ_DONE_ENABLED() __builtin_expect (postgresql_smgr__md__read__done_semaphore, 0) #endif __extension__ extern unsigned short postgresql_smgr__md__read__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_SMGR_MD_READ_DONE(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \ DTRACE_PROBE8 (postgresql, smgr__md__read__done, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) /* TRACE_POSTGRESQL_SMGR_MD_WRITE_START ( int, unsigned int, unsigned int, unsigned int, unsigned int, int ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_SMGR_MD_WRITE_START_ENABLED() __builtin_expect (smgr__md__write__start_semaphore, 0) #define postgresql_smgr__md__write__start_semaphore smgr__md__write__start_semaphore #else #define TRACE_POSTGRESQL_SMGR_MD_WRITE_START_ENABLED() __builtin_expect (postgresql_smgr__md__write__start_semaphore, 0) #endif __extension__ extern unsigned short postgresql_smgr__md__write__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_SMGR_MD_WRITE_START(arg1, arg2, arg3, arg4, arg5, arg6) \ DTRACE_PROBE6 (postgresql, smgr__md__write__start, arg1, arg2, arg3, arg4, arg5, arg6) /* TRACE_POSTGRESQL_SMGR_MD_WRITE_DONE ( int, unsigned int, unsigned int, unsigned int, unsigned int, int, int, int ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_SMGR_MD_WRITE_DONE_ENABLED() __builtin_expect (smgr__md__write__done_semaphore, 0) #define postgresql_smgr__md__write__done_semaphore smgr__md__write__done_semaphore #else #define TRACE_POSTGRESQL_SMGR_MD_WRITE_DONE_ENABLED() __builtin_expect (postgresql_smgr__md__write__done_semaphore, 0) #endif __extension__ extern unsigned short postgresql_smgr__md__write__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_SMGR_MD_WRITE_DONE(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \ DTRACE_PROBE8 (postgresql, smgr__md__write__done, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) /* TRACE_POSTGRESQL_XLOG_INSERT ( unsigned char, unsigned char ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_XLOG_INSERT_ENABLED() __builtin_expect (xlog__insert_semaphore, 0) #define postgresql_xlog__insert_semaphore xlog__insert_semaphore #else #define TRACE_POSTGRESQL_XLOG_INSERT_ENABLED() __builtin_expect (postgresql_xlog__insert_semaphore, 0) #endif __extension__ extern unsigned short postgresql_xlog__insert_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_XLOG_INSERT(arg1, arg2) \ DTRACE_PROBE2 (postgresql, xlog__insert, arg1, arg2) /* TRACE_POSTGRESQL_XLOG_SWITCH ( ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_XLOG_SWITCH_ENABLED() __builtin_expect (xlog__switch_semaphore, 0) #define postgresql_xlog__switch_semaphore xlog__switch_semaphore #else #define TRACE_POSTGRESQL_XLOG_SWITCH_ENABLED() __builtin_expect (postgresql_xlog__switch_semaphore, 0) #endif __extension__ extern unsigned short postgresql_xlog__switch_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_XLOG_SWITCH() \ DTRACE_PROBE (postgresql, xlog__switch) /* TRACE_POSTGRESQL_WAL_BUFFER_WRITE_DIRTY_START ( ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_WAL_BUFFER_WRITE_DIRTY_START_ENABLED() __builtin_expect (wal__buffer__write__dirty__start_semaphore, 0) #define postgresql_wal__buffer__write__dirty__start_semaphore wal__buffer__write__dirty__start_semaphore #else #define TRACE_POSTGRESQL_WAL_BUFFER_WRITE_DIRTY_START_ENABLED() __builtin_expect (postgresql_wal__buffer__write__dirty__start_semaphore, 0) #endif __extension__ extern unsigned short postgresql_wal__buffer__write__dirty__start_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_WAL_BUFFER_WRITE_DIRTY_START() \ DTRACE_PROBE (postgresql, wal__buffer__write__dirty__start) /* TRACE_POSTGRESQL_WAL_BUFFER_WRITE_DIRTY_DONE ( ) */ #if defined STAP_SDT_V1 #define TRACE_POSTGRESQL_WAL_BUFFER_WRITE_DIRTY_DONE_ENABLED() __builtin_expect (wal__buffer__write__dirty__done_semaphore, 0) #define postgresql_wal__buffer__write__dirty__done_semaphore wal__buffer__write__dirty__done_semaphore #else #define TRACE_POSTGRESQL_WAL_BUFFER_WRITE_DIRTY_DONE_ENABLED() __builtin_expect (postgresql_wal__buffer__write__dirty__done_semaphore, 0) #endif __extension__ extern unsigned short postgresql_wal__buffer__write__dirty__done_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))); #define TRACE_POSTGRESQL_WAL_BUFFER_WRITE_DIRTY_DONE() \ DTRACE_PROBE (postgresql, wal__buffer__write__dirty__done) PKBiZ=^ ^ server/utils/pg_locale.hnu[/*----------------------------------------------------------------------- * * PostgreSQL locale utilities * * src/include/utils/pg_locale.h * * Copyright (c) 2002-2012, PostgreSQL Global Development Group * *----------------------------------------------------------------------- */ #ifndef _PG_LOCALE_ #define _PG_LOCALE_ #include #if defined(LOCALE_T_IN_XLOCALE) || defined(WCSTOMBS_L_IN_XLOCALE) #include #endif #include "utils/guc.h" /* GUC settings */ extern char *locale_messages; extern char *locale_monetary; extern char *locale_numeric; extern char *locale_time; /* lc_time localization cache */ extern char *localized_abbrev_days[]; extern char *localized_full_days[]; extern char *localized_abbrev_months[]; extern char *localized_full_months[]; extern bool check_locale_messages(char **newval, void **extra, GucSource source); extern void assign_locale_messages(const char *newval, void *extra); extern bool check_locale_monetary(char **newval, void **extra, GucSource source); extern void assign_locale_monetary(const char *newval, void *extra); extern bool check_locale_numeric(char **newval, void **extra, GucSource source); extern void assign_locale_numeric(const char *newval, void *extra); extern bool check_locale_time(char **newval, void **extra, GucSource source); extern void assign_locale_time(const char *newval, void *extra); extern bool check_locale(int category, const char *locale, char **canonname); extern char *pg_perm_setlocale(int category, const char *locale); extern bool lc_collate_is_c(Oid collation); extern bool lc_ctype_is_c(Oid collation); /* * Return the POSIX lconv struct (contains number/money formatting * information) with locale information for all categories. */ extern struct lconv *PGLC_localeconv(void); extern void cache_locale_time(void); /* * We define our own wrapper around locale_t so we can keep the same * function signatures for all builds, while not having to create a * fake version of the standard type locale_t in the global namespace. * The fake version of pg_locale_t can be checked for truth; that's * about all it will be needed for. */ #ifdef HAVE_LOCALE_T typedef locale_t pg_locale_t; #else typedef int pg_locale_t; #endif extern pg_locale_t pg_newlocale_from_collation(Oid collid); /* These functions convert from/to libc's wchar_t, *not* pg_wchar_t */ #ifdef USE_WIDE_UPPER_LOWER extern size_t wchar2char(char *to, const wchar_t *from, size_t tolen, pg_locale_t locale); extern size_t char2wchar(wchar_t *to, size_t tolen, const char *from, size_t fromlen, pg_locale_t locale); #endif #endif /* _PG_LOCALE_ */ PKBiZ)P,,server/utils/spccache.hnu[/*------------------------------------------------------------------------- * * spccache.h * Tablespace cache. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/spccache.h * *------------------------------------------------------------------------- */ #ifndef SPCCACHE_H #define SPCCACHE_H void get_tablespace_page_costs(Oid spcid, float8 *spc_random_page_cost, float8 *spc_seq_page_cost); #endif /* SPCCACHE_H */ PKBiZ&server/utils/hsearch.hnu[/*------------------------------------------------------------------------- * * hsearch.h * exported definitions for utils/hash/dynahash.c; see notes therein * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/hsearch.h * *------------------------------------------------------------------------- */ #ifndef HSEARCH_H #define HSEARCH_H /* * Hash functions must have this signature. */ typedef uint32 (*HashValueFunc) (const void *key, Size keysize); /* * Key comparison functions must have this signature. Comparison functions * return zero for match, nonzero for no match. (The comparison function * definition is designed to allow memcmp() and strncmp() to be used directly * as key comparison functions.) */ typedef int (*HashCompareFunc) (const void *key1, const void *key2, Size keysize); /* * Key copying functions must have this signature. The return value is not * used. (The definition is set up to allow memcpy() and strncpy() to be * used directly.) */ typedef void *(*HashCopyFunc) (void *dest, const void *src, Size keysize); /* * Space allocation function for a hashtable --- designed to match malloc(). * Note: there is no free function API; can't destroy a hashtable unless you * use the default allocator. */ typedef void *(*HashAllocFunc) (Size request); /* * HASHELEMENT is the private part of a hashtable entry. The caller's data * follows the HASHELEMENT structure (on a MAXALIGN'd boundary). The hash key * is expected to be at the start of the caller's hash entry data structure. */ typedef struct HASHELEMENT { struct HASHELEMENT *link; /* link to next entry in same bucket */ uint32 hashvalue; /* hash function result for this entry */ } HASHELEMENT; /* Hash table header struct is an opaque type known only within dynahash.c */ typedef struct HASHHDR HASHHDR; /* Hash table control struct is an opaque type known only within dynahash.c */ typedef struct HTAB HTAB; /* Parameter data structure for hash_create */ /* Only those fields indicated by hash_flags need be set */ typedef struct HASHCTL { long num_partitions; /* # partitions (must be power of 2) */ long ssize; /* segment size */ long dsize; /* (initial) directory size */ long max_dsize; /* limit to dsize if dir size is limited */ long ffactor; /* fill factor */ Size keysize; /* hash key length in bytes */ Size entrysize; /* total user element size in bytes */ HashValueFunc hash; /* hash function */ HashCompareFunc match; /* key comparison function */ HashCopyFunc keycopy; /* key copying function */ HashAllocFunc alloc; /* memory allocator */ MemoryContext hcxt; /* memory context to use for allocations */ HASHHDR *hctl; /* location of header in shared mem */ } HASHCTL; /* Flags to indicate which parameters are supplied */ #define HASH_PARTITION 0x001 /* Hashtable is used w/partitioned locking */ #define HASH_SEGMENT 0x002 /* Set segment size */ #define HASH_DIRSIZE 0x004 /* Set directory size (initial and max) */ #define HASH_FFACTOR 0x008 /* Set fill factor */ #define HASH_FUNCTION 0x010 /* Set user defined hash function */ #define HASH_ELEM 0x020 /* Set keysize and entrysize */ #define HASH_SHARED_MEM 0x040 /* Hashtable is in shared memory */ #define HASH_ATTACH 0x080 /* Do not initialize hctl */ #define HASH_ALLOC 0x100 /* Set memory allocator */ #define HASH_CONTEXT 0x200 /* Set memory allocation context */ #define HASH_COMPARE 0x400 /* Set user defined comparison function */ #define HASH_KEYCOPY 0x800 /* Set user defined key-copying function */ #define HASH_FIXED_SIZE 0x1000 /* Initial size is a hard limit */ /* max_dsize value to indicate expansible directory */ #define NO_MAX_DSIZE (-1) /* hash_search operations */ typedef enum { HASH_FIND, HASH_ENTER, HASH_REMOVE, HASH_ENTER_NULL } HASHACTION; /* hash_seq status (should be considered an opaque type by callers) */ typedef struct { HTAB *hashp; uint32 curBucket; /* index of current bucket */ HASHELEMENT *curEntry; /* current entry in bucket */ } HASH_SEQ_STATUS; /* * prototypes for functions in dynahash.c */ extern HTAB *hash_create(const char *tabname, long nelem, HASHCTL *info, int flags); extern void hash_destroy(HTAB *hashp); extern void hash_stats(const char *where, HTAB *hashp); extern void *hash_search(HTAB *hashp, const void *keyPtr, HASHACTION action, bool *foundPtr); extern uint32 get_hash_value(HTAB *hashp, const void *keyPtr); extern void *hash_search_with_hash_value(HTAB *hashp, const void *keyPtr, uint32 hashvalue, HASHACTION action, bool *foundPtr); extern long hash_get_num_entries(HTAB *hashp); extern void hash_seq_init(HASH_SEQ_STATUS *status, HTAB *hashp); extern void *hash_seq_search(HASH_SEQ_STATUS *status); extern void hash_seq_term(HASH_SEQ_STATUS *status); extern void hash_freeze(HTAB *hashp); extern Size hash_estimate_size(long num_entries, Size entrysize); extern long hash_select_dirsize(long num_entries); extern Size hash_get_shared_size(HASHCTL *info, int flags); extern void AtEOXact_HashTables(bool isCommit); extern void AtEOSubXact_HashTables(bool isCommit, int nestDepth); /* * prototypes for functions in hashfn.c */ extern uint32 string_hash(const void *key, Size keysize); extern uint32 tag_hash(const void *key, Size keysize); extern uint32 oid_hash(const void *key, Size keysize); extern uint32 bitmap_hash(const void *key, Size keysize); extern int bitmap_match(const void *key1, const void *key2, Size keysize); #endif /* HSEARCH_H */ PKBiZD6] ] server/utils/snapshot.hnu[/*------------------------------------------------------------------------- * * snapshot.h * POSTGRES snapshot definition * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/snapshot.h * *------------------------------------------------------------------------- */ #ifndef SNAPSHOT_H #define SNAPSHOT_H #include "access/htup.h" #include "storage/buf.h" typedef struct SnapshotData *Snapshot; #define InvalidSnapshot ((Snapshot) NULL) /* * We use SnapshotData structures to represent both "regular" (MVCC) * snapshots and "special" snapshots that have non-MVCC semantics. * The specific semantics of a snapshot are encoded by the "satisfies" * function. */ typedef bool (*SnapshotSatisfiesFunc) (HeapTupleHeader tuple, Snapshot snapshot, Buffer buffer); typedef struct SnapshotData { SnapshotSatisfiesFunc satisfies; /* tuple test function */ /* * The remaining fields are used only for MVCC snapshots, and are normally * just zeroes in special snapshots. (But xmin and xmax are used * specially by HeapTupleSatisfiesDirty.) * * An MVCC snapshot can never see the effects of XIDs >= xmax. It can see * the effects of all older XIDs except those listed in the snapshot. xmin * is stored as an optimization to avoid needing to search the XID arrays * for most tuples. */ TransactionId xmin; /* all XID < xmin are visible to me */ TransactionId xmax; /* all XID >= xmax are invisible to me */ TransactionId *xip; /* array of xact IDs in progress */ uint32 xcnt; /* # of xact ids in xip[] */ /* note: all ids in xip[] satisfy xmin <= xip[i] < xmax */ int32 subxcnt; /* # of xact ids in subxip[] */ TransactionId *subxip; /* array of subxact IDs in progress */ bool suboverflowed; /* has the subxip array overflowed? */ bool takenDuringRecovery; /* recovery-shaped snapshot? */ bool copied; /* false if it's a static snapshot */ /* * note: all ids in subxip[] are >= xmin, but we don't bother filtering * out any that are >= xmax */ CommandId curcid; /* in my xact, CID < curcid are visible */ uint32 active_count; /* refcount on ActiveSnapshot stack */ uint32 regd_count; /* refcount on RegisteredSnapshotList */ } SnapshotData; /* * Result codes for HeapTupleSatisfiesUpdate. This should really be in * tqual.h, but we want to avoid including that file elsewhere. */ typedef enum { HeapTupleMayBeUpdated, HeapTupleInvisible, HeapTupleSelfUpdated, HeapTupleUpdated, HeapTupleBeingUpdated } HTSU_Result; #endif /* SNAPSHOT_H */ PKBiZ8z$server/pg_config.hnu[/* * Kluge to support multilib installation of both 32- and 64-bit RPMS: * we need to arrange that header files that appear in both RPMs are * identical. Hence, this file is architecture-independent and calls * in an arch-dependent file that will appear in just one RPM. * * To avoid breaking arches not explicitly supported by Red Hat, we * use this indirection file *only* on known multilib arches. * * Note: this may well fail if user tries to use gcc's -I- option. * But that option is deprecated anyway. */ #if defined(__x86_64__) #include "pg_config_x86_64.h" #elif defined(__i386__) #include "pg_config_i386.h" #elif defined(__ppc64__) || defined(__powerpc64__) #include "pg_config_ppc64.h" #elif defined(__ppc__) || defined(__powerpc__) #include "pg_config_ppc.h" #elif defined(__s390x__) #include "pg_config_s390x.h" #elif defined(__s390__) #include "pg_config_s390.h" #elif defined(__sparc__) && defined(__arch64__) #include "pg_config_sparc64.h" #elif defined(__sparc__) #include "pg_config_sparc.h" #endif PKBiZ} server/datatype/timestamp.hnu[/*------------------------------------------------------------------------- * * timestamp.h * Timestamp and Interval typedefs and related macros. * * Note: this file must be includable in both frontend and backend contexts. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/datatype/timestamp.h * *------------------------------------------------------------------------- */ #ifndef DATATYPE_TIMESTAMP_H #define DATATYPE_TIMESTAMP_H #include #include #include /* * Timestamp represents absolute time. * * Interval represents delta time. Keep track of months (and years), days, * and hours/minutes/seconds separately since the elapsed time spanned is * unknown until instantiated relative to an absolute time. * * Note that Postgres uses "time interval" to mean a bounded interval, * consisting of a beginning and ending time, not a time span - thomas 97/03/20 * * We have two implementations, one that uses int64 values with units of * microseconds, and one that uses double values with units of seconds. * * TimeOffset and fsec_t are convenience typedefs for temporary variables * that are of different types in the two cases. Do not use fsec_t in values * stored on-disk, since it is not the same size in both implementations. * Also, fsec_t is only meant for *fractional* seconds; beware of overflow * if the value you need to store could be many seconds. */ #ifdef HAVE_INT64_TIMESTAMP typedef int64 Timestamp; typedef int64 TimestampTz; typedef int64 TimeOffset; typedef int32 fsec_t; /* fractional seconds (in microseconds) */ #else typedef double Timestamp; typedef double TimestampTz; typedef double TimeOffset; typedef double fsec_t; /* fractional seconds (in seconds) */ #endif typedef struct { TimeOffset time; /* all time units other than days, months and * years */ int32 day; /* days, after time for alignment */ int32 month; /* months and years, after time for alignment */ } Interval; #define MAX_TIMESTAMP_PRECISION 6 #define MAX_INTERVAL_PRECISION 6 /* * Round off to MAX_TIMESTAMP_PRECISION decimal places. * Note: this is also used for rounding off intervals. */ #define TS_PREC_INV 1000000.0 #define TSROUND(j) (rint(((double) (j)) * TS_PREC_INV) / TS_PREC_INV) /* * Assorted constants for datetime-related calculations */ #define DAYS_PER_YEAR 365.25 /* assumes leap year every four years */ #define MONTHS_PER_YEAR 12 /* * DAYS_PER_MONTH is very imprecise. The more accurate value is * 365.2425/12 = 30.436875, or '30 days 10:29:06'. Right now we only * return an integral number of days, but someday perhaps we should * also return a 'time' value to be used as well. ISO 8601 suggests * 30 days. */ #define DAYS_PER_MONTH 30 /* assumes exactly 30 days per month */ #define HOURS_PER_DAY 24 /* assume no daylight savings time changes */ /* * This doesn't adjust for uneven daylight savings time intervals or leap * seconds, and it crudely estimates leap years. A more accurate value * for days per years is 365.2422. */ #define SECS_PER_YEAR (36525 * 864) /* avoid floating-point computation */ #define SECS_PER_DAY 86400 #define SECS_PER_HOUR 3600 #define SECS_PER_MINUTE 60 #define MINS_PER_HOUR 60 #define USECS_PER_DAY INT64CONST(86400000000) #define USECS_PER_HOUR INT64CONST(3600000000) #define USECS_PER_MINUTE INT64CONST(60000000) #define USECS_PER_SEC INT64CONST(1000000) /* * We allow numeric timezone offsets up to 15:59:59 either way from Greenwich. * Currently, the record holders for wackiest offsets in actual use are zones * Asia/Manila, at -15:56:00 until 1844, and America/Metlakatla, at +15:13:42 * until 1867. If we were to reject such values we would fail to dump and * restore old timestamptz values with these zone settings. */ #define MAX_TZDISP_HOUR 15 /* maximum allowed hour part */ #define TZDISP_LIMIT ((MAX_TZDISP_HOUR + 1) * SECS_PER_HOUR) /* * DT_NOBEGIN represents timestamp -infinity; DT_NOEND represents +infinity */ #ifdef HAVE_INT64_TIMESTAMP #define DT_NOBEGIN (-INT64CONST(0x7fffffffffffffff) - 1) #define DT_NOEND (INT64CONST(0x7fffffffffffffff)) #else /* !HAVE_INT64_TIMESTAMP */ #ifdef HUGE_VAL #define DT_NOBEGIN (-HUGE_VAL) #define DT_NOEND (HUGE_VAL) #else #define DT_NOBEGIN (-DBL_MAX) #define DT_NOEND (DBL_MAX) #endif #endif /* HAVE_INT64_TIMESTAMP */ #define TIMESTAMP_NOBEGIN(j) \ do {(j) = DT_NOBEGIN;} while (0) #define TIMESTAMP_IS_NOBEGIN(j) ((j) == DT_NOBEGIN) #define TIMESTAMP_NOEND(j) \ do {(j) = DT_NOEND;} while (0) #define TIMESTAMP_IS_NOEND(j) ((j) == DT_NOEND) #define TIMESTAMP_NOT_FINITE(j) (TIMESTAMP_IS_NOBEGIN(j) || TIMESTAMP_IS_NOEND(j)) /* * Julian date support. * * IS_VALID_JULIAN checks the minimum date exactly, but is a bit sloppy * about the maximum, since it's far enough out to not be especially * interesting. */ #define JULIAN_MINYEAR (-4713) #define JULIAN_MINMONTH (11) #define JULIAN_MINDAY (24) #define JULIAN_MAXYEAR (5874898) #define IS_VALID_JULIAN(y,m,d) \ (((y) > JULIAN_MINYEAR \ || ((y) == JULIAN_MINYEAR && \ ((m) > JULIAN_MINMONTH \ || ((m) == JULIAN_MINMONTH && (d) >= JULIAN_MINDAY)))) \ && (y) < JULIAN_MAXYEAR) #define JULIAN_MAX (2147483494) /* == date2j(JULIAN_MAXYEAR, 1, 1) */ /* Julian-date equivalents of Day 0 in Unix and Postgres reckoning */ #define UNIX_EPOCH_JDATE 2440588 /* == date2j(1970, 1, 1) */ #define POSTGRES_EPOCH_JDATE 2451545 /* == date2j(2000, 1, 1) */ #endif /* DATATYPE_TIMESTAMP_H */ PKBiZxk  server/pgtime.hnu[/*------------------------------------------------------------------------- * * pgtime.h * PostgreSQL internal timezone library * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * * IDENTIFICATION * src/include/pgtime.h * *------------------------------------------------------------------------- */ #ifndef _PGTIME_H #define _PGTIME_H /* * The API of this library is generally similar to the corresponding * C library functions, except that we use pg_time_t which (we hope) is * 64 bits wide, and which is most definitely signed not unsigned. */ typedef int64 pg_time_t; struct pg_tm { int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; /* origin 0, not 1 */ int tm_year; /* relative to 1900 */ int tm_wday; int tm_yday; int tm_isdst; long int tm_gmtoff; const char *tm_zone; }; typedef struct pg_tz pg_tz; typedef struct pg_tzenum pg_tzenum; /* Maximum length of a timezone name (not including trailing null) */ #define TZ_STRLEN_MAX 255 /* these functions are in localtime.c */ extern struct pg_tm *pg_localtime(const pg_time_t *timep, const pg_tz *tz); extern struct pg_tm *pg_gmtime(const pg_time_t *timep); extern int pg_next_dst_boundary(const pg_time_t *timep, long int *before_gmtoff, int *before_isdst, pg_time_t *boundary, long int *after_gmtoff, int *after_isdst, const pg_tz *tz); extern bool pg_interpret_timezone_abbrev(const char *abbrev, const pg_time_t *timep, long int *gmtoff, int *isdst, const pg_tz *tz); extern bool pg_get_timezone_offset(const pg_tz *tz, long int *gmtoff); extern const char *pg_get_timezone_name(pg_tz *tz); extern bool pg_tz_acceptable(pg_tz *tz); /* these functions are in strftime.c */ extern size_t pg_strftime(char *s, size_t max, const char *format, const struct pg_tm * tm); /* these functions and variables are in pgtz.c */ extern pg_tz *session_timezone; extern pg_tz *log_timezone; extern void pg_timezone_initialize(void); extern pg_tz *pg_tzset(const char *tzname); extern pg_tz *pg_tzset_offset(long gmtoffset); extern pg_tzenum *pg_tzenumerate_start(void); extern pg_tz *pg_tzenumerate_next(pg_tzenum *dir); extern void pg_tzenumerate_end(pg_tzenum *dir); #endif /* _PGTIME_H */ PKBiZua$##server/tsearch/ts_type.hnu[/*------------------------------------------------------------------------- * * ts_type.h * Definitions for the tsvector and tsquery types * * Copyright (c) 1998-2012, PostgreSQL Global Development Group * * src/include/tsearch/ts_type.h * *------------------------------------------------------------------------- */ #ifndef _PG_TSTYPE_H_ #define _PG_TSTYPE_H_ #include "fmgr.h" #include "utils/memutils.h" #include "utils/pg_crc.h" /* * TSVector type. * * Structure of tsvector datatype: * 1) standard varlena header * 2) int4 size - number of lexemes (WordEntry array entries) * 3) Array of WordEntry - one per lexeme; must be sorted according to * tsCompareString() (ie, memcmp of lexeme strings). * WordEntry->pos gives the number of bytes from end of WordEntry * array to start of lexeme's string, which is of length len. * 4) Per-lexeme data storage: * lexeme string (not null-terminated) * if haspos is true: * padding byte if necessary to make the position data 2-byte aligned * uint16 number of positions that follow * WordEntryPos[] positions * * The positions for each lexeme must be sorted. * * Note, tsvectorsend/recv believe that sizeof(WordEntry) == 4 */ typedef struct { uint32 haspos:1, len:11, /* MAX 2Kb */ pos:20; /* MAX 1Mb */ } WordEntry; #define MAXSTRLEN ( (1<<11) - 1) #define MAXSTRPOS ( (1<<20) - 1) /* * Equivalent to * typedef struct { * uint16 * weight:2, * pos:14; * } */ typedef uint16 WordEntryPos; typedef struct { uint16 npos; WordEntryPos pos[1]; /* variable length */ } WordEntryPosVector; #define WEP_GETWEIGHT(x) ( (x) >> 14 ) #define WEP_GETPOS(x) ( (x) & 0x3fff ) #define WEP_SETWEIGHT(x,v) ( (x) = ( (v) << 14 ) | ( (x) & 0x3fff ) ) #define WEP_SETPOS(x,v) ( (x) = ( (x) & 0xc000 ) | ( (v) & 0x3fff ) ) #define MAXENTRYPOS (1<<14) #define MAXNUMPOS (256) #define LIMITPOS(x) ( ( (x) >= MAXENTRYPOS ) ? (MAXENTRYPOS-1) : (x) ) /* This struct represents a complete tsvector datum */ typedef struct { int32 vl_len_; /* varlena header (do not touch directly!) */ int32 size; WordEntry entries[1]; /* variable length */ /* lexemes follow the entries[] array */ } TSVectorData; typedef TSVectorData *TSVector; #define DATAHDRSIZE (offsetof(TSVectorData, entries)) #define CALCDATASIZE(nentries, lenstr) (DATAHDRSIZE + (nentries) * sizeof(WordEntry) + (lenstr) ) /* pointer to start of a tsvector's WordEntry array */ #define ARRPTR(x) ( (x)->entries ) /* pointer to start of a tsvector's lexeme storage */ #define STRPTR(x) ( (char *) &(x)->entries[(x)->size] ) #define _POSVECPTR(x, e) ((WordEntryPosVector *)(STRPTR(x) + SHORTALIGN((e)->pos + (e)->len))) #define POSDATALEN(x,e) ( ( (e)->haspos ) ? (_POSVECPTR(x,e)->npos) : 0 ) #define POSDATAPTR(x,e) (_POSVECPTR(x,e)->pos) /* * fmgr interface macros */ #define DatumGetTSVector(X) ((TSVector) PG_DETOAST_DATUM(X)) #define DatumGetTSVectorCopy(X) ((TSVector) PG_DETOAST_DATUM_COPY(X)) #define TSVectorGetDatum(X) PointerGetDatum(X) #define PG_GETARG_TSVECTOR(n) DatumGetTSVector(PG_GETARG_DATUM(n)) #define PG_GETARG_TSVECTOR_COPY(n) DatumGetTSVectorCopy(PG_GETARG_DATUM(n)) #define PG_RETURN_TSVECTOR(x) return TSVectorGetDatum(x) /* * I/O */ extern Datum tsvectorin(PG_FUNCTION_ARGS); extern Datum tsvectorout(PG_FUNCTION_ARGS); extern Datum tsvectorsend(PG_FUNCTION_ARGS); extern Datum tsvectorrecv(PG_FUNCTION_ARGS); /* * operations with tsvector */ extern Datum tsvector_lt(PG_FUNCTION_ARGS); extern Datum tsvector_le(PG_FUNCTION_ARGS); extern Datum tsvector_eq(PG_FUNCTION_ARGS); extern Datum tsvector_ne(PG_FUNCTION_ARGS); extern Datum tsvector_ge(PG_FUNCTION_ARGS); extern Datum tsvector_gt(PG_FUNCTION_ARGS); extern Datum tsvector_cmp(PG_FUNCTION_ARGS); extern Datum tsvector_length(PG_FUNCTION_ARGS); extern Datum tsvector_strip(PG_FUNCTION_ARGS); extern Datum tsvector_setweight(PG_FUNCTION_ARGS); extern Datum tsvector_concat(PG_FUNCTION_ARGS); extern Datum tsvector_update_trigger_byid(PG_FUNCTION_ARGS); extern Datum tsvector_update_trigger_bycolumn(PG_FUNCTION_ARGS); extern Datum ts_match_vq(PG_FUNCTION_ARGS); extern Datum ts_match_qv(PG_FUNCTION_ARGS); extern Datum ts_match_tt(PG_FUNCTION_ARGS); extern Datum ts_match_tq(PG_FUNCTION_ARGS); extern Datum ts_stat1(PG_FUNCTION_ARGS); extern Datum ts_stat2(PG_FUNCTION_ARGS); extern Datum ts_rank_tt(PG_FUNCTION_ARGS); extern Datum ts_rank_wtt(PG_FUNCTION_ARGS); extern Datum ts_rank_ttf(PG_FUNCTION_ARGS); extern Datum ts_rank_wttf(PG_FUNCTION_ARGS); extern Datum ts_rankcd_tt(PG_FUNCTION_ARGS); extern Datum ts_rankcd_wtt(PG_FUNCTION_ARGS); extern Datum ts_rankcd_ttf(PG_FUNCTION_ARGS); extern Datum ts_rankcd_wttf(PG_FUNCTION_ARGS); extern Datum tsmatchsel(PG_FUNCTION_ARGS); extern Datum tsmatchjoinsel(PG_FUNCTION_ARGS); extern Datum ts_typanalyze(PG_FUNCTION_ARGS); /* * TSQuery * * */ typedef int8 QueryItemType; /* Valid values for QueryItemType: */ #define QI_VAL 1 #define QI_OPR 2 #define QI_VALSTOP 3 /* This is only used in an intermediate stack * representation in parse_tsquery. It's not a * legal type elsewhere. */ /* * QueryItem is one node in tsquery - operator or operand. */ typedef struct { QueryItemType type; /* operand or kind of operator (ts_tokentype) */ uint8 weight; /* weights of operand to search. It's a * bitmask of allowed weights. if it =0 then * any weight are allowed. Weights and bit * map: A: 1<<3 B: 1<<2 C: 1<<1 D: 1<<0 */ bool prefix; /* true if it's a prefix search */ int32 valcrc; /* XXX: pg_crc32 would be a more appropriate * data type, but we use comparisons to signed * integers in the code. They would need to be * changed as well. */ /* pointer to text value of operand, must correlate with WordEntry */ uint32 length:12, distance:20; } QueryOperand; /* Legal values for QueryOperator.operator */ #define OP_NOT 1 #define OP_AND 2 #define OP_OR 3 typedef struct { QueryItemType type; int8 oper; /* see above */ uint32 left; /* pointer to left operand. Right operand is * item + 1, left operand is placed * item+item->left */ } QueryOperator; /* * Note: TSQuery is 4-bytes aligned, so make sure there's no fields * inside QueryItem requiring 8-byte alignment, like int64. */ typedef union { QueryItemType type; QueryOperator qoperator; QueryOperand qoperand; } QueryItem; /* * Storage: * (len)(size)(array of QueryItem)(operands as '\0'-terminated c-strings) */ typedef struct { int32 vl_len_; /* varlena header (do not touch directly!) */ int4 size; /* number of QueryItems */ char data[1]; /* data starts here */ } TSQueryData; typedef TSQueryData *TSQuery; #define HDRSIZETQ ( VARHDRSZ + sizeof(int4) ) /* Computes the size of header and all QueryItems. size is the number of * QueryItems, and lenofoperand is the total length of all operands */ #define COMPUTESIZE(size, lenofoperand) ( HDRSIZETQ + (size) * sizeof(QueryItem) + (lenofoperand) ) #define TSQUERY_TOO_BIG(size, lenofoperand) \ ((size) > (MaxAllocSize - HDRSIZETQ - (lenofoperand)) / sizeof(QueryItem)) /* Returns a pointer to the first QueryItem in a TSQuery */ #define GETQUERY(x) ((QueryItem*)( (char*)(x)+HDRSIZETQ )) /* Returns a pointer to the beginning of operands in a TSQuery */ #define GETOPERAND(x) ( (char*)GETQUERY(x) + ((TSQuery)(x))->size * sizeof(QueryItem) ) /* * fmgr interface macros * Note, TSQuery type marked as plain storage, so it can't be toasted * but PG_DETOAST_DATUM_COPY is used for simplicity */ #define DatumGetTSQuery(X) ((TSQuery) DatumGetPointer(X)) #define DatumGetTSQueryCopy(X) ((TSQuery) PG_DETOAST_DATUM_COPY(X)) #define TSQueryGetDatum(X) PointerGetDatum(X) #define PG_GETARG_TSQUERY(n) DatumGetTSQuery(PG_GETARG_DATUM(n)) #define PG_GETARG_TSQUERY_COPY(n) DatumGetTSQueryCopy(PG_GETARG_DATUM(n)) #define PG_RETURN_TSQUERY(x) return TSQueryGetDatum(x) /* * I/O */ extern Datum tsqueryin(PG_FUNCTION_ARGS); extern Datum tsqueryout(PG_FUNCTION_ARGS); extern Datum tsquerysend(PG_FUNCTION_ARGS); extern Datum tsqueryrecv(PG_FUNCTION_ARGS); /* * operations with tsquery */ extern Datum tsquery_lt(PG_FUNCTION_ARGS); extern Datum tsquery_le(PG_FUNCTION_ARGS); extern Datum tsquery_eq(PG_FUNCTION_ARGS); extern Datum tsquery_ne(PG_FUNCTION_ARGS); extern Datum tsquery_ge(PG_FUNCTION_ARGS); extern Datum tsquery_gt(PG_FUNCTION_ARGS); extern Datum tsquery_cmp(PG_FUNCTION_ARGS); extern Datum tsquerytree(PG_FUNCTION_ARGS); extern Datum tsquery_numnode(PG_FUNCTION_ARGS); extern Datum tsquery_and(PG_FUNCTION_ARGS); extern Datum tsquery_or(PG_FUNCTION_ARGS); extern Datum tsquery_not(PG_FUNCTION_ARGS); extern Datum tsquery_rewrite(PG_FUNCTION_ARGS); extern Datum tsquery_rewrite_query(PG_FUNCTION_ARGS); extern Datum tsq_mcontains(PG_FUNCTION_ARGS); extern Datum tsq_mcontained(PG_FUNCTION_ARGS); #endif /* _PG_TSTYPE_H_ */ PKBiZVx *server/tsearch/ts_locale.hnu[/*------------------------------------------------------------------------- * * ts_locale.h * locale compatibility layer for tsearch * * Copyright (c) 1998-2012, PostgreSQL Global Development Group * * src/include/tsearch/ts_locale.h * *------------------------------------------------------------------------- */ #ifndef __TSLOCALE_H__ #define __TSLOCALE_H__ #include #include #include "utils/pg_locale.h" #include "mb/pg_wchar.h" /* * towlower() and friends should be in , but some pre-C99 systems * declare them in . */ #ifdef HAVE_WCHAR_H #include #endif #ifdef HAVE_WCTYPE_H #include #endif /* working state for tsearch_readline (should be a local var in caller) */ typedef struct { FILE *fp; const char *filename; int lineno; char *curline; ErrorContextCallback cb; } tsearch_readline_state; #define TOUCHAR(x) (*((const unsigned char *) (x))) #ifdef USE_WIDE_UPPER_LOWER extern int t_isdigit(const char *ptr); extern int t_isspace(const char *ptr); extern int t_isalpha(const char *ptr); extern int t_isprint(const char *ptr); /* The second argument of t_iseq() must be a plain ASCII character */ #define t_iseq(x,c) (TOUCHAR(x) == (unsigned char) (c)) #define COPYCHAR(d,s) memcpy(d, s, pg_mblen(s)) #else /* not USE_WIDE_UPPER_LOWER */ #define t_isdigit(x) isdigit(TOUCHAR(x)) #define t_isspace(x) isspace(TOUCHAR(x)) #define t_isalpha(x) isalpha(TOUCHAR(x)) #define t_isprint(x) isprint(TOUCHAR(x)) #define t_iseq(x,c) (TOUCHAR(x) == (unsigned char) (c)) #define COPYCHAR(d,s) (*((unsigned char *) (d)) = TOUCHAR(s)) #endif /* USE_WIDE_UPPER_LOWER */ extern char *lowerstr(const char *str); extern char *lowerstr_with_len(const char *str, int len); extern bool tsearch_readline_begin(tsearch_readline_state *stp, const char *filename); extern char *tsearch_readline(tsearch_readline_state *stp); extern void tsearch_readline_end(tsearch_readline_state *stp); extern char *t_readline(FILE *fp); #endif /* __TSLOCALE_H__ */ PKBiZa0;==server/tsearch/ts_cache.hnu[/*------------------------------------------------------------------------- * * ts_cache.h * Tsearch related object caches. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/tsearch/ts_cache.h * *------------------------------------------------------------------------- */ #ifndef TS_CACHE_H #define TS_CACHE_H #include "utils/guc.h" /* * All TS*CacheEntry structs must share this common header * (see InvalidateTSCacheCallBack) */ typedef struct TSAnyCacheEntry { Oid objId; bool isvalid; } TSAnyCacheEntry; typedef struct TSParserCacheEntry { /* prsId is the hash lookup key and MUST BE FIRST */ Oid prsId; /* OID of the parser */ bool isvalid; Oid startOid; Oid tokenOid; Oid endOid; Oid headlineOid; Oid lextypeOid; /* * Pre-set-up fmgr call of most needed parser's methods */ FmgrInfo prsstart; FmgrInfo prstoken; FmgrInfo prsend; FmgrInfo prsheadline; } TSParserCacheEntry; typedef struct TSDictionaryCacheEntry { /* dictId is the hash lookup key and MUST BE FIRST */ Oid dictId; bool isvalid; /* most frequent fmgr call */ Oid lexizeOid; FmgrInfo lexize; MemoryContext dictCtx; /* memory context to store private data */ void *dictData; } TSDictionaryCacheEntry; typedef struct { int len; Oid *dictIds; } ListDictionary; typedef struct { /* cfgId is the hash lookup key and MUST BE FIRST */ Oid cfgId; bool isvalid; Oid prsId; int lenmap; ListDictionary *map; } TSConfigCacheEntry; /* * GUC variable for current configuration */ extern char *TSCurrentConfig; extern TSParserCacheEntry *lookup_ts_parser_cache(Oid prsId); extern TSDictionaryCacheEntry *lookup_ts_dictionary_cache(Oid dictId); extern TSConfigCacheEntry *lookup_ts_config_cache(Oid cfgId); extern Oid getTSCurrentConfig(bool emitError); extern bool check_TSCurrentConfig(char **newval, void **extra, GucSource source); extern void assign_TSCurrentConfig(const char *newval, void *extra); #endif /* TS_CACHE_H */ PKBiZ server/tsearch/ts_public.hnu[/*------------------------------------------------------------------------- * * ts_public.h * Public interface to various tsearch modules, such as * parsers and dictionaries. * * Copyright (c) 1998-2012, PostgreSQL Global Development Group * * src/include/tsearch/ts_public.h * *------------------------------------------------------------------------- */ #ifndef _PG_TS_PUBLIC_H_ #define _PG_TS_PUBLIC_H_ #include "tsearch/ts_type.h" /* * Parser's framework */ /* * returning type for prslextype method of parser */ typedef struct { int lexid; char *alias; char *descr; } LexDescr; /* * Interface to headline generator */ typedef struct { uint32 selected:1, in:1, replace:1, repeated:1, skip:1, unused:3, type:8, len:16; char *word; QueryOperand *item; } HeadlineWordEntry; typedef struct { HeadlineWordEntry *words; int4 lenwords; int4 curwords; char *startsel; char *stopsel; char *fragdelim; int2 startsellen; int2 stopsellen; int2 fragdelimlen; } HeadlineParsedText; /* * Common useful things for tsearch subsystem */ extern char *get_tsearch_config_filename(const char *basename, const char *extension); /* * Often useful stopword list management */ typedef struct { int len; char **stop; } StopList; extern void readstoplist(const char *fname, StopList *s, char *(*wordop) (const char *)); extern bool searchstoplist(StopList *s, char *key); /* * Interface with dictionaries */ /* return struct for any lexize function */ typedef struct { /*---------- * Number of current variant of split word. For example the Norwegian * word 'fotballklubber' has two variants to split: ( fotball, klubb ) * and ( fot, ball, klubb ). So, dictionary should return: * * nvariant lexeme * 1 fotball * 1 klubb * 2 fot * 2 ball * 2 klubb * * In general, a TSLexeme will be considered to belong to the same split * variant as the previous one if they have the same nvariant value. * The exact values don't matter, only changes from one lexeme to next. *---------- */ uint16 nvariant; uint16 flags; /* See flag bits below */ char *lexeme; /* C string */ } TSLexeme; /* Flag bits that can appear in TSLexeme.flags */ #define TSL_ADDPOS 0x01 #define TSL_PREFIX 0x02 #define TSL_FILTER 0x04 /* * Struct for supporting complex dictionaries like thesaurus. * 4th argument for dictlexize method is a pointer to this */ typedef struct { bool isend; /* in: marks for lexize_info about text end is * reached */ bool getnext; /* out: dict wants next lexeme */ void *private_state; /* internal dict state between calls with * getnext == true */ } DictSubState; #endif /* _PG_TS_PUBLIC_H_ */ PKBiZ< {server/tsearch/ts_utils.hnu[/*------------------------------------------------------------------------- * * ts_utils.h * helper utilities for tsearch * * Copyright (c) 1998-2012, PostgreSQL Global Development Group * * src/include/tsearch/ts_utils.h * *------------------------------------------------------------------------- */ #ifndef _PG_TS_UTILS_H_ #define _PG_TS_UTILS_H_ #include "tsearch/ts_type.h" #include "tsearch/ts_public.h" #include "nodes/pg_list.h" /* * Common parse definitions for tsvector and tsquery */ /* tsvector parser support. */ struct TSVectorParseStateData; /* opaque struct in tsvector_parser.c */ typedef struct TSVectorParseStateData *TSVectorParseState; extern TSVectorParseState init_tsvector_parser(char *input, bool oprisdelim, bool is_tsquery); extern void reset_tsvector_parser(TSVectorParseState state, char *input); extern bool gettoken_tsvector(TSVectorParseState state, char **token, int *len, WordEntryPos **pos, int *poslen, char **endptr); extern void close_tsvector_parser(TSVectorParseState state); /* parse_tsquery */ struct TSQueryParserStateData; /* private in backend/utils/adt/tsquery.c */ typedef struct TSQueryParserStateData *TSQueryParserState; typedef void (*PushFunction) (Datum opaque, TSQueryParserState state, char *token, int tokenlen, int2 tokenweights, /* bitmap as described * in QueryOperand * struct */ bool prefix); extern TSQuery parse_tsquery(char *buf, PushFunction pushval, Datum opaque, bool isplain); /* Functions for use by PushFunction implementations */ extern void pushValue(TSQueryParserState state, char *strval, int lenval, int2 weight, bool prefix); extern void pushStop(TSQueryParserState state); extern void pushOperator(TSQueryParserState state, int8 oper); /* * parse plain text and lexize words */ typedef struct { uint16 len; uint16 nvariant; union { uint16 pos; /* * When apos array is used, apos[0] is the number of elements in the * array (excluding apos[0]), and alen is the allocated size of the * array. */ uint16 *apos; } pos; uint16 flags; /* currently, only TSL_PREFIX */ char *word; uint32 alen; } ParsedWord; typedef struct { ParsedWord *words; int4 lenwords; int4 curwords; int4 pos; } ParsedText; extern void parsetext(Oid cfgId, ParsedText *prs, char *buf, int4 buflen); /* * headline framework, flow in common to generate: * 1 parse text with hlparsetext * 2 parser-specific function to find part * 3 generateHeadline to generate result text */ extern void hlparsetext(Oid cfgId, HeadlineParsedText *prs, TSQuery query, char *buf, int4 buflen); extern text *generateHeadline(HeadlineParsedText *prs); /* * Common check function for tsvector @@ tsquery */ extern bool TS_execute(QueryItem *curitem, void *checkval, bool calcnot, bool (*chkcond) (void *checkval, QueryOperand *val)); extern bool tsquery_requires_match(QueryItem *curitem); /* * to_ts* - text transformation to tsvector, tsquery */ extern TSVector make_tsvector(ParsedText *prs); extern int32 tsCompareString(char *a, int lena, char *b, int lenb, bool prefix); extern Datum to_tsvector_byid(PG_FUNCTION_ARGS); extern Datum to_tsvector(PG_FUNCTION_ARGS); extern Datum to_tsquery_byid(PG_FUNCTION_ARGS); extern Datum to_tsquery(PG_FUNCTION_ARGS); extern Datum plainto_tsquery_byid(PG_FUNCTION_ARGS); extern Datum plainto_tsquery(PG_FUNCTION_ARGS); /* * GiST support function */ extern Datum gtsvector_compress(PG_FUNCTION_ARGS); extern Datum gtsvector_decompress(PG_FUNCTION_ARGS); extern Datum gtsvector_consistent(PG_FUNCTION_ARGS); extern Datum gtsvector_union(PG_FUNCTION_ARGS); extern Datum gtsvector_same(PG_FUNCTION_ARGS); extern Datum gtsvector_penalty(PG_FUNCTION_ARGS); extern Datum gtsvector_picksplit(PG_FUNCTION_ARGS); /* * IO functions for pseudotype gtsvector * used internally in tsvector GiST opclass */ extern Datum gtsvectorin(PG_FUNCTION_ARGS); extern Datum gtsvectorout(PG_FUNCTION_ARGS); /* * GIN support function */ extern Datum gin_extract_tsvector(PG_FUNCTION_ARGS); extern Datum gin_cmp_tslexeme(PG_FUNCTION_ARGS); extern Datum gin_cmp_prefix(PG_FUNCTION_ARGS); extern Datum gin_extract_tsquery(PG_FUNCTION_ARGS); extern Datum gin_tsquery_consistent(PG_FUNCTION_ARGS); extern Datum gin_extract_tsvector_2args(PG_FUNCTION_ARGS); extern Datum gin_extract_tsquery_5args(PG_FUNCTION_ARGS); extern Datum gin_tsquery_consistent_6args(PG_FUNCTION_ARGS); /* * Possible strategy numbers for indexes * TSearchStrategyNumber - (tsvector|text) @@ tsquery * TSearchWithClassStrategyNumber - tsvector @@@ tsquery */ #define TSearchStrategyNumber 1 #define TSearchWithClassStrategyNumber 2 /* * TSQuery Utilities */ extern QueryItem *clean_NOT(QueryItem *ptr, int4 *len); extern QueryItem *clean_fakeval(QueryItem *ptr, int4 *len); typedef struct QTNode { QueryItem *valnode; uint32 flags; int4 nchild; char *word; uint32 sign; struct QTNode **child; } QTNode; /* bits in QTNode.flags */ #define QTN_NEEDFREE 0x01 #define QTN_NOCHANGE 0x02 #define QTN_WORDFREE 0x04 typedef uint64 TSQuerySign; #define TSQS_SIGLEN (sizeof(TSQuerySign)*BITS_PER_BYTE) #define TSQuerySignGetDatum(X) Int64GetDatum((int64) (X)) #define DatumGetTSQuerySign(X) ((TSQuerySign) DatumGetInt64(X)) #define PG_RETURN_TSQUERYSIGN(X) return TSQuerySignGetDatum(X) #define PG_GETARG_TSQUERYSIGN(n) DatumGetTSQuerySign(PG_GETARG_DATUM(n)) extern QTNode *QT2QTN(QueryItem *in, char *operand); extern TSQuery QTN2QT(QTNode *in); extern void QTNFree(QTNode *in); extern void QTNSort(QTNode *in); extern void QTNTernary(QTNode *in); extern void QTNBinary(QTNode *in); extern int QTNodeCompare(QTNode *an, QTNode *bn); extern QTNode *QTNCopy(QTNode *in); extern void QTNClearFlags(QTNode *in, uint32 flags); extern bool QTNEq(QTNode *a, QTNode *b); extern TSQuerySign makeTSQuerySign(TSQuery a); extern QTNode *findsubquery(QTNode *root, QTNode *ex, QTNode *subs, bool *isfind); /* * TSQuery GiST support */ extern Datum gtsquery_compress(PG_FUNCTION_ARGS); extern Datum gtsquery_decompress(PG_FUNCTION_ARGS); extern Datum gtsquery_consistent(PG_FUNCTION_ARGS); extern Datum gtsquery_union(PG_FUNCTION_ARGS); extern Datum gtsquery_same(PG_FUNCTION_ARGS); extern Datum gtsquery_penalty(PG_FUNCTION_ARGS); extern Datum gtsquery_picksplit(PG_FUNCTION_ARGS); /* * Parser interface to SQL */ extern Datum ts_token_type_byid(PG_FUNCTION_ARGS); extern Datum ts_token_type_byname(PG_FUNCTION_ARGS); extern Datum ts_parse_byid(PG_FUNCTION_ARGS); extern Datum ts_parse_byname(PG_FUNCTION_ARGS); /* * Default word parser */ extern Datum prsd_start(PG_FUNCTION_ARGS); extern Datum prsd_nexttoken(PG_FUNCTION_ARGS); extern Datum prsd_end(PG_FUNCTION_ARGS); extern Datum prsd_headline(PG_FUNCTION_ARGS); extern Datum prsd_lextype(PG_FUNCTION_ARGS); /* * Dictionary interface to SQL */ extern Datum ts_lexize(PG_FUNCTION_ARGS); /* * Simple built-in dictionary */ extern Datum dsimple_init(PG_FUNCTION_ARGS); extern Datum dsimple_lexize(PG_FUNCTION_ARGS); /* * Synonym built-in dictionary */ extern Datum dsynonym_init(PG_FUNCTION_ARGS); extern Datum dsynonym_lexize(PG_FUNCTION_ARGS); /* * ISpell dictionary */ extern Datum dispell_init(PG_FUNCTION_ARGS); extern Datum dispell_lexize(PG_FUNCTION_ARGS); /* * Thesaurus */ extern Datum thesaurus_init(PG_FUNCTION_ARGS); extern Datum thesaurus_lexize(PG_FUNCTION_ARGS); /* * headline */ extern Datum ts_headline_byid_opt(PG_FUNCTION_ARGS); extern Datum ts_headline_byid(PG_FUNCTION_ARGS); extern Datum ts_headline(PG_FUNCTION_ARGS); extern Datum ts_headline_opt(PG_FUNCTION_ARGS); /* * current cfg */ extern Datum get_current_ts_config(PG_FUNCTION_ARGS); #endif /* _PG_TS_UTILS_H_ */ PKBiZ8pserver/tsearch/dicts/regis.hnu[/*------------------------------------------------------------------------- * * regis.h * * Declarations for fast regex subset, used by ISpell * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * * src/include/tsearch/dicts/regis.h * *------------------------------------------------------------------------- */ #ifndef __REGIS_H__ #define __REGIS_H__ typedef struct RegisNode { uint32 type:2, len:16, unused:14; struct RegisNode *next; unsigned char data[1]; } RegisNode; #define RNHDRSZ (offsetof(RegisNode,data)) #define RSF_ONEOF 1 #define RSF_NONEOF 2 typedef struct Regis { RegisNode *node; uint32 issuffix:1, nchar:16, unused:15; } Regis; bool RS_isRegis(const char *str); void RS_compile(Regis *r, bool issuffix, const char *str); void RS_free(Regis *r); /*returns true if matches */ bool RS_execute(Regis *r, char *str); #endif PKBiZj47Hqqserver/tsearch/dicts/spell.hnu[/*------------------------------------------------------------------------- * * spell.h * * Declarations for ISpell dictionary * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * * src/include/tsearch/dicts/spell.h * *------------------------------------------------------------------------- */ #ifndef __SPELL_H__ #define __SPELL_H__ #include "regex/regex.h" #include "tsearch/dicts/regis.h" #include "tsearch/ts_public.h" /* * Max length of a flag name. Names longer than this will be truncated * to the maximum. */ #define MAXFLAGLEN 16 struct SPNode; typedef struct { uint32 val:8, isword:1, compoundflag:4, affix:19; struct SPNode *node; } SPNodeData; /* * Names of FF_ are correlated with Hunspell options in affix file * http://hunspell.sourceforge.net/ */ #define FF_COMPOUNDONLY 0x01 #define FF_COMPOUNDBEGIN 0x02 #define FF_COMPOUNDMIDDLE 0x04 #define FF_COMPOUNDLAST 0x08 #define FF_COMPOUNDFLAG ( FF_COMPOUNDBEGIN | FF_COMPOUNDMIDDLE | FF_COMPOUNDLAST ) #define FF_DICTFLAGMASK 0x0f typedef struct SPNode { uint32 length; SPNodeData data[1]; } SPNode; #define SPNHDRSZ (offsetof(SPNode,data)) typedef struct spell_struct { union { /* * flag is filled in by NIImportDictionary. After NISortDictionary, d * is valid and flag is invalid. */ char flag[MAXFLAGLEN]; struct { int affix; int len; } d; } p; char word[1]; /* variable length, null-terminated */ } SPELL; #define SPELLHDRSZ (offsetof(SPELL, word)) typedef struct aff_struct { uint32 flag:8, type:1, flagflags:7, issimple:1, isregis:1, replen:14; char *find; char *repl; union { regex_t regex; Regis regis; } reg; } AFFIX; /* * affixes use dictionary flags too */ #define FF_COMPOUNDPERMITFLAG 0x10 #define FF_COMPOUNDFORBIDFLAG 0x20 #define FF_CROSSPRODUCT 0x40 /* * Don't change the order of these. Initialization sorts by these, * and expects prefixes to come first after sorting. */ #define FF_SUFFIX 1 #define FF_PREFIX 0 struct AffixNode; typedef struct { uint32 val:8, naff:24; AFFIX **aff; struct AffixNode *node; } AffixNodeData; typedef struct AffixNode { uint32 isvoid:1, length:31; AffixNodeData data[1]; } AffixNode; #define ANHRDSZ (offsetof(AffixNode, data)) typedef struct { char *affix; int len; bool issuffix; } CMPDAffix; typedef struct { int maffixes; int naffixes; AFFIX *Affix; AffixNode *Suffix; AffixNode *Prefix; SPNode *Dictionary; char **AffixData; int lenAffixData; int nAffixData; CMPDAffix *CompoundAffix; unsigned char flagval[256]; bool usecompound; /* * Remaining fields are only used during dictionary construction; they are * set up by NIStartBuild and cleared by NIFinishBuild. */ MemoryContext buildCxt; /* temp context for construction */ /* Temporary array of all words in the dict file */ SPELL **Spell; int nspell; /* number of valid entries in Spell array */ int mspell; /* allocated length of Spell array */ /* These are used to allocate "compact" data without palloc overhead */ char *firstfree; /* first free address (always maxaligned) */ size_t avail; /* free space remaining at firstfree */ } IspellDict; extern TSLexeme *NINormalizeWord(IspellDict *Conf, char *word); extern void NIStartBuild(IspellDict *Conf); extern void NIImportAffixes(IspellDict *Conf, const char *filename); extern void NIImportDictionary(IspellDict *Conf, const char *filename); extern void NISortDictionary(IspellDict *Conf); extern void NISortAffixes(IspellDict *Conf); extern void NIFinishBuild(IspellDict *Conf); #endif PKBiZޘserver/postgres_ext.hnu[/*------------------------------------------------------------------------- * * postgres_ext.h * * This file contains declarations of things that are visible everywhere * in PostgreSQL *and* are visible to clients of frontend interface libraries. * For example, the Oid type is part of the API of libpq and other libraries. * * Declarations which are specific to a particular interface should * go in the header file for that interface (such as libpq-fe.h). This * file is only for fundamental Postgres declarations. * * User-written C functions don't count as "external to Postgres." * Those function much as local modifications to the backend itself, and * use header files that are otherwise internal to Postgres to interface * with the backend. * * src/include/postgres_ext.h * *------------------------------------------------------------------------- */ #ifndef POSTGRES_EXT_H #define POSTGRES_EXT_H /* * Object ID is a fundamental type in Postgres. */ typedef unsigned int Oid; #ifdef __cplusplus #define InvalidOid (Oid(0)) #else #define InvalidOid ((Oid) 0) #endif #define OID_MAX UINT_MAX /* you will need to include to use the above #define */ /* * Identifiers of error message fields. Kept here to keep common * between frontend and backend, and also to export them to libpq * applications. */ #define PG_DIAG_SEVERITY 'S' #define PG_DIAG_SQLSTATE 'C' #define PG_DIAG_MESSAGE_PRIMARY 'M' #define PG_DIAG_MESSAGE_DETAIL 'D' #define PG_DIAG_MESSAGE_HINT 'H' #define PG_DIAG_STATEMENT_POSITION 'P' #define PG_DIAG_INTERNAL_POSITION 'p' #define PG_DIAG_INTERNAL_QUERY 'q' #define PG_DIAG_CONTEXT 'W' #define PG_DIAG_SOURCE_FILE 'F' #define PG_DIAG_SOURCE_LINE 'L' #define PG_DIAG_SOURCE_FUNCTION 'R' #endif PKBiZ+++server/bootstrap/bootstrap.hnu[/*------------------------------------------------------------------------- * * bootstrap.h * include file for the bootstrapping code * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/bootstrap/bootstrap.h * *------------------------------------------------------------------------- */ #ifndef BOOTSTRAP_H #define BOOTSTRAP_H #include "nodes/execnodes.h" /* * MAXATTR is the maximum number of attributes in a relation supported * at bootstrap time (i.e., the max possible in a system table). */ #define MAXATTR 40 extern Relation boot_reldesc; extern Form_pg_attribute attrtypes[MAXATTR]; extern int numattr; extern void AuxiliaryProcessMain(int argc, char *argv[]); extern void err_out(void); extern void closerel(char *name); extern void boot_openrel(char *name); extern void DefineAttr(char *name, char *type, int attnum); extern void InsertOneTuple(Oid objectid); extern void InsertOneValue(char *value, int i); extern void InsertOneNull(int i); extern char *MapArrayTypeName(const char *s); extern void index_register(Oid heap, Oid ind, IndexInfo *indexInfo); extern void build_indices(void); extern void boot_get_type_io_data(Oid typid, int16 *typlen, bool *typbyval, char *typalign, char *typdelim, Oid *typioparam, Oid *typinput, Oid *typoutput); extern int boot_yyparse(void); extern int boot_yylex(void); extern void boot_yyerror(const char *str); #endif /* BOOTSTRAP_H */ PKBiZ)``server/dynloader.hnu[/*------------------------------------------------------------------------- * * linux.h * Port-specific prototypes for Linux * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/backend/port/dynloader/linux.h * *------------------------------------------------------------------------- */ #ifndef PORT_PROTOS_H #define PORT_PROTOS_H #include "utils/dynamic_loader.h" /* pgrminclude ignore */ #ifdef HAVE_DLOPEN #include #endif #ifdef HAVE_DLOPEN /* * In some older systems, the RTLD_NOW flag isn't defined and the mode * argument to dlopen must always be 1. The RTLD_GLOBAL flag is wanted * if available, but it doesn't exist everywhere. * If it doesn't exist, set it to 0 so it has no effect. */ #ifndef RTLD_NOW #define RTLD_NOW 1 #endif #ifndef RTLD_GLOBAL #define RTLD_GLOBAL 0 #endif #define pg_dlopen(f) dlopen((f), RTLD_NOW | RTLD_GLOBAL) #define pg_dlsym dlsym #define pg_dlclose dlclose #define pg_dlerror dlerror #endif /* HAVE_DLOPEN */ #endif /* PORT_PROTOS_H */ PKBiZXΉserver/snowball/header.hnu[/*------------------------------------------------------------------------- * * header.h * Replacement header file for Snowball stemmer modules * * The Snowball stemmer modules do #include "header.h", and think they * are including snowball/libstemmer/header.h. We adjust the CPPFLAGS * so that this file is found instead, and thereby we can modify the * headers they see. The main point here is to ensure that pg_config.h * is included before any system headers such as ; without that, * we have portability issues on some platforms due to variation in * largefile options across different modules in the backend. * * NOTE: this file should not be included into any non-snowball sources! * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * * src/include/snowball/header.h * *------------------------------------------------------------------------- */ #ifndef SNOWBALL_HEADR_H #define SNOWBALL_HEADR_H #include "postgres.h" /* Some platforms define MAXINT and/or MININT, causing conflicts */ #ifdef MAXINT #undef MAXINT #endif #ifdef MININT #undef MININT #endif /* Now we can include the original Snowball header.h */ #include "snowball/libstemmer/header.h" /* pgrminclude ignore */ /* * Redefine standard memory allocation interface to pgsql's one. * This allows us to control where the Snowball code allocates stuff. */ #ifdef malloc #undef malloc #endif #define malloc(a) palloc(a) #ifdef calloc #undef calloc #endif #define calloc(a,b) palloc0((a) * (b)) #ifdef realloc #undef realloc #endif #define realloc(a,b) repalloc(a,b) #ifdef free #undef free #endif #define free(a) pfree(a) #endif /* SNOWBALL_HEADR_H */ PKBiZlBB2server/snowball/libstemmer/stem_ISO_8859_1_dutch.hnu[ /* This file was generated automatically by the Snowball to ANSI C compiler */ #ifdef __cplusplus extern "C" { #endif extern struct SN_env * dutch_ISO_8859_1_create_env(void); extern void dutch_ISO_8859_1_close_env(struct SN_env * z); extern int dutch_ISO_8859_1_stem(struct SN_env * z); #ifdef __cplusplus } #endif PKBiZ7dEE3server/snowball/libstemmer/stem_ISO_8859_1_german.hnu[ /* This file was generated automatically by the Snowball to ANSI C compiler */ #ifdef __cplusplus extern "C" { #endif extern struct SN_env * german_ISO_8859_1_create_env(void); extern void german_ISO_8859_1_close_env(struct SN_env * z); extern int german_ISO_8859_1_stem(struct SN_env * z); #ifdef __cplusplus } #endif PKBiZc,99/server/snowball/libstemmer/stem_UTF_8_russian.hnu[ /* This file was generated automatically by the Snowball to ANSI C compiler */ #ifdef __cplusplus extern "C" { #endif extern struct SN_env * russian_UTF_8_create_env(void); extern void russian_UTF_8_close_env(struct SN_env * z); extern int russian_UTF_8_stem(struct SN_env * z); #ifdef __cplusplus } #endif PKBiZCEE3server/snowball/libstemmer/stem_ISO_8859_1_porter.hnu[ /* This file was generated automatically by the Snowball to ANSI C compiler */ #ifdef __cplusplus extern "C" { #endif extern struct SN_env * porter_ISO_8859_1_create_env(void); extern void porter_ISO_8859_1_close_env(struct SN_env * z); extern int porter_ISO_8859_1_stem(struct SN_env * z); #ifdef __cplusplus } #endif PKBiZd #server/snowball/libstemmer/header.hnu[ #include #include "api.h" #define MAXINT INT_MAX #define MININT INT_MIN #define HEAD 2*sizeof(int) #define SIZE(p) ((int *)(p))[-1] #define SET_SIZE(p, n) ((int *)(p))[-1] = n #define CAPACITY(p) ((int *)(p))[-2] struct among { int s_size; /* number of chars in string */ const symbol * s; /* search string */ int substring_i;/* index to longest matching substring */ int result; /* result of the lookup */ int (* function)(struct SN_env *); }; extern symbol * create_s(void); extern void lose_s(symbol * p); extern int skip_utf8(const symbol * p, int c, int lb, int l, int n); extern int in_grouping_U(struct SN_env * z, const unsigned char * s, int min, int max, int repeat); extern int in_grouping_b_U(struct SN_env * z, const unsigned char * s, int min, int max, int repeat); extern int out_grouping_U(struct SN_env * z, const unsigned char * s, int min, int max, int repeat); extern int out_grouping_b_U(struct SN_env * z, const unsigned char * s, int min, int max, int repeat); extern int in_grouping(struct SN_env * z, const unsigned char * s, int min, int max, int repeat); extern int in_grouping_b(struct SN_env * z, const unsigned char * s, int min, int max, int repeat); extern int out_grouping(struct SN_env * z, const unsigned char * s, int min, int max, int repeat); extern int out_grouping_b(struct SN_env * z, const unsigned char * s, int min, int max, int repeat); extern int eq_s(struct SN_env * z, int s_size, const symbol * s); extern int eq_s_b(struct SN_env * z, int s_size, const symbol * s); extern int eq_v(struct SN_env * z, const symbol * p); extern int eq_v_b(struct SN_env * z, const symbol * p); extern int find_among(struct SN_env * z, const struct among * v, int v_size); extern int find_among_b(struct SN_env * z, const struct among * v, int v_size); extern int replace_s(struct SN_env * z, int c_bra, int c_ket, int s_size, const symbol * s, int * adjustment); extern int slice_from_s(struct SN_env * z, int s_size, const symbol * s); extern int slice_from_v(struct SN_env * z, const symbol * p); extern int slice_del(struct SN_env * z); extern int insert_s(struct SN_env * z, int bra, int ket, int s_size, const symbol * s); extern int insert_v(struct SN_env * z, int bra, int ket, const symbol * p); extern symbol * slice_to(struct SN_env * z, symbol * p); extern symbol * assign_to(struct SN_env * z, symbol * p); extern void debug(struct SN_env * z, int number, int line_count); PKBiZ)MaNN6server/snowball/libstemmer/stem_ISO_8859_1_norwegian.hnu[ /* This file was generated automatically by the Snowball to ANSI C compiler */ #ifdef __cplusplus extern "C" { #endif extern struct SN_env * norwegian_ISO_8859_1_create_env(void); extern void norwegian_ISO_8859_1_close_env(struct SN_env * z); extern int norwegian_ISO_8859_1_stem(struct SN_env * z); #ifdef __cplusplus } #endif PKBiZN<<0server/snowball/libstemmer/stem_UTF_8_romanian.hnu[ /* This file was generated automatically by the Snowball to ANSI C compiler */ #ifdef __cplusplus extern "C" { #endif extern struct SN_env * romanian_UTF_8_create_env(void); extern void romanian_UTF_8_close_env(struct SN_env * z); extern int romanian_UTF_8_stem(struct SN_env * z); #ifdef __cplusplus } #endif PKBiZ;99/server/snowball/libstemmer/stem_UTF_8_spanish.hnu[ /* This file was generated automatically by the Snowball to ANSI C compiler */ #ifdef __cplusplus extern "C" { #endif extern struct SN_env * spanish_UTF_8_create_env(void); extern void spanish_UTF_8_close_env(struct SN_env * z); extern int spanish_UTF_8_stem(struct SN_env * z); #ifdef __cplusplus } #endif PKBiZDQ99/server/snowball/libstemmer/stem_UTF_8_english.hnu[ /* This file was generated automatically by the Snowball to ANSI C compiler */ #ifdef __cplusplus extern "C" { #endif extern struct SN_env * english_UTF_8_create_env(void); extern void english_UTF_8_close_env(struct SN_env * z); extern int english_UTF_8_stem(struct SN_env * z); #ifdef __cplusplus } #endif PKBiZ99/server/snowball/libstemmer/stem_UTF_8_turkish.hnu[ /* This file was generated automatically by the Snowball to ANSI C compiler */ #ifdef __cplusplus extern "C" { #endif extern struct SN_env * turkish_UTF_8_create_env(void); extern void turkish_UTF_8_close_env(struct SN_env * z); extern int turkish_UTF_8_stem(struct SN_env * z); #ifdef __cplusplus } #endif PKBiZ?6HH4server/snowball/libstemmer/stem_ISO_8859_1_italian.hnu[ /* This file was generated automatically by the Snowball to ANSI C compiler */ #ifdef __cplusplus extern "C" { #endif extern struct SN_env * italian_ISO_8859_1_create_env(void); extern void italian_ISO_8859_1_close_env(struct SN_env * z); extern int italian_ISO_8859_1_stem(struct SN_env * z); #ifdef __cplusplus } #endif PKBiZsj|_HH4server/snowball/libstemmer/stem_ISO_8859_1_spanish.hnu[ /* This file was generated automatically by the Snowball to ANSI C compiler */ #ifdef __cplusplus extern "C" { #endif extern struct SN_env * spanish_ISO_8859_1_create_env(void); extern void spanish_ISO_8859_1_close_env(struct SN_env * z); extern int spanish_ISO_8859_1_stem(struct SN_env * z); #ifdef __cplusplus } #endif PKBiZ.466.server/snowball/libstemmer/stem_UTF_8_danish.hnu[ /* This file was generated automatically by the Snowball to ANSI C compiler */ #ifdef __cplusplus extern "C" { #endif extern struct SN_env * danish_UTF_8_create_env(void); extern void danish_UTF_8_close_env(struct SN_env * z); extern int danish_UTF_8_stem(struct SN_env * z); #ifdef __cplusplus } #endif PKBiZ$pD99/server/snowball/libstemmer/stem_UTF_8_swedish.hnu[ /* This file was generated automatically by the Snowball to ANSI C compiler */ #ifdef __cplusplus extern "C" { #endif extern struct SN_env * swedish_UTF_8_create_env(void); extern void swedish_UTF_8_close_env(struct SN_env * z); extern int swedish_UTF_8_stem(struct SN_env * z); #ifdef __cplusplus } #endif PKBiZ99/server/snowball/libstemmer/stem_UTF_8_italian.hnu[ /* This file was generated automatically by the Snowball to ANSI C compiler */ #ifdef __cplusplus extern "C" { #endif extern struct SN_env * italian_UTF_8_create_env(void); extern void italian_UTF_8_close_env(struct SN_env * z); extern int italian_UTF_8_stem(struct SN_env * z); #ifdef __cplusplus } #endif PKBiZ qQQ7server/snowball/libstemmer/stem_ISO_8859_1_portuguese.hnu[ /* This file was generated automatically by the Snowball to ANSI C compiler */ #ifdef __cplusplus extern "C" { #endif extern struct SN_env * portuguese_ISO_8859_1_create_env(void); extern void portuguese_ISO_8859_1_close_env(struct SN_env * z); extern int portuguese_ISO_8859_1_stem(struct SN_env * z); #ifdef __cplusplus } #endif PKBiZ^0KK5server/snowball/libstemmer/stem_ISO_8859_2_romanian.hnu[ /* This file was generated automatically by the Snowball to ANSI C compiler */ #ifdef __cplusplus extern "C" { #endif extern struct SN_env * romanian_ISO_8859_2_create_env(void); extern void romanian_ISO_8859_2_close_env(struct SN_env * z); extern int romanian_ISO_8859_2_stem(struct SN_env * z); #ifdef __cplusplus } #endif PKBiZSBB2server/snowball/libstemmer/stem_UTF_8_portuguese.hnu[ /* This file was generated automatically by the Snowball to ANSI C compiler */ #ifdef __cplusplus extern "C" { #endif extern struct SN_env * portuguese_UTF_8_create_env(void); extern void portuguese_UTF_8_close_env(struct SN_env * z); extern int portuguese_UTF_8_stem(struct SN_env * z); #ifdef __cplusplus } #endif PKBiZJ99/server/snowball/libstemmer/stem_UTF_8_finnish.hnu[ /* This file was generated automatically by the Snowball to ANSI C compiler */ #ifdef __cplusplus extern "C" { #endif extern struct SN_env * finnish_UTF_8_create_env(void); extern void finnish_UTF_8_close_env(struct SN_env * z); extern int finnish_UTF_8_stem(struct SN_env * z); #ifdef __cplusplus } #endif PKBiZC?66.server/snowball/libstemmer/stem_UTF_8_german.hnu[ /* This file was generated automatically by the Snowball to ANSI C compiler */ #ifdef __cplusplus extern "C" { #endif extern struct SN_env * german_UTF_8_create_env(void); extern void german_UTF_8_close_env(struct SN_env * z); extern int german_UTF_8_stem(struct SN_env * z); #ifdef __cplusplus } #endif PKBiZ%g33-server/snowball/libstemmer/stem_UTF_8_dutch.hnu[ /* This file was generated automatically by the Snowball to ANSI C compiler */ #ifdef __cplusplus extern "C" { #endif extern struct SN_env * dutch_UTF_8_create_env(void); extern void dutch_UTF_8_close_env(struct SN_env * z); extern int dutch_UTF_8_stem(struct SN_env * z); #ifdef __cplusplus } #endif PKBiZxQIHH4server/snowball/libstemmer/stem_ISO_8859_1_finnish.hnu[ /* This file was generated automatically by the Snowball to ANSI C compiler */ #ifdef __cplusplus extern "C" { #endif extern struct SN_env * finnish_ISO_8859_1_create_env(void); extern void finnish_ISO_8859_1_close_env(struct SN_env * z); extern int finnish_ISO_8859_1_stem(struct SN_env * z); #ifdef __cplusplus } #endif PKBiZO<<0server/snowball/libstemmer/stem_KOI8_R_russian.hnu[ /* This file was generated automatically by the Snowball to ANSI C compiler */ #ifdef __cplusplus extern "C" { #endif extern struct SN_env * russian_KOI8_R_create_env(void); extern void russian_KOI8_R_close_env(struct SN_env * z); extern int russian_KOI8_R_stem(struct SN_env * z); #ifdef __cplusplus } #endif PKBiZG66.server/snowball/libstemmer/stem_UTF_8_porter.hnu[ /* This file was generated automatically by the Snowball to ANSI C compiler */ #ifdef __cplusplus extern "C" { #endif extern struct SN_env * porter_UTF_8_create_env(void); extern void porter_UTF_8_close_env(struct SN_env * z); extern int porter_UTF_8_stem(struct SN_env * z); #ifdef __cplusplus } #endif PKBiZHH4server/snowball/libstemmer/stem_ISO_8859_1_english.hnu[ /* This file was generated automatically by the Snowball to ANSI C compiler */ #ifdef __cplusplus extern "C" { #endif extern struct SN_env * english_ISO_8859_1_create_env(void); extern void english_ISO_8859_1_close_env(struct SN_env * z); extern int english_ISO_8859_1_stem(struct SN_env * z); #ifdef __cplusplus } #endif PKBiZEE3server/snowball/libstemmer/stem_ISO_8859_1_danish.hnu[ /* This file was generated automatically by the Snowball to ANSI C compiler */ #ifdef __cplusplus extern "C" { #endif extern struct SN_env * danish_ISO_8859_1_create_env(void); extern void danish_ISO_8859_1_close_env(struct SN_env * z); extern int danish_ISO_8859_1_stem(struct SN_env * z); #ifdef __cplusplus } #endif PKBiZAY4??1server/snowball/libstemmer/stem_UTF_8_norwegian.hnu[ /* This file was generated automatically by the Snowball to ANSI C compiler */ #ifdef __cplusplus extern "C" { #endif extern struct SN_env * norwegian_UTF_8_create_env(void); extern void norwegian_UTF_8_close_env(struct SN_env * z); extern int norwegian_UTF_8_stem(struct SN_env * z); #ifdef __cplusplus } #endif PKBiZXwNN6server/snowball/libstemmer/stem_ISO_8859_1_hungarian.hnu[ /* This file was generated automatically by the Snowball to ANSI C compiler */ #ifdef __cplusplus extern "C" { #endif extern struct SN_env * hungarian_ISO_8859_1_create_env(void); extern void hungarian_ISO_8859_1_close_env(struct SN_env * z); extern int hungarian_ISO_8859_1_stem(struct SN_env * z); #ifdef __cplusplus } #endif PKBiZN;HH4server/snowball/libstemmer/stem_ISO_8859_1_swedish.hnu[ /* This file was generated automatically by the Snowball to ANSI C compiler */ #ifdef __cplusplus extern "C" { #endif extern struct SN_env * swedish_ISO_8859_1_create_env(void); extern void swedish_ISO_8859_1_close_env(struct SN_env * z); extern int swedish_ISO_8859_1_stem(struct SN_env * z); #ifdef __cplusplus } #endif PKBiZ a server/snowball/libstemmer/api.hnu[ typedef unsigned char symbol; /* Or replace 'char' above with 'short' for 16 bit characters. More precisely, replace 'char' with whatever type guarantees the character width you need. Note however that sizeof(symbol) should divide HEAD, defined in header.h as 2*sizeof(int), without remainder, otherwise there is an alignment problem. In the unlikely event of a problem here, consult Martin Porter. */ struct SN_env { symbol * p; int c; int l; int lb; int bra; int ket; symbol * * S; int * I; unsigned char * B; }; extern struct SN_env * SN_create_env(int S_size, int I_size, int B_size); extern void SN_close_env(struct SN_env * z, int S_size); extern int SN_set_current(struct SN_env * z, int size, const symbol * s); PKBiZ̈,??1server/snowball/libstemmer/stem_UTF_8_hungarian.hnu[ /* This file was generated automatically by the Snowball to ANSI C compiler */ #ifdef __cplusplus extern "C" { #endif extern struct SN_env * hungarian_UTF_8_create_env(void); extern void hungarian_UTF_8_close_env(struct SN_env * z); extern int hungarian_UTF_8_stem(struct SN_env * z); #ifdef __cplusplus } #endif PKBiZz|OEE3server/snowball/libstemmer/stem_ISO_8859_1_french.hnu[ /* This file was generated automatically by the Snowball to ANSI C compiler */ #ifdef __cplusplus extern "C" { #endif extern struct SN_env * french_ISO_8859_1_create_env(void); extern void french_ISO_8859_1_close_env(struct SN_env * z); extern int french_ISO_8859_1_stem(struct SN_env * z); #ifdef __cplusplus } #endif PKBiZA66.server/snowball/libstemmer/stem_UTF_8_french.hnu[ /* This file was generated automatically by the Snowball to ANSI C compiler */ #ifdef __cplusplus extern "C" { #endif extern struct SN_env * french_UTF_8_create_env(void); extern void french_UTF_8_close_env(struct SN_env * z); extern int french_UTF_8_stem(struct SN_env * z); #ifdef __cplusplus } #endif PKBiZaffserver/plpgsql.hnu[/*------------------------------------------------------------------------- * * plpgsql.h - Definitions for the PL/pgSQL * procedural language * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * * IDENTIFICATION * src/pl/plpgsql/src/plpgsql.h * *------------------------------------------------------------------------- */ #ifndef PLPGSQL_H #define PLPGSQL_H #include "postgres.h" #include "access/xact.h" #include "commands/trigger.h" #include "executor/spi.h" /********************************************************************** * Definitions **********************************************************************/ /* define our text domain for translations */ #undef TEXTDOMAIN #define TEXTDOMAIN PG_TEXTDOMAIN("plpgsql") #undef _ #define _(x) dgettext(TEXTDOMAIN, x) /* ---------- * Compiler's namespace item types * ---------- */ enum { PLPGSQL_NSTYPE_LABEL, PLPGSQL_NSTYPE_VAR, PLPGSQL_NSTYPE_ROW, PLPGSQL_NSTYPE_REC }; /* ---------- * Datum array node types * ---------- */ enum { PLPGSQL_DTYPE_VAR, PLPGSQL_DTYPE_ROW, PLPGSQL_DTYPE_REC, PLPGSQL_DTYPE_RECFIELD, PLPGSQL_DTYPE_ARRAYELEM, PLPGSQL_DTYPE_EXPR }; /* ---------- * Variants distinguished in PLpgSQL_type structs * ---------- */ enum { PLPGSQL_TTYPE_SCALAR, /* scalar types and domains */ PLPGSQL_TTYPE_ROW, /* composite types */ PLPGSQL_TTYPE_REC, /* RECORD pseudotype */ PLPGSQL_TTYPE_PSEUDO /* other pseudotypes */ }; /* ---------- * Execution tree node types * ---------- */ enum PLpgSQL_stmt_types { PLPGSQL_STMT_BLOCK, PLPGSQL_STMT_ASSIGN, PLPGSQL_STMT_IF, PLPGSQL_STMT_CASE, PLPGSQL_STMT_LOOP, PLPGSQL_STMT_WHILE, PLPGSQL_STMT_FORI, PLPGSQL_STMT_FORS, PLPGSQL_STMT_FORC, PLPGSQL_STMT_FOREACH_A, PLPGSQL_STMT_EXIT, PLPGSQL_STMT_RETURN, PLPGSQL_STMT_RETURN_NEXT, PLPGSQL_STMT_RETURN_QUERY, PLPGSQL_STMT_RAISE, PLPGSQL_STMT_EXECSQL, PLPGSQL_STMT_DYNEXECUTE, PLPGSQL_STMT_DYNFORS, PLPGSQL_STMT_GETDIAG, PLPGSQL_STMT_OPEN, PLPGSQL_STMT_FETCH, PLPGSQL_STMT_CLOSE, PLPGSQL_STMT_PERFORM }; /* ---------- * Execution node return codes * ---------- */ enum { PLPGSQL_RC_OK, PLPGSQL_RC_EXIT, PLPGSQL_RC_RETURN, PLPGSQL_RC_CONTINUE }; /* ---------- * GET DIAGNOSTICS information items * ---------- */ enum { PLPGSQL_GETDIAG_ROW_COUNT, PLPGSQL_GETDIAG_RESULT_OID, PLPGSQL_GETDIAG_ERROR_CONTEXT, PLPGSQL_GETDIAG_ERROR_DETAIL, PLPGSQL_GETDIAG_ERROR_HINT, PLPGSQL_GETDIAG_RETURNED_SQLSTATE, PLPGSQL_GETDIAG_MESSAGE_TEXT }; /* -------- * RAISE statement options * -------- */ enum { PLPGSQL_RAISEOPTION_ERRCODE, PLPGSQL_RAISEOPTION_MESSAGE, PLPGSQL_RAISEOPTION_DETAIL, PLPGSQL_RAISEOPTION_HINT }; /* -------- * Behavioral modes for plpgsql variable resolution * -------- */ typedef enum { PLPGSQL_RESOLVE_ERROR, /* throw error if ambiguous */ PLPGSQL_RESOLVE_VARIABLE, /* prefer plpgsql var to table column */ PLPGSQL_RESOLVE_COLUMN /* prefer table column to plpgsql var */ } PLpgSQL_resolve_option; /********************************************************************** * Node and structure definitions **********************************************************************/ typedef struct { /* Postgres data type */ char *typname; /* (simple) name of the type */ Oid typoid; /* OID of the data type */ int ttype; /* PLPGSQL_TTYPE_ code */ int16 typlen; /* stuff copied from its pg_type entry */ bool typbyval; Oid typrelid; Oid typioparam; Oid collation; /* from pg_type, but can be overridden */ FmgrInfo typinput; /* lookup info for typinput function */ int32 atttypmod; /* typmod (taken from someplace else) */ } PLpgSQL_type; /* * PLpgSQL_datum is the common supertype for PLpgSQL_expr, PLpgSQL_var, * PLpgSQL_row, PLpgSQL_rec, PLpgSQL_recfield, and PLpgSQL_arrayelem */ typedef struct { /* Generic datum array item */ int dtype; int dno; } PLpgSQL_datum; /* * The variants PLpgSQL_var, PLpgSQL_row, and PLpgSQL_rec share these * fields */ typedef struct { /* Scalar or composite variable */ int dtype; int dno; char *refname; int lineno; } PLpgSQL_variable; typedef struct PLpgSQL_expr { /* SQL Query to plan and execute */ int dtype; int dno; char *query; SPIPlanPtr plan; Bitmapset *paramnos; /* all dnos referenced by this query */ /* function containing this expr (not set until we first parse query) */ struct PLpgSQL_function *func; /* namespace chain visible to this expr */ struct PLpgSQL_nsitem *ns; /* fields for "simple expression" fast-path execution: */ Expr *expr_simple_expr; /* NULL means not a simple expr */ int expr_simple_generation; /* plancache generation we checked */ Oid expr_simple_type; /* result type Oid, if simple */ /* * if expr is simple AND prepared in current transaction, * expr_simple_state and expr_simple_in_use are valid. Test validity by * seeing if expr_simple_lxid matches current LXID. (If not, * expr_simple_state probably points at garbage!) */ ExprState *expr_simple_state; /* eval tree for expr_simple_expr */ bool expr_simple_in_use; /* true if eval tree is active */ LocalTransactionId expr_simple_lxid; } PLpgSQL_expr; typedef struct { /* Scalar variable */ int dtype; int dno; char *refname; int lineno; PLpgSQL_type *datatype; int isconst; int notnull; PLpgSQL_expr *default_val; PLpgSQL_expr *cursor_explicit_expr; int cursor_explicit_argrow; int cursor_options; Datum value; bool isnull; bool freeval; } PLpgSQL_var; typedef struct { /* Row variable */ int dtype; int dno; char *refname; int lineno; TupleDesc rowtupdesc; /* * Note: TupleDesc is only set up for named rowtypes, else it is NULL. * * Note: if the underlying rowtype contains a dropped column, the * corresponding fieldnames[] entry will be NULL, and there is no * corresponding var (varnos[] will be -1). */ int nfields; char **fieldnames; int *varnos; } PLpgSQL_row; typedef struct { /* Record variable (non-fixed structure) */ int dtype; int dno; char *refname; int lineno; HeapTuple tup; TupleDesc tupdesc; bool freetup; bool freetupdesc; } PLpgSQL_rec; typedef struct { /* Field in record */ int dtype; int dno; char *fieldname; int recparentno; /* dno of parent record */ } PLpgSQL_recfield; typedef struct { /* Element of array variable */ int dtype; int dno; PLpgSQL_expr *subscript; int arrayparentno; /* dno of parent array variable */ /* Remaining fields are cached info about the array variable's type */ Oid parenttypoid; /* type of array variable; 0 if not yet set */ int32 parenttypmod; /* typmod of array variable */ Oid arraytypoid; /* OID of actual array type */ int32 arraytypmod; /* typmod of array (and its elements too) */ int16 arraytyplen; /* typlen of array type */ Oid elemtypoid; /* OID of array element type */ int16 elemtyplen; /* typlen of element type */ bool elemtypbyval; /* element type is pass-by-value? */ char elemtypalign; /* typalign of element type */ } PLpgSQL_arrayelem; typedef struct PLpgSQL_nsitem { /* Item in the compilers namespace tree */ int itemtype; int itemno; struct PLpgSQL_nsitem *prev; char name[1]; /* actually, as long as needed */ } PLpgSQL_nsitem; typedef struct { /* Generic execution node */ int cmd_type; int lineno; } PLpgSQL_stmt; typedef struct PLpgSQL_condition { /* One EXCEPTION condition name */ int sqlerrstate; /* SQLSTATE code */ char *condname; /* condition name (for debugging) */ struct PLpgSQL_condition *next; } PLpgSQL_condition; typedef struct { int sqlstate_varno; int sqlerrm_varno; List *exc_list; /* List of WHEN clauses */ } PLpgSQL_exception_block; typedef struct { /* One EXCEPTION ... WHEN clause */ int lineno; PLpgSQL_condition *conditions; List *action; /* List of statements */ } PLpgSQL_exception; typedef struct { /* Block of statements */ int cmd_type; int lineno; char *label; List *body; /* List of statements */ int n_initvars; int *initvarnos; PLpgSQL_exception_block *exceptions; } PLpgSQL_stmt_block; typedef struct { /* Assign statement */ int cmd_type; int lineno; int varno; PLpgSQL_expr *expr; } PLpgSQL_stmt_assign; typedef struct { /* PERFORM statement */ int cmd_type; int lineno; PLpgSQL_expr *expr; } PLpgSQL_stmt_perform; typedef struct { /* Get Diagnostics item */ int kind; /* id for diagnostic value desired */ int target; /* where to assign it */ } PLpgSQL_diag_item; typedef struct { /* Get Diagnostics statement */ int cmd_type; int lineno; bool is_stacked; /* STACKED or CURRENT diagnostics area? */ List *diag_items; /* List of PLpgSQL_diag_item */ } PLpgSQL_stmt_getdiag; typedef struct { /* IF statement */ int cmd_type; int lineno; PLpgSQL_expr *cond; /* boolean expression for THEN */ List *then_body; /* List of statements */ List *elsif_list; /* List of PLpgSQL_if_elsif structs */ List *else_body; /* List of statements */ } PLpgSQL_stmt_if; typedef struct /* one ELSIF arm of IF statement */ { int lineno; PLpgSQL_expr *cond; /* boolean expression for this case */ List *stmts; /* List of statements */ } PLpgSQL_if_elsif; typedef struct /* CASE statement */ { int cmd_type; int lineno; PLpgSQL_expr *t_expr; /* test expression, or NULL if none */ int t_varno; /* var to store test expression value into */ List *case_when_list; /* List of PLpgSQL_case_when structs */ bool have_else; /* flag needed because list could be empty */ List *else_stmts; /* List of statements */ } PLpgSQL_stmt_case; typedef struct /* one arm of CASE statement */ { int lineno; PLpgSQL_expr *expr; /* boolean expression for this case */ List *stmts; /* List of statements */ } PLpgSQL_case_when; typedef struct { /* Unconditional LOOP statement */ int cmd_type; int lineno; char *label; List *body; /* List of statements */ } PLpgSQL_stmt_loop; typedef struct { /* WHILE cond LOOP statement */ int cmd_type; int lineno; char *label; PLpgSQL_expr *cond; List *body; /* List of statements */ } PLpgSQL_stmt_while; typedef struct { /* FOR statement with integer loopvar */ int cmd_type; int lineno; char *label; PLpgSQL_var *var; PLpgSQL_expr *lower; PLpgSQL_expr *upper; PLpgSQL_expr *step; /* NULL means default (ie, BY 1) */ int reverse; List *body; /* List of statements */ } PLpgSQL_stmt_fori; /* * PLpgSQL_stmt_forq represents a FOR statement running over a SQL query. * It is the common supertype of PLpgSQL_stmt_fors, PLpgSQL_stmt_forc * and PLpgSQL_dynfors. */ typedef struct { int cmd_type; int lineno; char *label; PLpgSQL_rec *rec; PLpgSQL_row *row; List *body; /* List of statements */ } PLpgSQL_stmt_forq; typedef struct { /* FOR statement running over SELECT */ int cmd_type; int lineno; char *label; PLpgSQL_rec *rec; PLpgSQL_row *row; List *body; /* List of statements */ /* end of fields that must match PLpgSQL_stmt_forq */ PLpgSQL_expr *query; } PLpgSQL_stmt_fors; typedef struct { /* FOR statement running over cursor */ int cmd_type; int lineno; char *label; PLpgSQL_rec *rec; PLpgSQL_row *row; List *body; /* List of statements */ /* end of fields that must match PLpgSQL_stmt_forq */ int curvar; PLpgSQL_expr *argquery; /* cursor arguments if any */ } PLpgSQL_stmt_forc; typedef struct { /* FOR statement running over EXECUTE */ int cmd_type; int lineno; char *label; PLpgSQL_rec *rec; PLpgSQL_row *row; List *body; /* List of statements */ /* end of fields that must match PLpgSQL_stmt_forq */ PLpgSQL_expr *query; List *params; /* USING expressions */ } PLpgSQL_stmt_dynfors; typedef struct { /* FOREACH item in array loop */ int cmd_type; int lineno; char *label; int varno; /* loop target variable */ int slice; /* slice dimension, or 0 */ PLpgSQL_expr *expr; /* array expression */ List *body; /* List of statements */ } PLpgSQL_stmt_foreach_a; typedef struct { /* OPEN a curvar */ int cmd_type; int lineno; int curvar; int cursor_options; PLpgSQL_row *returntype; PLpgSQL_expr *argquery; PLpgSQL_expr *query; PLpgSQL_expr *dynquery; List *params; /* USING expressions */ } PLpgSQL_stmt_open; typedef struct { /* FETCH or MOVE statement */ int cmd_type; int lineno; PLpgSQL_rec *rec; /* target, as record or row */ PLpgSQL_row *row; int curvar; /* cursor variable to fetch from */ FetchDirection direction; /* fetch direction */ long how_many; /* count, if constant (expr is NULL) */ PLpgSQL_expr *expr; /* count, if expression */ bool is_move; /* is this a fetch or move? */ bool returns_multiple_rows; /* can return more than one row? */ } PLpgSQL_stmt_fetch; typedef struct { /* CLOSE curvar */ int cmd_type; int lineno; int curvar; } PLpgSQL_stmt_close; typedef struct { /* EXIT or CONTINUE statement */ int cmd_type; int lineno; bool is_exit; /* Is this an exit or a continue? */ char *label; /* NULL if it's an unlabelled EXIT/CONTINUE */ PLpgSQL_expr *cond; } PLpgSQL_stmt_exit; typedef struct { /* RETURN statement */ int cmd_type; int lineno; PLpgSQL_expr *expr; int retvarno; } PLpgSQL_stmt_return; typedef struct { /* RETURN NEXT statement */ int cmd_type; int lineno; PLpgSQL_expr *expr; int retvarno; } PLpgSQL_stmt_return_next; typedef struct { /* RETURN QUERY statement */ int cmd_type; int lineno; PLpgSQL_expr *query; /* if static query */ PLpgSQL_expr *dynquery; /* if dynamic query (RETURN QUERY EXECUTE) */ List *params; /* USING arguments for dynamic query */ } PLpgSQL_stmt_return_query; typedef struct { /* RAISE statement */ int cmd_type; int lineno; int elog_level; char *condname; /* condition name, SQLSTATE, or NULL */ char *message; /* old-style message format literal, or NULL */ List *params; /* list of expressions for old-style message */ List *options; /* list of PLpgSQL_raise_option */ } PLpgSQL_stmt_raise; typedef struct { /* RAISE statement option */ int opt_type; PLpgSQL_expr *expr; } PLpgSQL_raise_option; typedef struct { /* Generic SQL statement to execute */ int cmd_type; int lineno; PLpgSQL_expr *sqlstmt; bool mod_stmt; /* is the stmt INSERT/UPDATE/DELETE? */ /* note: mod_stmt is set when we plan the query */ bool into; /* INTO supplied? */ bool strict; /* INTO STRICT flag */ PLpgSQL_rec *rec; /* INTO target, if record */ PLpgSQL_row *row; /* INTO target, if row */ } PLpgSQL_stmt_execsql; typedef struct { /* Dynamic SQL string to execute */ int cmd_type; int lineno; PLpgSQL_expr *query; /* string expression */ bool into; /* INTO supplied? */ bool strict; /* INTO STRICT flag */ PLpgSQL_rec *rec; /* INTO target, if record */ PLpgSQL_row *row; /* INTO target, if row */ List *params; /* USING expressions */ } PLpgSQL_stmt_dynexecute; typedef struct PLpgSQL_func_hashkey { /* Hash lookup key for functions */ Oid funcOid; bool isTrigger; /* true if called as a trigger */ /* be careful that pad bytes in this struct get zeroed! */ /* * For a trigger function, the OID of the relation triggered on is part of * the hash key --- we want to compile the trigger separately for each * relation it is used with, in case the rowtype is different. Zero if * not called as a trigger. */ Oid trigrelOid; /* * We must include the input collation as part of the hash key too, * because we have to generate different plans (with different Param * collations) for different collation settings. */ Oid inputCollation; /* * We include actual argument types in the hash key to support polymorphic * PLpgSQL functions. Be careful that extra positions are zeroed! */ Oid argtypes[FUNC_MAX_ARGS]; } PLpgSQL_func_hashkey; typedef struct PLpgSQL_function { /* Complete compiled function */ char *fn_signature; Oid fn_oid; TransactionId fn_xmin; ItemPointerData fn_tid; bool fn_is_trigger; Oid fn_input_collation; PLpgSQL_func_hashkey *fn_hashkey; /* back-link to hashtable key */ MemoryContext fn_cxt; Oid fn_rettype; int fn_rettyplen; bool fn_retbyval; FmgrInfo fn_retinput; Oid fn_rettypioparam; bool fn_retistuple; bool fn_retset; bool fn_readonly; int fn_nargs; int fn_argvarnos[FUNC_MAX_ARGS]; int out_param_varno; int found_varno; int new_varno; int old_varno; int tg_name_varno; int tg_when_varno; int tg_level_varno; int tg_op_varno; int tg_relid_varno; int tg_relname_varno; int tg_table_name_varno; int tg_table_schema_varno; int tg_nargs_varno; int tg_argv_varno; PLpgSQL_resolve_option resolve_option; int ndatums; PLpgSQL_datum **datums; PLpgSQL_stmt_block *action; /* these fields change when the function is used */ struct PLpgSQL_execstate *cur_estate; unsigned long use_count; } PLpgSQL_function; typedef struct PLpgSQL_execstate { /* Runtime execution data */ PLpgSQL_function *func; /* function being executed */ Datum retval; bool retisnull; Oid rettype; /* type of current retval */ Oid fn_rettype; /* info about declared function rettype */ bool retistuple; bool retisset; bool readonly_func; TupleDesc rettupdesc; char *exitlabel; /* the "target" label of the current EXIT or * CONTINUE stmt, if any */ ErrorData *cur_error; /* current exception handler's error */ Tuplestorestate *tuple_store; /* SRFs accumulate results here */ MemoryContext tuple_store_cxt; ResourceOwner tuple_store_owner; ReturnSetInfo *rsi; int found_varno; int ndatums; PLpgSQL_datum **datums; /* temporary state for results from evaluation of query or expr */ SPITupleTable *eval_tuptable; uint32 eval_processed; Oid eval_lastoid; ExprContext *eval_econtext; /* for executing simple expressions */ PLpgSQL_expr *cur_expr; /* current query/expr being evaluated */ /* status information for error context reporting */ PLpgSQL_stmt *err_stmt; /* current stmt */ const char *err_text; /* additional state info */ void *plugin_info; /* reserved for use by optional plugin */ } PLpgSQL_execstate; /* * A PLpgSQL_plugin structure represents an instrumentation plugin. * To instrument PL/pgSQL, a plugin library must access the rendezvous * variable "PLpgSQL_plugin" and set it to point to a PLpgSQL_plugin struct. * Typically the struct could just be static data in the plugin library. * We expect that a plugin would do this at library load time (_PG_init()). * It must also be careful to set the rendezvous variable back to NULL * if it is unloaded (_PG_fini()). * * This structure is basically a collection of function pointers --- at * various interesting points in pl_exec.c, we call these functions * (if the pointers are non-NULL) to give the plugin a chance to watch * what we are doing. * * func_setup is called when we start a function, before we've initialized * the local variables defined by the function. * * func_beg is called when we start a function, after we've initialized * the local variables. * * func_end is called at the end of a function. * * stmt_beg and stmt_end are called before and after (respectively) each * statement. * * Also, immediately before any call to func_setup, PL/pgSQL fills in the * error_callback and assign_expr fields with pointers to its own * plpgsql_exec_error_callback and exec_assign_expr functions. This is * a somewhat ad-hoc expedient to simplify life for debugger plugins. */ typedef struct { /* Function pointers set up by the plugin */ void (*func_setup) (PLpgSQL_execstate *estate, PLpgSQL_function *func); void (*func_beg) (PLpgSQL_execstate *estate, PLpgSQL_function *func); void (*func_end) (PLpgSQL_execstate *estate, PLpgSQL_function *func); void (*stmt_beg) (PLpgSQL_execstate *estate, PLpgSQL_stmt *stmt); void (*stmt_end) (PLpgSQL_execstate *estate, PLpgSQL_stmt *stmt); /* Function pointers set by PL/pgSQL itself */ void (*error_callback) (void *arg); void (*assign_expr) (PLpgSQL_execstate *estate, PLpgSQL_datum *target, PLpgSQL_expr *expr); } PLpgSQL_plugin; /* Struct types used during parsing */ typedef struct { char *ident; /* palloc'd converted identifier */ bool quoted; /* Was it double-quoted? */ } PLword; typedef struct { List *idents; /* composite identifiers (list of String) */ } PLcword; typedef struct { PLpgSQL_datum *datum; /* referenced variable */ char *ident; /* valid if simple name */ bool quoted; List *idents; /* valid if composite name */ } PLwdatum; /********************************************************************** * Global variable declarations **********************************************************************/ typedef enum { IDENTIFIER_LOOKUP_NORMAL, /* normal processing of var names */ IDENTIFIER_LOOKUP_DECLARE, /* In DECLARE --- don't look up names */ IDENTIFIER_LOOKUP_EXPR /* In SQL expression --- special case */ } IdentifierLookup; extern IdentifierLookup plpgsql_IdentifierLookup; extern int plpgsql_variable_conflict; extern bool plpgsql_check_syntax; extern bool plpgsql_DumpExecTree; extern PLpgSQL_stmt_block *plpgsql_parse_result; extern int plpgsql_nDatums; extern PLpgSQL_datum **plpgsql_Datums; extern char *plpgsql_error_funcname; extern PLpgSQL_function *plpgsql_curr_compile; extern MemoryContext compile_tmp_cxt; extern PLpgSQL_plugin **plugin_ptr; /********************************************************************** * Function declarations **********************************************************************/ /* ---------- * Functions in pl_comp.c * ---------- */ extern PLpgSQL_function *plpgsql_compile(FunctionCallInfo fcinfo, bool forValidator); extern PLpgSQL_function *plpgsql_compile_inline(char *proc_source); extern void plpgsql_parser_setup(struct ParseState *pstate, PLpgSQL_expr *expr); extern bool plpgsql_parse_word(char *word1, const char *yytxt, PLwdatum *wdatum, PLword *word); extern bool plpgsql_parse_dblword(char *word1, char *word2, PLwdatum *wdatum, PLcword *cword); extern bool plpgsql_parse_tripword(char *word1, char *word2, char *word3, PLwdatum *wdatum, PLcword *cword); extern PLpgSQL_type *plpgsql_parse_wordtype(char *ident); extern PLpgSQL_type *plpgsql_parse_cwordtype(List *idents); extern PLpgSQL_type *plpgsql_parse_wordrowtype(char *ident); extern PLpgSQL_type *plpgsql_parse_cwordrowtype(List *idents); extern PLpgSQL_type *plpgsql_build_datatype(Oid typeOid, int32 typmod, Oid collation); extern PLpgSQL_variable *plpgsql_build_variable(const char *refname, int lineno, PLpgSQL_type *dtype, bool add2namespace); extern PLpgSQL_rec *plpgsql_build_record(const char *refname, int lineno, bool add2namespace); extern int plpgsql_recognize_err_condition(const char *condname, bool allow_sqlstate); extern PLpgSQL_condition *plpgsql_parse_err_condition(char *condname); extern void plpgsql_adddatum(PLpgSQL_datum *new); extern int plpgsql_add_initdatums(int **varnos); extern void plpgsql_HashTableInit(void); /* ---------- * Functions in pl_handler.c * ---------- */ extern void _PG_init(void); extern Datum plpgsql_call_handler(PG_FUNCTION_ARGS); extern Datum plpgsql_inline_handler(PG_FUNCTION_ARGS); extern Datum plpgsql_validator(PG_FUNCTION_ARGS); /* ---------- * Functions in pl_exec.c * ---------- */ extern Datum plpgsql_exec_function(PLpgSQL_function *func, FunctionCallInfo fcinfo); extern HeapTuple plpgsql_exec_trigger(PLpgSQL_function *func, TriggerData *trigdata); extern void plpgsql_xact_cb(XactEvent event, void *arg); extern void plpgsql_subxact_cb(SubXactEvent event, SubTransactionId mySubid, SubTransactionId parentSubid, void *arg); extern Oid exec_get_datum_type(PLpgSQL_execstate *estate, PLpgSQL_datum *datum); extern void exec_get_datum_type_info(PLpgSQL_execstate *estate, PLpgSQL_datum *datum, Oid *typeid, int32 *typmod, Oid *collation); /* ---------- * Functions for namespace handling in pl_funcs.c * ---------- */ extern void plpgsql_ns_init(void); extern void plpgsql_ns_push(const char *label); extern void plpgsql_ns_pop(void); extern PLpgSQL_nsitem *plpgsql_ns_top(void); extern void plpgsql_ns_additem(int itemtype, int itemno, const char *name); extern PLpgSQL_nsitem *plpgsql_ns_lookup(PLpgSQL_nsitem *ns_cur, bool localmode, const char *name1, const char *name2, const char *name3, int *names_used); extern PLpgSQL_nsitem *plpgsql_ns_lookup_label(PLpgSQL_nsitem *ns_cur, const char *name); /* ---------- * Other functions in pl_funcs.c * ---------- */ extern const char *plpgsql_stmt_typename(PLpgSQL_stmt *stmt); extern const char *plpgsql_getdiag_kindname(int kind); extern void plpgsql_free_function_memory(PLpgSQL_function *func); extern void plpgsql_dumptree(PLpgSQL_function *func); /* ---------- * Scanner functions in pl_scanner.c * ---------- */ extern int plpgsql_base_yylex(void); extern int plpgsql_yylex(void); extern void plpgsql_push_back_token(int token); extern void plpgsql_append_source_text(StringInfo buf, int startlocation, int endlocation); extern void plpgsql_peek2(int *tok1_p, int *tok2_p, int *tok1_loc, int *tok2_loc); extern int plpgsql_scanner_errposition(int location); extern void plpgsql_yyerror(const char *message); extern int plpgsql_location_to_lineno(int location); extern int plpgsql_latest_lineno(void); extern void plpgsql_scanner_init(const char *str); extern void plpgsql_scanner_finish(void); /* ---------- * Externs in gram.y * ---------- */ extern int plpgsql_yyparse(void); #endif /* PLPGSQL_H */ PKBiZ$uu server/fmgr.hnu[/*------------------------------------------------------------------------- * * fmgr.h * Definitions for the Postgres function manager and function-call * interface. * * This file must be included by all Postgres modules that either define * or call fmgr-callable functions. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/fmgr.h * *------------------------------------------------------------------------- */ #ifndef FMGR_H #define FMGR_H /* We don't want to include primnodes.h here, so make a stub reference */ typedef struct Node *fmNodePtr; /* Likewise, avoid including stringinfo.h here */ typedef struct StringInfoData *fmStringInfo; /* * All functions that can be called directly by fmgr must have this signature. * (Other functions can be called by using a handler that does have this * signature.) */ typedef struct FunctionCallInfoData *FunctionCallInfo; typedef Datum (*PGFunction) (FunctionCallInfo fcinfo); /* * This struct holds the system-catalog information that must be looked up * before a function can be called through fmgr. If the same function is * to be called multiple times, the lookup need be done only once and the * info struct saved for re-use. * * Note that fn_expr really is parse-time-determined information about the * arguments, rather than about the function itself. But it's convenient * to store it here rather than in FunctionCallInfoData, where it might more * logically belong. */ typedef struct FmgrInfo { PGFunction fn_addr; /* pointer to function or handler to be called */ Oid fn_oid; /* OID of function (NOT of handler, if any) */ short fn_nargs; /* 0..FUNC_MAX_ARGS, or -1 if variable arg * count */ bool fn_strict; /* function is "strict" (NULL in => NULL out) */ bool fn_retset; /* function returns a set */ unsigned char fn_stats; /* collect stats if track_functions > this */ void *fn_extra; /* extra space for use by handler */ MemoryContext fn_mcxt; /* memory context to store fn_extra in */ fmNodePtr fn_expr; /* expression parse tree for call, or NULL */ } FmgrInfo; /* * This struct is the data actually passed to an fmgr-called function. */ typedef struct FunctionCallInfoData { FmgrInfo *flinfo; /* ptr to lookup info used for this call */ fmNodePtr context; /* pass info about context of call */ fmNodePtr resultinfo; /* pass or return extra info about result */ Oid fncollation; /* collation for function to use */ bool isnull; /* function must set true if result is NULL */ short nargs; /* # arguments actually passed */ Datum arg[FUNC_MAX_ARGS]; /* Arguments passed to function */ bool argnull[FUNC_MAX_ARGS]; /* T if arg[i] is actually NULL */ } FunctionCallInfoData; /* * This routine fills a FmgrInfo struct, given the OID * of the function to be called. */ extern void fmgr_info(Oid functionId, FmgrInfo *finfo); /* * Same, when the FmgrInfo struct is in a memory context longer-lived than * CurrentMemoryContext. The specified context will be set as fn_mcxt * and used to hold all subsidiary data of finfo. */ extern void fmgr_info_cxt(Oid functionId, FmgrInfo *finfo, MemoryContext mcxt); /* Convenience macro for setting the fn_expr field */ #define fmgr_info_set_expr(expr, finfo) \ ((finfo)->fn_expr = (expr)) /* * Copy an FmgrInfo struct */ extern void fmgr_info_copy(FmgrInfo *dstinfo, FmgrInfo *srcinfo, MemoryContext destcxt); /* * This macro initializes all the fields of a FunctionCallInfoData except * for the arg[] and argnull[] arrays. Performance testing has shown that * the fastest way to set up argnull[] for small numbers of arguments is to * explicitly set each required element to false, so we don't try to zero * out the argnull[] array in the macro. */ #define InitFunctionCallInfoData(Fcinfo, Flinfo, Nargs, Collation, Context, Resultinfo) \ do { \ (Fcinfo).flinfo = (Flinfo); \ (Fcinfo).context = (Context); \ (Fcinfo).resultinfo = (Resultinfo); \ (Fcinfo).fncollation = (Collation); \ (Fcinfo).isnull = false; \ (Fcinfo).nargs = (Nargs); \ } while (0) /* * This macro invokes a function given a filled-in FunctionCallInfoData * struct. The macro result is the returned Datum --- but note that * caller must still check fcinfo->isnull! Also, if function is strict, * it is caller's responsibility to verify that no null arguments are present * before calling. */ #define FunctionCallInvoke(fcinfo) ((* (fcinfo)->flinfo->fn_addr) (fcinfo)) /*------------------------------------------------------------------------- * Support macros to ease writing fmgr-compatible functions * * A C-coded fmgr-compatible function should be declared as * * Datum * function_name(PG_FUNCTION_ARGS) * { * ... * } * * It should access its arguments using appropriate PG_GETARG_xxx macros * and should return its result using PG_RETURN_xxx. * *------------------------------------------------------------------------- */ /* Standard parameter list for fmgr-compatible functions */ #define PG_FUNCTION_ARGS FunctionCallInfo fcinfo /* * Get collation function should use. */ #define PG_GET_COLLATION() (fcinfo->fncollation) /* * Get number of arguments passed to function. */ #define PG_NARGS() (fcinfo->nargs) /* * If function is not marked "proisstrict" in pg_proc, it must check for * null arguments using this macro. Do not try to GETARG a null argument! */ #define PG_ARGISNULL(n) (fcinfo->argnull[n]) /* * Support for fetching detoasted copies of toastable datatypes (all of * which are varlena types). pg_detoast_datum() gives you either the input * datum (if not toasted) or a detoasted copy allocated with palloc(). * pg_detoast_datum_copy() always gives you a palloc'd copy --- use it * if you need a modifiable copy of the input. Caller is expected to have * checked for null inputs first, if necessary. * * pg_detoast_datum_packed() will return packed (1-byte header) datums * unmodified. It will still expand an externally toasted or compressed datum. * The resulting datum can be accessed using VARSIZE_ANY() and VARDATA_ANY() * (beware of multiple evaluations in those macros!) * * WARNING: It is only safe to use pg_detoast_datum_packed() and * VARDATA_ANY() if you really don't care about the alignment. Either because * you're working with something like text where the alignment doesn't matter * or because you're not going to access its constituent parts and just use * things like memcpy on it anyways. * * Note: it'd be nice if these could be macros, but I see no way to do that * without evaluating the arguments multiple times, which is NOT acceptable. */ extern struct varlena *pg_detoast_datum(struct varlena * datum); extern struct varlena *pg_detoast_datum_copy(struct varlena * datum); extern struct varlena *pg_detoast_datum_slice(struct varlena * datum, int32 first, int32 count); extern struct varlena *pg_detoast_datum_packed(struct varlena * datum); #define PG_DETOAST_DATUM(datum) \ pg_detoast_datum((struct varlena *) DatumGetPointer(datum)) #define PG_DETOAST_DATUM_COPY(datum) \ pg_detoast_datum_copy((struct varlena *) DatumGetPointer(datum)) #define PG_DETOAST_DATUM_SLICE(datum,f,c) \ pg_detoast_datum_slice((struct varlena *) DatumGetPointer(datum), \ (int32) (f), (int32) (c)) /* WARNING -- unaligned pointer */ #define PG_DETOAST_DATUM_PACKED(datum) \ pg_detoast_datum_packed((struct varlena *) DatumGetPointer(datum)) /* * Support for cleaning up detoasted copies of inputs. This must only * be used for pass-by-ref datatypes, and normally would only be used * for toastable types. If the given pointer is different from the * original argument, assume it's a palloc'd detoasted copy, and pfree it. * NOTE: most functions on toastable types do not have to worry about this, * but we currently require that support functions for indexes not leak * memory. */ #define PG_FREE_IF_COPY(ptr,n) \ do { \ if ((Pointer) (ptr) != PG_GETARG_POINTER(n)) \ pfree(ptr); \ } while (0) /* Macros for fetching arguments of standard types */ #define PG_GETARG_DATUM(n) (fcinfo->arg[n]) #define PG_GETARG_INT32(n) DatumGetInt32(PG_GETARG_DATUM(n)) #define PG_GETARG_UINT32(n) DatumGetUInt32(PG_GETARG_DATUM(n)) #define PG_GETARG_INT16(n) DatumGetInt16(PG_GETARG_DATUM(n)) #define PG_GETARG_UINT16(n) DatumGetUInt16(PG_GETARG_DATUM(n)) #define PG_GETARG_CHAR(n) DatumGetChar(PG_GETARG_DATUM(n)) #define PG_GETARG_BOOL(n) DatumGetBool(PG_GETARG_DATUM(n)) #define PG_GETARG_OID(n) DatumGetObjectId(PG_GETARG_DATUM(n)) #define PG_GETARG_POINTER(n) DatumGetPointer(PG_GETARG_DATUM(n)) #define PG_GETARG_CSTRING(n) DatumGetCString(PG_GETARG_DATUM(n)) #define PG_GETARG_NAME(n) DatumGetName(PG_GETARG_DATUM(n)) /* these macros hide the pass-by-reference-ness of the datatype: */ #define PG_GETARG_FLOAT4(n) DatumGetFloat4(PG_GETARG_DATUM(n)) #define PG_GETARG_FLOAT8(n) DatumGetFloat8(PG_GETARG_DATUM(n)) #define PG_GETARG_INT64(n) DatumGetInt64(PG_GETARG_DATUM(n)) /* use this if you want the raw, possibly-toasted input datum: */ #define PG_GETARG_RAW_VARLENA_P(n) ((struct varlena *) PG_GETARG_POINTER(n)) /* use this if you want the input datum de-toasted: */ #define PG_GETARG_VARLENA_P(n) PG_DETOAST_DATUM(PG_GETARG_DATUM(n)) /* and this if you can handle 1-byte-header datums: */ #define PG_GETARG_VARLENA_PP(n) PG_DETOAST_DATUM_PACKED(PG_GETARG_DATUM(n)) /* DatumGetFoo macros for varlena types will typically look like this: */ #define DatumGetByteaP(X) ((bytea *) PG_DETOAST_DATUM(X)) #define DatumGetByteaPP(X) ((bytea *) PG_DETOAST_DATUM_PACKED(X)) #define DatumGetTextP(X) ((text *) PG_DETOAST_DATUM(X)) #define DatumGetTextPP(X) ((text *) PG_DETOAST_DATUM_PACKED(X)) #define DatumGetBpCharP(X) ((BpChar *) PG_DETOAST_DATUM(X)) #define DatumGetBpCharPP(X) ((BpChar *) PG_DETOAST_DATUM_PACKED(X)) #define DatumGetVarCharP(X) ((VarChar *) PG_DETOAST_DATUM(X)) #define DatumGetVarCharPP(X) ((VarChar *) PG_DETOAST_DATUM_PACKED(X)) #define DatumGetHeapTupleHeader(X) ((HeapTupleHeader) PG_DETOAST_DATUM(X)) /* And we also offer variants that return an OK-to-write copy */ #define DatumGetByteaPCopy(X) ((bytea *) PG_DETOAST_DATUM_COPY(X)) #define DatumGetTextPCopy(X) ((text *) PG_DETOAST_DATUM_COPY(X)) #define DatumGetBpCharPCopy(X) ((BpChar *) PG_DETOAST_DATUM_COPY(X)) #define DatumGetVarCharPCopy(X) ((VarChar *) PG_DETOAST_DATUM_COPY(X)) #define DatumGetHeapTupleHeaderCopy(X) ((HeapTupleHeader) PG_DETOAST_DATUM_COPY(X)) /* Variants which return n bytes starting at pos. m */ #define DatumGetByteaPSlice(X,m,n) ((bytea *) PG_DETOAST_DATUM_SLICE(X,m,n)) #define DatumGetTextPSlice(X,m,n) ((text *) PG_DETOAST_DATUM_SLICE(X,m,n)) #define DatumGetBpCharPSlice(X,m,n) ((BpChar *) PG_DETOAST_DATUM_SLICE(X,m,n)) #define DatumGetVarCharPSlice(X,m,n) ((VarChar *) PG_DETOAST_DATUM_SLICE(X,m,n)) /* GETARG macros for varlena types will typically look like this: */ #define PG_GETARG_BYTEA_P(n) DatumGetByteaP(PG_GETARG_DATUM(n)) #define PG_GETARG_BYTEA_PP(n) DatumGetByteaPP(PG_GETARG_DATUM(n)) #define PG_GETARG_TEXT_P(n) DatumGetTextP(PG_GETARG_DATUM(n)) #define PG_GETARG_TEXT_PP(n) DatumGetTextPP(PG_GETARG_DATUM(n)) #define PG_GETARG_BPCHAR_P(n) DatumGetBpCharP(PG_GETARG_DATUM(n)) #define PG_GETARG_BPCHAR_PP(n) DatumGetBpCharPP(PG_GETARG_DATUM(n)) #define PG_GETARG_VARCHAR_P(n) DatumGetVarCharP(PG_GETARG_DATUM(n)) #define PG_GETARG_VARCHAR_PP(n) DatumGetVarCharPP(PG_GETARG_DATUM(n)) #define PG_GETARG_HEAPTUPLEHEADER(n) DatumGetHeapTupleHeader(PG_GETARG_DATUM(n)) /* And we also offer variants that return an OK-to-write copy */ #define PG_GETARG_BYTEA_P_COPY(n) DatumGetByteaPCopy(PG_GETARG_DATUM(n)) #define PG_GETARG_TEXT_P_COPY(n) DatumGetTextPCopy(PG_GETARG_DATUM(n)) #define PG_GETARG_BPCHAR_P_COPY(n) DatumGetBpCharPCopy(PG_GETARG_DATUM(n)) #define PG_GETARG_VARCHAR_P_COPY(n) DatumGetVarCharPCopy(PG_GETARG_DATUM(n)) #define PG_GETARG_HEAPTUPLEHEADER_COPY(n) DatumGetHeapTupleHeaderCopy(PG_GETARG_DATUM(n)) /* And a b-byte slice from position a -also OK to write */ #define PG_GETARG_BYTEA_P_SLICE(n,a,b) DatumGetByteaPSlice(PG_GETARG_DATUM(n),a,b) #define PG_GETARG_TEXT_P_SLICE(n,a,b) DatumGetTextPSlice(PG_GETARG_DATUM(n),a,b) #define PG_GETARG_BPCHAR_P_SLICE(n,a,b) DatumGetBpCharPSlice(PG_GETARG_DATUM(n),a,b) #define PG_GETARG_VARCHAR_P_SLICE(n,a,b) DatumGetVarCharPSlice(PG_GETARG_DATUM(n),a,b) /* To return a NULL do this: */ #define PG_RETURN_NULL() \ do { fcinfo->isnull = true; return (Datum) 0; } while (0) /* A few internal functions return void (which is not the same as NULL!) */ #define PG_RETURN_VOID() return (Datum) 0 /* Macros for returning results of standard types */ #define PG_RETURN_DATUM(x) return (x) #define PG_RETURN_INT32(x) return Int32GetDatum(x) #define PG_RETURN_UINT32(x) return UInt32GetDatum(x) #define PG_RETURN_INT16(x) return Int16GetDatum(x) #define PG_RETURN_CHAR(x) return CharGetDatum(x) #define PG_RETURN_BOOL(x) return BoolGetDatum(x) #define PG_RETURN_OID(x) return ObjectIdGetDatum(x) #define PG_RETURN_POINTER(x) return PointerGetDatum(x) #define PG_RETURN_CSTRING(x) return CStringGetDatum(x) #define PG_RETURN_NAME(x) return NameGetDatum(x) /* these macros hide the pass-by-reference-ness of the datatype: */ #define PG_RETURN_FLOAT4(x) return Float4GetDatum(x) #define PG_RETURN_FLOAT8(x) return Float8GetDatum(x) #define PG_RETURN_INT64(x) return Int64GetDatum(x) /* RETURN macros for other pass-by-ref types will typically look like this: */ #define PG_RETURN_BYTEA_P(x) PG_RETURN_POINTER(x) #define PG_RETURN_TEXT_P(x) PG_RETURN_POINTER(x) #define PG_RETURN_BPCHAR_P(x) PG_RETURN_POINTER(x) #define PG_RETURN_VARCHAR_P(x) PG_RETURN_POINTER(x) #define PG_RETURN_HEAPTUPLEHEADER(x) return HeapTupleHeaderGetDatum(x) /*------------------------------------------------------------------------- * Support for detecting call convention of dynamically-loaded functions * * Dynamically loaded functions may use either the version-1 ("new style") * or version-0 ("old style") calling convention. Version 1 is the call * convention defined in this header file; version 0 is the old "plain C" * convention. A version-1 function must be accompanied by the macro call * * PG_FUNCTION_INFO_V1(function_name); * * Note that internal functions do not need this decoration since they are * assumed to be version-1. * *------------------------------------------------------------------------- */ typedef struct { int api_version; /* specifies call convention version number */ /* More fields may be added later, for version numbers > 1. */ } Pg_finfo_record; /* Expected signature of an info function */ typedef const Pg_finfo_record *(*PGFInfoFunction) (void); /* * Macro to build an info function associated with the given function name. * Win32 loadable functions usually link with 'dlltool --export-all', but it * doesn't hurt to add PGDLLIMPORT in case they don't. */ #define PG_FUNCTION_INFO_V1(funcname) \ extern PGDLLEXPORT const Pg_finfo_record * CppConcat(pg_finfo_,funcname)(void); \ const Pg_finfo_record * \ CppConcat(pg_finfo_,funcname) (void) \ { \ static const Pg_finfo_record my_finfo = { 1 }; \ return &my_finfo; \ } \ extern int no_such_variable /*------------------------------------------------------------------------- * Support for verifying backend compatibility of loaded modules * * We require dynamically-loaded modules to include the macro call * PG_MODULE_MAGIC; * so that we can check for obvious incompatibility, such as being compiled * for a different major PostgreSQL version. * * To compile with versions of PostgreSQL that do not support this, * you may put an #ifdef/#endif test around it. Note that in a multiple- * source-file module, the macro call should only appear once. * * The specific items included in the magic block are intended to be ones that * are custom-configurable and especially likely to break dynamically loaded * modules if they were compiled with other values. Also, the length field * can be used to detect definition changes. * * Note: we compare magic blocks with memcmp(), so there had better not be * any alignment pad bytes in them. * * Note: when changing the contents of magic blocks, be sure to adjust the * incompatible_module_error() function in dfmgr.c. *------------------------------------------------------------------------- */ /* Definition of the magic block structure */ typedef struct { int len; /* sizeof(this struct) */ int version; /* PostgreSQL major version */ int funcmaxargs; /* FUNC_MAX_ARGS */ int indexmaxkeys; /* INDEX_MAX_KEYS */ int namedatalen; /* NAMEDATALEN */ int float4byval; /* FLOAT4PASSBYVAL */ int float8byval; /* FLOAT8PASSBYVAL */ } Pg_magic_struct; /* The actual data block contents */ #define PG_MODULE_MAGIC_DATA \ { \ sizeof(Pg_magic_struct), \ PG_VERSION_NUM / 100, \ FUNC_MAX_ARGS, \ INDEX_MAX_KEYS, \ NAMEDATALEN, \ FLOAT4PASSBYVAL, \ FLOAT8PASSBYVAL \ } /* * Declare the module magic function. It needs to be a function as the dlsym * in the backend is only guaranteed to work on functions, not data */ typedef const Pg_magic_struct *(*PGModuleMagicFunction) (void); #define PG_MAGIC_FUNCTION_NAME Pg_magic_func #define PG_MAGIC_FUNCTION_NAME_STRING "Pg_magic_func" #define PG_MODULE_MAGIC \ extern PGDLLEXPORT const Pg_magic_struct *PG_MAGIC_FUNCTION_NAME(void); \ const Pg_magic_struct * \ PG_MAGIC_FUNCTION_NAME(void) \ { \ static const Pg_magic_struct Pg_magic_data = PG_MODULE_MAGIC_DATA; \ return &Pg_magic_data; \ } \ extern int no_such_variable /*------------------------------------------------------------------------- * Support routines and macros for callers of fmgr-compatible functions *------------------------------------------------------------------------- */ /* These are for invocation of a specifically named function with a * directly-computed parameter list. Note that neither arguments nor result * are allowed to be NULL. */ extern Datum DirectFunctionCall1Coll(PGFunction func, Oid collation, Datum arg1); extern Datum DirectFunctionCall2Coll(PGFunction func, Oid collation, Datum arg1, Datum arg2); extern Datum DirectFunctionCall3Coll(PGFunction func, Oid collation, Datum arg1, Datum arg2, Datum arg3); extern Datum DirectFunctionCall4Coll(PGFunction func, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4); extern Datum DirectFunctionCall5Coll(PGFunction func, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4, Datum arg5); extern Datum DirectFunctionCall6Coll(PGFunction func, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4, Datum arg5, Datum arg6); extern Datum DirectFunctionCall7Coll(PGFunction func, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4, Datum arg5, Datum arg6, Datum arg7); extern Datum DirectFunctionCall8Coll(PGFunction func, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4, Datum arg5, Datum arg6, Datum arg7, Datum arg8); extern Datum DirectFunctionCall9Coll(PGFunction func, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4, Datum arg5, Datum arg6, Datum arg7, Datum arg8, Datum arg9); /* These are for invocation of a previously-looked-up function with a * directly-computed parameter list. Note that neither arguments nor result * are allowed to be NULL. */ extern Datum FunctionCall1Coll(FmgrInfo *flinfo, Oid collation, Datum arg1); extern Datum FunctionCall2Coll(FmgrInfo *flinfo, Oid collation, Datum arg1, Datum arg2); extern Datum FunctionCall3Coll(FmgrInfo *flinfo, Oid collation, Datum arg1, Datum arg2, Datum arg3); extern Datum FunctionCall4Coll(FmgrInfo *flinfo, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4); extern Datum FunctionCall5Coll(FmgrInfo *flinfo, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4, Datum arg5); extern Datum FunctionCall6Coll(FmgrInfo *flinfo, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4, Datum arg5, Datum arg6); extern Datum FunctionCall7Coll(FmgrInfo *flinfo, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4, Datum arg5, Datum arg6, Datum arg7); extern Datum FunctionCall8Coll(FmgrInfo *flinfo, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4, Datum arg5, Datum arg6, Datum arg7, Datum arg8); extern Datum FunctionCall9Coll(FmgrInfo *flinfo, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4, Datum arg5, Datum arg6, Datum arg7, Datum arg8, Datum arg9); /* These are for invocation of a function identified by OID with a * directly-computed parameter list. Note that neither arguments nor result * are allowed to be NULL. These are essentially FunctionLookup() followed * by FunctionCallN(). If the same function is to be invoked repeatedly, * do the FunctionLookup() once and then use FunctionCallN(). */ extern Datum OidFunctionCall0Coll(Oid functionId, Oid collation); extern Datum OidFunctionCall1Coll(Oid functionId, Oid collation, Datum arg1); extern Datum OidFunctionCall2Coll(Oid functionId, Oid collation, Datum arg1, Datum arg2); extern Datum OidFunctionCall3Coll(Oid functionId, Oid collation, Datum arg1, Datum arg2, Datum arg3); extern Datum OidFunctionCall4Coll(Oid functionId, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4); extern Datum OidFunctionCall5Coll(Oid functionId, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4, Datum arg5); extern Datum OidFunctionCall6Coll(Oid functionId, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4, Datum arg5, Datum arg6); extern Datum OidFunctionCall7Coll(Oid functionId, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4, Datum arg5, Datum arg6, Datum arg7); extern Datum OidFunctionCall8Coll(Oid functionId, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4, Datum arg5, Datum arg6, Datum arg7, Datum arg8); extern Datum OidFunctionCall9Coll(Oid functionId, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4, Datum arg5, Datum arg6, Datum arg7, Datum arg8, Datum arg9); /* These macros allow the collation argument to be omitted (with a default of * InvalidOid, ie, no collation). They exist mostly for backwards * compatibility of source code. */ #define DirectFunctionCall1(func, arg1) \ DirectFunctionCall1Coll(func, InvalidOid, arg1) #define DirectFunctionCall2(func, arg1, arg2) \ DirectFunctionCall2Coll(func, InvalidOid, arg1, arg2) #define DirectFunctionCall3(func, arg1, arg2, arg3) \ DirectFunctionCall3Coll(func, InvalidOid, arg1, arg2, arg3) #define DirectFunctionCall4(func, arg1, arg2, arg3, arg4) \ DirectFunctionCall4Coll(func, InvalidOid, arg1, arg2, arg3, arg4) #define DirectFunctionCall5(func, arg1, arg2, arg3, arg4, arg5) \ DirectFunctionCall5Coll(func, InvalidOid, arg1, arg2, arg3, arg4, arg5) #define DirectFunctionCall6(func, arg1, arg2, arg3, arg4, arg5, arg6) \ DirectFunctionCall6Coll(func, InvalidOid, arg1, arg2, arg3, arg4, arg5, arg6) #define DirectFunctionCall7(func, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \ DirectFunctionCall7Coll(func, InvalidOid, arg1, arg2, arg3, arg4, arg5, arg6, arg7) #define DirectFunctionCall8(func, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \ DirectFunctionCall8Coll(func, InvalidOid, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) #define DirectFunctionCall9(func, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) \ DirectFunctionCall9Coll(func, InvalidOid, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) #define FunctionCall1(flinfo, arg1) \ FunctionCall1Coll(flinfo, InvalidOid, arg1) #define FunctionCall2(flinfo, arg1, arg2) \ FunctionCall2Coll(flinfo, InvalidOid, arg1, arg2) #define FunctionCall3(flinfo, arg1, arg2, arg3) \ FunctionCall3Coll(flinfo, InvalidOid, arg1, arg2, arg3) #define FunctionCall4(flinfo, arg1, arg2, arg3, arg4) \ FunctionCall4Coll(flinfo, InvalidOid, arg1, arg2, arg3, arg4) #define FunctionCall5(flinfo, arg1, arg2, arg3, arg4, arg5) \ FunctionCall5Coll(flinfo, InvalidOid, arg1, arg2, arg3, arg4, arg5) #define FunctionCall6(flinfo, arg1, arg2, arg3, arg4, arg5, arg6) \ FunctionCall6Coll(flinfo, InvalidOid, arg1, arg2, arg3, arg4, arg5, arg6) #define FunctionCall7(flinfo, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \ FunctionCall7Coll(flinfo, InvalidOid, arg1, arg2, arg3, arg4, arg5, arg6, arg7) #define FunctionCall8(flinfo, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \ FunctionCall8Coll(flinfo, InvalidOid, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) #define FunctionCall9(flinfo, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) \ FunctionCall9Coll(flinfo, InvalidOid, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) #define OidFunctionCall0(functionId) \ OidFunctionCall0Coll(functionId, InvalidOid) #define OidFunctionCall1(functionId, arg1) \ OidFunctionCall1Coll(functionId, InvalidOid, arg1) #define OidFunctionCall2(functionId, arg1, arg2) \ OidFunctionCall2Coll(functionId, InvalidOid, arg1, arg2) #define OidFunctionCall3(functionId, arg1, arg2, arg3) \ OidFunctionCall3Coll(functionId, InvalidOid, arg1, arg2, arg3) #define OidFunctionCall4(functionId, arg1, arg2, arg3, arg4) \ OidFunctionCall4Coll(functionId, InvalidOid, arg1, arg2, arg3, arg4) #define OidFunctionCall5(functionId, arg1, arg2, arg3, arg4, arg5) \ OidFunctionCall5Coll(functionId, InvalidOid, arg1, arg2, arg3, arg4, arg5) #define OidFunctionCall6(functionId, arg1, arg2, arg3, arg4, arg5, arg6) \ OidFunctionCall6Coll(functionId, InvalidOid, arg1, arg2, arg3, arg4, arg5, arg6) #define OidFunctionCall7(functionId, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \ OidFunctionCall7Coll(functionId, InvalidOid, arg1, arg2, arg3, arg4, arg5, arg6, arg7) #define OidFunctionCall8(functionId, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \ OidFunctionCall8Coll(functionId, InvalidOid, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) #define OidFunctionCall9(functionId, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) \ OidFunctionCall9Coll(functionId, InvalidOid, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) /* Special cases for convenient invocation of datatype I/O functions. */ extern Datum InputFunctionCall(FmgrInfo *flinfo, char *str, Oid typioparam, int32 typmod); extern Datum OidInputFunctionCall(Oid functionId, char *str, Oid typioparam, int32 typmod); extern char *OutputFunctionCall(FmgrInfo *flinfo, Datum val); extern char *OidOutputFunctionCall(Oid functionId, Datum val); extern Datum ReceiveFunctionCall(FmgrInfo *flinfo, fmStringInfo buf, Oid typioparam, int32 typmod); extern Datum OidReceiveFunctionCall(Oid functionId, fmStringInfo buf, Oid typioparam, int32 typmod); extern bytea *SendFunctionCall(FmgrInfo *flinfo, Datum val); extern bytea *OidSendFunctionCall(Oid functionId, Datum val); /* * Routines in fmgr.c */ extern const Pg_finfo_record *fetch_finfo_record(void *filehandle, char *funcname); extern void clear_external_function_hash(void *filehandle); extern Oid fmgr_internal_function(const char *proname); extern Oid get_fn_expr_rettype(FmgrInfo *flinfo); extern Oid get_fn_expr_argtype(FmgrInfo *flinfo, int argnum); extern Oid get_call_expr_argtype(fmNodePtr expr, int argnum); extern bool get_fn_expr_arg_stable(FmgrInfo *flinfo, int argnum); extern bool get_call_expr_arg_stable(fmNodePtr expr, int argnum); extern bool CheckFunctionValidatorAccess(Oid validatorOid, Oid functionOid); /* * Routines in dfmgr.c */ extern char *Dynamic_library_path; extern PGFunction load_external_function(char *filename, char *funcname, bool signalNotFound, void **filehandle); extern PGFunction lookup_external_function(void *filehandle, char *funcname); extern void load_file(const char *filename, bool restricted); extern void **find_rendezvous_variable(const char *varName); /* * Support for aggregate functions * * This is actually in executor/nodeAgg.c, but we declare it here since the * whole point is for callers of it to not be overly friendly with nodeAgg. */ /* AggCheckCallContext can return one of the following codes, or 0: */ #define AGG_CONTEXT_AGGREGATE 1 /* regular aggregate */ #define AGG_CONTEXT_WINDOW 2 /* window function */ extern int AggCheckCallContext(FunctionCallInfo fcinfo, MemoryContext *aggcontext); /* * We allow plugin modules to hook function entry/exit. This is intended * as support for loadable security policy modules, which may want to * perform additional privilege checks on function entry or exit, or to do * other internal bookkeeping. To make this possible, such modules must be * able not only to support normal function entry and exit, but also to trap * the case where we bail out due to an error; and they must also be able to * prevent inlining. */ typedef enum FmgrHookEventType { FHET_START, FHET_END, FHET_ABORT } FmgrHookEventType; typedef bool (*needs_fmgr_hook_type) (Oid fn_oid); typedef void (*fmgr_hook_type) (FmgrHookEventType event, FmgrInfo *flinfo, Datum *arg); extern PGDLLIMPORT needs_fmgr_hook_type needs_fmgr_hook; extern PGDLLIMPORT fmgr_hook_type fmgr_hook; #define FmgrHookIsNeeded(fn_oid) \ (!needs_fmgr_hook ? false : (*needs_fmgr_hook)(fn_oid)) /* * !!! OLD INTERFACE !!! * * fmgr() is the only remaining vestige of the old-style caller support * functions. It's no longer used anywhere in the Postgres distribution, * but we should leave it around for a release or two to ease the transition * for user-supplied C functions. OidFunctionCallN() replaces it for new * code. */ /* * DEPRECATED, DO NOT USE IN NEW CODE */ extern char *fmgr(Oid procedureId,...); #endif /* FMGR_H */ PKBiZ !!server/access/xact.hnu[/*------------------------------------------------------------------------- * * xact.h * postgres transaction system definitions * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/xact.h * *------------------------------------------------------------------------- */ #ifndef XACT_H #define XACT_H #include "access/xlog.h" #include "nodes/pg_list.h" #include "storage/relfilenode.h" /* * Xact isolation levels */ #define XACT_READ_UNCOMMITTED 0 #define XACT_READ_COMMITTED 1 #define XACT_REPEATABLE_READ 2 #define XACT_SERIALIZABLE 3 extern int DefaultXactIsoLevel; extern int XactIsoLevel; /* * We implement three isolation levels internally. * The two stronger ones use one snapshot per database transaction; * the others use one snapshot per statement. * Serializable uses predicate locks in addition to snapshots. * These macros should be used to check which isolation level is selected. */ #define IsolationUsesXactSnapshot() (XactIsoLevel >= XACT_REPEATABLE_READ) #define IsolationIsSerializable() (XactIsoLevel == XACT_SERIALIZABLE) /* Xact read-only state */ extern bool DefaultXactReadOnly; extern bool XactReadOnly; /* * Xact is deferrable -- only meaningful (currently) for read only * SERIALIZABLE transactions */ extern bool DefaultXactDeferrable; extern bool XactDeferrable; typedef enum { SYNCHRONOUS_COMMIT_OFF, /* asynchronous commit */ SYNCHRONOUS_COMMIT_LOCAL_FLUSH, /* wait for local flush only */ SYNCHRONOUS_COMMIT_REMOTE_WRITE, /* wait for local flush and remote * write */ SYNCHRONOUS_COMMIT_REMOTE_FLUSH /* wait for local and remote flush */ } SyncCommitLevel; /* Define the default setting for synchronous_commit */ #define SYNCHRONOUS_COMMIT_ON SYNCHRONOUS_COMMIT_REMOTE_FLUSH /* Synchronous commit level */ extern int synchronous_commit; /* Kluge for 2PC support */ extern bool MyXactAccessedTempRel; /* * start- and end-of-transaction callbacks for dynamically loaded modules */ typedef enum { XACT_EVENT_COMMIT, XACT_EVENT_ABORT, XACT_EVENT_PREPARE } XactEvent; typedef void (*XactCallback) (XactEvent event, void *arg); typedef enum { SUBXACT_EVENT_START_SUB, SUBXACT_EVENT_COMMIT_SUB, SUBXACT_EVENT_ABORT_SUB } SubXactEvent; typedef void (*SubXactCallback) (SubXactEvent event, SubTransactionId mySubid, SubTransactionId parentSubid, void *arg); /* ---------------- * transaction-related XLOG entries * ---------------- */ /* * XLOG allows to store some information in high 4 bits of log * record xl_info field */ #define XLOG_XACT_COMMIT 0x00 #define XLOG_XACT_PREPARE 0x10 #define XLOG_XACT_ABORT 0x20 #define XLOG_XACT_COMMIT_PREPARED 0x30 #define XLOG_XACT_ABORT_PREPARED 0x40 #define XLOG_XACT_ASSIGNMENT 0x50 #define XLOG_XACT_COMMIT_COMPACT 0x60 typedef struct xl_xact_assignment { TransactionId xtop; /* assigned XID's top-level XID */ int nsubxacts; /* number of subtransaction XIDs */ TransactionId xsub[1]; /* assigned subxids */ } xl_xact_assignment; #define MinSizeOfXactAssignment offsetof(xl_xact_assignment, xsub) typedef struct xl_xact_commit_compact { TimestampTz xact_time; /* time of commit */ int nsubxacts; /* number of subtransaction XIDs */ /* ARRAY OF COMMITTED SUBTRANSACTION XIDs FOLLOWS */ TransactionId subxacts[1]; /* VARIABLE LENGTH ARRAY */ } xl_xact_commit_compact; #define MinSizeOfXactCommitCompact offsetof(xl_xact_commit_compact, subxacts) typedef struct xl_xact_commit { TimestampTz xact_time; /* time of commit */ uint32 xinfo; /* info flags */ int nrels; /* number of RelFileNodes */ int nsubxacts; /* number of subtransaction XIDs */ int nmsgs; /* number of shared inval msgs */ Oid dbId; /* MyDatabaseId */ Oid tsId; /* MyDatabaseTableSpace */ /* Array of RelFileNode(s) to drop at commit */ RelFileNode xnodes[1]; /* VARIABLE LENGTH ARRAY */ /* ARRAY OF COMMITTED SUBTRANSACTION XIDs FOLLOWS */ /* ARRAY OF SHARED INVALIDATION MESSAGES FOLLOWS */ } xl_xact_commit; #define MinSizeOfXactCommit offsetof(xl_xact_commit, xnodes) /* * These flags are set in the xinfo fields of WAL commit records, * indicating a variety of additional actions that need to occur * when emulating transaction effects during recovery. * They are named XactCompletion... to differentiate them from * EOXact... routines which run at the end of the original * transaction completion. */ #define XACT_COMPLETION_UPDATE_RELCACHE_FILE 0x01 #define XACT_COMPLETION_FORCE_SYNC_COMMIT 0x02 /* Access macros for above flags */ #define XactCompletionRelcacheInitFileInval(xinfo) (xinfo & XACT_COMPLETION_UPDATE_RELCACHE_FILE) #define XactCompletionForceSyncCommit(xinfo) (xinfo & XACT_COMPLETION_FORCE_SYNC_COMMIT) typedef struct xl_xact_abort { TimestampTz xact_time; /* time of abort */ int nrels; /* number of RelFileNodes */ int nsubxacts; /* number of subtransaction XIDs */ /* Array of RelFileNode(s) to drop at abort */ RelFileNode xnodes[1]; /* VARIABLE LENGTH ARRAY */ /* ARRAY OF ABORTED SUBTRANSACTION XIDs FOLLOWS */ } xl_xact_abort; /* Note the intentional lack of an invalidation message array c.f. commit */ #define MinSizeOfXactAbort offsetof(xl_xact_abort, xnodes) /* * COMMIT_PREPARED and ABORT_PREPARED are identical to COMMIT/ABORT records * except that we have to store the XID of the prepared transaction explicitly * --- the XID in the record header will be invalid. */ typedef struct xl_xact_commit_prepared { TransactionId xid; /* XID of prepared xact */ xl_xact_commit crec; /* COMMIT record */ /* MORE DATA FOLLOWS AT END OF STRUCT */ } xl_xact_commit_prepared; #define MinSizeOfXactCommitPrepared offsetof(xl_xact_commit_prepared, crec.xnodes) typedef struct xl_xact_abort_prepared { TransactionId xid; /* XID of prepared xact */ xl_xact_abort arec; /* ABORT record */ /* MORE DATA FOLLOWS AT END OF STRUCT */ } xl_xact_abort_prepared; #define MinSizeOfXactAbortPrepared offsetof(xl_xact_abort_prepared, arec.xnodes) /* ---------------- * extern definitions * ---------------- */ extern bool IsTransactionState(void); extern bool IsAbortedTransactionBlockState(void); extern TransactionId GetTopTransactionId(void); extern TransactionId GetTopTransactionIdIfAny(void); extern TransactionId GetCurrentTransactionId(void); extern TransactionId GetCurrentTransactionIdIfAny(void); extern TransactionId GetStableLatestTransactionId(void); extern SubTransactionId GetCurrentSubTransactionId(void); extern bool SubTransactionIsActive(SubTransactionId subxid); extern CommandId GetCurrentCommandId(bool used); extern TimestampTz GetCurrentTransactionStartTimestamp(void); extern TimestampTz GetCurrentStatementStartTimestamp(void); extern TimestampTz GetCurrentTransactionStopTimestamp(void); extern void SetCurrentStatementStartTimestamp(void); extern int GetCurrentTransactionNestLevel(void); extern bool TransactionIdIsCurrentTransactionId(TransactionId xid); extern void CommandCounterIncrement(void); extern void ForceSyncCommit(void); extern void StartTransactionCommand(void); extern void CommitTransactionCommand(void); extern void AbortCurrentTransaction(void); extern void BeginTransactionBlock(void); extern bool EndTransactionBlock(void); extern bool PrepareTransactionBlock(char *gid); extern void UserAbortTransactionBlock(void); extern void ReleaseSavepoint(List *options); extern void DefineSavepoint(char *name); extern void RollbackToSavepoint(List *options); extern void BeginInternalSubTransaction(char *name); extern void ReleaseCurrentSubTransaction(void); extern void RollbackAndReleaseCurrentSubTransaction(void); extern bool IsSubTransaction(void); extern bool IsTransactionBlock(void); extern bool IsTransactionOrTransactionBlock(void); extern char TransactionBlockStatusCode(void); extern void AbortOutOfAnyTransaction(void); extern void PreventTransactionChain(bool isTopLevel, const char *stmtType); extern void RequireTransactionChain(bool isTopLevel, const char *stmtType); extern bool IsInTransactionChain(bool isTopLevel); extern void RegisterXactCallback(XactCallback callback, void *arg); extern void UnregisterXactCallback(XactCallback callback, void *arg); extern void RegisterSubXactCallback(SubXactCallback callback, void *arg); extern void UnregisterSubXactCallback(SubXactCallback callback, void *arg); extern int xactGetCommittedChildren(TransactionId **ptr); extern void xact_redo(XLogRecPtr lsn, XLogRecord *record); extern void xact_desc(StringInfo buf, uint8 xl_info, char *rec); #endif /* XACT_H */ PKBiZtserver/access/twophase.hnu[/*------------------------------------------------------------------------- * * twophase.h * Two-phase-commit related declarations. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/twophase.h * *------------------------------------------------------------------------- */ #ifndef TWOPHASE_H #define TWOPHASE_H #include "storage/proc.h" /* * GlobalTransactionData is defined in twophase.c; other places have no * business knowing the internal definition. */ typedef struct GlobalTransactionData *GlobalTransaction; /* GUC variable */ extern int max_prepared_xacts; extern Size TwoPhaseShmemSize(void); extern void TwoPhaseShmemInit(void); extern void AtAbort_Twophase(void); extern void PostPrepare_Twophase(void); extern PGPROC *TwoPhaseGetDummyProc(TransactionId xid); extern BackendId TwoPhaseGetDummyBackendId(TransactionId xid); extern GlobalTransaction MarkAsPreparing(TransactionId xid, const char *gid, TimestampTz prepared_at, Oid owner, Oid databaseid); extern void StartPrepare(GlobalTransaction gxact); extern void EndPrepare(GlobalTransaction gxact); extern bool StandbyTransactionIdIsPrepared(TransactionId xid); extern TransactionId PrescanPreparedTransactions(TransactionId **xids_p, int *nxids_p); extern void StandbyRecoverPreparedTransactions(bool overwriteOK); extern void RecoverPreparedTransactions(void); extern void RecreateTwoPhaseFile(TransactionId xid, void *content, int len); extern void RemoveTwoPhaseFile(TransactionId xid, bool giveWarning); extern void CheckPointTwoPhase(XLogRecPtr redo_horizon); extern void FinishPreparedTransaction(const char *gid, bool isCommit); #endif /* TWOPHASE_H */ PKBiZ server/access/rewriteheap.hnu[/*------------------------------------------------------------------------- * * rewriteheap.h * Declarations for heap rewrite support functions * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994-5, Regents of the University of California * * src/include/access/rewriteheap.h * *------------------------------------------------------------------------- */ #ifndef REWRITE_HEAP_H #define REWRITE_HEAP_H #include "access/htup.h" #include "utils/relcache.h" /* struct definition is private to rewriteheap.c */ typedef struct RewriteStateData *RewriteState; extern RewriteState begin_heap_rewrite(Relation NewHeap, TransactionId OldestXmin, TransactionId FreezeXid, bool use_wal); extern void end_heap_rewrite(RewriteState state); extern void rewrite_heap_tuple(RewriteState state, HeapTuple oldTuple, HeapTuple newTuple); extern bool rewrite_heap_dead_tuple(RewriteState state, HeapTuple oldTuple); #endif /* REWRITE_HEAP_H */ PKBiZserver/access/subtrans.hnu[/* * subtrans.h * * PostgreSQL subtransaction-log manager * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/subtrans.h */ #ifndef SUBTRANS_H #define SUBTRANS_H /* Number of SLRU buffers to use for subtrans */ #define NUM_SUBTRANS_BUFFERS 32 extern void SubTransSetParent(TransactionId xid, TransactionId parent, bool overwriteOK); extern TransactionId SubTransGetParent(TransactionId xid); extern TransactionId SubTransGetTopmostTransaction(TransactionId xid); extern Size SUBTRANSShmemSize(void); extern void SUBTRANSShmemInit(void); extern void BootStrapSUBTRANS(void); extern void StartupSUBTRANS(TransactionId oldestActiveXID); extern void ShutdownSUBTRANS(void); extern void CheckPointSUBTRANS(void); extern void ExtendSUBTRANS(TransactionId newestXact); extern void TruncateSUBTRANS(TransactionId oldestXact); #endif /* SUBTRANS_H */ PKBiZ~[server/access/tupconvert.hnu[/*------------------------------------------------------------------------- * * tupconvert.h * Tuple conversion support. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/tupconvert.h * *------------------------------------------------------------------------- */ #ifndef TUPCONVERT_H #define TUPCONVERT_H #include "access/htup.h" typedef struct TupleConversionMap { TupleDesc indesc; /* tupdesc for source rowtype */ TupleDesc outdesc; /* tupdesc for result rowtype */ AttrNumber *attrMap; /* indexes of input fields, or 0 for null */ Datum *invalues; /* workspace for deconstructing source */ bool *inisnull; Datum *outvalues; /* workspace for constructing result */ bool *outisnull; } TupleConversionMap; extern TupleConversionMap *convert_tuples_by_position(TupleDesc indesc, TupleDesc outdesc, const char *msg); extern TupleConversionMap *convert_tuples_by_name(TupleDesc indesc, TupleDesc outdesc, const char *msg); extern HeapTuple do_convert_tuple(HeapTuple tuple, TupleConversionMap *map); extern void free_conversion_map(TupleConversionMap *map); #endif /* TUPCONVERT_H */ PKBiZPT2mmserver/access/nbtree.hnu[/*------------------------------------------------------------------------- * * nbtree.h * header file for postgres btree access method implementation. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/nbtree.h * *------------------------------------------------------------------------- */ #ifndef NBTREE_H #define NBTREE_H #include "access/genam.h" #include "access/itup.h" #include "access/sdir.h" #include "access/xlog.h" #include "access/xlogutils.h" #include "catalog/pg_index.h" /* There's room for a 16-bit vacuum cycle ID in BTPageOpaqueData */ typedef uint16 BTCycleId; /* * BTPageOpaqueData -- At the end of every page, we store a pointer * to both siblings in the tree. This is used to do forward/backward * index scans. The next-page link is also critical for recovery when * a search has navigated to the wrong page due to concurrent page splits * or deletions; see src/backend/access/nbtree/README for more info. * * In addition, we store the page's btree level (counting upwards from * zero at a leaf page) as well as some flag bits indicating the page type * and status. If the page is deleted, we replace the level with the * next-transaction-ID value indicating when it is safe to reclaim the page. * * We also store a "vacuum cycle ID". When a page is split while VACUUM is * processing the index, a nonzero value associated with the VACUUM run is * stored into both halves of the split page. (If VACUUM is not running, * both pages receive zero cycleids.) This allows VACUUM to detect whether * a page was split since it started, with a small probability of false match * if the page was last split some exact multiple of MAX_BT_CYCLE_ID VACUUMs * ago. Also, during a split, the BTP_SPLIT_END flag is cleared in the left * (original) page, and set in the right page, but only if the next page * to its right has a different cycleid. * * NOTE: the BTP_LEAF flag bit is redundant since level==0 could be tested * instead. */ typedef struct BTPageOpaqueData { BlockNumber btpo_prev; /* left sibling, or P_NONE if leftmost */ BlockNumber btpo_next; /* right sibling, or P_NONE if rightmost */ union { uint32 level; /* tree level --- zero for leaf pages */ TransactionId xact; /* next transaction ID, if deleted */ } btpo; uint16 btpo_flags; /* flag bits, see below */ BTCycleId btpo_cycleid; /* vacuum cycle ID of latest split */ } BTPageOpaqueData; typedef BTPageOpaqueData *BTPageOpaque; /* Bits defined in btpo_flags */ #define BTP_LEAF (1 << 0) /* leaf page, i.e. not internal page */ #define BTP_ROOT (1 << 1) /* root page (has no parent) */ #define BTP_DELETED (1 << 2) /* page has been deleted from tree */ #define BTP_META (1 << 3) /* meta-page */ #define BTP_HALF_DEAD (1 << 4) /* empty, but still in tree */ #define BTP_SPLIT_END (1 << 5) /* rightmost page of split group */ #define BTP_HAS_GARBAGE (1 << 6) /* page has LP_DEAD tuples */ /* * The max allowed value of a cycle ID is a bit less than 64K. This is * for convenience of pg_filedump and similar utilities: we want to use * the last 2 bytes of special space as an index type indicator, and * restricting cycle ID lets btree use that space for vacuum cycle IDs * while still allowing index type to be identified. */ #define MAX_BT_CYCLE_ID 0xFF7F /* * The Meta page is always the first page in the btree index. * Its primary purpose is to point to the location of the btree root page. * We also point to the "fast" root, which is the current effective root; * see README for discussion. */ typedef struct BTMetaPageData { uint32 btm_magic; /* should contain BTREE_MAGIC */ uint32 btm_version; /* should contain BTREE_VERSION */ BlockNumber btm_root; /* current root location */ uint32 btm_level; /* tree level of the root page */ BlockNumber btm_fastroot; /* current "fast" root location */ uint32 btm_fastlevel; /* tree level of the "fast" root page */ } BTMetaPageData; #define BTPageGetMeta(p) \ ((BTMetaPageData *) PageGetContents(p)) #define BTREE_METAPAGE 0 /* first page is meta */ #define BTREE_MAGIC 0x053162 /* magic number of btree pages */ #define BTREE_VERSION 2 /* current version number */ /* * Maximum size of a btree index entry, including its tuple header. * * We actually need to be able to fit three items on every page, * so restrict any one item to 1/3 the per-page available space. */ #define BTMaxItemSize(page) \ MAXALIGN_DOWN((PageGetPageSize(page) - \ MAXALIGN(SizeOfPageHeaderData + 3*sizeof(ItemIdData)) - \ MAXALIGN(sizeof(BTPageOpaqueData))) / 3) /* * The leaf-page fillfactor defaults to 90% but is user-adjustable. * For pages above the leaf level, we use a fixed 70% fillfactor. * The fillfactor is applied during index build and when splitting * a rightmost page; when splitting non-rightmost pages we try to * divide the data equally. */ #define BTREE_MIN_FILLFACTOR 10 #define BTREE_DEFAULT_FILLFACTOR 90 #define BTREE_NONLEAF_FILLFACTOR 70 /* * Test whether two btree entries are "the same". * * Old comments: * In addition, we must guarantee that all tuples in the index are unique, * in order to satisfy some assumptions in Lehman and Yao. The way that we * do this is by generating a new OID for every insertion that we do in the * tree. This adds eight bytes to the size of btree index tuples. Note * that we do not use the OID as part of a composite key; the OID only * serves as a unique identifier for a given index tuple (logical position * within a page). * * New comments: * actually, we must guarantee that all tuples in A LEVEL * are unique, not in ALL INDEX. So, we can use the t_tid * as unique identifier for a given index tuple (logical position * within a level). - vadim 04/09/97 */ #define BTTidSame(i1, i2) \ ( (i1).ip_blkid.bi_hi == (i2).ip_blkid.bi_hi && \ (i1).ip_blkid.bi_lo == (i2).ip_blkid.bi_lo && \ (i1).ip_posid == (i2).ip_posid ) #define BTEntrySame(i1, i2) \ BTTidSame((i1)->t_tid, (i2)->t_tid) /* * In general, the btree code tries to localize its knowledge about * page layout to a couple of routines. However, we need a special * value to indicate "no page number" in those places where we expect * page numbers. We can use zero for this because we never need to * make a pointer to the metadata page. */ #define P_NONE 0 /* * Macros to test whether a page is leftmost or rightmost on its tree level, * as well as other state info kept in the opaque data. */ #define P_LEFTMOST(opaque) ((opaque)->btpo_prev == P_NONE) #define P_RIGHTMOST(opaque) ((opaque)->btpo_next == P_NONE) #define P_ISLEAF(opaque) ((opaque)->btpo_flags & BTP_LEAF) #define P_ISROOT(opaque) ((opaque)->btpo_flags & BTP_ROOT) #define P_ISDELETED(opaque) ((opaque)->btpo_flags & BTP_DELETED) #define P_ISHALFDEAD(opaque) ((opaque)->btpo_flags & BTP_HALF_DEAD) #define P_IGNORE(opaque) ((opaque)->btpo_flags & (BTP_DELETED|BTP_HALF_DEAD)) #define P_HAS_GARBAGE(opaque) ((opaque)->btpo_flags & BTP_HAS_GARBAGE) /* * Lehman and Yao's algorithm requires a ``high key'' on every non-rightmost * page. The high key is not a data key, but gives info about what range of * keys is supposed to be on this page. The high key on a page is required * to be greater than or equal to any data key that appears on the page. * If we find ourselves trying to insert a key > high key, we know we need * to move right (this should only happen if the page was split since we * examined the parent page). * * Our insertion algorithm guarantees that we can use the initial least key * on our right sibling as the high key. Once a page is created, its high * key changes only if the page is split. * * On a non-rightmost page, the high key lives in item 1 and data items * start in item 2. Rightmost pages have no high key, so we store data * items beginning in item 1. */ #define P_HIKEY ((OffsetNumber) 1) #define P_FIRSTKEY ((OffsetNumber) 2) #define P_FIRSTDATAKEY(opaque) (P_RIGHTMOST(opaque) ? P_HIKEY : P_FIRSTKEY) /* * XLOG records for btree operations * * XLOG allows to store some information in high 4 bits of log * record xl_info field */ #define XLOG_BTREE_INSERT_LEAF 0x00 /* add index tuple without split */ #define XLOG_BTREE_INSERT_UPPER 0x10 /* same, on a non-leaf page */ #define XLOG_BTREE_INSERT_META 0x20 /* same, plus update metapage */ #define XLOG_BTREE_SPLIT_L 0x30 /* add index tuple with split */ #define XLOG_BTREE_SPLIT_R 0x40 /* as above, new item on right */ #define XLOG_BTREE_SPLIT_L_ROOT 0x50 /* add tuple with split of root */ #define XLOG_BTREE_SPLIT_R_ROOT 0x60 /* as above, new item on right */ #define XLOG_BTREE_DELETE 0x70 /* delete leaf index tuples for a page */ #define XLOG_BTREE_DELETE_PAGE 0x80 /* delete an entire page */ #define XLOG_BTREE_DELETE_PAGE_META 0x90 /* same, and update metapage */ #define XLOG_BTREE_NEWROOT 0xA0 /* new root page */ #define XLOG_BTREE_DELETE_PAGE_HALF 0xB0 /* page deletion that makes * parent half-dead */ #define XLOG_BTREE_VACUUM 0xC0 /* delete entries on a page during * vacuum */ #define XLOG_BTREE_REUSE_PAGE 0xD0 /* old page is about to be reused from * FSM */ /* * All that we need to find changed index tuple */ typedef struct xl_btreetid { RelFileNode node; ItemPointerData tid; /* changed tuple id */ } xl_btreetid; /* * All that we need to regenerate the meta-data page */ typedef struct xl_btree_metadata { BlockNumber root; uint32 level; BlockNumber fastroot; uint32 fastlevel; } xl_btree_metadata; /* * This is what we need to know about simple (without split) insert. * * This data record is used for INSERT_LEAF, INSERT_UPPER, INSERT_META. * Note that INSERT_META implies it's not a leaf page. */ typedef struct xl_btree_insert { xl_btreetid target; /* inserted tuple id */ /* BlockNumber downlink field FOLLOWS IF NOT XLOG_BTREE_INSERT_LEAF */ /* xl_btree_metadata FOLLOWS IF XLOG_BTREE_INSERT_META */ /* INDEX TUPLE FOLLOWS AT END OF STRUCT */ } xl_btree_insert; #define SizeOfBtreeInsert (offsetof(xl_btreetid, tid) + SizeOfIptrData) /* * On insert with split, we save all the items going into the right sibling * so that we can restore it completely from the log record. This way takes * less xlog space than the normal approach, because if we did it standardly, * XLogInsert would almost always think the right page is new and store its * whole page image. The left page, however, is handled in the normal * incremental-update fashion. * * Note: the four XLOG_BTREE_SPLIT xl_info codes all use this data record. * The _L and _R variants indicate whether the inserted tuple went into the * left or right split page (and thus, whether newitemoff and the new item * are stored or not). The _ROOT variants indicate that we are splitting * the root page, and thus that a newroot record rather than an insert or * split record should follow. Note that a split record never carries a * metapage update --- we'll do that in the parent-level update. */ typedef struct xl_btree_split { RelFileNode node; BlockNumber leftsib; /* orig page / new left page */ BlockNumber rightsib; /* new right page */ BlockNumber rnext; /* next block (orig page's rightlink) */ uint32 level; /* tree level of page being split */ OffsetNumber firstright; /* first item moved to right page */ /* * If level > 0, BlockIdData downlink follows. (We use BlockIdData rather * than BlockNumber for alignment reasons: SizeOfBtreeSplit is only 16-bit * aligned.) * * If level > 0, an IndexTuple representing the HIKEY of the left page * follows. We don't need this on leaf pages, because it's the same as * the leftmost key in the new right page. Also, it's suppressed if * XLogInsert chooses to store the left page's whole page image. * * In the _L variants, next are OffsetNumber newitemoff and the new item. * (In the _R variants, the new item is one of the right page's tuples.) * The new item, but not newitemoff, is suppressed if XLogInsert chooses * to store the left page's whole page image. * * Last are the right page's tuples in the form used by _bt_restore_page. */ } xl_btree_split; #define SizeOfBtreeSplit (offsetof(xl_btree_split, firstright) + sizeof(OffsetNumber)) /* * This is what we need to know about delete of individual leaf index tuples. * The WAL record can represent deletion of any number of index tuples on a * single index page when *not* executed by VACUUM. */ typedef struct xl_btree_delete { RelFileNode node; /* RelFileNode of the index */ BlockNumber block; RelFileNode hnode; /* RelFileNode of the heap the index currently * points at */ int nitems; /* TARGET OFFSET NUMBERS FOLLOW AT THE END */ } xl_btree_delete; #define SizeOfBtreeDelete (offsetof(xl_btree_delete, nitems) + sizeof(int)) /* * This is what we need to know about page reuse within btree. */ typedef struct xl_btree_reuse_page { RelFileNode node; BlockNumber block; TransactionId latestRemovedXid; } xl_btree_reuse_page; #define SizeOfBtreeReusePage (sizeof(xl_btree_reuse_page)) /* * This is what we need to know about vacuum of individual leaf index tuples. * The WAL record can represent deletion of any number of index tuples on a * single index page when executed by VACUUM. * * The correctness requirement for applying these changes during recovery is * that we must do one of these two things for every block in the index: * * lock the block for cleanup and apply any required changes * * EnsureBlockUnpinned() * The purpose of this is to ensure that no index scans started before we * finish scanning the index are still running by the time we begin to remove * heap tuples. * * Any changes to any one block are registered on just one WAL record. All * blocks that we need to run EnsureBlockUnpinned() are listed as a block range * starting from the last block vacuumed through until this one. Individual * block numbers aren't given. * * Note that the *last* WAL record in any vacuum of an index is allowed to * have a zero length array of offsets. Earlier records must have at least one. */ typedef struct xl_btree_vacuum { RelFileNode node; BlockNumber block; BlockNumber lastBlockVacuumed; /* TARGET OFFSET NUMBERS FOLLOW */ } xl_btree_vacuum; #define SizeOfBtreeVacuum (offsetof(xl_btree_vacuum, lastBlockVacuumed) + sizeof(BlockNumber)) /* * This is what we need to know about deletion of a btree page. The target * identifies the tuple removed from the parent page (note that we remove * this tuple's downlink and the *following* tuple's key). Note we do not * store any content for the deleted page --- it is just rewritten as empty * during recovery, apart from resetting the btpo.xact. */ typedef struct xl_btree_delete_page { xl_btreetid target; /* deleted tuple id in parent page */ BlockNumber deadblk; /* child block being deleted */ BlockNumber leftblk; /* child block's left sibling, if any */ BlockNumber rightblk; /* child block's right sibling */ TransactionId btpo_xact; /* value of btpo.xact for use in recovery */ /* xl_btree_metadata FOLLOWS IF XLOG_BTREE_DELETE_PAGE_META */ } xl_btree_delete_page; #define SizeOfBtreeDeletePage (offsetof(xl_btree_delete_page, btpo_xact) + sizeof(TransactionId)) /* * New root log record. There are zero tuples if this is to establish an * empty root, or two if it is the result of splitting an old root. * * Note that although this implies rewriting the metadata page, we don't need * an xl_btree_metadata record --- the rootblk and level are sufficient. */ typedef struct xl_btree_newroot { RelFileNode node; BlockNumber rootblk; /* location of new root */ uint32 level; /* its tree level */ /* 0 or 2 INDEX TUPLES FOLLOW AT END OF STRUCT */ } xl_btree_newroot; #define SizeOfBtreeNewroot (offsetof(xl_btree_newroot, level) + sizeof(uint32)) /* * Operator strategy numbers for B-tree have been moved to access/skey.h, * because many places need to use them in ScanKeyInit() calls. * * The strategy numbers are chosen so that we can commute them by * subtraction, thus: */ #define BTCommuteStrategyNumber(strat) (BTMaxStrategyNumber + 1 - (strat)) /* * When a new operator class is declared, we require that the user * supply us with an amproc procedure (BTORDER_PROC) for determining * whether, for two keys a and b, a < b, a = b, or a > b. This routine * must return < 0, 0, > 0, respectively, in these three cases. (It must * not return INT_MIN, since we may negate the result before using it.) * * To facilitate accelerated sorting, an operator class may choose to * offer a second procedure (BTSORTSUPPORT_PROC). For full details, see * src/include/utils/sortsupport.h. */ #define BTORDER_PROC 1 #define BTSORTSUPPORT_PROC 2 /* * We need to be able to tell the difference between read and write * requests for pages, in order to do locking correctly. */ #define BT_READ BUFFER_LOCK_SHARE #define BT_WRITE BUFFER_LOCK_EXCLUSIVE /* * BTStackData -- As we descend a tree, we push the (location, downlink) * pairs from internal pages onto a private stack. If we split a * leaf, we use this stack to walk back up the tree and insert data * into parent pages (and possibly to split them, too). Lehman and * Yao's update algorithm guarantees that under no circumstances can * our private stack give us an irredeemably bad picture up the tree. * Again, see the paper for details. */ typedef struct BTStackData { BlockNumber bts_blkno; OffsetNumber bts_offset; IndexTupleData bts_btentry; struct BTStackData *bts_parent; } BTStackData; typedef BTStackData *BTStack; /* * BTScanOpaqueData is the btree-private state needed for an indexscan. * This consists of preprocessed scan keys (see _bt_preprocess_keys() for * details of the preprocessing), information about the current location * of the scan, and information about the marked location, if any. (We use * BTScanPosData to represent the data needed for each of current and marked * locations.) In addition we can remember some known-killed index entries * that must be marked before we can move off the current page. * * Index scans work a page at a time: we pin and read-lock the page, identify * all the matching items on the page and save them in BTScanPosData, then * release the read-lock while returning the items to the caller for * processing. This approach minimizes lock/unlock traffic. Note that we * keep the pin on the index page until the caller is done with all the items * (this is needed for VACUUM synchronization, see nbtree/README). When we * are ready to step to the next page, if the caller has told us any of the * items were killed, we re-lock the page to mark them killed, then unlock. * Finally we drop the pin and step to the next page in the appropriate * direction. * * If we are doing an index-only scan, we save the entire IndexTuple for each * matched item, otherwise only its heap TID and offset. The IndexTuples go * into a separate workspace array; each BTScanPosItem stores its tuple's * offset within that array. */ typedef struct BTScanPosItem /* what we remember about each match */ { ItemPointerData heapTid; /* TID of referenced heap item */ OffsetNumber indexOffset; /* index item's location within page */ LocationIndex tupleOffset; /* IndexTuple's offset in workspace, if any */ } BTScanPosItem; typedef struct BTScanPosData { Buffer buf; /* if valid, the buffer is pinned */ BlockNumber nextPage; /* page's right link when we scanned it */ /* * moreLeft and moreRight track whether we think there may be matching * index entries to the left and right of the current page, respectively. * We can clear the appropriate one of these flags when _bt_checkkeys() * returns continuescan = false. */ bool moreLeft; bool moreRight; /* * If we are doing an index-only scan, nextTupleOffset is the first free * location in the associated tuple storage workspace. */ int nextTupleOffset; /* * The items array is always ordered in index order (ie, increasing * indexoffset). When scanning backwards it is convenient to fill the * array back-to-front, so we start at the last slot and fill downwards. * Hence we need both a first-valid-entry and a last-valid-entry counter. * itemIndex is a cursor showing which entry was last returned to caller. */ int firstItem; /* first valid index in items[] */ int lastItem; /* last valid index in items[] */ int itemIndex; /* current index in items[] */ BTScanPosItem items[MaxIndexTuplesPerPage]; /* MUST BE LAST */ } BTScanPosData; typedef BTScanPosData *BTScanPos; #define BTScanPosIsValid(scanpos) BufferIsValid((scanpos).buf) /* We need one of these for each equality-type SK_SEARCHARRAY scan key */ typedef struct BTArrayKeyInfo { int scan_key; /* index of associated key in arrayKeyData */ int cur_elem; /* index of current element in elem_values */ int mark_elem; /* index of marked element in elem_values */ int num_elems; /* number of elems in current array value */ Datum *elem_values; /* array of num_elems Datums */ } BTArrayKeyInfo; typedef struct BTScanOpaqueData { /* these fields are set by _bt_preprocess_keys(): */ bool qual_ok; /* false if qual can never be satisfied */ int numberOfKeys; /* number of preprocessed scan keys */ ScanKey keyData; /* array of preprocessed scan keys */ /* workspace for SK_SEARCHARRAY support */ ScanKey arrayKeyData; /* modified copy of scan->keyData */ int numArrayKeys; /* number of equality-type array keys (-1 if * there are any unsatisfiable array keys) */ BTArrayKeyInfo *arrayKeys; /* info about each equality-type array key */ MemoryContext arrayContext; /* scan-lifespan context for array data */ /* info about killed items if any (killedItems is NULL if never used) */ int *killedItems; /* currPos.items indexes of killed items */ int numKilled; /* number of currently stored items */ /* * If we are doing an index-only scan, these are the tuple storage * workspaces for the currPos and markPos respectively. Each is of size * BLCKSZ, so it can hold as much as a full page's worth of tuples. */ char *currTuples; /* tuple storage for currPos */ char *markTuples; /* tuple storage for markPos */ /* * If the marked position is on the same page as current position, we * don't use markPos, but just keep the marked itemIndex in markItemIndex * (all the rest of currPos is valid for the mark position). Hence, to * determine if there is a mark, first look at markItemIndex, then at * markPos. */ int markItemIndex; /* itemIndex, or -1 if not valid */ /* keep these last in struct for efficiency */ BTScanPosData currPos; /* current position data */ BTScanPosData markPos; /* marked position, if any */ } BTScanOpaqueData; typedef BTScanOpaqueData *BTScanOpaque; /* * We use some private sk_flags bits in preprocessed scan keys. We're allowed * to use bits 16-31 (see skey.h). The uppermost bits are copied from the * index's indoption[] array entry for the index attribute. */ #define SK_BT_REQFWD 0x00010000 /* required to continue forward scan */ #define SK_BT_REQBKWD 0x00020000 /* required to continue backward scan */ #define SK_BT_INDOPTION_SHIFT 24 /* must clear the above bits */ #define SK_BT_DESC (INDOPTION_DESC << SK_BT_INDOPTION_SHIFT) #define SK_BT_NULLS_FIRST (INDOPTION_NULLS_FIRST << SK_BT_INDOPTION_SHIFT) /* * prototypes for functions in nbtree.c (external entry points for btree) */ extern Datum btbuild(PG_FUNCTION_ARGS); extern Datum btbuildempty(PG_FUNCTION_ARGS); extern Datum btinsert(PG_FUNCTION_ARGS); extern Datum btbeginscan(PG_FUNCTION_ARGS); extern Datum btgettuple(PG_FUNCTION_ARGS); extern Datum btgetbitmap(PG_FUNCTION_ARGS); extern Datum btrescan(PG_FUNCTION_ARGS); extern Datum btendscan(PG_FUNCTION_ARGS); extern Datum btmarkpos(PG_FUNCTION_ARGS); extern Datum btrestrpos(PG_FUNCTION_ARGS); extern Datum btbulkdelete(PG_FUNCTION_ARGS); extern Datum btvacuumcleanup(PG_FUNCTION_ARGS); extern Datum btcanreturn(PG_FUNCTION_ARGS); extern Datum btoptions(PG_FUNCTION_ARGS); /* * prototypes for functions in nbtinsert.c */ extern bool _bt_doinsert(Relation rel, IndexTuple itup, IndexUniqueCheck checkUnique, Relation heapRel); extern Buffer _bt_getstackbuf(Relation rel, BTStack stack, int access); extern void _bt_insert_parent(Relation rel, Buffer buf, Buffer rbuf, BTStack stack, bool is_root, bool is_only); /* * prototypes for functions in nbtpage.c */ extern void _bt_initmetapage(Page page, BlockNumber rootbknum, uint32 level); extern Buffer _bt_getroot(Relation rel, int access); extern Buffer _bt_gettrueroot(Relation rel); extern void _bt_checkpage(Relation rel, Buffer buf); extern Buffer _bt_getbuf(Relation rel, BlockNumber blkno, int access); extern Buffer _bt_relandgetbuf(Relation rel, Buffer obuf, BlockNumber blkno, int access); extern void _bt_relbuf(Relation rel, Buffer buf); extern void _bt_pageinit(Page page, Size size); extern bool _bt_page_recyclable(Page page); extern void _bt_delitems_delete(Relation rel, Buffer buf, OffsetNumber *itemnos, int nitems, Relation heapRel); extern void _bt_delitems_vacuum(Relation rel, Buffer buf, OffsetNumber *itemnos, int nitems, BlockNumber lastBlockVacuumed); extern int _bt_pagedel(Relation rel, Buffer buf, BTStack stack); /* * prototypes for functions in nbtsearch.c */ extern BTStack _bt_search(Relation rel, int keysz, ScanKey scankey, bool nextkey, Buffer *bufP, int access); extern Buffer _bt_moveright(Relation rel, Buffer buf, int keysz, ScanKey scankey, bool nextkey, int access); extern OffsetNumber _bt_binsrch(Relation rel, Buffer buf, int keysz, ScanKey scankey, bool nextkey); extern int32 _bt_compare(Relation rel, int keysz, ScanKey scankey, Page page, OffsetNumber offnum); extern bool _bt_first(IndexScanDesc scan, ScanDirection dir); extern bool _bt_next(IndexScanDesc scan, ScanDirection dir); extern Buffer _bt_get_endpoint(Relation rel, uint32 level, bool rightmost); /* * prototypes for functions in nbtutils.c */ extern ScanKey _bt_mkscankey(Relation rel, IndexTuple itup); extern ScanKey _bt_mkscankey_nodata(Relation rel); extern void _bt_freeskey(ScanKey skey); extern void _bt_freestack(BTStack stack); extern void _bt_preprocess_array_keys(IndexScanDesc scan); extern void _bt_start_array_keys(IndexScanDesc scan, ScanDirection dir); extern bool _bt_advance_array_keys(IndexScanDesc scan, ScanDirection dir); extern void _bt_mark_array_keys(IndexScanDesc scan); extern void _bt_restore_array_keys(IndexScanDesc scan); extern void _bt_preprocess_keys(IndexScanDesc scan); extern IndexTuple _bt_checkkeys(IndexScanDesc scan, Page page, OffsetNumber offnum, ScanDirection dir, bool *continuescan); extern void _bt_killitems(IndexScanDesc scan, bool haveLock); extern BTCycleId _bt_vacuum_cycleid(Relation rel); extern BTCycleId _bt_start_vacuum(Relation rel); extern void _bt_end_vacuum(Relation rel); extern void _bt_end_vacuum_callback(int code, Datum arg); extern Size BTreeShmemSize(void); extern void BTreeShmemInit(void); /* * prototypes for functions in nbtsort.c */ typedef struct BTSpool BTSpool; /* opaque type known only within nbtsort.c */ extern BTSpool *_bt_spoolinit(Relation index, bool isunique, bool isdead); extern void _bt_spooldestroy(BTSpool *btspool); extern void _bt_spool(IndexTuple itup, BTSpool *btspool); extern void _bt_leafbuild(BTSpool *btspool, BTSpool *spool2); /* * prototypes for functions in nbtxlog.c */ extern void btree_redo(XLogRecPtr lsn, XLogRecord *record); extern void btree_desc(StringInfo buf, uint8 xl_info, char *rec); extern void btree_xlog_startup(void); extern void btree_xlog_cleanup(void); extern bool btree_safe_restartpoint(void); #endif /* NBTREE_H */ PKBiZ`server/access/attnum.hnu[/*------------------------------------------------------------------------- * * attnum.h * POSTGRES attribute number definitions. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/attnum.h * *------------------------------------------------------------------------- */ #ifndef ATTNUM_H #define ATTNUM_H /* * user defined attribute numbers start at 1. -ay 2/95 */ typedef int16 AttrNumber; #define InvalidAttrNumber 0 #define MaxAttrNumber 32767 /* ---------------- * support macros * ---------------- */ /* * AttributeNumberIsValid * True iff the attribute number is valid. */ #define AttributeNumberIsValid(attributeNumber) \ ((bool) ((attributeNumber) != InvalidAttrNumber)) /* * AttrNumberIsForUserDefinedAttr * True iff the attribute number corresponds to an user defined attribute. */ #define AttrNumberIsForUserDefinedAttr(attributeNumber) \ ((bool) ((attributeNumber) > 0)) /* * AttrNumberGetAttrOffset * Returns the attribute offset for an attribute number. * * Note: * Assumes the attribute number is for an user defined attribute. */ #define AttrNumberGetAttrOffset(attNum) \ ( \ AssertMacro(AttrNumberIsForUserDefinedAttr(attNum)), \ ((attNum) - 1) \ ) /* * AttributeOffsetGetAttributeNumber * Returns the attribute number for an attribute offset. */ #define AttrOffsetGetAttrNumber(attributeOffset) \ ((AttrNumber) (1 + (attributeOffset))) #endif /* ATTNUM_H */ PKBiZ:jserver/access/xlogdefs.hnu[/* * xlogdefs.h * * Postgres transaction log manager record pointer and * timeline number definitions * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/xlogdefs.h */ #ifndef XLOG_DEFS_H #define XLOG_DEFS_H #include /* need open() flags */ /* * Pointer to a location in the XLOG. These pointers are 64 bits wide, * because we don't want them ever to overflow. * * NOTE: xrecoff == 0 is used to indicate an invalid pointer. This is OK * because we use page headers in the XLOG, so no XLOG record can start * right at the beginning of a file. * * NOTE: the "log file number" is somewhat misnamed, since the actual files * making up the XLOG are much smaller than 4Gb. Each actual file is an * XLogSegSize-byte "segment" of a logical log file having the indicated * xlogid. The log file number and segment number together identify a * physical XLOG file. Segment number and offset within the physical file * are computed from xrecoff div and mod XLogSegSize. */ typedef struct XLogRecPtr { uint32 xlogid; /* log file #, 0 based */ uint32 xrecoff; /* byte offset of location in log file */ } XLogRecPtr; #define XLogRecPtrIsInvalid(r) ((r).xrecoff == 0) /* * Macros for comparing XLogRecPtrs * * Beware of passing expressions with side-effects to these macros, * since the arguments may be evaluated multiple times. */ #define XLByteLT(a, b) \ ((a).xlogid < (b).xlogid || \ ((a).xlogid == (b).xlogid && (a).xrecoff < (b).xrecoff)) #define XLByteLE(a, b) \ ((a).xlogid < (b).xlogid || \ ((a).xlogid == (b).xlogid && (a).xrecoff <= (b).xrecoff)) #define XLByteEQ(a, b) \ ((a).xlogid == (b).xlogid && (a).xrecoff == (b).xrecoff) /* * Macro for advancing a record pointer by the specified number of bytes. */ #define XLByteAdvance(recptr, nbytes) \ do { \ if (recptr.xrecoff + nbytes >= XLogFileSize) \ { \ recptr.xlogid += 1; \ recptr.xrecoff \ = recptr.xrecoff + nbytes - XLogFileSize; \ } \ else \ recptr.xrecoff += nbytes; \ } while (0) /* * TimeLineID (TLI) - identifies different database histories to prevent * confusion after restoring a prior state of a database installation. * TLI does not change in a normal stop/restart of the database (including * crash-and-recover cases); but we must assign a new TLI after doing * a recovery to a prior state, a/k/a point-in-time recovery. This makes * the new WAL logfile sequence we generate distinguishable from the * sequence that was generated in the previous incarnation. */ typedef uint32 TimeLineID; /* * Because O_DIRECT bypasses the kernel buffers, and because we never * read those buffers except during crash recovery or if wal_level != minimal, * it is a win to use it in all cases where we sync on each write(). We could * allow O_DIRECT with fsync(), but it is unclear if fsync() could process * writes not buffered in the kernel. Also, O_DIRECT is never enough to force * data to the drives, it merely tries to bypass the kernel cache, so we still * need O_SYNC/O_DSYNC. */ #ifdef O_DIRECT #define PG_O_DIRECT O_DIRECT #else #define PG_O_DIRECT 0 #endif /* * This chunk of hackery attempts to determine which file sync methods * are available on the current platform, and to choose an appropriate * default method. We assume that fsync() is always available, and that * configure determined whether fdatasync() is. */ #if defined(O_SYNC) #define OPEN_SYNC_FLAG O_SYNC #elif defined(O_FSYNC) #define OPEN_SYNC_FLAG O_FSYNC #endif #if defined(O_DSYNC) #if defined(OPEN_SYNC_FLAG) /* O_DSYNC is distinct? */ #if O_DSYNC != OPEN_SYNC_FLAG #define OPEN_DATASYNC_FLAG O_DSYNC #endif #else /* !defined(OPEN_SYNC_FLAG) */ /* Win32 only has O_DSYNC */ #define OPEN_DATASYNC_FLAG O_DSYNC #endif #endif #if defined(PLATFORM_DEFAULT_SYNC_METHOD) #define DEFAULT_SYNC_METHOD PLATFORM_DEFAULT_SYNC_METHOD #elif defined(OPEN_DATASYNC_FLAG) #define DEFAULT_SYNC_METHOD SYNC_METHOD_OPEN_DSYNC #elif defined(HAVE_FDATASYNC) #define DEFAULT_SYNC_METHOD SYNC_METHOD_FDATASYNC #else #define DEFAULT_SYNC_METHOD SYNC_METHOD_FSYNC #endif /* * Limitation of buffer-alignment for direct IO depends on OS and filesystem, * but XLOG_BLCKSZ is assumed to be enough for it. */ #ifdef O_DIRECT #define ALIGNOF_XLOG_BUFFER XLOG_BLCKSZ #else #define ALIGNOF_XLOG_BUFFER ALIGNOF_BUFFER #endif #endif /* XLOG_DEFS_H */ PKBiZw`server/access/tupmacs.hnu[/*------------------------------------------------------------------------- * * tupmacs.h * Tuple macros used by both index tuples and heap tuples. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/tupmacs.h * *------------------------------------------------------------------------- */ #ifndef TUPMACS_H #define TUPMACS_H /* * check to see if the ATT'th bit of an array of 8-bit bytes is set. */ #define att_isnull(ATT, BITS) (!((BITS)[(ATT) >> 3] & (1 << ((ATT) & 0x07)))) /* * Given a Form_pg_attribute and a pointer into a tuple's data area, * return the correct value or pointer. * * We return a Datum value in all cases. If the attribute has "byval" false, * we return the same pointer into the tuple data area that we're passed. * Otherwise, we return the correct number of bytes fetched from the data * area and extended to Datum form. * * On machines where Datum is 8 bytes, we support fetching 8-byte byval * attributes; otherwise, only 1, 2, and 4-byte values are supported. * * Note that T must already be properly aligned for this to work correctly. */ #define fetchatt(A,T) fetch_att(T, (A)->attbyval, (A)->attlen) /* * Same, but work from byval/len parameters rather than Form_pg_attribute. */ #if SIZEOF_DATUM == 8 #define fetch_att(T,attbyval,attlen) \ ( \ (attbyval) ? \ ( \ (attlen) == (int) sizeof(Datum) ? \ *((Datum *)(T)) \ : \ ( \ (attlen) == (int) sizeof(int32) ? \ Int32GetDatum(*((int32 *)(T))) \ : \ ( \ (attlen) == (int) sizeof(int16) ? \ Int16GetDatum(*((int16 *)(T))) \ : \ ( \ AssertMacro((attlen) == 1), \ CharGetDatum(*((char *)(T))) \ ) \ ) \ ) \ ) \ : \ PointerGetDatum((char *) (T)) \ ) #else /* SIZEOF_DATUM != 8 */ #define fetch_att(T,attbyval,attlen) \ ( \ (attbyval) ? \ ( \ (attlen) == (int) sizeof(int32) ? \ Int32GetDatum(*((int32 *)(T))) \ : \ ( \ (attlen) == (int) sizeof(int16) ? \ Int16GetDatum(*((int16 *)(T))) \ : \ ( \ AssertMacro((attlen) == 1), \ CharGetDatum(*((char *)(T))) \ ) \ ) \ ) \ : \ PointerGetDatum((char *) (T)) \ ) #endif /* SIZEOF_DATUM == 8 */ /* * att_align_datum aligns the given offset as needed for a datum of alignment * requirement attalign and typlen attlen. attdatum is the Datum variable * we intend to pack into a tuple (it's only accessed if we are dealing with * a varlena type). Note that this assumes the Datum will be stored as-is; * callers that are intending to convert non-short varlena datums to short * format have to account for that themselves. */ #define att_align_datum(cur_offset, attalign, attlen, attdatum) \ ( \ ((attlen) == -1 && VARATT_IS_SHORT(DatumGetPointer(attdatum))) ? \ (intptr_t) (cur_offset) : \ att_align_nominal(cur_offset, attalign) \ ) /* * att_align_pointer performs the same calculation as att_align_datum, * but is used when walking a tuple. attptr is the current actual data * pointer; when accessing a varlena field we have to "peek" to see if we * are looking at a pad byte or the first byte of a 1-byte-header datum. * (A zero byte must be either a pad byte, or the first byte of a correctly * aligned 4-byte length word; in either case we can align safely. A non-zero * byte must be either a 1-byte length word, or the first byte of a correctly * aligned 4-byte length word; in either case we need not align.) * * Note: some callers pass a "char *" pointer for cur_offset. This is * a bit of a hack but should work all right as long as intptr_t is the * correct width. */ #define att_align_pointer(cur_offset, attalign, attlen, attptr) \ ( \ ((attlen) == -1 && VARATT_NOT_PAD_BYTE(attptr)) ? \ (intptr_t) (cur_offset) : \ att_align_nominal(cur_offset, attalign) \ ) /* * att_align_nominal aligns the given offset as needed for a datum of alignment * requirement attalign, ignoring any consideration of packed varlena datums. * There are three main use cases for using this macro directly: * * we know that the att in question is not varlena (attlen != -1); * in this case it is cheaper than the above macros and just as good. * * we need to estimate alignment padding cost abstractly, ie without * reference to a real tuple. We must assume the worst case that * all varlenas are aligned. * * within arrays, we unconditionally align varlenas (XXX this should be * revisited, probably). * * The attalign cases are tested in what is hopefully something like their * frequency of occurrence. */ #define att_align_nominal(cur_offset, attalign) \ ( \ ((attalign) == 'i') ? INTALIGN(cur_offset) : \ (((attalign) == 'c') ? (intptr_t) (cur_offset) : \ (((attalign) == 'd') ? DOUBLEALIGN(cur_offset) : \ ( \ AssertMacro((attalign) == 's'), \ SHORTALIGN(cur_offset) \ ))) \ ) /* * att_addlength_datum increments the given offset by the space needed for * the given Datum variable. attdatum is only accessed if we are dealing * with a variable-length attribute. */ #define att_addlength_datum(cur_offset, attlen, attdatum) \ att_addlength_pointer(cur_offset, attlen, DatumGetPointer(attdatum)) /* * att_addlength_pointer performs the same calculation as att_addlength_datum, * but is used when walking a tuple --- attptr is the pointer to the field * within the tuple. * * Note: some callers pass a "char *" pointer for cur_offset. This is * actually perfectly OK, but probably should be cleaned up along with * the same practice for att_align_pointer. */ #define att_addlength_pointer(cur_offset, attlen, attptr) \ ( \ ((attlen) > 0) ? \ ( \ (cur_offset) + (attlen) \ ) \ : (((attlen) == -1) ? \ ( \ (cur_offset) + VARSIZE_ANY(attptr) \ ) \ : \ ( \ AssertMacro((attlen) == -2), \ (cur_offset) + (strlen((char *) (attptr)) + 1) \ )) \ ) /* * store_att_byval is a partial inverse of fetch_att: store a given Datum * value into a tuple data area at the specified address. However, it only * handles the byval case, because in typical usage the caller needs to * distinguish by-val and by-ref cases anyway, and so a do-it-all macro * wouldn't be convenient. */ #if SIZEOF_DATUM == 8 #define store_att_byval(T,newdatum,attlen) \ do { \ switch (attlen) \ { \ case sizeof(char): \ *(char *) (T) = DatumGetChar(newdatum); \ break; \ case sizeof(int16): \ *(int16 *) (T) = DatumGetInt16(newdatum); \ break; \ case sizeof(int32): \ *(int32 *) (T) = DatumGetInt32(newdatum); \ break; \ case sizeof(Datum): \ *(Datum *) (T) = (newdatum); \ break; \ default: \ elog(ERROR, "unsupported byval length: %d", \ (int) (attlen)); \ break; \ } \ } while (0) #else /* SIZEOF_DATUM != 8 */ #define store_att_byval(T,newdatum,attlen) \ do { \ switch (attlen) \ { \ case sizeof(char): \ *(char *) (T) = DatumGetChar(newdatum); \ break; \ case sizeof(int16): \ *(int16 *) (T) = DatumGetInt16(newdatum); \ break; \ case sizeof(int32): \ *(int32 *) (T) = DatumGetInt32(newdatum); \ break; \ default: \ elog(ERROR, "unsupported byval length: %d", \ (int) (attlen)); \ break; \ } \ } while (0) #endif /* SIZEOF_DATUM == 8 */ #endif PKBiZI00server/access/genam.hnu[/*------------------------------------------------------------------------- * * genam.h * POSTGRES generalized index access method definitions. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/genam.h * *------------------------------------------------------------------------- */ #ifndef GENAM_H #define GENAM_H #include "access/sdir.h" #include "access/skey.h" #include "nodes/tidbitmap.h" #include "storage/lock.h" #include "utils/relcache.h" #include "utils/snapshot.h" /* * Struct for statistics returned by ambuild */ typedef struct IndexBuildResult { double heap_tuples; /* # of tuples seen in parent table */ double index_tuples; /* # of tuples inserted into index */ } IndexBuildResult; /* * Struct for input arguments passed to ambulkdelete and amvacuumcleanup * * num_heap_tuples is accurate only when estimated_count is false; * otherwise it's just an estimate (currently, the estimate is the * prior value of the relation's pg_class.reltuples field). It will * always just be an estimate during ambulkdelete. */ typedef struct IndexVacuumInfo { Relation index; /* the index being vacuumed */ bool analyze_only; /* ANALYZE (without any actual vacuum) */ bool estimated_count; /* num_heap_tuples is an estimate */ int message_level; /* ereport level for progress messages */ double num_heap_tuples; /* tuples remaining in heap */ BufferAccessStrategy strategy; /* access strategy for reads */ } IndexVacuumInfo; /* * Struct for statistics returned by ambulkdelete and amvacuumcleanup * * This struct is normally allocated by the first ambulkdelete call and then * passed along through subsequent ones until amvacuumcleanup; however, * amvacuumcleanup must be prepared to allocate it in the case where no * ambulkdelete calls were made (because no tuples needed deletion). * Note that an index AM could choose to return a larger struct * of which this is just the first field; this provides a way for ambulkdelete * to communicate additional private data to amvacuumcleanup. * * Note: pages_removed is the amount by which the index physically shrank, * if any (ie the change in its total size on disk). pages_deleted and * pages_free refer to free space within the index file. Some index AMs * may compute num_index_tuples by reference to num_heap_tuples, in which * case they should copy the estimated_count field from IndexVacuumInfo. */ typedef struct IndexBulkDeleteResult { BlockNumber num_pages; /* pages remaining in index */ BlockNumber pages_removed; /* # removed during vacuum operation */ bool estimated_count; /* num_index_tuples is an estimate */ double num_index_tuples; /* tuples remaining */ double tuples_removed; /* # removed during vacuum operation */ BlockNumber pages_deleted; /* # unused pages in index */ BlockNumber pages_free; /* # pages available for reuse */ } IndexBulkDeleteResult; /* Typedef for callback function to determine if a tuple is bulk-deletable */ typedef bool (*IndexBulkDeleteCallback) (ItemPointer itemptr, void *state); /* struct definitions appear in relscan.h */ typedef struct IndexScanDescData *IndexScanDesc; typedef struct SysScanDescData *SysScanDesc; /* * Enumeration specifying the type of uniqueness check to perform in * index_insert(). * * UNIQUE_CHECK_YES is the traditional Postgres immediate check, possibly * blocking to see if a conflicting transaction commits. * * For deferrable unique constraints, UNIQUE_CHECK_PARTIAL is specified at * insertion time. The index AM should test if the tuple is unique, but * should not throw error, block, or prevent the insertion if the tuple * appears not to be unique. We'll recheck later when it is time for the * constraint to be enforced. The AM must return true if the tuple is * known unique, false if it is possibly non-unique. In the "true" case * it is safe to omit the later recheck. * * When it is time to recheck the deferred constraint, a pseudo-insertion * call is made with UNIQUE_CHECK_EXISTING. The tuple is already in the * index in this case, so it should not be inserted again. Rather, just * check for conflicting live tuples (possibly blocking). */ typedef enum IndexUniqueCheck { UNIQUE_CHECK_NO, /* Don't do any uniqueness checking */ UNIQUE_CHECK_YES, /* Enforce uniqueness at insertion time */ UNIQUE_CHECK_PARTIAL, /* Test uniqueness, but no error */ UNIQUE_CHECK_EXISTING /* Check if existing tuple is unique */ } IndexUniqueCheck; /* * generalized index_ interface routines (in indexam.c) */ /* * IndexScanIsValid * True iff the index scan is valid. */ #define IndexScanIsValid(scan) PointerIsValid(scan) extern Relation index_open(Oid relationId, LOCKMODE lockmode); extern void index_close(Relation relation, LOCKMODE lockmode); extern bool index_insert(Relation indexRelation, Datum *values, bool *isnull, ItemPointer heap_t_ctid, Relation heapRelation, IndexUniqueCheck checkUnique); extern IndexScanDesc index_beginscan(Relation heapRelation, Relation indexRelation, Snapshot snapshot, int nkeys, int norderbys); extern IndexScanDesc index_beginscan_bitmap(Relation indexRelation, Snapshot snapshot, int nkeys); extern void index_rescan(IndexScanDesc scan, ScanKey keys, int nkeys, ScanKey orderbys, int norderbys); extern void index_endscan(IndexScanDesc scan); extern void index_markpos(IndexScanDesc scan); extern void index_restrpos(IndexScanDesc scan); extern ItemPointer index_getnext_tid(IndexScanDesc scan, ScanDirection direction); extern HeapTuple index_fetch_heap(IndexScanDesc scan); extern HeapTuple index_getnext(IndexScanDesc scan, ScanDirection direction); extern int64 index_getbitmap(IndexScanDesc scan, TIDBitmap *bitmap); extern IndexBulkDeleteResult *index_bulk_delete(IndexVacuumInfo *info, IndexBulkDeleteResult *stats, IndexBulkDeleteCallback callback, void *callback_state); extern IndexBulkDeleteResult *index_vacuum_cleanup(IndexVacuumInfo *info, IndexBulkDeleteResult *stats); extern bool index_can_return(Relation indexRelation); extern RegProcedure index_getprocid(Relation irel, AttrNumber attnum, uint16 procnum); extern FmgrInfo *index_getprocinfo(Relation irel, AttrNumber attnum, uint16 procnum); /* * index access method support routines (in genam.c) */ extern IndexScanDesc RelationGetIndexScan(Relation indexRelation, int nkeys, int norderbys); extern void IndexScanEnd(IndexScanDesc scan); extern char *BuildIndexValueDescription(Relation indexRelation, Datum *values, bool *isnull); /* * heap-or-index access to system catalogs (in genam.c) */ extern SysScanDesc systable_beginscan(Relation heapRelation, Oid indexId, bool indexOK, Snapshot snapshot, int nkeys, ScanKey key); extern HeapTuple systable_getnext(SysScanDesc sysscan); extern bool systable_recheck_tuple(SysScanDesc sysscan, HeapTuple tup); extern void systable_endscan(SysScanDesc sysscan); extern SysScanDesc systable_beginscan_ordered(Relation heapRelation, Relation indexRelation, Snapshot snapshot, int nkeys, ScanKey key); extern HeapTuple systable_getnext_ordered(SysScanDesc sysscan, ScanDirection direction); extern void systable_endscan_ordered(SysScanDesc sysscan); #endif /* GENAM_H */ PKBiZe/server/access/gin.hnu[/*-------------------------------------------------------------------------- * gin.h * Public header file for Generalized Inverted Index access method. * * Copyright (c) 2006-2012, PostgreSQL Global Development Group * * src/include/access/gin.h *-------------------------------------------------------------------------- */ #ifndef GIN_H #define GIN_H #include "access/xlog.h" #include "storage/block.h" #include "utils/relcache.h" /* * amproc indexes for inverted indexes. */ #define GIN_COMPARE_PROC 1 #define GIN_EXTRACTVALUE_PROC 2 #define GIN_EXTRACTQUERY_PROC 3 #define GIN_CONSISTENT_PROC 4 #define GIN_COMPARE_PARTIAL_PROC 5 #define GINNProcs 5 /* * searchMode settings for extractQueryFn. */ #define GIN_SEARCH_MODE_DEFAULT 0 #define GIN_SEARCH_MODE_INCLUDE_EMPTY 1 #define GIN_SEARCH_MODE_ALL 2 #define GIN_SEARCH_MODE_EVERYTHING 3 /* for internal use only */ /* * GinStatsData represents stats data for planner use */ typedef struct GinStatsData { BlockNumber nPendingPages; BlockNumber nTotalPages; BlockNumber nEntryPages; BlockNumber nDataPages; int64 nEntries; int32 ginVersion; } GinStatsData; /* GUC parameter */ extern PGDLLIMPORT int GinFuzzySearchLimit; /* ginutil.c */ extern void ginGetStats(Relation index, GinStatsData *stats); extern void ginUpdateStats(Relation index, const GinStatsData *stats); /* ginxlog.c */ extern void gin_redo(XLogRecPtr lsn, XLogRecord *record); extern void gin_desc(StringInfo buf, uint8 xl_info, char *rec); extern void gin_xlog_startup(void); extern void gin_xlog_cleanup(void); extern bool gin_safe_restartpoint(void); #endif /* GIN_H */ PKBiZA1server/access/gistscan.hnu[/*------------------------------------------------------------------------- * * gistscan.h * routines defined in access/gist/gistscan.c * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/gistscan.h * *------------------------------------------------------------------------- */ #ifndef GISTSCAN_H #define GISTSCAN_H #include "fmgr.h" extern Datum gistbeginscan(PG_FUNCTION_ARGS); extern Datum gistrescan(PG_FUNCTION_ARGS); extern Datum gistmarkpos(PG_FUNCTION_ARGS); extern Datum gistrestrpos(PG_FUNCTION_ARGS); extern Datum gistendscan(PG_FUNCTION_ARGS); #endif /* GISTSCAN_H */ PKBiZ11server/access/xlog.hnu[/* * xlog.h * * PostgreSQL transaction log manager * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/xlog.h */ #ifndef XLOG_H #define XLOG_H #include "access/rmgr.h" #include "access/xlogdefs.h" #include "datatype/timestamp.h" #include "lib/stringinfo.h" #include "storage/buf.h" #include "utils/pg_crc.h" /* * The overall layout of an XLOG record is: * Fixed-size header (XLogRecord struct) * rmgr-specific data * BkpBlock * backup block data * BkpBlock * backup block data * ... * * where there can be zero to four backup blocks (as signaled by xl_info flag * bits). XLogRecord structs always start on MAXALIGN boundaries in the WAL * files, and we round up SizeOfXLogRecord so that the rmgr data is also * guaranteed to begin on a MAXALIGN boundary. However, no padding is added * to align BkpBlock structs or backup block data. * * NOTE: xl_len counts only the rmgr data, not the XLogRecord header, * and also not any backup blocks. xl_tot_len counts everything. Neither * length field is rounded up to an alignment boundary. */ typedef struct XLogRecord { pg_crc32 xl_crc; /* CRC for this record */ XLogRecPtr xl_prev; /* ptr to previous record in log */ TransactionId xl_xid; /* xact id */ uint32 xl_tot_len; /* total len of entire record */ uint32 xl_len; /* total len of rmgr data */ uint8 xl_info; /* flag bits, see below */ RmgrId xl_rmid; /* resource manager for this record */ /* Depending on MAXALIGN, there are either 2 or 6 wasted bytes here */ /* ACTUAL LOG DATA FOLLOWS AT END OF STRUCT */ } XLogRecord; #define SizeOfXLogRecord MAXALIGN(sizeof(XLogRecord)) #define XLogRecGetData(record) ((char*) (record) + SizeOfXLogRecord) /* * XLOG uses only low 4 bits of xl_info. High 4 bits may be used by rmgr. */ #define XLR_INFO_MASK 0x0F /* * If we backed up any disk blocks with the XLOG record, we use flag bits in * xl_info to signal it. We support backup of up to 4 disk blocks per XLOG * record. */ #define XLR_BKP_BLOCK_MASK 0x0F /* all info bits used for bkp blocks */ #define XLR_MAX_BKP_BLOCKS 4 #define XLR_BKP_BLOCK(iblk) (0x08 >> (iblk)) /* iblk in 0..3 */ /* These macros are deprecated and will be removed in 9.3; use XLR_BKP_BLOCK */ #define XLR_SET_BKP_BLOCK(iblk) (0x08 >> (iblk)) #define XLR_BKP_BLOCK_1 XLR_SET_BKP_BLOCK(0) /* 0x08 */ #define XLR_BKP_BLOCK_2 XLR_SET_BKP_BLOCK(1) /* 0x04 */ #define XLR_BKP_BLOCK_3 XLR_SET_BKP_BLOCK(2) /* 0x02 */ #define XLR_BKP_BLOCK_4 XLR_SET_BKP_BLOCK(3) /* 0x01 */ /* Sync methods */ #define SYNC_METHOD_FSYNC 0 #define SYNC_METHOD_FDATASYNC 1 #define SYNC_METHOD_OPEN 2 /* for O_SYNC */ #define SYNC_METHOD_FSYNC_WRITETHROUGH 3 #define SYNC_METHOD_OPEN_DSYNC 4 /* for O_DSYNC */ extern int sync_method; /* * The rmgr data to be written by XLogInsert() is defined by a chain of * one or more XLogRecData structs. (Multiple structs would be used when * parts of the source data aren't physically adjacent in memory, or when * multiple associated buffers need to be specified.) * * If buffer is valid then XLOG will check if buffer must be backed up * (ie, whether this is first change of that page since last checkpoint). * If so, the whole page contents are attached to the XLOG record, and XLOG * sets XLR_BKP_BLOCK(N) bit in xl_info. Note that the buffer must be pinned * and exclusive-locked by the caller, so that it won't change under us. * NB: when the buffer is backed up, we DO NOT insert the data pointed to by * this XLogRecData struct into the XLOG record, since we assume it's present * in the buffer. Therefore, rmgr redo routines MUST pay attention to * XLR_BKP_BLOCK(N) to know what is actually stored in the XLOG record. * The N'th XLR_BKP_BLOCK bit corresponds to the N'th distinct buffer * value (ignoring InvalidBuffer) appearing in the rdata chain. * * When buffer is valid, caller must set buffer_std to indicate whether the * page uses standard pd_lower/pd_upper header fields. If this is true, then * XLOG is allowed to omit the free space between pd_lower and pd_upper from * the backed-up page image. Note that even when buffer_std is false, the * page MUST have an LSN field as its first eight bytes! * * Note: data can be NULL to indicate no rmgr data associated with this chain * entry. This can be sensible (ie, not a wasted entry) if buffer is valid. * The implication is that the buffer has been changed by the operation being * logged, and so may need to be backed up, but the change can be redone using * only information already present elsewhere in the XLOG entry. */ typedef struct XLogRecData { char *data; /* start of rmgr data to include */ uint32 len; /* length of rmgr data to include */ Buffer buffer; /* buffer associated with data, if any */ bool buffer_std; /* buffer has standard pd_lower/pd_upper */ struct XLogRecData *next; /* next struct in chain, or NULL */ } XLogRecData; extern PGDLLIMPORT TimeLineID ThisTimeLineID; /* current TLI */ /* * Prior to 8.4, all activity during recovery was carried out by the startup * process. This local variable continues to be used in many parts of the * code to indicate actions taken by RecoveryManagers. Other processes that * potentially perform work during recovery should check RecoveryInProgress(). * See XLogCtl notes in xlog.c. */ extern bool InRecovery; /* * Like InRecovery, standbyState is only valid in the startup process. * In all other processes it will have the value STANDBY_DISABLED (so * InHotStandby will read as FALSE). * * In DISABLED state, we're performing crash recovery or hot standby was * disabled in postgresql.conf. * * In INITIALIZED state, we've run InitRecoveryTransactionEnvironment, but * we haven't yet processed a RUNNING_XACTS or shutdown-checkpoint WAL record * to initialize our master-transaction tracking system. * * When the transaction tracking is initialized, we enter the SNAPSHOT_PENDING * state. The tracked information might still be incomplete, so we can't allow * connections yet, but redo functions must update the in-memory state when * appropriate. * * In SNAPSHOT_READY mode, we have full knowledge of transactions that are * (or were) running in the master at the current WAL location. Snapshots * can be taken, and read-only queries can be run. */ typedef enum { STANDBY_DISABLED, STANDBY_INITIALIZED, STANDBY_SNAPSHOT_PENDING, STANDBY_SNAPSHOT_READY } HotStandbyState; extern HotStandbyState standbyState; #define InHotStandby (standbyState >= STANDBY_SNAPSHOT_PENDING) /* * Recovery target type. * Only set during a Point in Time recovery, not when standby_mode = on */ typedef enum { RECOVERY_TARGET_UNSET, RECOVERY_TARGET_XID, RECOVERY_TARGET_TIME, RECOVERY_TARGET_NAME } RecoveryTargetType; extern XLogRecPtr XactLastRecEnd; extern bool reachedConsistency; /* these variables are GUC parameters related to XLOG */ extern int CheckPointSegments; extern int wal_keep_segments; extern int XLOGbuffers; extern int XLogArchiveTimeout; extern bool XLogArchiveMode; extern char *XLogArchiveCommand; extern bool EnableHotStandby; extern bool fullPageWrites; extern bool log_checkpoints; /* WAL levels */ typedef enum WalLevel { WAL_LEVEL_MINIMAL = 0, WAL_LEVEL_ARCHIVE, WAL_LEVEL_HOT_STANDBY } WalLevel; extern int wal_level; #define XLogArchivingActive() (XLogArchiveMode && wal_level >= WAL_LEVEL_ARCHIVE) #define XLogArchiveCommandSet() (XLogArchiveCommand[0] != '\0') /* * Is WAL-logging necessary for archival or log-shipping, or can we skip * WAL-logging if we fsync() the data before committing instead? */ #define XLogIsNeeded() (wal_level >= WAL_LEVEL_ARCHIVE) /* Do we need to WAL-log information required only for Hot Standby? */ #define XLogStandbyInfoActive() (wal_level >= WAL_LEVEL_HOT_STANDBY) #ifdef WAL_DEBUG extern bool XLOG_DEBUG; #endif /* * OR-able request flag bits for checkpoints. The "cause" bits are used only * for logging purposes. Note: the flags must be defined so that it's * sensible to OR together request flags arising from different requestors. */ /* These directly affect the behavior of CreateCheckPoint and subsidiaries */ #define CHECKPOINT_IS_SHUTDOWN 0x0001 /* Checkpoint is for shutdown */ #define CHECKPOINT_END_OF_RECOVERY 0x0002 /* Like shutdown checkpoint, * but issued at end of WAL * recovery */ #define CHECKPOINT_IMMEDIATE 0x0004 /* Do it without delays */ #define CHECKPOINT_FORCE 0x0008 /* Force even if no activity */ /* These are important to RequestCheckpoint */ #define CHECKPOINT_WAIT 0x0010 /* Wait for completion */ /* These indicate the cause of a checkpoint request */ #define CHECKPOINT_CAUSE_XLOG 0x0020 /* XLOG consumption */ #define CHECKPOINT_CAUSE_TIME 0x0040 /* Elapsed time */ #define CHECKPOINT_FLUSH_ALL 0x0080 /* Flush all pages, including those * belonging to unlogged tables */ /* Checkpoint statistics */ typedef struct CheckpointStatsData { TimestampTz ckpt_start_t; /* start of checkpoint */ TimestampTz ckpt_write_t; /* start of flushing buffers */ TimestampTz ckpt_sync_t; /* start of fsyncs */ TimestampTz ckpt_sync_end_t; /* end of fsyncs */ TimestampTz ckpt_end_t; /* end of checkpoint */ int ckpt_bufs_written; /* # of buffers written */ int ckpt_segs_added; /* # of new xlog segments created */ int ckpt_segs_removed; /* # of xlog segments deleted */ int ckpt_segs_recycled; /* # of xlog segments recycled */ int ckpt_sync_rels; /* # of relations synced */ uint64 ckpt_longest_sync; /* Longest sync for one relation */ uint64 ckpt_agg_sync_time; /* The sum of all the individual sync * times, which is not necessarily the * same as the total elapsed time for * the entire sync phase. */ } CheckpointStatsData; extern CheckpointStatsData CheckpointStats; extern XLogRecPtr XLogInsert(RmgrId rmid, uint8 info, XLogRecData *rdata); extern void XLogFlush(XLogRecPtr RecPtr); extern bool XLogBackgroundFlush(void); extern bool XLogNeedsFlush(XLogRecPtr RecPtr); extern int XLogFileInit(uint32 log, uint32 seg, bool *use_existent, bool use_lock); extern int XLogFileOpen(uint32 log, uint32 seg); extern void CheckXLogRemoved(uint32 log, uint32 seg, TimeLineID tli); extern void XLogSetAsyncXactLSN(XLogRecPtr record); extern Buffer RestoreBackupBlock(XLogRecPtr lsn, XLogRecord *record, int block_index, bool get_cleanup_lock, bool keep_buffer); extern void xlog_redo(XLogRecPtr lsn, XLogRecord *record); extern void xlog_desc(StringInfo buf, uint8 xl_info, char *rec); extern void issue_xlog_fsync(int fd, uint32 log, uint32 seg); extern bool RecoveryInProgress(void); extern bool HotStandbyActive(void); extern bool HotStandbyActiveInReplay(void); extern bool XLogInsertAllowed(void); extern void GetXLogReceiptTime(TimestampTz *rtime, bool *fromStream); extern XLogRecPtr GetXLogReplayRecPtr(TimeLineID *targetTLI); extern XLogRecPtr GetStandbyFlushRecPtr(TimeLineID *targetTLI); extern XLogRecPtr GetXLogInsertRecPtr(void); extern XLogRecPtr GetXLogWriteRecPtr(void); extern bool RecoveryIsPaused(void); extern void SetRecoveryPause(bool recoveryPause); extern TimestampTz GetLatestXTime(void); extern TimestampTz GetCurrentChunkReplayStartTime(void); extern void UpdateControlFile(void); extern uint64 GetSystemIdentifier(void); extern Size XLOGShmemSize(void); extern void XLOGShmemInit(void); extern void BootStrapXLOG(void); extern void StartupXLOG(void); extern void ShutdownXLOG(int code, Datum arg); extern void InitXLOGAccess(void); extern void CreateCheckPoint(int flags); extern bool CreateRestartPoint(int flags); extern void XLogPutNextOid(Oid nextOid); extern XLogRecPtr XLogRestorePoint(const char *rpName); extern void UpdateFullPageWrites(void); extern XLogRecPtr GetRedoRecPtr(void); extern XLogRecPtr GetInsertRecPtr(void); extern XLogRecPtr GetFlushRecPtr(void); extern void GetNextXidAndEpoch(TransactionId *xid, uint32 *epoch); extern TimeLineID GetRecoveryTargetTLI(void); extern void RemovePromoteSignalFiles(void); extern bool CheckPromoteSignal(void); extern void WakeupRecovery(void); extern void SetWalWriterSleeping(bool sleeping); /* * Starting/stopping a base backup */ extern XLogRecPtr do_pg_start_backup(const char *backupidstr, bool fast, char **labelfile); extern XLogRecPtr do_pg_stop_backup(char *labelfile, bool waitforarchive); extern void do_pg_abort_backup(void); /* File path names (all relative to $PGDATA) */ #define BACKUP_LABEL_FILE "backup_label" #define BACKUP_LABEL_OLD "backup_label.old" #endif /* XLOG_H */ PKBiZI#server/access/heapam.hnu[/*------------------------------------------------------------------------- * * heapam.h * POSTGRES heap access method definitions. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/heapam.h * *------------------------------------------------------------------------- */ #ifndef HEAPAM_H #define HEAPAM_H #include "access/sdir.h" #include "access/skey.h" #include "access/xlog.h" #include "nodes/primnodes.h" #include "storage/lock.h" #include "utils/relcache.h" #include "utils/snapshot.h" /* "options" flag bits for heap_insert */ #define HEAP_INSERT_SKIP_WAL 0x0001 #define HEAP_INSERT_SKIP_FSM 0x0002 typedef struct BulkInsertStateData *BulkInsertState; typedef enum { LockTupleShared, LockTupleExclusive } LockTupleMode; /* ---------------- * function prototypes for heap access method * * heap_create, heap_create_with_catalog, and heap_drop_with_catalog * are declared in catalog/heap.h * ---------------- */ /* in heap/heapam.c */ extern Relation relation_open(Oid relationId, LOCKMODE lockmode); extern Relation try_relation_open(Oid relationId, LOCKMODE lockmode); extern Relation relation_openrv(const RangeVar *relation, LOCKMODE lockmode); extern Relation relation_openrv_extended(const RangeVar *relation, LOCKMODE lockmode, bool missing_ok); extern void relation_close(Relation relation, LOCKMODE lockmode); extern Relation heap_open(Oid relationId, LOCKMODE lockmode); extern Relation heap_openrv(const RangeVar *relation, LOCKMODE lockmode); extern Relation heap_openrv_extended(const RangeVar *relation, LOCKMODE lockmode, bool missing_ok); #define heap_close(r,l) relation_close(r,l) /* struct definition appears in relscan.h */ typedef struct HeapScanDescData *HeapScanDesc; /* * HeapScanIsValid * True iff the heap scan is valid. */ #define HeapScanIsValid(scan) PointerIsValid(scan) extern HeapScanDesc heap_beginscan(Relation relation, Snapshot snapshot, int nkeys, ScanKey key); extern HeapScanDesc heap_beginscan_strat(Relation relation, Snapshot snapshot, int nkeys, ScanKey key, bool allow_strat, bool allow_sync); extern HeapScanDesc heap_beginscan_bm(Relation relation, Snapshot snapshot, int nkeys, ScanKey key); extern void heap_rescan(HeapScanDesc scan, ScanKey key); extern void heap_endscan(HeapScanDesc scan); extern HeapTuple heap_getnext(HeapScanDesc scan, ScanDirection direction); extern bool heap_fetch(Relation relation, Snapshot snapshot, HeapTuple tuple, Buffer *userbuf, bool keep_buf, Relation stats_relation); extern bool heap_hot_search_buffer(ItemPointer tid, Relation relation, Buffer buffer, Snapshot snapshot, HeapTuple heapTuple, bool *all_dead, bool first_call); extern bool heap_hot_search(ItemPointer tid, Relation relation, Snapshot snapshot, bool *all_dead); extern void heap_get_latest_tid(Relation relation, Snapshot snapshot, ItemPointer tid); extern void setLastTid(const ItemPointer tid); extern BulkInsertState GetBulkInsertState(void); extern void FreeBulkInsertState(BulkInsertState); extern Oid heap_insert(Relation relation, HeapTuple tup, CommandId cid, int options, BulkInsertState bistate); extern void heap_multi_insert(Relation relation, HeapTuple *tuples, int ntuples, CommandId cid, int options, BulkInsertState bistate); extern HTSU_Result heap_delete(Relation relation, ItemPointer tid, ItemPointer ctid, TransactionId *update_xmax, CommandId cid, Snapshot crosscheck, bool wait); extern HTSU_Result heap_update(Relation relation, ItemPointer otid, HeapTuple newtup, ItemPointer ctid, TransactionId *update_xmax, CommandId cid, Snapshot crosscheck, bool wait); extern HTSU_Result heap_lock_tuple(Relation relation, HeapTuple tuple, Buffer *buffer, ItemPointer ctid, TransactionId *update_xmax, CommandId cid, LockTupleMode mode, bool nowait); extern void heap_inplace_update(Relation relation, HeapTuple tuple); extern bool heap_freeze_tuple(HeapTupleHeader tuple, TransactionId cutoff_xid); extern bool heap_tuple_needs_freeze(HeapTupleHeader tuple, TransactionId cutoff_xid, Buffer buf); extern Oid simple_heap_insert(Relation relation, HeapTuple tup); extern void simple_heap_delete(Relation relation, ItemPointer tid); extern void simple_heap_update(Relation relation, ItemPointer otid, HeapTuple tup); extern void heap_markpos(HeapScanDesc scan); extern void heap_restrpos(HeapScanDesc scan); extern void heap_sync(Relation relation); extern void heap_redo(XLogRecPtr lsn, XLogRecord *rptr); extern void heap_desc(StringInfo buf, uint8 xl_info, char *rec); extern void heap2_redo(XLogRecPtr lsn, XLogRecord *rptr); extern void heap2_desc(StringInfo buf, uint8 xl_info, char *rec); extern XLogRecPtr log_heap_cleanup_info(RelFileNode rnode, TransactionId latestRemovedXid); extern XLogRecPtr log_heap_clean(Relation reln, Buffer buffer, OffsetNumber *redirected, int nredirected, OffsetNumber *nowdead, int ndead, OffsetNumber *nowunused, int nunused, TransactionId latestRemovedXid); extern XLogRecPtr log_heap_freeze(Relation reln, Buffer buffer, TransactionId cutoff_xid, OffsetNumber *offsets, int offcnt); extern XLogRecPtr log_heap_visible(RelFileNode rnode, BlockNumber block, Buffer vm_buffer, TransactionId cutoff_xid); extern XLogRecPtr log_newpage(RelFileNode *rnode, ForkNumber forkNum, BlockNumber blk, Page page); extern XLogRecPtr log_newpage_buffer(Buffer buffer); /* in heap/pruneheap.c */ extern void heap_page_prune_opt(Relation relation, Buffer buffer, TransactionId OldestXmin); extern int heap_page_prune(Relation relation, Buffer buffer, TransactionId OldestXmin, bool report_stats, TransactionId *latestRemovedXid); extern void heap_page_prune_execute(Buffer buffer, OffsetNumber *redirected, int nredirected, OffsetNumber *nowdead, int ndead, OffsetNumber *nowunused, int nunused); extern void heap_get_root_tuples(Page page, OffsetNumber *root_offsets); /* in heap/syncscan.c */ extern void ss_report_location(Relation rel, BlockNumber location); extern BlockNumber ss_get_location(Relation rel, BlockNumber relnblocks); extern void SyncScanShmemInit(void); extern Size SyncScanShmemSize(void); #endif /* HEAPAM_H */ PKBiZbTserver/access/clog.hnu[/* * clog.h * * PostgreSQL transaction-commit-log manager * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/clog.h */ #ifndef CLOG_H #define CLOG_H #include "access/xlog.h" /* * Possible transaction statuses --- note that all-zeroes is the initial * state. * * A "subcommitted" transaction is a committed subtransaction whose parent * hasn't committed or aborted yet. */ typedef int XidStatus; #define TRANSACTION_STATUS_IN_PROGRESS 0x00 #define TRANSACTION_STATUS_COMMITTED 0x01 #define TRANSACTION_STATUS_ABORTED 0x02 #define TRANSACTION_STATUS_SUB_COMMITTED 0x03 extern void TransactionIdSetTreeStatus(TransactionId xid, int nsubxids, TransactionId *subxids, XidStatus status, XLogRecPtr lsn); extern XidStatus TransactionIdGetStatus(TransactionId xid, XLogRecPtr *lsn); extern Size CLOGShmemBuffers(void); extern Size CLOGShmemSize(void); extern void CLOGShmemInit(void); extern void BootStrapCLOG(void); extern void StartupCLOG(void); extern void TrimCLOG(void); extern void ShutdownCLOG(void); extern void CheckPointCLOG(void); extern void ExtendCLOG(TransactionId newestXact); extern void TruncateCLOG(TransactionId oldestXact); /* XLOG stuff */ #define CLOG_ZEROPAGE 0x00 #define CLOG_TRUNCATE 0x10 extern void clog_redo(XLogRecPtr lsn, XLogRecord *record); extern void clog_desc(StringInfo buf, uint8 xl_info, char *rec); #endif /* CLOG_H */ PKBiZd|HHserver/access/relscan.hnu[/*------------------------------------------------------------------------- * * relscan.h * POSTGRES relation scan descriptor definitions. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/relscan.h * *------------------------------------------------------------------------- */ #ifndef RELSCAN_H #define RELSCAN_H #include "access/genam.h" #include "access/heapam.h" #include "access/itup.h" #include "access/tupdesc.h" typedef struct HeapScanDescData { /* scan parameters */ Relation rs_rd; /* heap relation descriptor */ Snapshot rs_snapshot; /* snapshot to see */ int rs_nkeys; /* number of scan keys */ ScanKey rs_key; /* array of scan key descriptors */ bool rs_bitmapscan; /* true if this is really a bitmap scan */ bool rs_pageatatime; /* verify visibility page-at-a-time? */ bool rs_allow_strat; /* allow or disallow use of access strategy */ bool rs_allow_sync; /* allow or disallow use of syncscan */ /* state set up at initscan time */ BlockNumber rs_nblocks; /* number of blocks to scan */ BlockNumber rs_startblock; /* block # to start at */ BufferAccessStrategy rs_strategy; /* access strategy for reads */ bool rs_syncscan; /* report location to syncscan logic? */ /* scan current state */ bool rs_inited; /* false = scan not init'd yet */ HeapTupleData rs_ctup; /* current tuple in scan, if any */ BlockNumber rs_cblock; /* current block # in scan, if any */ Buffer rs_cbuf; /* current buffer in scan, if any */ /* NB: if rs_cbuf is not InvalidBuffer, we hold a pin on that buffer */ ItemPointerData rs_mctid; /* marked scan position, if any */ /* these fields only used in page-at-a-time mode and for bitmap scans */ int rs_cindex; /* current tuple's index in vistuples */ int rs_mindex; /* marked tuple's saved index */ int rs_ntuples; /* number of visible tuples on page */ OffsetNumber rs_vistuples[MaxHeapTuplesPerPage]; /* their offsets */ } HeapScanDescData; /* * We use the same IndexScanDescData structure for both amgettuple-based * and amgetbitmap-based index scans. Some fields are only relevant in * amgettuple-based scans. */ typedef struct IndexScanDescData { /* scan parameters */ Relation heapRelation; /* heap relation descriptor, or NULL */ Relation indexRelation; /* index relation descriptor */ Snapshot xs_snapshot; /* snapshot to see */ int numberOfKeys; /* number of index qualifier conditions */ int numberOfOrderBys; /* number of ordering operators */ ScanKey keyData; /* array of index qualifier descriptors */ ScanKey orderByData; /* array of ordering op descriptors */ bool xs_want_itup; /* caller requests index tuples */ /* signaling to index AM about killing index tuples */ bool kill_prior_tuple; /* last-returned tuple is dead */ bool ignore_killed_tuples; /* do not return killed entries */ bool xactStartedInRecovery; /* prevents killing/seeing killed * tuples */ /* index access method's private state */ void *opaque; /* access-method-specific info */ /* in an index-only scan, this is valid after a successful amgettuple */ IndexTuple xs_itup; /* index tuple returned by AM */ TupleDesc xs_itupdesc; /* rowtype descriptor of xs_itup */ /* xs_ctup/xs_cbuf/xs_recheck are valid after a successful index_getnext */ HeapTupleData xs_ctup; /* current heap tuple, if any */ Buffer xs_cbuf; /* current heap buffer in scan, if any */ /* NB: if xs_cbuf is not InvalidBuffer, we hold a pin on that buffer */ bool xs_recheck; /* T means scan keys must be rechecked */ /* state data for traversing HOT chains in index_getnext */ bool xs_continue_hot; /* T if must keep walking HOT chain */ } IndexScanDescData; /* Struct for heap-or-index scans of system tables */ typedef struct SysScanDescData { Relation heap_rel; /* catalog being scanned */ Relation irel; /* NULL if doing heap scan */ HeapScanDesc scan; /* only valid in heap-scan case */ IndexScanDesc iscan; /* only valid in index-scan case */ } SysScanDescData; #endif /* RELSCAN_H */ PKBiZz3server/access/hio.hnu[/*------------------------------------------------------------------------- * * hio.h * POSTGRES heap access method input/output definitions. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/hio.h * *------------------------------------------------------------------------- */ #ifndef HIO_H #define HIO_H #include "access/heapam.h" #include "access/htup.h" #include "utils/relcache.h" #include "storage/buf.h" /* * state for bulk inserts --- private to heapam.c and hio.c * * If current_buf isn't InvalidBuffer, then we are holding an extra pin * on that buffer. * * "typedef struct BulkInsertStateData *BulkInsertState" is in heapam.h */ typedef struct BulkInsertStateData { BufferAccessStrategy strategy; /* our BULKWRITE strategy object */ Buffer current_buf; /* current insertion target page */ } BulkInsertStateData; extern void RelationPutHeapTuple(Relation relation, Buffer buffer, HeapTuple tuple); extern Buffer RelationGetBufferForTuple(Relation relation, Size len, Buffer otherBuffer, int options, BulkInsertState bistate, Buffer *vmbuffer, Buffer *vmbuffer_other); #endif /* HIO_H */ PKBiZٚVn"n"server/access/reloptions.hnu[/*------------------------------------------------------------------------- * * reloptions.h * Core support for relation and tablespace options (pg_class.reloptions * and pg_tablespace.spcoptions) * * Note: the functions dealing with text-array reloptions values declare * them as Datum, not ArrayType *, to avoid needing to include array.h * into a lot of low-level code. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/reloptions.h * *------------------------------------------------------------------------- */ #ifndef RELOPTIONS_H #define RELOPTIONS_H #include "access/htup.h" #include "nodes/pg_list.h" /* types supported by reloptions */ typedef enum relopt_type { RELOPT_TYPE_BOOL, RELOPT_TYPE_INT, RELOPT_TYPE_REAL, RELOPT_TYPE_STRING } relopt_type; /* kinds supported by reloptions */ typedef enum relopt_kind { RELOPT_KIND_HEAP = (1 << 0), RELOPT_KIND_TOAST = (1 << 1), RELOPT_KIND_BTREE = (1 << 2), RELOPT_KIND_HASH = (1 << 3), RELOPT_KIND_GIN = (1 << 4), RELOPT_KIND_GIST = (1 << 5), RELOPT_KIND_ATTRIBUTE = (1 << 6), RELOPT_KIND_TABLESPACE = (1 << 7), RELOPT_KIND_SPGIST = (1 << 8), RELOPT_KIND_VIEW = (1 << 9), /* if you add a new kind, make sure you update "last_default" too */ RELOPT_KIND_LAST_DEFAULT = RELOPT_KIND_VIEW, /* some compilers treat enums as signed ints, so we can't use 1 << 31 */ RELOPT_KIND_MAX = (1 << 30) } relopt_kind; /* reloption namespaces allowed for heaps -- currently only TOAST */ #define HEAP_RELOPT_NAMESPACES { "toast", NULL } /* generic struct to hold shared data */ typedef struct relopt_gen { const char *name; /* must be first (used as list termination * marker) */ const char *desc; bits32 kinds; int namelen; relopt_type type; } relopt_gen; /* holds a parsed value */ typedef struct relopt_value { relopt_gen *gen; bool isset; union { bool bool_val; int int_val; double real_val; char *string_val; /* allocated separately */ } values; } relopt_value; /* reloptions records for specific variable types */ typedef struct relopt_bool { relopt_gen gen; bool default_val; } relopt_bool; typedef struct relopt_int { relopt_gen gen; int default_val; int min; int max; } relopt_int; typedef struct relopt_real { relopt_gen gen; double default_val; double min; double max; } relopt_real; /* validation routines for strings */ typedef void (*validate_string_relopt) (char *value); typedef struct relopt_string { relopt_gen gen; int default_len; bool default_isnull; validate_string_relopt validate_cb; char *default_val; } relopt_string; /* This is the table datatype for fillRelOptions */ typedef struct { const char *optname; /* option's name */ relopt_type opttype; /* option's datatype */ int offset; /* offset of field in result struct */ } relopt_parse_elt; /* * These macros exist for the convenience of amoptions writers (but consider * using fillRelOptions, which is a lot simpler). Beware of multiple * evaluation of arguments! * * The last argument in the HANDLE_*_RELOPTION macros allows the caller to * determine whether the option was set (true), or its value acquired from * defaults (false); it can be passed as (char *) NULL if the caller does not * need this information. * * optname is the option name (a string), var is the variable * on which the value should be stored (e.g. StdRdOptions->fillfactor), and * option is a relopt_value pointer. * * The normal way to use this is to loop on the relopt_value array returned by * parseRelOptions: * for (i = 0; options[i].gen->name; i++) * { * if (HAVE_RELOPTION("fillfactor", options[i]) * { * HANDLE_INT_RELOPTION("fillfactor", rdopts->fillfactor, options[i], &isset); * continue; * } * if (HAVE_RELOPTION("default_row_acl", options[i]) * { * ... * } * ... * if (validate) * ereport(ERROR, * (errmsg("unknown option"))); * } * * Note that this is more or less the same that fillRelOptions does, so only * use this if you need to do something non-standard within some option's * code block. */ #define HAVE_RELOPTION(optname, option) \ (pg_strncasecmp(option.gen->name, optname, option.gen->namelen + 1) == 0) #define HANDLE_INT_RELOPTION(optname, var, option, wasset) \ do { \ if (option.isset) \ var = option.values.int_val; \ else \ var = ((relopt_int *) option.gen)->default_val; \ (wasset) != NULL ? *(wasset) = option.isset : (dummyret)NULL; \ } while (0) #define HANDLE_BOOL_RELOPTION(optname, var, option, wasset) \ do { \ if (option.isset) \ var = option.values.bool_val; \ else \ var = ((relopt_bool *) option.gen)->default_val; \ (wasset) != NULL ? *(wasset) = option.isset : (dummyret) NULL; \ } while (0) #define HANDLE_REAL_RELOPTION(optname, var, option, wasset) \ do { \ if (option.isset) \ var = option.values.real_val; \ else \ var = ((relopt_real *) option.gen)->default_val; \ (wasset) != NULL ? *(wasset) = option.isset : (dummyret) NULL; \ } while (0) /* * Note that this assumes that the variable is already allocated at the tail of * reloptions structure (StdRdOptions or equivalent). * * "base" is a pointer to the reloptions structure, and "offset" is an integer * variable that must be initialized to sizeof(reloptions structure). This * struct must have been allocated with enough space to hold any string option * present, including terminating \0 for every option. SET_VARSIZE() must be * called on the struct with this offset as the second argument, after all the * string options have been processed. */ #define HANDLE_STRING_RELOPTION(optname, var, option, base, offset, wasset) \ do { \ relopt_string *optstring = (relopt_string *) option.gen;\ char *string_val; \ if (option.isset) \ string_val = option.values.string_val; \ else if (!optstring->default_isnull) \ string_val = optstring->default_val; \ else \ string_val = NULL; \ (wasset) != NULL ? *(wasset) = option.isset : (dummyret) NULL; \ if (string_val == NULL) \ var = 0; \ else \ { \ strcpy(((char *)(base)) + (offset), string_val); \ var = (offset); \ (offset) += strlen(string_val) + 1; \ } \ } while (0) /* * For use during amoptions: get the strlen of a string option * (either default or the user defined value) */ #define GET_STRING_RELOPTION_LEN(option) \ ((option).isset ? strlen((option).values.string_val) : \ ((relopt_string *) (option).gen)->default_len) /* * For use by code reading options already parsed: get a pointer to the string * value itself. "optstruct" is the StdRdOption struct or equivalent, "member" * is the struct member corresponding to the string option */ #define GET_STRING_RELOPTION(optstruct, member) \ ((optstruct)->member == 0 ? NULL : \ (char *)(optstruct) + (optstruct)->member) extern relopt_kind add_reloption_kind(void); extern void add_bool_reloption(bits32 kinds, char *name, char *desc, bool default_val); extern void add_int_reloption(bits32 kinds, char *name, char *desc, int default_val, int min_val, int max_val); extern void add_real_reloption(bits32 kinds, char *name, char *desc, double default_val, double min_val, double max_val); extern void add_string_reloption(bits32 kinds, char *name, char *desc, char *default_val, validate_string_relopt validator); extern Datum transformRelOptions(Datum oldOptions, List *defList, char *namspace, char *validnsps[], bool ignoreOids, bool isReset); extern List *untransformRelOptions(Datum options); extern bytea *extractRelOptions(HeapTuple tuple, TupleDesc tupdesc, Oid amoptions); extern relopt_value *parseRelOptions(Datum options, bool validate, relopt_kind kind, int *numrelopts); extern void *allocateReloptStruct(Size base, relopt_value *options, int numoptions); extern void fillRelOptions(void *rdopts, Size basesize, relopt_value *options, int numoptions, bool validate, const relopt_parse_elt *elems, int nelems); extern bytea *default_reloptions(Datum reloptions, bool validate, relopt_kind kind); extern bytea *heap_reloptions(char relkind, Datum reloptions, bool validate); extern bytea *index_reloptions(RegProcedure amoptions, Datum reloptions, bool validate); extern bytea *attribute_reloptions(Datum reloptions, bool validate); extern bytea *tablespace_reloptions(Datum reloptions, bool validate); #endif /* RELOPTIONS_H */ PKBiZKhGO{{server/access/skey.hnu[/*------------------------------------------------------------------------- * * skey.h * POSTGRES scan key definitions. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/skey.h * *------------------------------------------------------------------------- */ #ifndef SKEY_H #define SKEY_H #include "access/attnum.h" #include "fmgr.h" /* * Strategy numbers identify the semantics that particular operators have * with respect to particular operator classes. In some cases a strategy * subtype (an OID) is used as further information. */ typedef uint16 StrategyNumber; #define InvalidStrategy ((StrategyNumber) 0) /* * We define the strategy numbers for B-tree indexes here, to avoid having * to import access/nbtree.h into a lot of places that shouldn't need it. */ #define BTLessStrategyNumber 1 #define BTLessEqualStrategyNumber 2 #define BTEqualStrategyNumber 3 #define BTGreaterEqualStrategyNumber 4 #define BTGreaterStrategyNumber 5 #define BTMaxStrategyNumber 5 /* * A ScanKey represents the application of a comparison operator between * a table or index column and a constant. When it's part of an array of * ScanKeys, the comparison conditions are implicitly ANDed. The index * column is the left argument of the operator, if it's a binary operator. * (The data structure can support unary indexable operators too; in that * case sk_argument would go unused. This is not currently implemented.) * * For an index scan, sk_strategy and sk_subtype must be set correctly for * the operator. When using a ScanKey in a heap scan, these fields are not * used and may be set to InvalidStrategy/InvalidOid. * * If the operator is collation-sensitive, sk_collation must be set * correctly as well. * * A ScanKey can also represent a ScalarArrayOpExpr, that is a condition * "column op ANY(ARRAY[...])". This is signaled by the SK_SEARCHARRAY * flag bit. The sk_argument is not a value of the operator's right-hand * argument type, but rather an array of such values, and the per-element * comparisons are to be ORed together. * * A ScanKey can also represent a condition "column IS NULL" or "column * IS NOT NULL"; these cases are signaled by the SK_SEARCHNULL and * SK_SEARCHNOTNULL flag bits respectively. The argument is always NULL, * and the sk_strategy, sk_subtype, sk_collation, and sk_func fields are * not used (unless set by the index AM). * * SK_SEARCHARRAY, SK_SEARCHNULL and SK_SEARCHNOTNULL are supported only * for index scans, not heap scans; and not all index AMs support them, * only those that set amsearcharray or amsearchnulls respectively. * * A ScanKey can also represent an ordering operator invocation, that is * an ordering requirement "ORDER BY indexedcol op constant". This looks * the same as a comparison operator, except that the operator doesn't * (usually) yield boolean. We mark such ScanKeys with SK_ORDER_BY. * SK_SEARCHARRAY, SK_SEARCHNULL, SK_SEARCHNOTNULL cannot be used here. * * Note: in some places, ScanKeys are used as a convenient representation * for the invocation of an access method support procedure. In this case * sk_strategy/sk_subtype are not meaningful (but sk_collation can be); and * sk_func may refer to a function that returns something other than boolean. */ typedef struct ScanKeyData { int sk_flags; /* flags, see below */ AttrNumber sk_attno; /* table or index column number */ StrategyNumber sk_strategy; /* operator strategy number */ Oid sk_subtype; /* strategy subtype */ Oid sk_collation; /* collation to use, if needed */ FmgrInfo sk_func; /* lookup info for function to call */ Datum sk_argument; /* data to compare */ } ScanKeyData; typedef ScanKeyData *ScanKey; /* * About row comparisons: * * The ScanKey data structure also supports row comparisons, that is ordered * tuple comparisons like (x, y) > (c1, c2), having the SQL-spec semantics * "x > c1 OR (x = c1 AND y > c2)". Note that this is currently only * implemented for btree index searches, not for heapscans or any other index * type. A row comparison is represented by a "header" ScanKey entry plus * a separate array of ScanKeys, one for each column of the row comparison. * The header entry has these properties: * sk_flags = SK_ROW_HEADER * sk_attno = index column number for leading column of row comparison * sk_strategy = btree strategy code for semantics of row comparison * (ie, < <= > or >=) * sk_subtype, sk_collation, sk_func: not used * sk_argument: pointer to subsidiary ScanKey array * If the header is part of a ScanKey array that's sorted by attno, it * must be sorted according to the leading column number. * * The subsidiary ScanKey array appears in logical column order of the row * comparison, which may be different from index column order. The array * elements are like a normal ScanKey array except that: * sk_flags must include SK_ROW_MEMBER, plus SK_ROW_END in the last * element (needed since row header does not include a count) * sk_func points to the btree comparison support function for the * opclass, NOT the operator's implementation function. * sk_strategy must be the same in all elements of the subsidiary array, * that is, the same as in the header entry. * SK_SEARCHARRAY, SK_SEARCHNULL, SK_SEARCHNOTNULL cannot be used here. */ /* * ScanKeyData sk_flags * * sk_flags bits 0-15 are reserved for system-wide use (symbols for those * bits should be defined here). Bits 16-31 are reserved for use within * individual index access methods. */ #define SK_ISNULL 0x0001 /* sk_argument is NULL */ #define SK_UNARY 0x0002 /* unary operator (not supported!) */ #define SK_ROW_HEADER 0x0004 /* row comparison header (see above) */ #define SK_ROW_MEMBER 0x0008 /* row comparison member (see above) */ #define SK_ROW_END 0x0010 /* last row comparison member */ #define SK_SEARCHARRAY 0x0020 /* scankey represents ScalarArrayOp */ #define SK_SEARCHNULL 0x0040 /* scankey represents "col IS NULL" */ #define SK_SEARCHNOTNULL 0x0080 /* scankey represents "col IS NOT * NULL" */ #define SK_ORDER_BY 0x0100 /* scankey is for ORDER BY op */ /* * prototypes for functions in access/common/scankey.c */ extern void ScanKeyInit(ScanKey entry, AttrNumber attributeNumber, StrategyNumber strategy, RegProcedure procedure, Datum argument); extern void ScanKeyEntryInitialize(ScanKey entry, int flags, AttrNumber attributeNumber, StrategyNumber strategy, Oid subtype, Oid collation, RegProcedure procedure, Datum argument); extern void ScanKeyEntryInitializeWithInfo(ScanKey entry, int flags, AttrNumber attributeNumber, StrategyNumber strategy, Oid subtype, Oid collation, FmgrInfo *finfo, Datum argument); #endif /* SKEY_H */ PKBiZ~\{{server/access/sysattr.hnu[/*------------------------------------------------------------------------- * * sysattr.h * POSTGRES system attribute definitions. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/sysattr.h * *------------------------------------------------------------------------- */ #ifndef SYSATTR_H #define SYSATTR_H /* * Attribute numbers for the system-defined attributes */ #define SelfItemPointerAttributeNumber (-1) #define ObjectIdAttributeNumber (-2) #define MinTransactionIdAttributeNumber (-3) #define MinCommandIdAttributeNumber (-4) #define MaxTransactionIdAttributeNumber (-5) #define MaxCommandIdAttributeNumber (-6) #define TableOidAttributeNumber (-7) #define FirstLowInvalidHeapAttributeNumber (-8) #endif /* SYSATTR_H */ PKBiZoIserver/access/visibilitymap.hnu[/*------------------------------------------------------------------------- * * visibilitymap.h * visibility map interface * * * Portions Copyright (c) 2007-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/visibilitymap.h * *------------------------------------------------------------------------- */ #ifndef VISIBILITYMAP_H #define VISIBILITYMAP_H #include "access/xlogdefs.h" #include "storage/block.h" #include "storage/buf.h" #include "utils/relcache.h" extern void visibilitymap_clear(Relation rel, BlockNumber heapBlk, Buffer vmbuf); extern void visibilitymap_pin(Relation rel, BlockNumber heapBlk, Buffer *vmbuf); extern bool visibilitymap_pin_ok(BlockNumber heapBlk, Buffer vmbuf); extern void visibilitymap_set(Relation rel, BlockNumber heapBlk, XLogRecPtr recptr, Buffer vmbuf, TransactionId cutoff_xid); extern bool visibilitymap_test(Relation rel, BlockNumber heapBlk, Buffer *vmbuf); extern BlockNumber visibilitymap_count(Relation rel); extern void visibilitymap_truncate(Relation rel, BlockNumber nheapblocks); #endif /* VISIBILITYMAP_H */ PKBiZoj$$server/access/rmgr.hnu[/* * rmgr.h * * Resource managers definition * * src/include/access/rmgr.h */ #ifndef RMGR_H #define RMGR_H typedef uint8 RmgrId; /* * Built-in resource managers * * Note: RM_MAX_ID could be as much as 255 without breaking the XLOG file * format, but we keep it small to minimize the size of RmgrTable[]. */ #define RM_XLOG_ID 0 #define RM_XACT_ID 1 #define RM_SMGR_ID 2 #define RM_CLOG_ID 3 #define RM_DBASE_ID 4 #define RM_TBLSPC_ID 5 #define RM_MULTIXACT_ID 6 #define RM_RELMAP_ID 7 #define RM_STANDBY_ID 8 #define RM_HEAP2_ID 9 #define RM_HEAP_ID 10 #define RM_BTREE_ID 11 #define RM_HASH_ID 12 #define RM_GIN_ID 13 #define RM_GIST_ID 14 #define RM_SEQ_ID 15 #define RM_SPGIST_ID 16 #define RM_MAX_ID RM_SPGIST_ID #endif /* RMGR_H */ PKBiZ 2z3z3server/access/hash.hnu[/*------------------------------------------------------------------------- * * hash.h * header file for postgres hash access method implementation * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/hash.h * * NOTES * modeled after Margo Seltzer's hash implementation for unix. * *------------------------------------------------------------------------- */ #ifndef HASH_H #define HASH_H #include "access/genam.h" #include "access/itup.h" #include "access/sdir.h" #include "access/xlog.h" #include "fmgr.h" #include "storage/bufmgr.h" #include "storage/lock.h" #include "utils/relcache.h" /* * Mapping from hash bucket number to physical block number of bucket's * starting page. Beware of multiple evaluations of argument! */ typedef uint32 Bucket; #define BUCKET_TO_BLKNO(metap,B) \ ((BlockNumber) ((B) + ((B) ? (metap)->hashm_spares[_hash_log2((B)+1)-1] : 0)) + 1) /* * Special space for hash index pages. * * hasho_flag tells us which type of page we're looking at. For * example, knowing overflow pages from bucket pages is necessary * information when you're deleting tuples from a page. If all the * tuples are deleted from an overflow page, the overflow is made * available to other buckets by calling _hash_freeovflpage(). If all * the tuples are deleted from a bucket page, no additional action is * necessary. */ #define LH_UNUSED_PAGE (0) #define LH_OVERFLOW_PAGE (1 << 0) #define LH_BUCKET_PAGE (1 << 1) #define LH_BITMAP_PAGE (1 << 2) #define LH_META_PAGE (1 << 3) typedef struct HashPageOpaqueData { BlockNumber hasho_prevblkno; /* previous ovfl (or bucket) blkno */ BlockNumber hasho_nextblkno; /* next ovfl blkno */ Bucket hasho_bucket; /* bucket number this pg belongs to */ uint16 hasho_flag; /* page type code, see above */ uint16 hasho_page_id; /* for identification of hash indexes */ } HashPageOpaqueData; typedef HashPageOpaqueData *HashPageOpaque; /* * The page ID is for the convenience of pg_filedump and similar utilities, * which otherwise would have a hard time telling pages of different index * types apart. It should be the last 2 bytes on the page. This is more or * less "free" due to alignment considerations. */ #define HASHO_PAGE_ID 0xFF80 /* * HashScanOpaqueData is private state for a hash index scan. */ typedef struct HashScanOpaqueData { /* Hash value of the scan key, ie, the hash key we seek */ uint32 hashso_sk_hash; /* * By definition, a hash scan should be examining only one bucket. We * record the bucket number here as soon as it is known. */ Bucket hashso_bucket; bool hashso_bucket_valid; /* * If we have a share lock on the bucket, we record it here. When * hashso_bucket_blkno is zero, we have no such lock. */ BlockNumber hashso_bucket_blkno; /* * We also want to remember which buffer we're currently examining in the * scan. We keep the buffer pinned (but not locked) across hashgettuple * calls, in order to avoid doing a ReadBuffer() for every tuple in the * index. */ Buffer hashso_curbuf; /* Current position of the scan, as an index TID */ ItemPointerData hashso_curpos; /* Current position of the scan, as a heap TID */ ItemPointerData hashso_heappos; } HashScanOpaqueData; typedef HashScanOpaqueData *HashScanOpaque; /* * Definitions for metapage. */ #define HASH_METAPAGE 0 /* metapage is always block 0 */ #define HASH_MAGIC 0x6440640 #define HASH_VERSION 2 /* 2 signifies only hash key value is stored */ /* * Spares[] holds the number of overflow pages currently allocated at or * before a certain splitpoint. For example, if spares[3] = 7 then there are * 7 ovflpages before splitpoint 3 (compare BUCKET_TO_BLKNO macro). The * value in spares[ovflpoint] increases as overflow pages are added at the * end of the index. Once ovflpoint increases (ie, we have actually allocated * the bucket pages belonging to that splitpoint) the number of spares at the * prior splitpoint cannot change anymore. * * ovflpages that have been recycled for reuse can be found by looking at * bitmaps that are stored within ovflpages dedicated for the purpose. * The blknos of these bitmap pages are kept in bitmaps[]; nmaps is the * number of currently existing bitmaps. * * The limitation on the size of spares[] comes from the fact that there's * no point in having more than 2^32 buckets with only uint32 hashcodes. * There is no particular upper limit on the size of mapp[], other than * needing to fit into the metapage. (With 8K block size, 128 bitmaps * limit us to 64 Gb of overflow space...) */ #define HASH_MAX_SPLITPOINTS 32 #define HASH_MAX_BITMAPS 128 typedef struct HashMetaPageData { uint32 hashm_magic; /* magic no. for hash tables */ uint32 hashm_version; /* version ID */ double hashm_ntuples; /* number of tuples stored in the table */ uint16 hashm_ffactor; /* target fill factor (tuples/bucket) */ uint16 hashm_bsize; /* index page size (bytes) */ uint16 hashm_bmsize; /* bitmap array size (bytes) - must be a power * of 2 */ uint16 hashm_bmshift; /* log2(bitmap array size in BITS) */ uint32 hashm_maxbucket; /* ID of maximum bucket in use */ uint32 hashm_highmask; /* mask to modulo into entire table */ uint32 hashm_lowmask; /* mask to modulo into lower half of table */ uint32 hashm_ovflpoint;/* splitpoint from which ovflpgs being * allocated */ uint32 hashm_firstfree; /* lowest-number free ovflpage (bit#) */ uint32 hashm_nmaps; /* number of bitmap pages */ RegProcedure hashm_procid; /* hash procedure id from pg_proc */ uint32 hashm_spares[HASH_MAX_SPLITPOINTS]; /* spare pages before * each splitpoint */ BlockNumber hashm_mapp[HASH_MAX_BITMAPS]; /* blknos of ovfl bitmaps */ } HashMetaPageData; typedef HashMetaPageData *HashMetaPage; /* * Maximum size of a hash index item (it's okay to have only one per page) */ #define HashMaxItemSize(page) \ MAXALIGN_DOWN(PageGetPageSize(page) - \ SizeOfPageHeaderData - \ sizeof(ItemIdData) - \ MAXALIGN(sizeof(HashPageOpaqueData))) #define HASH_MIN_FILLFACTOR 10 #define HASH_DEFAULT_FILLFACTOR 75 /* * Constants */ #define BYTE_TO_BIT 3 /* 2^3 bits/byte */ #define ALL_SET ((uint32) ~0) /* * Bitmap pages do not contain tuples. They do contain the standard * page headers and trailers; however, everything in between is a * giant bit array. The number of bits that fit on a page obviously * depends on the page size and the header/trailer overhead. We require * the number of bits per page to be a power of 2. */ #define BMPGSZ_BYTE(metap) ((metap)->hashm_bmsize) #define BMPGSZ_BIT(metap) ((metap)->hashm_bmsize << BYTE_TO_BIT) #define BMPG_SHIFT(metap) ((metap)->hashm_bmshift) #define BMPG_MASK(metap) (BMPGSZ_BIT(metap) - 1) #define HashPageGetBitmap(page) \ ((uint32 *) PageGetContents(page)) #define HashGetMaxBitmapSize(page) \ (PageGetPageSize((Page) page) - \ (MAXALIGN(SizeOfPageHeaderData) + MAXALIGN(sizeof(HashPageOpaqueData)))) #define HashPageGetMeta(page) \ ((HashMetaPage) PageGetContents(page)) /* * The number of bits in an ovflpage bitmap word. */ #define BITS_PER_MAP 32 /* Number of bits in uint32 */ /* Given the address of the beginning of a bit map, clear/set the nth bit */ #define CLRBIT(A, N) ((A)[(N)/BITS_PER_MAP] &= ~(1<<((N)%BITS_PER_MAP))) #define SETBIT(A, N) ((A)[(N)/BITS_PER_MAP] |= (1<<((N)%BITS_PER_MAP))) #define ISSET(A, N) ((A)[(N)/BITS_PER_MAP] & (1<<((N)%BITS_PER_MAP))) /* * page-level and high-level locking modes (see README) */ #define HASH_READ BUFFER_LOCK_SHARE #define HASH_WRITE BUFFER_LOCK_EXCLUSIVE #define HASH_NOLOCK (-1) #define HASH_SHARE ShareLock #define HASH_EXCLUSIVE ExclusiveLock /* * Strategy number. There's only one valid strategy for hashing: equality. */ #define HTEqualStrategyNumber 1 #define HTMaxStrategyNumber 1 /* * When a new operator class is declared, we require that the user supply * us with an amproc procudure for hashing a key of the new type. * Since we only have one such proc in amproc, it's number 1. */ #define HASHPROC 1 /* public routines */ extern Datum hashbuild(PG_FUNCTION_ARGS); extern Datum hashbuildempty(PG_FUNCTION_ARGS); extern Datum hashinsert(PG_FUNCTION_ARGS); extern Datum hashbeginscan(PG_FUNCTION_ARGS); extern Datum hashgettuple(PG_FUNCTION_ARGS); extern Datum hashgetbitmap(PG_FUNCTION_ARGS); extern Datum hashrescan(PG_FUNCTION_ARGS); extern Datum hashendscan(PG_FUNCTION_ARGS); extern Datum hashmarkpos(PG_FUNCTION_ARGS); extern Datum hashrestrpos(PG_FUNCTION_ARGS); extern Datum hashbulkdelete(PG_FUNCTION_ARGS); extern Datum hashvacuumcleanup(PG_FUNCTION_ARGS); extern Datum hashoptions(PG_FUNCTION_ARGS); /* * Datatype-specific hash functions in hashfunc.c. * * These support both hash indexes and hash joins. * * NOTE: some of these are also used by catcache operations, without * any direct connection to hash indexes. Also, the common hash_any * routine is also used by dynahash tables. */ extern Datum hashchar(PG_FUNCTION_ARGS); extern Datum hashint2(PG_FUNCTION_ARGS); extern Datum hashint4(PG_FUNCTION_ARGS); extern Datum hashint8(PG_FUNCTION_ARGS); extern Datum hashoid(PG_FUNCTION_ARGS); extern Datum hashenum(PG_FUNCTION_ARGS); extern Datum hashfloat4(PG_FUNCTION_ARGS); extern Datum hashfloat8(PG_FUNCTION_ARGS); extern Datum hashoidvector(PG_FUNCTION_ARGS); extern Datum hashint2vector(PG_FUNCTION_ARGS); extern Datum hashname(PG_FUNCTION_ARGS); extern Datum hashtext(PG_FUNCTION_ARGS); extern Datum hashvarlena(PG_FUNCTION_ARGS); extern Datum hash_any(register const unsigned char *k, register int keylen); extern Datum hash_uint32(uint32 k); /* private routines */ /* hashinsert.c */ extern void _hash_doinsert(Relation rel, IndexTuple itup); extern OffsetNumber _hash_pgaddtup(Relation rel, Buffer buf, Size itemsize, IndexTuple itup); /* hashovfl.c */ extern Buffer _hash_addovflpage(Relation rel, Buffer metabuf, Buffer buf); extern BlockNumber _hash_freeovflpage(Relation rel, Buffer ovflbuf, BufferAccessStrategy bstrategy); extern void _hash_initbitmap(Relation rel, HashMetaPage metap, BlockNumber blkno, ForkNumber forkNum); extern void _hash_squeezebucket(Relation rel, Bucket bucket, BlockNumber bucket_blkno, BufferAccessStrategy bstrategy); /* hashpage.c */ extern void _hash_getlock(Relation rel, BlockNumber whichlock, int access); extern bool _hash_try_getlock(Relation rel, BlockNumber whichlock, int access); extern void _hash_droplock(Relation rel, BlockNumber whichlock, int access); extern Buffer _hash_getbuf(Relation rel, BlockNumber blkno, int access, int flags); extern Buffer _hash_getinitbuf(Relation rel, BlockNumber blkno); extern Buffer _hash_getnewbuf(Relation rel, BlockNumber blkno, ForkNumber forkNum); extern Buffer _hash_getbuf_with_strategy(Relation rel, BlockNumber blkno, int access, int flags, BufferAccessStrategy bstrategy); extern void _hash_relbuf(Relation rel, Buffer buf); extern void _hash_dropbuf(Relation rel, Buffer buf); extern void _hash_wrtbuf(Relation rel, Buffer buf); extern void _hash_chgbufaccess(Relation rel, Buffer buf, int from_access, int to_access); extern uint32 _hash_metapinit(Relation rel, double num_tuples, ForkNumber forkNum); extern void _hash_pageinit(Page page, Size size); extern void _hash_expandtable(Relation rel, Buffer metabuf); /* hashscan.c */ extern void _hash_regscan(IndexScanDesc scan); extern void _hash_dropscan(IndexScanDesc scan); extern bool _hash_has_active_scan(Relation rel, Bucket bucket); extern void ReleaseResources_hash(void); /* hashsearch.c */ extern bool _hash_next(IndexScanDesc scan, ScanDirection dir); extern bool _hash_first(IndexScanDesc scan, ScanDirection dir); extern bool _hash_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir); /* hashsort.c */ typedef struct HSpool HSpool; /* opaque struct in hashsort.c */ extern HSpool *_h_spoolinit(Relation index, uint32 num_buckets); extern void _h_spooldestroy(HSpool *hspool); extern void _h_spool(IndexTuple itup, HSpool *hspool); extern void _h_indexbuild(HSpool *hspool); /* hashutil.c */ extern bool _hash_checkqual(IndexScanDesc scan, IndexTuple itup); extern uint32 _hash_datum2hashkey(Relation rel, Datum key); extern uint32 _hash_datum2hashkey_type(Relation rel, Datum key, Oid keytype); extern Bucket _hash_hashkey2bucket(uint32 hashkey, uint32 maxbucket, uint32 highmask, uint32 lowmask); extern uint32 _hash_log2(uint32 num); extern void _hash_checkpage(Relation rel, Buffer buf, int flags); extern uint32 _hash_get_indextuple_hashkey(IndexTuple itup); extern IndexTuple _hash_form_tuple(Relation index, Datum *values, bool *isnull); extern OffsetNumber _hash_binsearch(Page page, uint32 hash_value); extern OffsetNumber _hash_binsearch_last(Page page, uint32 hash_value); /* hash.c */ extern void hash_redo(XLogRecPtr lsn, XLogRecord *record); extern void hash_desc(StringInfo buf, uint8 xl_info, char *rec); #endif /* HASH_H */ PKBiZUN N server/access/multixact.hnu[/* * multixact.h * * PostgreSQL multi-transaction-log manager * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/multixact.h */ #ifndef MULTIXACT_H #define MULTIXACT_H #include "access/xlog.h" #define InvalidMultiXactId ((MultiXactId) 0) #define FirstMultiXactId ((MultiXactId) 1) #define MaxMultiXactId ((MultiXactId) 0xFFFFFFFF) #define MultiXactIdIsValid(multi) ((multi) != InvalidMultiXactId) /* Number of SLRU buffers to use for multixact */ #define NUM_MXACTOFFSET_BUFFERS 8 #define NUM_MXACTMEMBER_BUFFERS 16 /* ---------------- * multixact-related XLOG entries * ---------------- */ #define XLOG_MULTIXACT_ZERO_OFF_PAGE 0x00 #define XLOG_MULTIXACT_ZERO_MEM_PAGE 0x10 #define XLOG_MULTIXACT_CREATE_ID 0x20 typedef struct xl_multixact_create { MultiXactId mid; /* new MultiXact's ID */ MultiXactOffset moff; /* its starting offset in members file */ int32 nxids; /* number of member XIDs */ TransactionId xids[1]; /* VARIABLE LENGTH ARRAY */ } xl_multixact_create; #define MinSizeOfMultiXactCreate offsetof(xl_multixact_create, xids) extern MultiXactId MultiXactIdCreate(TransactionId xid1, TransactionId xid2); extern MultiXactId MultiXactIdExpand(MultiXactId multi, TransactionId xid); extern bool MultiXactIdIsRunning(MultiXactId multi); extern bool MultiXactIdIsCurrent(MultiXactId multi); extern void MultiXactIdWait(MultiXactId multi); extern bool ConditionalMultiXactIdWait(MultiXactId multi); extern void MultiXactIdSetOldestMember(void); extern int GetMultiXactIdMembers(MultiXactId multi, TransactionId **xids); extern void AtEOXact_MultiXact(void); extern void AtPrepare_MultiXact(void); extern void PostPrepare_MultiXact(TransactionId xid); extern Size MultiXactShmemSize(void); extern void MultiXactShmemInit(void); extern void BootStrapMultiXact(void); extern void StartupMultiXact(void); extern void TrimMultiXact(void); extern void ShutdownMultiXact(void); extern void MultiXactGetCheckptMulti(bool is_shutdown, MultiXactId *nextMulti, MultiXactOffset *nextMultiOffset); extern void CheckPointMultiXact(void); extern void MultiXactSetNextMXact(MultiXactId nextMulti, MultiXactOffset nextMultiOffset); extern void MultiXactAdvanceNextMXact(MultiXactId minMulti, MultiXactOffset minMultiOffset); extern void multixact_twophase_recover(TransactionId xid, uint16 info, void *recdata, uint32 len); extern void multixact_twophase_postcommit(TransactionId xid, uint16 info, void *recdata, uint32 len); extern void multixact_twophase_postabort(TransactionId xid, uint16 info, void *recdata, uint32 len); extern void multixact_redo(XLogRecPtr lsn, XLogRecord *record); extern void multixact_desc(StringInfo buf, uint8 xl_info, char *rec); #endif /* MULTIXACT_H */ PKBiZA55server/access/itup.hnu[/*------------------------------------------------------------------------- * * itup.h * POSTGRES index tuple definitions. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/itup.h * *------------------------------------------------------------------------- */ #ifndef ITUP_H #define ITUP_H #include "access/tupdesc.h" #include "access/tupmacs.h" #include "storage/bufpage.h" #include "storage/itemptr.h" /* * Index tuple header structure * * All index tuples start with IndexTupleData. If the HasNulls bit is set, * this is followed by an IndexAttributeBitMapData. The index attribute * values follow, beginning at a MAXALIGN boundary. * * Note that the space allocated for the bitmap does not vary with the number * of attributes; that is because we don't have room to store the number of * attributes in the header. Given the MAXALIGN constraint there's no space * savings to be had anyway, for usual values of INDEX_MAX_KEYS. */ typedef struct IndexTupleData { ItemPointerData t_tid; /* reference TID to heap tuple */ /* --------------- * t_info is laid out in the following fashion: * * 15th (high) bit: has nulls * 14th bit: has var-width attributes * 13th bit: unused * 12-0 bit: size of tuple * --------------- */ unsigned short t_info; /* various info about tuple */ } IndexTupleData; /* MORE DATA FOLLOWS AT END OF STRUCT */ typedef IndexTupleData *IndexTuple; typedef struct IndexAttributeBitMapData { bits8 bits[(INDEX_MAX_KEYS + 8 - 1) / 8]; } IndexAttributeBitMapData; typedef IndexAttributeBitMapData *IndexAttributeBitMap; /* * t_info manipulation macros */ #define INDEX_SIZE_MASK 0x1FFF /* bit 0x2000 is not used at present */ #define INDEX_VAR_MASK 0x4000 #define INDEX_NULL_MASK 0x8000 #define IndexTupleSize(itup) ((Size) (((IndexTuple) (itup))->t_info & INDEX_SIZE_MASK)) #define IndexTupleDSize(itup) ((Size) ((itup).t_info & INDEX_SIZE_MASK)) #define IndexTupleHasNulls(itup) ((((IndexTuple) (itup))->t_info & INDEX_NULL_MASK)) #define IndexTupleHasVarwidths(itup) ((((IndexTuple) (itup))->t_info & INDEX_VAR_MASK)) /* * Takes an infomask as argument (primarily because this needs to be usable * at index_form_tuple time so enough space is allocated). */ #define IndexInfoFindDataOffset(t_info) \ ( \ (!((t_info) & INDEX_NULL_MASK)) ? \ ( \ (Size)MAXALIGN(sizeof(IndexTupleData)) \ ) \ : \ ( \ (Size)MAXALIGN(sizeof(IndexTupleData) + sizeof(IndexAttributeBitMapData)) \ ) \ ) /* ---------------- * index_getattr * * This gets called many times, so we macro the cacheable and NULL * lookups, and call nocache_index_getattr() for the rest. * * ---------------- */ #define index_getattr(tup, attnum, tupleDesc, isnull) \ ( \ AssertMacro(PointerIsValid(isnull) && (attnum) > 0), \ *(isnull) = false, \ !IndexTupleHasNulls(tup) ? \ ( \ (tupleDesc)->attrs[(attnum)-1]->attcacheoff >= 0 ? \ ( \ fetchatt((tupleDesc)->attrs[(attnum)-1], \ (char *) (tup) + IndexInfoFindDataOffset((tup)->t_info) \ + (tupleDesc)->attrs[(attnum)-1]->attcacheoff) \ ) \ : \ nocache_index_getattr((tup), (attnum), (tupleDesc)) \ ) \ : \ ( \ (att_isnull((attnum)-1, (char *)(tup) + sizeof(IndexTupleData))) ? \ ( \ *(isnull) = true, \ (Datum)NULL \ ) \ : \ ( \ nocache_index_getattr((tup), (attnum), (tupleDesc)) \ ) \ ) \ ) /* * MaxIndexTuplesPerPage is an upper bound on the number of tuples that can * fit on one index page. An index tuple must have either data or a null * bitmap, so we can safely assume it's at least 1 byte bigger than a bare * IndexTupleData struct. We arrive at the divisor because each tuple * must be maxaligned, and it must have an associated item pointer. */ #define MaxIndexTuplesPerPage \ ((int) ((BLCKSZ - SizeOfPageHeaderData) / \ (MAXALIGN(sizeof(IndexTupleData) + 1) + sizeof(ItemIdData)))) /* routines in indextuple.c */ extern IndexTuple index_form_tuple(TupleDesc tupleDescriptor, Datum *values, bool *isnull); extern Datum nocache_index_getattr(IndexTuple tup, int attnum, TupleDesc tupleDesc); extern void index_deform_tuple(IndexTuple tup, TupleDesc tupleDescriptor, Datum *values, bool *isnull); extern IndexTuple CopyIndexTuple(IndexTuple source); #endif /* ITUP_H */ PKBiZLserver/access/twophase_rmgr.hnu[/*------------------------------------------------------------------------- * * twophase_rmgr.h * Two-phase-commit resource managers definition * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/twophase_rmgr.h * *------------------------------------------------------------------------- */ #ifndef TWOPHASE_RMGR_H #define TWOPHASE_RMGR_H typedef void (*TwoPhaseCallback) (TransactionId xid, uint16 info, void *recdata, uint32 len); typedef uint8 TwoPhaseRmgrId; /* * Built-in resource managers */ #define TWOPHASE_RM_END_ID 0 #define TWOPHASE_RM_LOCK_ID 1 #define TWOPHASE_RM_PGSTAT_ID 2 #define TWOPHASE_RM_MULTIXACT_ID 3 #define TWOPHASE_RM_PREDICATELOCK_ID 4 #define TWOPHASE_RM_MAX_ID TWOPHASE_RM_PREDICATELOCK_ID extern const TwoPhaseCallback twophase_recover_callbacks[]; extern const TwoPhaseCallback twophase_postcommit_callbacks[]; extern const TwoPhaseCallback twophase_postabort_callbacks[]; extern const TwoPhaseCallback twophase_standby_recover_callbacks[]; extern void RegisterTwoPhaseRecord(TwoPhaseRmgrId rmid, uint16 info, const void *data, uint32 len); #endif /* TWOPHASE_RMGR_H */ PKBiZ1'.{server/access/sdir.hnu[/*------------------------------------------------------------------------- * * sdir.h * POSTGRES scan direction definitions. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/sdir.h * *------------------------------------------------------------------------- */ #ifndef SDIR_H #define SDIR_H /* * ScanDirection was an int8 for no apparent reason. I kept the original * values because I'm not sure if I'll break anything otherwise. -ay 2/95 */ typedef enum ScanDirection { BackwardScanDirection = -1, NoMovementScanDirection = 0, ForwardScanDirection = 1 } ScanDirection; /* * ScanDirectionIsValid * True iff scan direction is valid. */ #define ScanDirectionIsValid(direction) \ ((bool) (BackwardScanDirection <= (direction) && \ (direction) <= ForwardScanDirection)) /* * ScanDirectionIsBackward * True iff scan direction is backward. */ #define ScanDirectionIsBackward(direction) \ ((bool) ((direction) == BackwardScanDirection)) /* * ScanDirectionIsNoMovement * True iff scan direction indicates no movement. */ #define ScanDirectionIsNoMovement(direction) \ ((bool) ((direction) == NoMovementScanDirection)) /* * ScanDirectionIsForward * True iff scan direction is forward. */ #define ScanDirectionIsForward(direction) \ ((bool) ((direction) == ForwardScanDirection)) #endif /* SDIR_H */ PKBiZWMserver/access/slru.hnu[/*------------------------------------------------------------------------- * * slru.h * Simple LRU buffering for transaction status logfiles * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/slru.h * *------------------------------------------------------------------------- */ #ifndef SLRU_H #define SLRU_H #include "access/xlogdefs.h" #include "storage/lwlock.h" /* * Define SLRU segment size. A page is the same BLCKSZ as is used everywhere * else in Postgres. The segment size can be chosen somewhat arbitrarily; * we make it 32 pages by default, or 256Kb, i.e. 1M transactions for CLOG * or 64K transactions for SUBTRANS. * * Note: because TransactionIds are 32 bits and wrap around at 0xFFFFFFFF, * page numbering also wraps around at 0xFFFFFFFF/xxxx_XACTS_PER_PAGE (where * xxxx is CLOG or SUBTRANS, respectively), and segment numbering at * 0xFFFFFFFF/xxxx_XACTS_PER_PAGE/SLRU_PAGES_PER_SEGMENT. We need * take no explicit notice of that fact in slru.c, except when comparing * segment and page numbers in SimpleLruTruncate (see PagePrecedes()). * * Note: slru.c currently assumes that segment file names will be four hex * digits. This sets a lower bound on the segment size (64K transactions * for 32-bit TransactionIds). */ #define SLRU_PAGES_PER_SEGMENT 32 /* * Page status codes. Note that these do not include the "dirty" bit. * page_dirty can be TRUE only in the VALID or WRITE_IN_PROGRESS states; * in the latter case it implies that the page has been re-dirtied since * the write started. */ typedef enum { SLRU_PAGE_EMPTY, /* buffer is not in use */ SLRU_PAGE_READ_IN_PROGRESS, /* page is being read in */ SLRU_PAGE_VALID, /* page is valid and not being written */ SLRU_PAGE_WRITE_IN_PROGRESS /* page is being written out */ } SlruPageStatus; /* * Shared-memory state */ typedef struct SlruSharedData { LWLockId ControlLock; /* Number of buffers managed by this SLRU structure */ int num_slots; /* * Arrays holding info for each buffer slot. Page number is undefined * when status is EMPTY, as is page_lru_count. */ char **page_buffer; SlruPageStatus *page_status; bool *page_dirty; int *page_number; int *page_lru_count; LWLockId *buffer_locks; /* * Optional array of WAL flush LSNs associated with entries in the SLRU * pages. If not zero/NULL, we must flush WAL before writing pages (true * for pg_clog, false for multixact, pg_subtrans, pg_notify). group_lsn[] * has lsn_groups_per_page entries per buffer slot, each containing the * highest LSN known for a contiguous group of SLRU entries on that slot's * page. */ XLogRecPtr *group_lsn; int lsn_groups_per_page; /*---------- * We mark a page "most recently used" by setting * page_lru_count[slotno] = ++cur_lru_count; * The oldest page is therefore the one with the highest value of * cur_lru_count - page_lru_count[slotno] * The counts will eventually wrap around, but this calculation still * works as long as no page's age exceeds INT_MAX counts. *---------- */ int cur_lru_count; /* * latest_page_number is the page number of the current end of the log; * this is not critical data, since we use it only to avoid swapping out * the latest page. */ int latest_page_number; } SlruSharedData; typedef SlruSharedData *SlruShared; /* * SlruCtlData is an unshared structure that points to the active information * in shared memory. */ typedef struct SlruCtlData { SlruShared shared; /* * This flag tells whether to fsync writes (true for pg_clog and multixact * stuff, false for pg_subtrans and pg_notify). */ bool do_fsync; /* * Decide which of two page numbers is "older" for truncation purposes. We * need to use comparison of TransactionIds here in order to do the right * thing with wraparound XID arithmetic. */ bool (*PagePrecedes) (int, int); /* * Dir is set during SimpleLruInit and does not change thereafter. Since * it's always the same, it doesn't need to be in shared memory. */ char Dir[64]; } SlruCtlData; typedef SlruCtlData *SlruCtl; extern Size SimpleLruShmemSize(int nslots, int nlsns); extern void SimpleLruInit(SlruCtl ctl, const char *name, int nslots, int nlsns, LWLockId ctllock, const char *subdir); extern int SimpleLruZeroPage(SlruCtl ctl, int pageno); extern int SimpleLruReadPage(SlruCtl ctl, int pageno, bool write_ok, TransactionId xid); extern int SimpleLruReadPage_ReadOnly(SlruCtl ctl, int pageno, TransactionId xid); extern void SimpleLruWritePage(SlruCtl ctl, int slotno); extern void SimpleLruFlush(SlruCtl ctl, bool checkpoint); extern void SimpleLruTruncate(SlruCtl ctl, int cutoffPage); typedef bool (*SlruScanCallback) (SlruCtl ctl, char *filename, int segpage, void *data); extern bool SlruScanDirectory(SlruCtl ctl, SlruScanCallback callback, void *data); /* SlruScanDirectory public callbacks */ extern bool SlruScanDirCbReportPresence(SlruCtl ctl, char *filename, int segpage, void *data); extern bool SlruScanDirCbDeleteAll(SlruCtl ctl, char *filename, int segpage, void *data); #endif /* SLRU_H */ PKBiZeserver/access/tupdesc.hnu[/*------------------------------------------------------------------------- * * tupdesc.h * POSTGRES tuple descriptor definitions. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/tupdesc.h * *------------------------------------------------------------------------- */ #ifndef TUPDESC_H #define TUPDESC_H #include "access/attnum.h" #include "catalog/pg_attribute.h" #include "nodes/pg_list.h" typedef struct attrDefault { AttrNumber adnum; char *adbin; /* nodeToString representation of expr */ } AttrDefault; typedef struct constrCheck { char *ccname; char *ccbin; /* nodeToString representation of expr */ bool ccvalid; bool ccnoinherit; /* this is a non-inheritable constraint */ } ConstrCheck; /* This structure contains constraints of a tuple */ typedef struct tupleConstr { AttrDefault *defval; /* array */ ConstrCheck *check; /* array */ uint16 num_defval; uint16 num_check; bool has_not_null; } TupleConstr; /* * This struct is passed around within the backend to describe the structure * of tuples. For tuples coming from on-disk relations, the information is * collected from the pg_attribute, pg_attrdef, and pg_constraint catalogs. * Transient row types (such as the result of a join query) have anonymous * TupleDesc structs that generally omit any constraint info; therefore the * structure is designed to let the constraints be omitted efficiently. * * Note that only user attributes, not system attributes, are mentioned in * TupleDesc; with the exception that tdhasoid indicates if OID is present. * * If the tupdesc is known to correspond to a named rowtype (such as a table's * rowtype) then tdtypeid identifies that type and tdtypmod is -1. Otherwise * tdtypeid is RECORDOID, and tdtypmod can be either -1 for a fully anonymous * row type, or a value >= 0 to allow the rowtype to be looked up in the * typcache.c type cache. * * Tuple descriptors that live in caches (relcache or typcache, at present) * are reference-counted: they can be deleted when their reference count goes * to zero. Tuple descriptors created by the executor need no reference * counting, however: they are simply created in the appropriate memory * context and go away when the context is freed. We set the tdrefcount * field of such a descriptor to -1, while reference-counted descriptors * always have tdrefcount >= 0. */ typedef struct tupleDesc { int natts; /* number of attributes in the tuple */ Form_pg_attribute *attrs; /* attrs[N] is a pointer to the description of Attribute Number N+1 */ TupleConstr *constr; /* constraints, or NULL if none */ Oid tdtypeid; /* composite type ID for tuple type */ int32 tdtypmod; /* typmod for tuple type */ bool tdhasoid; /* tuple has oid attribute in its header */ int tdrefcount; /* reference count, or -1 if not counting */ } *TupleDesc; /* Accessor for the i'th attribute of tupdesc. */ #define TupleDescAttr(tupdesc, i) ((tupdesc)->attrs[(i)]) extern TupleDesc CreateTemplateTupleDesc(int natts, bool hasoid); extern TupleDesc CreateTupleDesc(int natts, bool hasoid, Form_pg_attribute *attrs); extern TupleDesc CreateTupleDescCopy(TupleDesc tupdesc); extern TupleDesc CreateTupleDescCopyConstr(TupleDesc tupdesc); extern void FreeTupleDesc(TupleDesc tupdesc); extern void IncrTupleDescRefCount(TupleDesc tupdesc); extern void DecrTupleDescRefCount(TupleDesc tupdesc); #define PinTupleDesc(tupdesc) \ do { \ if ((tupdesc)->tdrefcount >= 0) \ IncrTupleDescRefCount(tupdesc); \ } while (0) #define ReleaseTupleDesc(tupdesc) \ do { \ if ((tupdesc)->tdrefcount >= 0) \ DecrTupleDescRefCount(tupdesc); \ } while (0) extern bool equalTupleDescs(TupleDesc tupdesc1, TupleDesc tupdesc2); extern void TupleDescInitEntry(TupleDesc desc, AttrNumber attributeNumber, const char *attributeName, Oid oidtypeid, int32 typmod, int attdim); extern void TupleDescInitEntryCollation(TupleDesc desc, AttrNumber attributeNumber, Oid collationid); extern TupleDesc BuildDescForRelation(List *schema); extern TupleDesc BuildDescFromLists(List *names, List *types, List *typmods, List *collations); #endif /* TUPDESC_H */ PKBiZRserver/access/htup.hnu[/*------------------------------------------------------------------------- * * htup.h * POSTGRES heap tuple definitions. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/htup.h * *------------------------------------------------------------------------- */ #ifndef HTUP_H #define HTUP_H #include "access/tupdesc.h" #include "access/tupmacs.h" #include "storage/bufpage.h" #include "storage/itemptr.h" #include "storage/relfilenode.h" /* * MaxTupleAttributeNumber limits the number of (user) columns in a tuple. * The key limit on this value is that the size of the fixed overhead for * a tuple, plus the size of the null-values bitmap (at 1 bit per column), * plus MAXALIGN alignment, must fit into t_hoff which is uint8. On most * machines the upper limit without making t_hoff wider would be a little * over 1700. We use round numbers here and for MaxHeapAttributeNumber * so that alterations in HeapTupleHeaderData layout won't change the * supported max number of columns. */ #define MaxTupleAttributeNumber 1664 /* 8 * 208 */ /* * MaxHeapAttributeNumber limits the number of (user) columns in a table. * This should be somewhat less than MaxTupleAttributeNumber. It must be * at least one less, else we will fail to do UPDATEs on a maximal-width * table (because UPDATE has to form working tuples that include CTID). * In practice we want some additional daylight so that we can gracefully * support operations that add hidden "resjunk" columns, for example * SELECT * FROM wide_table ORDER BY foo, bar, baz. * In any case, depending on column data types you will likely be running * into the disk-block-based limit on overall tuple size if you have more * than a thousand or so columns. TOAST won't help. */ #define MaxHeapAttributeNumber 1600 /* 8 * 200 */ /* * Heap tuple header. To avoid wasting space, the fields should be * laid out in such a way as to avoid structure padding. * * Datums of composite types (row types) share the same general structure * as on-disk tuples, so that the same routines can be used to build and * examine them. However the requirements are slightly different: a Datum * does not need any transaction visibility information, and it does need * a length word and some embedded type information. We can achieve this * by overlaying the xmin/cmin/xmax/cmax/xvac fields of a heap tuple * with the fields needed in the Datum case. Typically, all tuples built * in-memory will be initialized with the Datum fields; but when a tuple is * about to be inserted in a table, the transaction fields will be filled, * overwriting the datum fields. * * The overall structure of a heap tuple looks like: * fixed fields (HeapTupleHeaderData struct) * nulls bitmap (if HEAP_HASNULL is set in t_infomask) * alignment padding (as needed to make user data MAXALIGN'd) * object ID (if HEAP_HASOID is set in t_infomask) * user data fields * * We store five "virtual" fields Xmin, Cmin, Xmax, Cmax, and Xvac in three * physical fields. Xmin and Xmax are always really stored, but Cmin, Cmax * and Xvac share a field. This works because we know that Cmin and Cmax * are only interesting for the lifetime of the inserting and deleting * transaction respectively. If a tuple is inserted and deleted in the same * transaction, we store a "combo" command id that can be mapped to the real * cmin and cmax, but only by use of local state within the originating * backend. See combocid.c for more details. Meanwhile, Xvac is only set by * old-style VACUUM FULL, which does not have any command sub-structure and so * does not need either Cmin or Cmax. (This requires that old-style VACUUM * FULL never try to move a tuple whose Cmin or Cmax is still interesting, * ie, an insert-in-progress or delete-in-progress tuple.) * * A word about t_ctid: whenever a new tuple is stored on disk, its t_ctid * is initialized with its own TID (location). If the tuple is ever updated, * its t_ctid is changed to point to the replacement version of the tuple. * Thus, a tuple is the latest version of its row iff XMAX is invalid or * t_ctid points to itself (in which case, if XMAX is valid, the tuple is * either locked or deleted). One can follow the chain of t_ctid links * to find the newest version of the row. Beware however that VACUUM might * erase the pointed-to (newer) tuple before erasing the pointing (older) * tuple. Hence, when following a t_ctid link, it is necessary to check * to see if the referenced slot is empty or contains an unrelated tuple. * Check that the referenced tuple has XMIN equal to the referencing tuple's * XMAX to verify that it is actually the descendant version and not an * unrelated tuple stored into a slot recently freed by VACUUM. If either * check fails, one may assume that there is no live descendant version. * * Following the fixed header fields, the nulls bitmap is stored (beginning * at t_bits). The bitmap is *not* stored if t_infomask shows that there * are no nulls in the tuple. If an OID field is present (as indicated by * t_infomask), then it is stored just before the user data, which begins at * the offset shown by t_hoff. Note that t_hoff must be a multiple of * MAXALIGN. */ typedef struct HeapTupleFields { TransactionId t_xmin; /* inserting xact ID */ TransactionId t_xmax; /* deleting or locking xact ID */ union { CommandId t_cid; /* inserting or deleting command ID, or both */ TransactionId t_xvac; /* old-style VACUUM FULL xact ID */ } t_field3; } HeapTupleFields; typedef struct DatumTupleFields { int32 datum_len_; /* varlena header (do not touch directly!) */ int32 datum_typmod; /* -1, or identifier of a record type */ Oid datum_typeid; /* composite type OID, or RECORDOID */ /* * Note: field ordering is chosen with thought that Oid might someday * widen to 64 bits. */ } DatumTupleFields; typedef struct HeapTupleHeaderData { union { HeapTupleFields t_heap; DatumTupleFields t_datum; } t_choice; ItemPointerData t_ctid; /* current TID of this or newer tuple */ /* Fields below here must match MinimalTupleData! */ uint16 t_infomask2; /* number of attributes + various flags */ uint16 t_infomask; /* various flag bits, see below */ uint8 t_hoff; /* sizeof header incl. bitmap, padding */ /* ^ - 23 bytes - ^ */ bits8 t_bits[1]; /* bitmap of NULLs -- VARIABLE LENGTH */ /* MORE DATA FOLLOWS AT END OF STRUCT */ } HeapTupleHeaderData; typedef HeapTupleHeaderData *HeapTupleHeader; /* * information stored in t_infomask: */ #define HEAP_HASNULL 0x0001 /* has null attribute(s) */ #define HEAP_HASVARWIDTH 0x0002 /* has variable-width attribute(s) */ #define HEAP_HASEXTERNAL 0x0004 /* has external stored attribute(s) */ #define HEAP_HASOID 0x0008 /* has an object-id field */ /* bit 0x0010 is available */ #define HEAP_COMBOCID 0x0020 /* t_cid is a combo cid */ #define HEAP_XMAX_EXCL_LOCK 0x0040 /* xmax is exclusive locker */ #define HEAP_XMAX_SHARED_LOCK 0x0080 /* xmax is shared locker */ /* if either LOCK bit is set, xmax hasn't deleted the tuple, only locked it */ #define HEAP_IS_LOCKED (HEAP_XMAX_EXCL_LOCK | HEAP_XMAX_SHARED_LOCK) #define HEAP_XMIN_COMMITTED 0x0100 /* t_xmin committed */ #define HEAP_XMIN_INVALID 0x0200 /* t_xmin invalid/aborted */ #define HEAP_XMAX_COMMITTED 0x0400 /* t_xmax committed */ #define HEAP_XMAX_INVALID 0x0800 /* t_xmax invalid/aborted */ #define HEAP_XMAX_IS_MULTI 0x1000 /* t_xmax is a MultiXactId */ #define HEAP_UPDATED 0x2000 /* this is UPDATEd version of row */ #define HEAP_MOVED_OFF 0x4000 /* moved to another place by pre-9.0 * VACUUM FULL; kept for binary * upgrade support */ #define HEAP_MOVED_IN 0x8000 /* moved from another place by pre-9.0 * VACUUM FULL; kept for binary * upgrade support */ #define HEAP_MOVED (HEAP_MOVED_OFF | HEAP_MOVED_IN) #define HEAP_XACT_MASK 0xFFE0 /* visibility-related bits */ /* * information stored in t_infomask2: */ #define HEAP_NATTS_MASK 0x07FF /* 11 bits for number of attributes */ /* bits 0x3800 are available */ #define HEAP_HOT_UPDATED 0x4000 /* tuple was HOT-updated */ #define HEAP_ONLY_TUPLE 0x8000 /* this is heap-only tuple */ #define HEAP2_XACT_MASK 0xC000 /* visibility-related bits */ /* * HEAP_TUPLE_HAS_MATCH is a temporary flag used during hash joins. It is * only used in tuples that are in the hash table, and those don't need * any visibility information, so we can overlay it on a visibility flag * instead of using up a dedicated bit. */ #define HEAP_TUPLE_HAS_MATCH HEAP_ONLY_TUPLE /* tuple has a join match */ /* * HeapTupleHeader accessor macros * * Note: beware of multiple evaluations of "tup" argument. But the Set * macros evaluate their other argument only once. */ #define HeapTupleHeaderGetXmin(tup) \ ( \ (tup)->t_choice.t_heap.t_xmin \ ) #define HeapTupleHeaderSetXmin(tup, xid) \ ( \ (tup)->t_choice.t_heap.t_xmin = (xid) \ ) #define HeapTupleHeaderGetXmax(tup) \ ( \ (tup)->t_choice.t_heap.t_xmax \ ) #define HeapTupleHeaderSetXmax(tup, xid) \ ( \ (tup)->t_choice.t_heap.t_xmax = (xid) \ ) /* * HeapTupleHeaderGetRawCommandId will give you what's in the header whether * it is useful or not. Most code should use HeapTupleHeaderGetCmin or * HeapTupleHeaderGetCmax instead, but note that those Assert that you can * get a legitimate result, ie you are in the originating transaction! */ #define HeapTupleHeaderGetRawCommandId(tup) \ ( \ (tup)->t_choice.t_heap.t_field3.t_cid \ ) /* SetCmin is reasonably simple since we never need a combo CID */ #define HeapTupleHeaderSetCmin(tup, cid) \ do { \ Assert(!((tup)->t_infomask & HEAP_MOVED)); \ (tup)->t_choice.t_heap.t_field3.t_cid = (cid); \ (tup)->t_infomask &= ~HEAP_COMBOCID; \ } while (0) /* SetCmax must be used after HeapTupleHeaderAdjustCmax; see combocid.c */ #define HeapTupleHeaderSetCmax(tup, cid, iscombo) \ do { \ Assert(!((tup)->t_infomask & HEAP_MOVED)); \ (tup)->t_choice.t_heap.t_field3.t_cid = (cid); \ if (iscombo) \ (tup)->t_infomask |= HEAP_COMBOCID; \ else \ (tup)->t_infomask &= ~HEAP_COMBOCID; \ } while (0) #define HeapTupleHeaderGetXvac(tup) \ ( \ ((tup)->t_infomask & HEAP_MOVED) ? \ (tup)->t_choice.t_heap.t_field3.t_xvac \ : \ InvalidTransactionId \ ) #define HeapTupleHeaderSetXvac(tup, xid) \ do { \ Assert((tup)->t_infomask & HEAP_MOVED); \ (tup)->t_choice.t_heap.t_field3.t_xvac = (xid); \ } while (0) #define HeapTupleHeaderGetDatumLength(tup) \ VARSIZE(tup) #define HeapTupleHeaderSetDatumLength(tup, len) \ SET_VARSIZE(tup, len) #define HeapTupleHeaderGetTypeId(tup) \ ( \ (tup)->t_choice.t_datum.datum_typeid \ ) #define HeapTupleHeaderSetTypeId(tup, typeid) \ ( \ (tup)->t_choice.t_datum.datum_typeid = (typeid) \ ) #define HeapTupleHeaderGetTypMod(tup) \ ( \ (tup)->t_choice.t_datum.datum_typmod \ ) #define HeapTupleHeaderSetTypMod(tup, typmod) \ ( \ (tup)->t_choice.t_datum.datum_typmod = (typmod) \ ) #define HeapTupleHeaderGetOid(tup) \ ( \ ((tup)->t_infomask & HEAP_HASOID) ? \ *((Oid *) ((char *)(tup) + (tup)->t_hoff - sizeof(Oid))) \ : \ InvalidOid \ ) #define HeapTupleHeaderSetOid(tup, oid) \ do { \ Assert((tup)->t_infomask & HEAP_HASOID); \ *((Oid *) ((char *)(tup) + (tup)->t_hoff - sizeof(Oid))) = (oid); \ } while (0) /* * Note that we stop considering a tuple HOT-updated as soon as it is known * aborted or the would-be updating transaction is known aborted. For best * efficiency, check tuple visibility before using this macro, so that the * INVALID bits will be as up to date as possible. */ #define HeapTupleHeaderIsHotUpdated(tup) \ ( \ ((tup)->t_infomask2 & HEAP_HOT_UPDATED) != 0 && \ ((tup)->t_infomask & (HEAP_XMIN_INVALID | HEAP_XMAX_INVALID)) == 0 \ ) #define HeapTupleHeaderSetHotUpdated(tup) \ ( \ (tup)->t_infomask2 |= HEAP_HOT_UPDATED \ ) #define HeapTupleHeaderClearHotUpdated(tup) \ ( \ (tup)->t_infomask2 &= ~HEAP_HOT_UPDATED \ ) #define HeapTupleHeaderIsHeapOnly(tup) \ ( \ ((tup)->t_infomask2 & HEAP_ONLY_TUPLE) != 0 \ ) #define HeapTupleHeaderSetHeapOnly(tup) \ ( \ (tup)->t_infomask2 |= HEAP_ONLY_TUPLE \ ) #define HeapTupleHeaderClearHeapOnly(tup) \ ( \ (tup)->t_infomask2 &= ~HEAP_ONLY_TUPLE \ ) #define HeapTupleHeaderHasMatch(tup) \ ( \ ((tup)->t_infomask2 & HEAP_TUPLE_HAS_MATCH) != 0 \ ) #define HeapTupleHeaderSetMatch(tup) \ ( \ (tup)->t_infomask2 |= HEAP_TUPLE_HAS_MATCH \ ) #define HeapTupleHeaderClearMatch(tup) \ ( \ (tup)->t_infomask2 &= ~HEAP_TUPLE_HAS_MATCH \ ) #define HeapTupleHeaderGetNatts(tup) \ ((tup)->t_infomask2 & HEAP_NATTS_MASK) #define HeapTupleHeaderSetNatts(tup, natts) \ ( \ (tup)->t_infomask2 = ((tup)->t_infomask2 & ~HEAP_NATTS_MASK) | (natts) \ ) #define HeapTupleHeaderHasExternal(tup) \ (((tup)->t_infomask & HEAP_HASEXTERNAL) != 0) /* * BITMAPLEN(NATTS) - * Computes size of null bitmap given number of data columns. */ #define BITMAPLEN(NATTS) (((int)(NATTS) + 7) / 8) /* * MaxHeapTupleSize is the maximum allowed size of a heap tuple, including * header and MAXALIGN alignment padding. Basically it's BLCKSZ minus the * other stuff that has to be on a disk page. Since heap pages use no * "special space", there's no deduction for that. * * NOTE: we allow for the ItemId that must point to the tuple, ensuring that * an otherwise-empty page can indeed hold a tuple of this size. Because * ItemIds and tuples have different alignment requirements, don't assume that * you can, say, fit 2 tuples of size MaxHeapTupleSize/2 on the same page. */ #define MaxHeapTupleSize (BLCKSZ - MAXALIGN(SizeOfPageHeaderData + sizeof(ItemIdData))) /* * MaxHeapTuplesPerPage is an upper bound on the number of tuples that can * fit on one heap page. (Note that indexes could have more, because they * use a smaller tuple header.) We arrive at the divisor because each tuple * must be maxaligned, and it must have an associated item pointer. * * Note: with HOT, there could theoretically be more line pointers (not actual * tuples) than this on a heap page. However we constrain the number of line * pointers to this anyway, to avoid excessive line-pointer bloat and not * require increases in the size of work arrays. */ #define MaxHeapTuplesPerPage \ ((int) ((BLCKSZ - SizeOfPageHeaderData) / \ (MAXALIGN(offsetof(HeapTupleHeaderData, t_bits)) + sizeof(ItemIdData)))) /* * MaxAttrSize is a somewhat arbitrary upper limit on the declared size of * data fields of char(n) and similar types. It need not have anything * directly to do with the *actual* upper limit of varlena values, which * is currently 1Gb (see TOAST structures in postgres.h). I've set it * at 10Mb which seems like a reasonable number --- tgl 8/6/00. */ #define MaxAttrSize (10 * 1024 * 1024) /* * MinimalTuple is an alternative representation that is used for transient * tuples inside the executor, in places where transaction status information * is not required, the tuple rowtype is known, and shaving off a few bytes * is worthwhile because we need to store many tuples. The representation * is chosen so that tuple access routines can work with either full or * minimal tuples via a HeapTupleData pointer structure. The access routines * see no difference, except that they must not access the transaction status * or t_ctid fields because those aren't there. * * For the most part, MinimalTuples should be accessed via TupleTableSlot * routines. These routines will prevent access to the "system columns" * and thereby prevent accidental use of the nonexistent fields. * * MinimalTupleData contains a length word, some padding, and fields matching * HeapTupleHeaderData beginning with t_infomask2. The padding is chosen so * that offsetof(t_infomask2) is the same modulo MAXIMUM_ALIGNOF in both * structs. This makes data alignment rules equivalent in both cases. * * When a minimal tuple is accessed via a HeapTupleData pointer, t_data is * set to point MINIMAL_TUPLE_OFFSET bytes before the actual start of the * minimal tuple --- that is, where a full tuple matching the minimal tuple's * data would start. This trick is what makes the structs seem equivalent. * * Note that t_hoff is computed the same as in a full tuple, hence it includes * the MINIMAL_TUPLE_OFFSET distance. t_len does not include that, however. * * MINIMAL_TUPLE_DATA_OFFSET is the offset to the first useful (non-pad) data * other than the length word. tuplesort.c and tuplestore.c use this to avoid * writing the padding to disk. */ #define MINIMAL_TUPLE_OFFSET \ ((offsetof(HeapTupleHeaderData, t_infomask2) - sizeof(uint32)) / MAXIMUM_ALIGNOF * MAXIMUM_ALIGNOF) #define MINIMAL_TUPLE_PADDING \ ((offsetof(HeapTupleHeaderData, t_infomask2) - sizeof(uint32)) % MAXIMUM_ALIGNOF) #define MINIMAL_TUPLE_DATA_OFFSET \ offsetof(MinimalTupleData, t_infomask2) typedef struct MinimalTupleData { uint32 t_len; /* actual length of minimal tuple */ char mt_padding[MINIMAL_TUPLE_PADDING]; /* Fields below here must match HeapTupleHeaderData! */ uint16 t_infomask2; /* number of attributes + various flags */ uint16 t_infomask; /* various flag bits, see below */ uint8 t_hoff; /* sizeof header incl. bitmap, padding */ /* ^ - 23 bytes - ^ */ bits8 t_bits[1]; /* bitmap of NULLs -- VARIABLE LENGTH */ /* MORE DATA FOLLOWS AT END OF STRUCT */ } MinimalTupleData; typedef MinimalTupleData *MinimalTuple; /* * HeapTupleData is an in-memory data structure that points to a tuple. * * There are several ways in which this data structure is used: * * * Pointer to a tuple in a disk buffer: t_data points directly into the * buffer (which the code had better be holding a pin on, but this is not * reflected in HeapTupleData itself). * * * Pointer to nothing: t_data is NULL. This is used as a failure indication * in some functions. * * * Part of a palloc'd tuple: the HeapTupleData itself and the tuple * form a single palloc'd chunk. t_data points to the memory location * immediately following the HeapTupleData struct (at offset HEAPTUPLESIZE). * This is the output format of heap_form_tuple and related routines. * * * Separately allocated tuple: t_data points to a palloc'd chunk that * is not adjacent to the HeapTupleData. (This case is deprecated since * it's difficult to tell apart from case #1. It should be used only in * limited contexts where the code knows that case #1 will never apply.) * * * Separately allocated minimal tuple: t_data points MINIMAL_TUPLE_OFFSET * bytes before the start of a MinimalTuple. As with the previous case, * this can't be told apart from case #1 by inspection; code setting up * or destroying this representation has to know what it's doing. * * t_len should always be valid, except in the pointer-to-nothing case. * t_self and t_tableOid should be valid if the HeapTupleData points to * a disk buffer, or if it represents a copy of a tuple on disk. They * should be explicitly set invalid in manufactured tuples. */ typedef struct HeapTupleData { uint32 t_len; /* length of *t_data */ ItemPointerData t_self; /* SelfItemPointer */ Oid t_tableOid; /* table the tuple came from */ HeapTupleHeader t_data; /* -> tuple header and data */ } HeapTupleData; typedef HeapTupleData *HeapTuple; #define HEAPTUPLESIZE MAXALIGN(sizeof(HeapTupleData)) /* * GETSTRUCT - given a HeapTuple pointer, return address of the user data */ #define GETSTRUCT(TUP) ((char *) ((TUP)->t_data) + (TUP)->t_data->t_hoff) /* * Accessor macros to be used with HeapTuple pointers. */ #define HeapTupleIsValid(tuple) PointerIsValid(tuple) #define HeapTupleHasNulls(tuple) \ (((tuple)->t_data->t_infomask & HEAP_HASNULL) != 0) #define HeapTupleNoNulls(tuple) \ (!((tuple)->t_data->t_infomask & HEAP_HASNULL)) #define HeapTupleHasVarWidth(tuple) \ (((tuple)->t_data->t_infomask & HEAP_HASVARWIDTH) != 0) #define HeapTupleAllFixed(tuple) \ (!((tuple)->t_data->t_infomask & HEAP_HASVARWIDTH)) #define HeapTupleHasExternal(tuple) \ (((tuple)->t_data->t_infomask & HEAP_HASEXTERNAL) != 0) #define HeapTupleIsHotUpdated(tuple) \ HeapTupleHeaderIsHotUpdated((tuple)->t_data) #define HeapTupleSetHotUpdated(tuple) \ HeapTupleHeaderSetHotUpdated((tuple)->t_data) #define HeapTupleClearHotUpdated(tuple) \ HeapTupleHeaderClearHotUpdated((tuple)->t_data) #define HeapTupleIsHeapOnly(tuple) \ HeapTupleHeaderIsHeapOnly((tuple)->t_data) #define HeapTupleSetHeapOnly(tuple) \ HeapTupleHeaderSetHeapOnly((tuple)->t_data) #define HeapTupleClearHeapOnly(tuple) \ HeapTupleHeaderClearHeapOnly((tuple)->t_data) #define HeapTupleGetOid(tuple) \ HeapTupleHeaderGetOid((tuple)->t_data) #define HeapTupleSetOid(tuple, oid) \ HeapTupleHeaderSetOid((tuple)->t_data, (oid)) /* * WAL record definitions for heapam.c's WAL operations * * XLOG allows to store some information in high 4 bits of log * record xl_info field. We use 3 for opcode and one for init bit. */ #define XLOG_HEAP_INSERT 0x00 #define XLOG_HEAP_DELETE 0x10 #define XLOG_HEAP_UPDATE 0x20 /* 0x030 is free, was XLOG_HEAP_MOVE */ #define XLOG_HEAP_HOT_UPDATE 0x40 #define XLOG_HEAP_NEWPAGE 0x50 #define XLOG_HEAP_LOCK 0x60 #define XLOG_HEAP_INPLACE 0x70 #define XLOG_HEAP_OPMASK 0x70 /* * When we insert 1st item on new page in INSERT, UPDATE, HOT_UPDATE, * or MULTI_INSERT, we can (and we do) restore entire page in redo */ #define XLOG_HEAP_INIT_PAGE 0x80 /* * We ran out of opcodes, so heapam.c now has a second RmgrId. These opcodes * are associated with RM_HEAP2_ID, but are not logically different from * the ones above associated with RM_HEAP_ID. XLOG_HEAP_OPMASK applies to * these, too. */ #define XLOG_HEAP2_FREEZE 0x00 #define XLOG_HEAP2_CLEAN 0x10 /* 0x20 is free, was XLOG_HEAP2_CLEAN_MOVE */ #define XLOG_HEAP2_CLEANUP_INFO 0x30 #define XLOG_HEAP2_VISIBLE 0x40 #define XLOG_HEAP2_MULTI_INSERT 0x50 /* * All what we need to find changed tuple * * NB: on most machines, sizeof(xl_heaptid) will include some trailing pad * bytes for alignment. We don't want to store the pad space in the XLOG, * so use SizeOfHeapTid for space calculations. Similar comments apply for * the other xl_FOO structs. */ typedef struct xl_heaptid { RelFileNode node; ItemPointerData tid; /* changed tuple id */ } xl_heaptid; #define SizeOfHeapTid (offsetof(xl_heaptid, tid) + SizeOfIptrData) /* This is what we need to know about delete */ typedef struct xl_heap_delete { xl_heaptid target; /* deleted tuple id */ bool all_visible_cleared; /* PD_ALL_VISIBLE was cleared */ } xl_heap_delete; #define SizeOfHeapDelete (offsetof(xl_heap_delete, all_visible_cleared) + sizeof(bool)) /* * We don't store the whole fixed part (HeapTupleHeaderData) of an inserted * or updated tuple in WAL; we can save a few bytes by reconstructing the * fields that are available elsewhere in the WAL record, or perhaps just * plain needn't be reconstructed. These are the fields we must store. * NOTE: t_hoff could be recomputed, but we may as well store it because * it will come for free due to alignment considerations. */ typedef struct xl_heap_header { uint16 t_infomask2; uint16 t_infomask; uint8 t_hoff; } xl_heap_header; #define SizeOfHeapHeader (offsetof(xl_heap_header, t_hoff) + sizeof(uint8)) /* This is what we need to know about insert */ typedef struct xl_heap_insert { xl_heaptid target; /* inserted tuple id */ bool all_visible_cleared; /* PD_ALL_VISIBLE was cleared */ /* xl_heap_header & TUPLE DATA FOLLOWS AT END OF STRUCT */ } xl_heap_insert; #define SizeOfHeapInsert (offsetof(xl_heap_insert, all_visible_cleared) + sizeof(bool)) /* * This is what we need to know about a multi-insert. The record consists of * xl_heap_multi_insert header, followed by a xl_multi_insert_tuple and tuple * data for each tuple. 'offsets' array is omitted if the whole page is * reinitialized (XLOG_HEAP_INIT_PAGE) */ typedef struct xl_heap_multi_insert { RelFileNode node; BlockNumber blkno; bool all_visible_cleared; uint16 ntuples; OffsetNumber offsets[1]; /* TUPLE DATA (xl_multi_insert_tuples) FOLLOW AT END OF STRUCT */ } xl_heap_multi_insert; #define SizeOfHeapMultiInsert offsetof(xl_heap_multi_insert, offsets) typedef struct xl_multi_insert_tuple { uint16 datalen; /* size of tuple data that follows */ uint16 t_infomask2; uint16 t_infomask; uint8 t_hoff; /* TUPLE DATA FOLLOWS AT END OF STRUCT */ } xl_multi_insert_tuple; #define SizeOfMultiInsertTuple (offsetof(xl_multi_insert_tuple, t_hoff) + sizeof(uint8)) /* This is what we need to know about update|hot_update */ typedef struct xl_heap_update { xl_heaptid target; /* deleted tuple id */ ItemPointerData newtid; /* new inserted tuple id */ bool all_visible_cleared; /* PD_ALL_VISIBLE was cleared */ bool new_all_visible_cleared; /* same for the page of newtid */ /* NEW TUPLE xl_heap_header AND TUPLE DATA FOLLOWS AT END OF STRUCT */ } xl_heap_update; #define SizeOfHeapUpdate (offsetof(xl_heap_update, new_all_visible_cleared) + sizeof(bool)) /* * This is what we need to know about vacuum page cleanup/redirect * * The array of OffsetNumbers following the fixed part of the record contains: * * for each redirected item: the item offset, then the offset redirected to * * for each now-dead item: the item offset * * for each now-unused item: the item offset * The total number of OffsetNumbers is therefore 2*nredirected+ndead+nunused. * Note that nunused is not explicitly stored, but may be found by reference * to the total record length. */ typedef struct xl_heap_clean { RelFileNode node; BlockNumber block; TransactionId latestRemovedXid; uint16 nredirected; uint16 ndead; /* OFFSET NUMBERS FOLLOW */ } xl_heap_clean; #define SizeOfHeapClean (offsetof(xl_heap_clean, ndead) + sizeof(uint16)) /* * Cleanup_info is required in some cases during a lazy VACUUM. * Used for reporting the results of HeapTupleHeaderAdvanceLatestRemovedXid() * see vacuumlazy.c for full explanation */ typedef struct xl_heap_cleanup_info { RelFileNode node; TransactionId latestRemovedXid; } xl_heap_cleanup_info; #define SizeOfHeapCleanupInfo (sizeof(xl_heap_cleanup_info)) /* This is for replacing a page's contents in toto */ /* NB: this is used for indexes as well as heaps */ typedef struct xl_heap_newpage { RelFileNode node; ForkNumber forknum; BlockNumber blkno; /* location of new page */ /* entire page contents follow at end of record */ } xl_heap_newpage; #define SizeOfHeapNewpage (offsetof(xl_heap_newpage, blkno) + sizeof(BlockNumber)) /* This is what we need to know about lock */ typedef struct xl_heap_lock { xl_heaptid target; /* locked tuple id */ TransactionId locking_xid; /* might be a MultiXactId not xid */ bool xid_is_mxact; /* is it? */ bool shared_lock; /* shared or exclusive row lock? */ } xl_heap_lock; #define SizeOfHeapLock (offsetof(xl_heap_lock, shared_lock) + sizeof(bool)) /* This is what we need to know about in-place update */ typedef struct xl_heap_inplace { xl_heaptid target; /* updated tuple id */ /* TUPLE DATA FOLLOWS AT END OF STRUCT */ } xl_heap_inplace; #define SizeOfHeapInplace (offsetof(xl_heap_inplace, target) + SizeOfHeapTid) /* This is what we need to know about tuple freezing during vacuum */ typedef struct xl_heap_freeze { RelFileNode node; BlockNumber block; TransactionId cutoff_xid; /* TUPLE OFFSET NUMBERS FOLLOW AT THE END */ } xl_heap_freeze; #define SizeOfHeapFreeze (offsetof(xl_heap_freeze, cutoff_xid) + sizeof(TransactionId)) /* This is what we need to know about setting a visibility map bit */ typedef struct xl_heap_visible { RelFileNode node; BlockNumber block; TransactionId cutoff_xid; } xl_heap_visible; #define SizeOfHeapVisible (offsetof(xl_heap_visible, cutoff_xid) + sizeof(TransactionId)) extern void HeapTupleHeaderAdvanceLatestRemovedXid(HeapTupleHeader tuple, TransactionId *latestRemovedXid); /* HeapTupleHeader functions implemented in utils/time/combocid.c */ extern CommandId HeapTupleHeaderGetCmin(HeapTupleHeader tup); extern CommandId HeapTupleHeaderGetCmax(HeapTupleHeader tup); extern void HeapTupleHeaderAdjustCmax(HeapTupleHeader tup, CommandId *cmax, bool *iscombo); /* ---------------- * fastgetattr * * Fetch a user attribute's value as a Datum (might be either a * value, or a pointer into the data area of the tuple). * * This must not be used when a system attribute might be requested. * Furthermore, the passed attnum MUST be valid. Use heap_getattr() * instead, if in doubt. * * This gets called many times, so we macro the cacheable and NULL * lookups, and call nocachegetattr() for the rest. * ---------------- */ #if !defined(DISABLE_COMPLEX_MACRO) #define fastgetattr(tup, attnum, tupleDesc, isnull) \ ( \ AssertMacro((attnum) > 0), \ (*(isnull) = false), \ HeapTupleNoNulls(tup) ? \ ( \ (tupleDesc)->attrs[(attnum)-1]->attcacheoff >= 0 ? \ ( \ fetchatt((tupleDesc)->attrs[(attnum)-1], \ (char *) (tup)->t_data + (tup)->t_data->t_hoff + \ (tupleDesc)->attrs[(attnum)-1]->attcacheoff) \ ) \ : \ nocachegetattr((tup), (attnum), (tupleDesc)) \ ) \ : \ ( \ att_isnull((attnum)-1, (tup)->t_data->t_bits) ? \ ( \ (*(isnull) = true), \ (Datum)NULL \ ) \ : \ ( \ nocachegetattr((tup), (attnum), (tupleDesc)) \ ) \ ) \ ) #else /* defined(DISABLE_COMPLEX_MACRO) */ extern Datum fastgetattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, bool *isnull); #endif /* defined(DISABLE_COMPLEX_MACRO) */ /* ---------------- * heap_getattr * * Extract an attribute of a heap tuple and return it as a Datum. * This works for either system or user attributes. The given attnum * is properly range-checked. * * If the field in question has a NULL value, we return a zero Datum * and set *isnull == true. Otherwise, we set *isnull == false. * * is the pointer to the heap tuple. is the attribute * number of the column (field) caller wants. is a * pointer to the structure describing the row and all its fields. * ---------------- */ #define heap_getattr(tup, attnum, tupleDesc, isnull) \ ( \ ((attnum) > 0) ? \ ( \ ((attnum) > (int) HeapTupleHeaderGetNatts((tup)->t_data)) ? \ ( \ (*(isnull) = true), \ (Datum)NULL \ ) \ : \ fastgetattr((tup), (attnum), (tupleDesc), (isnull)) \ ) \ : \ heap_getsysattr((tup), (attnum), (tupleDesc), (isnull)) \ ) /* prototypes for functions in common/heaptuple.c */ extern Size heap_compute_data_size(TupleDesc tupleDesc, Datum *values, bool *isnull); extern void heap_fill_tuple(TupleDesc tupleDesc, Datum *values, bool *isnull, char *data, Size data_size, uint16 *infomask, bits8 *bit); extern bool heap_attisnull(HeapTuple tup, int attnum); extern Datum nocachegetattr(HeapTuple tup, int attnum, TupleDesc att); extern Datum heap_getsysattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, bool *isnull); extern HeapTuple heap_copytuple(HeapTuple tuple); extern void heap_copytuple_with_tuple(HeapTuple src, HeapTuple dest); extern Datum heap_copy_tuple_as_datum(HeapTuple tuple, TupleDesc tupleDesc); extern HeapTuple heap_form_tuple(TupleDesc tupleDescriptor, Datum *values, bool *isnull); extern HeapTuple heap_modify_tuple(HeapTuple tuple, TupleDesc tupleDesc, Datum *replValues, bool *replIsnull, bool *doReplace); extern void heap_deform_tuple(HeapTuple tuple, TupleDesc tupleDesc, Datum *values, bool *isnull); /* these three are deprecated versions of the three above: */ extern HeapTuple heap_formtuple(TupleDesc tupleDescriptor, Datum *values, char *nulls); extern HeapTuple heap_modifytuple(HeapTuple tuple, TupleDesc tupleDesc, Datum *replValues, char *replNulls, char *replActions); extern void heap_deformtuple(HeapTuple tuple, TupleDesc tupleDesc, Datum *values, char *nulls); extern void heap_freetuple(HeapTuple htup); extern MinimalTuple heap_form_minimal_tuple(TupleDesc tupleDescriptor, Datum *values, bool *isnull); extern void heap_free_minimal_tuple(MinimalTuple mtup); extern MinimalTuple heap_copy_minimal_tuple(MinimalTuple mtup); extern HeapTuple heap_tuple_from_minimal_tuple(MinimalTuple mtup); extern MinimalTuple minimal_tuple_from_heap_tuple(HeapTuple htup); #endif /* HTUP_H */ PKBiZwpXpXserver/access/spgist_private.hnu[/*------------------------------------------------------------------------- * * spgist_private.h * Private declarations for SP-GiST access method. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/spgist_private.h * *------------------------------------------------------------------------- */ #ifndef SPGIST_PRIVATE_H #define SPGIST_PRIVATE_H #include "access/itup.h" #include "access/spgist.h" #include "nodes/tidbitmap.h" #include "utils/rel.h" /* Page numbers of fixed-location pages */ #define SPGIST_METAPAGE_BLKNO (0) /* metapage */ #define SPGIST_ROOT_BLKNO (1) /* root for normal entries */ #define SPGIST_NULL_BLKNO (2) /* root for null-value entries */ #define SPGIST_LAST_FIXED_BLKNO SPGIST_NULL_BLKNO #define SpGistBlockIsRoot(blkno) \ ((blkno) == SPGIST_ROOT_BLKNO || (blkno) == SPGIST_NULL_BLKNO) #define SpGistBlockIsFixed(blkno) \ ((BlockNumber) (blkno) <= (BlockNumber) SPGIST_LAST_FIXED_BLKNO) /* * Contents of page special space on SPGiST index pages */ typedef struct SpGistPageOpaqueData { uint16 flags; /* see bit definitions below */ uint16 nRedirection; /* number of redirection tuples on page */ uint16 nPlaceholder; /* number of placeholder tuples on page */ /* note there's no count of either LIVE or DEAD tuples ... */ uint16 spgist_page_id; /* for identification of SP-GiST indexes */ } SpGistPageOpaqueData; typedef SpGistPageOpaqueData *SpGistPageOpaque; /* Flag bits in page special space */ #define SPGIST_META (1<<0) #define SPGIST_DELETED (1<<1) /* never set, but keep for backwards * compatibility */ #define SPGIST_LEAF (1<<2) #define SPGIST_NULLS (1<<3) #define SpGistPageGetOpaque(page) ((SpGistPageOpaque) PageGetSpecialPointer(page)) #define SpGistPageIsMeta(page) (SpGistPageGetOpaque(page)->flags & SPGIST_META) #define SpGistPageIsDeleted(page) (SpGistPageGetOpaque(page)->flags & SPGIST_DELETED) #define SpGistPageIsLeaf(page) (SpGistPageGetOpaque(page)->flags & SPGIST_LEAF) #define SpGistPageStoresNulls(page) (SpGistPageGetOpaque(page)->flags & SPGIST_NULLS) /* * The page ID is for the convenience of pg_filedump and similar utilities, * which otherwise would have a hard time telling pages of different index * types apart. It should be the last 2 bytes on the page. This is more or * less "free" due to alignment considerations. */ #define SPGIST_PAGE_ID 0xFF82 /* * Each backend keeps a cache of last-used page info in its index->rd_amcache * area. This is initialized from, and occasionally written back to, * shared storage in the index metapage. */ typedef struct SpGistLastUsedPage { BlockNumber blkno; /* block number, or InvalidBlockNumber */ int freeSpace; /* page's free space (could be obsolete!) */ } SpGistLastUsedPage; /* Note: indexes in cachedPage[] match flag assignments for SpGistGetBuffer */ #define SPGIST_CACHED_PAGES 8 typedef struct SpGistLUPCache { SpGistLastUsedPage cachedPage[SPGIST_CACHED_PAGES]; } SpGistLUPCache; /* * metapage */ typedef struct SpGistMetaPageData { uint32 magicNumber; /* for identity cross-check */ SpGistLUPCache lastUsedPages; /* shared storage of last-used info */ } SpGistMetaPageData; #define SPGIST_MAGIC_NUMBER (0xBA0BABEE) #define SpGistPageGetMeta(p) \ ((SpGistMetaPageData *) PageGetContents(p)) /* * Private state of index AM. SpGistState is common to both insert and * search code; SpGistScanOpaque is for searches only. */ /* Per-datatype info needed in SpGistState */ typedef struct SpGistTypeDesc { Oid type; bool attbyval; int16 attlen; } SpGistTypeDesc; typedef struct SpGistState { spgConfigOut config; /* filled in by opclass config method */ SpGistTypeDesc attType; /* type of input data and leaf values */ SpGistTypeDesc attPrefixType; /* type of inner-tuple prefix values */ SpGistTypeDesc attLabelType; /* type of node label values */ char *deadTupleStorage; /* workspace for spgFormDeadTuple */ TransactionId myXid; /* XID to use when creating a redirect tuple */ bool isBuild; /* true if doing index build */ } SpGistState; /* * Private state of an index scan */ typedef struct SpGistScanOpaqueData { SpGistState state; /* see above */ MemoryContext tempCxt; /* short-lived memory context */ /* Control flags showing whether to search nulls and/or non-nulls */ bool searchNulls; /* scan matches (all) null entries */ bool searchNonNulls; /* scan matches (some) non-null entries */ /* Index quals to be passed to opclass (null-related quals removed) */ int numberOfKeys; /* number of index qualifier conditions */ ScanKey keyData; /* array of index qualifier descriptors */ /* Stack of yet-to-be-visited pages */ List *scanStack; /* List of ScanStackEntrys */ /* These fields are only used in amgetbitmap scans: */ TIDBitmap *tbm; /* bitmap being filled */ int64 ntids; /* number of TIDs passed to bitmap */ /* These fields are only used in amgettuple scans: */ bool want_itup; /* are we reconstructing tuples? */ TupleDesc indexTupDesc; /* if so, tuple descriptor for them */ int nPtrs; /* number of TIDs found on current page */ int iPtr; /* index for scanning through same */ ItemPointerData heapPtrs[MaxIndexTuplesPerPage]; /* TIDs from cur page */ bool recheck[MaxIndexTuplesPerPage]; /* their recheck flags */ IndexTuple indexTups[MaxIndexTuplesPerPage]; /* reconstructed tuples */ /* * Note: using MaxIndexTuplesPerPage above is a bit hokey since * SpGistLeafTuples aren't exactly IndexTuples; however, they are larger, * so this is safe. */ } SpGistScanOpaqueData; typedef SpGistScanOpaqueData *SpGistScanOpaque; /* * This struct is what we actually keep in index->rd_amcache. It includes * static configuration information as well as the lastUsedPages cache. */ typedef struct SpGistCache { spgConfigOut config; /* filled in by opclass config method */ SpGistTypeDesc attType; /* type of input data and leaf values */ SpGistTypeDesc attPrefixType; /* type of inner-tuple prefix values */ SpGistTypeDesc attLabelType; /* type of node label values */ SpGistLUPCache lastUsedPages; /* local storage of last-used info */ } SpGistCache; /* * SPGiST tuple types. Note: inner, leaf, and dead tuple structs * must have the same tupstate field in the same position! Real inner and * leaf tuples always have tupstate = LIVE; if the state is something else, * use the SpGistDeadTuple struct to inspect the tuple. */ /* values of tupstate (see README for more info) */ #define SPGIST_LIVE 0 /* normal live tuple (either inner or leaf) */ #define SPGIST_REDIRECT 1 /* temporary redirection placeholder */ #define SPGIST_DEAD 2 /* dead, cannot be removed because of links */ #define SPGIST_PLACEHOLDER 3 /* placeholder, used to preserve offsets */ /* * SPGiST inner tuple: list of "nodes" that subdivide a set of tuples * * Inner tuple layout: * header/optional prefix/array of nodes, which are SpGistNodeTuples * * size and prefixSize must be multiples of MAXALIGN */ typedef struct SpGistInnerTupleData { unsigned int tupstate:2, /* LIVE/REDIRECT/DEAD/PLACEHOLDER */ allTheSame:1, /* all nodes in tuple are equivalent */ nNodes:13, /* number of nodes within inner tuple */ prefixSize:16; /* size of prefix, or 0 if none */ uint16 size; /* total size of inner tuple */ /* On most machines there will be a couple of wasted bytes here */ /* prefix datum follows, then nodes */ } SpGistInnerTupleData; typedef SpGistInnerTupleData *SpGistInnerTuple; /* these must match largest values that fit in bit fields declared above */ #define SGITMAXNNODES 0x1FFF #define SGITMAXPREFIXSIZE 0xFFFF #define SGITMAXSIZE 0xFFFF #define SGITHDRSZ MAXALIGN(sizeof(SpGistInnerTupleData)) #define _SGITDATA(x) (((char *) (x)) + SGITHDRSZ) #define SGITDATAPTR(x) ((x)->prefixSize ? _SGITDATA(x) : NULL) #define SGITDATUM(x, s) ((x)->prefixSize ? \ ((s)->attPrefixType.attbyval ? \ *(Datum *) _SGITDATA(x) : \ PointerGetDatum(_SGITDATA(x))) \ : (Datum) 0) #define SGITNODEPTR(x) ((SpGistNodeTuple) (_SGITDATA(x) + (x)->prefixSize)) /* Macro for iterating through the nodes of an inner tuple */ #define SGITITERATE(x, i, nt) \ for ((i) = 0, (nt) = SGITNODEPTR(x); \ (i) < (x)->nNodes; \ (i)++, (nt) = (SpGistNodeTuple) (((char *) (nt)) + IndexTupleSize(nt))) /* * SPGiST node tuple: one node within an inner tuple * * Node tuples use the same header as ordinary Postgres IndexTuples, but * we do not use a null bitmap, because we know there is only one column * so the INDEX_NULL_MASK bit suffices. Also, pass-by-value datums are * stored as a full Datum, the same convention as for inner tuple prefixes * and leaf tuple datums. */ typedef IndexTupleData SpGistNodeTupleData; typedef SpGistNodeTupleData *SpGistNodeTuple; #define SGNTHDRSZ MAXALIGN(sizeof(SpGistNodeTupleData)) #define SGNTDATAPTR(x) (((char *) (x)) + SGNTHDRSZ) #define SGNTDATUM(x, s) ((s)->attLabelType.attbyval ? \ *(Datum *) SGNTDATAPTR(x) : \ PointerGetDatum(SGNTDATAPTR(x))) /* * SPGiST leaf tuple: carries a datum and a heap tuple TID * * In the simplest case, the datum is the same as the indexed value; but * it could also be a suffix or some other sort of delta that permits * reconstruction given knowledge of the prefix path traversed to get here. * * The size field is wider than could possibly be needed for an on-disk leaf * tuple, but this allows us to form leaf tuples even when the datum is too * wide to be stored immediately, and it costs nothing because of alignment * considerations. * * Normally, nextOffset links to the next tuple belonging to the same parent * node (which must be on the same page). But when the root page is a leaf * page, we don't chain its tuples, so nextOffset is always 0 on the root. * * size must be a multiple of MAXALIGN; also, it must be at least SGDTSIZE * so that the tuple can be converted to REDIRECT status later. (This * restriction only adds bytes for the null-datum case, otherwise alignment * restrictions force it anyway.) * * In a leaf tuple for a NULL indexed value, there's no useful datum value; * however, the SGDTSIZE limit ensures that's there's a Datum word there * anyway, so SGLTDATUM can be applied safely as long as you don't do * anything with the result. */ typedef struct SpGistLeafTupleData { unsigned int tupstate:2, /* LIVE/REDIRECT/DEAD/PLACEHOLDER */ size:30; /* large enough for any palloc'able value */ OffsetNumber nextOffset; /* next tuple in chain, or InvalidOffset */ ItemPointerData heapPtr; /* TID of represented heap tuple */ /* leaf datum follows */ } SpGistLeafTupleData; typedef SpGistLeafTupleData *SpGistLeafTuple; #define SGLTHDRSZ MAXALIGN(sizeof(SpGistLeafTupleData)) #define SGLTDATAPTR(x) (((char *) (x)) + SGLTHDRSZ) #define SGLTDATUM(x, s) ((s)->attType.attbyval ? \ *(Datum *) SGLTDATAPTR(x) : \ PointerGetDatum(SGLTDATAPTR(x))) /* * SPGiST dead tuple: declaration for examining non-live tuples * * The tupstate field of this struct must match those of regular inner and * leaf tuples, and its size field must match a leaf tuple's. * Also, the pointer field must be in the same place as a leaf tuple's heapPtr * field, to satisfy some Asserts that we make when replacing a leaf tuple * with a dead tuple. * We don't use nextOffset, but it's needed to align the pointer field. * pointer and xid are only valid when tupstate = REDIRECT. */ typedef struct SpGistDeadTupleData { unsigned int tupstate:2, /* LIVE/REDIRECT/DEAD/PLACEHOLDER */ size:30; OffsetNumber nextOffset; /* not used in dead tuples */ ItemPointerData pointer; /* redirection inside index */ TransactionId xid; /* ID of xact that inserted this tuple */ } SpGistDeadTupleData; typedef SpGistDeadTupleData *SpGistDeadTuple; #define SGDTSIZE MAXALIGN(sizeof(SpGistDeadTupleData)) /* * Macros for doing free-space calculations. Note that when adding up the * space needed for tuples, we always consider each tuple to need the tuple's * size plus sizeof(ItemIdData) (for the line pointer). This works correctly * so long as tuple sizes are always maxaligned. */ /* Page capacity after allowing for fixed header and special space */ #define SPGIST_PAGE_CAPACITY \ MAXALIGN_DOWN(BLCKSZ - \ SizeOfPageHeaderData - \ MAXALIGN(sizeof(SpGistPageOpaqueData))) /* * Compute free space on page, assuming that up to n placeholders can be * recycled if present (n should be the number of tuples to be inserted) */ #define SpGistPageGetFreeSpace(p, n) \ (PageGetExactFreeSpace(p) + \ Min(SpGistPageGetOpaque(p)->nPlaceholder, n) * \ (SGDTSIZE + sizeof(ItemIdData))) /* * XLOG stuff * * ACCEPT_RDATA_* can only use fixed-length rdata arrays, because of lengthof */ #define ACCEPT_RDATA_DATA(p, s, i) \ do { \ Assert((i) < lengthof(rdata)); \ rdata[i].data = (char *) (p); \ rdata[i].len = (s); \ rdata[i].buffer = InvalidBuffer; \ rdata[i].buffer_std = true; \ rdata[i].next = NULL; \ if ((i) > 0) \ rdata[(i) - 1].next = rdata + (i); \ } while(0) #define ACCEPT_RDATA_BUFFER(b, i) \ do { \ Assert((i) < lengthof(rdata)); \ rdata[i].data = NULL; \ rdata[i].len = 0; \ rdata[i].buffer = (b); \ rdata[i].buffer_std = true; \ rdata[i].next = NULL; \ if ((i) > 0) \ rdata[(i) - 1].next = rdata + (i); \ } while(0) /* XLOG record types for SPGiST */ #define XLOG_SPGIST_CREATE_INDEX 0x00 #define XLOG_SPGIST_ADD_LEAF 0x10 #define XLOG_SPGIST_MOVE_LEAFS 0x20 #define XLOG_SPGIST_ADD_NODE 0x30 #define XLOG_SPGIST_SPLIT_TUPLE 0x40 #define XLOG_SPGIST_PICKSPLIT 0x50 #define XLOG_SPGIST_VACUUM_LEAF 0x60 #define XLOG_SPGIST_VACUUM_ROOT 0x70 #define XLOG_SPGIST_VACUUM_REDIRECT 0x80 /* * Some redo functions need an SpGistState, although only a few of its fields * need to be valid. spgxlogState carries the required info in xlog records. * (See fillFakeState in spgxlog.c for more comments.) */ typedef struct spgxlogState { TransactionId myXid; bool isBuild; } spgxlogState; #define STORE_STATE(s, d) \ do { \ (d).myXid = (s)->myXid; \ (d).isBuild = (s)->isBuild; \ } while(0) typedef struct spgxlogAddLeaf { RelFileNode node; BlockNumber blknoLeaf; /* destination page for leaf tuple */ bool newPage; /* init dest page? */ bool storesNulls; /* page is in the nulls tree? */ OffsetNumber offnumLeaf; /* offset where leaf tuple gets placed */ OffsetNumber offnumHeadLeaf; /* offset of head tuple in chain, if any */ BlockNumber blknoParent; /* where the parent downlink is, if any */ OffsetNumber offnumParent; uint16 nodeI; /* * new leaf tuple follows, on an intalign boundary (replay only needs to * fetch its size field, so that should be enough alignment) */ } spgxlogAddLeaf; typedef struct spgxlogMoveLeafs { RelFileNode node; BlockNumber blknoSrc; /* source leaf page */ BlockNumber blknoDst; /* destination leaf page */ uint16 nMoves; /* number of tuples moved from source page */ bool newPage; /* init dest page? */ bool replaceDead; /* are we replacing a DEAD source tuple? */ bool storesNulls; /* pages are in the nulls tree? */ BlockNumber blknoParent; /* where the parent downlink is */ OffsetNumber offnumParent; uint16 nodeI; spgxlogState stateSrc; /*---------- * data follows: * array of deleted tuple numbers, length nMoves * array of inserted tuple numbers, length nMoves + 1 or 1 * list of leaf tuples, length nMoves + 1 or 1 (must be maxaligned) * the tuple number arrays are padded to maxalign boundaries so that the * leaf tuples will be suitably aligned * * Note: if replaceDead is true then there is only one inserted tuple * number and only one leaf tuple in the data, because we are not copying * the dead tuple from the source * * Buffer references in the rdata array are: * Src page * Dest page * Parent page *---------- */ } spgxlogMoveLeafs; typedef struct spgxlogAddNode { RelFileNode node; BlockNumber blkno; /* block number of original inner tuple */ OffsetNumber offnum; /* offset of original inner tuple */ BlockNumber blknoParent; /* where parent downlink is, if updated */ OffsetNumber offnumParent; uint16 nodeI; BlockNumber blknoNew; /* where new tuple goes, if not same place */ OffsetNumber offnumNew; bool newPage; /* init new page? */ spgxlogState stateSrc; /* * updated inner tuple follows, on an intalign boundary (replay only needs * to fetch its size field, so that should be enough alignment) */ } spgxlogAddNode; typedef struct spgxlogSplitTuple { RelFileNode node; BlockNumber blknoPrefix; /* where the prefix tuple goes */ OffsetNumber offnumPrefix; BlockNumber blknoPostfix; /* where the postfix tuple goes */ OffsetNumber offnumPostfix; bool newPage; /* need to init that page? */ /* * new prefix inner tuple follows, then new postfix inner tuple, on * intalign boundaries (replay only needs to fetch size fields, so that * should be enough alignment) */ } spgxlogSplitTuple; typedef struct spgxlogPickSplit { RelFileNode node; BlockNumber blknoSrc; /* original leaf page */ BlockNumber blknoDest; /* other leaf page, if any */ uint16 nDelete; /* n to delete from Src */ uint16 nInsert; /* n to insert on Src and/or Dest */ bool initSrc; /* re-init the Src page? */ bool initDest; /* re-init the Dest page? */ BlockNumber blknoInner; /* where to put new inner tuple */ OffsetNumber offnumInner; bool initInner; /* re-init the Inner page? */ bool storesNulls; /* pages are in the nulls tree? */ BlockNumber blknoParent; /* where the parent downlink is, if any */ OffsetNumber offnumParent; uint16 nodeI; spgxlogState stateSrc; /*---------- * data follows: * new inner tuple (assumed to have a maxaligned length) * array of deleted tuple numbers, length nDelete * array of inserted tuple numbers, length nInsert * array of page selector bytes for inserted tuples, length nInsert * list of leaf tuples, length nInsert (must be maxaligned) * the tuple number and page selector arrays are padded to maxalign * boundaries so that the leaf tuples will be suitably aligned * * Buffer references in the rdata array are: * Src page (only if not root and not being init'd) * Dest page (if used and not being init'd) * Inner page (only if not being init'd) * Parent page (if any; could be same as Inner) *---------- */ } spgxlogPickSplit; typedef struct spgxlogVacuumLeaf { RelFileNode node; BlockNumber blkno; /* block number to clean */ uint16 nDead; /* number of tuples to become DEAD */ uint16 nPlaceholder; /* number of tuples to become PLACEHOLDER */ uint16 nMove; /* number of tuples to move */ uint16 nChain; /* number of tuples to re-chain */ spgxlogState stateSrc; /*---------- * data follows: * tuple numbers to become DEAD * tuple numbers to become PLACEHOLDER * tuple numbers to move from (and replace with PLACEHOLDER) * tuple numbers to move to (replacing what is there) * tuple numbers to update nextOffset links of * tuple numbers to insert in nextOffset links *---------- */ } spgxlogVacuumLeaf; typedef struct spgxlogVacuumRoot { /* vacuum a root page when it is also a leaf */ RelFileNode node; BlockNumber blkno; /* block number to clean */ uint16 nDelete; /* number of tuples to delete */ spgxlogState stateSrc; /* offsets of tuples to delete follow */ } spgxlogVacuumRoot; typedef struct spgxlogVacuumRedirect { RelFileNode node; BlockNumber blkno; /* block number to clean */ uint16 nToPlaceholder; /* number of redirects to make placeholders */ OffsetNumber firstPlaceholder; /* first placeholder tuple to remove */ TransactionId newestRedirectXid; /* newest XID of removed redirects */ /* offsets of redirect tuples to make placeholders follow */ } spgxlogVacuumRedirect; /* * The "flags" argument for SpGistGetBuffer should be either GBUF_LEAF to * get a leaf page, or GBUF_INNER_PARITY(blockNumber) to get an inner * page in the same triple-parity group as the specified block number. * (Typically, this should be GBUF_INNER_PARITY(parentBlockNumber + 1) * to follow the rule described in spgist/README.) * In addition, GBUF_NULLS can be OR'd in to get a page for storage of * null-valued tuples. * * Note: these flag values are used as indexes into lastUsedPages. */ #define GBUF_LEAF 0x03 #define GBUF_INNER_PARITY(x) ((x) % 3) #define GBUF_NULLS 0x04 #define GBUF_PARITY_MASK 0x03 #define GBUF_REQ_LEAF(flags) (((flags) & GBUF_PARITY_MASK) == GBUF_LEAF) #define GBUF_REQ_NULLS(flags) ((flags) & GBUF_NULLS) /* spgutils.c */ extern SpGistCache *spgGetCache(Relation index); extern void initSpGistState(SpGistState *state, Relation index); extern Buffer SpGistNewBuffer(Relation index); extern void SpGistUpdateMetaPage(Relation index); extern Buffer SpGistGetBuffer(Relation index, int flags, int needSpace, bool *isNew); extern void SpGistSetLastUsedPage(Relation index, Buffer buffer); extern void SpGistInitPage(Page page, uint16 f); extern void SpGistInitBuffer(Buffer b, uint16 f); extern void SpGistInitMetapage(Page page); extern unsigned int SpGistGetTypeSize(SpGistTypeDesc *att, Datum datum); extern SpGistLeafTuple spgFormLeafTuple(SpGistState *state, ItemPointer heapPtr, Datum datum, bool isnull); extern SpGistNodeTuple spgFormNodeTuple(SpGistState *state, Datum label, bool isnull); extern SpGistInnerTuple spgFormInnerTuple(SpGistState *state, bool hasPrefix, Datum prefix, int nNodes, SpGistNodeTuple *nodes); extern SpGistDeadTuple spgFormDeadTuple(SpGistState *state, int tupstate, BlockNumber blkno, OffsetNumber offnum); extern Datum *spgExtractNodeLabels(SpGistState *state, SpGistInnerTuple innerTuple); extern OffsetNumber SpGistPageAddNewItem(SpGistState *state, Page page, Item item, Size size, OffsetNumber *startOffset, bool errorOK); /* spgdoinsert.c */ extern void spgUpdateNodeLink(SpGistInnerTuple tup, int nodeN, BlockNumber blkno, OffsetNumber offset); extern void spgPageIndexMultiDelete(SpGistState *state, Page page, OffsetNumber *itemnos, int nitems, int firststate, int reststate, BlockNumber blkno, OffsetNumber offnum); extern bool spgdoinsert(Relation index, SpGistState *state, ItemPointer heapPtr, Datum datum, bool isnull); #endif /* SPGIST_PRIVATE_H */ PKBiZ`server/access/transam.hnu[/*------------------------------------------------------------------------- * * transam.h * postgres transaction access method support code * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/transam.h * *------------------------------------------------------------------------- */ #ifndef TRANSAM_H #define TRANSAM_H #include "access/xlogdefs.h" /* ---------------- * Special transaction ID values * * BootstrapTransactionId is the XID for "bootstrap" operations, and * FrozenTransactionId is used for very old tuples. Both should * always be considered valid. * * FirstNormalTransactionId is the first "normal" transaction id. * Note: if you need to change it, you must change pg_class.h as well. * ---------------- */ #define InvalidTransactionId ((TransactionId) 0) #define BootstrapTransactionId ((TransactionId) 1) #define FrozenTransactionId ((TransactionId) 2) #define FirstNormalTransactionId ((TransactionId) 3) #define MaxTransactionId ((TransactionId) 0xFFFFFFFF) /* ---------------- * transaction ID manipulation macros * ---------------- */ #define TransactionIdIsValid(xid) ((xid) != InvalidTransactionId) #define TransactionIdIsNormal(xid) ((xid) >= FirstNormalTransactionId) #define TransactionIdEquals(id1, id2) ((id1) == (id2)) #define TransactionIdStore(xid, dest) (*(dest) = (xid)) #define StoreInvalidTransactionId(dest) (*(dest) = InvalidTransactionId) /* advance a transaction ID variable, handling wraparound correctly */ #define TransactionIdAdvance(dest) \ do { \ (dest)++; \ if ((dest) < FirstNormalTransactionId) \ (dest) = FirstNormalTransactionId; \ } while(0) /* back up a transaction ID variable, handling wraparound correctly */ #define TransactionIdRetreat(dest) \ do { \ (dest)--; \ } while ((dest) < FirstNormalTransactionId) /* compare two XIDs already known to be normal; this is a macro for speed */ #define NormalTransactionIdPrecedes(id1, id2) \ (AssertMacro(TransactionIdIsNormal(id1) && TransactionIdIsNormal(id2)), \ (int32) ((id1) - (id2)) < 0) /* ---------- * Object ID (OID) zero is InvalidOid. * * OIDs 1-9999 are reserved for manual assignment (see the files * in src/include/catalog/). * * OIDS 10000-16383 are reserved for assignment during initdb * using the OID generator. (We start the generator at 10000.) * * OIDs beginning at 16384 are assigned from the OID generator * during normal multiuser operation. (We force the generator up to * 16384 as soon as we are in normal operation.) * * The choices of 10000 and 16384 are completely arbitrary, and can be moved * if we run low on OIDs in either category. Changing the macros below * should be sufficient to do this. * * NOTE: if the OID generator wraps around, we skip over OIDs 0-16383 * and resume with 16384. This minimizes the odds of OID conflict, by not * reassigning OIDs that might have been assigned during initdb. * ---------- */ #define FirstBootstrapObjectId 10000 #define FirstNormalObjectId 16384 /* * VariableCache is a data structure in shared memory that is used to track * OID and XID assignment state. For largely historical reasons, there is * just one struct with different fields that are protected by different * LWLocks. * * Note: xidWrapLimit and oldestXidDB are not "active" values, but are * used just to generate useful messages when xidWarnLimit or xidStopLimit * are exceeded. */ typedef struct VariableCacheData { /* * These fields are protected by OidGenLock. */ Oid nextOid; /* next OID to assign */ uint32 oidCount; /* OIDs available before must do XLOG work */ /* * These fields are protected by XidGenLock. */ TransactionId nextXid; /* next XID to assign */ TransactionId oldestXid; /* cluster-wide minimum datfrozenxid */ TransactionId xidVacLimit; /* start forcing autovacuums here */ TransactionId xidWarnLimit; /* start complaining here */ TransactionId xidStopLimit; /* refuse to advance nextXid beyond here */ TransactionId xidWrapLimit; /* where the world ends */ Oid oldestXidDB; /* database with minimum datfrozenxid */ /* * These fields are protected by ProcArrayLock. */ TransactionId latestCompletedXid; /* newest XID that has committed or * aborted */ } VariableCacheData; typedef VariableCacheData *VariableCache; /* ---------------- * extern declarations * ---------------- */ /* in transam/xact.c */ extern bool TransactionStartedDuringRecovery(void); /* in transam/varsup.c */ extern PGDLLIMPORT VariableCache ShmemVariableCache; /* in transam/transam.c */ extern const XLogRecPtr InvalidXLogRecPtr; /* * prototypes for functions in transam/transam.c */ extern bool TransactionIdDidCommit(TransactionId transactionId); extern bool TransactionIdDidAbort(TransactionId transactionId); extern bool TransactionIdIsKnownCompleted(TransactionId transactionId); extern void TransactionIdAbort(TransactionId transactionId); extern void TransactionIdCommitTree(TransactionId xid, int nxids, TransactionId *xids); extern void TransactionIdAsyncCommitTree(TransactionId xid, int nxids, TransactionId *xids, XLogRecPtr lsn); extern void TransactionIdAbortTree(TransactionId xid, int nxids, TransactionId *xids); extern bool TransactionIdPrecedes(TransactionId id1, TransactionId id2); extern bool TransactionIdPrecedesOrEquals(TransactionId id1, TransactionId id2); extern bool TransactionIdFollows(TransactionId id1, TransactionId id2); extern bool TransactionIdFollowsOrEquals(TransactionId id1, TransactionId id2); extern TransactionId TransactionIdLatest(TransactionId mainxid, int nxids, const TransactionId *xids); extern XLogRecPtr TransactionIdGetCommitLSN(TransactionId xid); /* in transam/varsup.c */ extern TransactionId GetNewTransactionId(bool isSubXact); extern TransactionId ReadNewTransactionId(void); extern void SetTransactionIdLimit(TransactionId oldest_datfrozenxid, Oid oldest_datoid); extern bool ForceTransactionIdLimitUpdate(void); extern Oid GetNewObjectId(void); #endif /* TRAMSAM_H */ PKBiZ*server/access/gist.hnu[/*------------------------------------------------------------------------- * * gist.h * The public API for GiST indexes. This API is exposed to * individuals implementing GiST indexes, so backward-incompatible * changes should be made with care. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/gist.h * *------------------------------------------------------------------------- */ #ifndef GIST_H #define GIST_H #include "access/xlog.h" #include "access/xlogdefs.h" #include "storage/block.h" #include "storage/bufpage.h" #include "utils/relcache.h" /* * amproc indexes for GiST indexes. */ #define GIST_CONSISTENT_PROC 1 #define GIST_UNION_PROC 2 #define GIST_COMPRESS_PROC 3 #define GIST_DECOMPRESS_PROC 4 #define GIST_PENALTY_PROC 5 #define GIST_PICKSPLIT_PROC 6 #define GIST_EQUAL_PROC 7 #define GIST_DISTANCE_PROC 8 #define GISTNProcs 8 /* * strategy numbers for GiST opclasses that want to implement the old * RTREE behavior. */ #define RTLeftStrategyNumber 1 #define RTOverLeftStrategyNumber 2 #define RTOverlapStrategyNumber 3 #define RTOverRightStrategyNumber 4 #define RTRightStrategyNumber 5 #define RTSameStrategyNumber 6 #define RTContainsStrategyNumber 7 /* for @> */ #define RTContainedByStrategyNumber 8 /* for <@ */ #define RTOverBelowStrategyNumber 9 #define RTBelowStrategyNumber 10 #define RTAboveStrategyNumber 11 #define RTOverAboveStrategyNumber 12 #define RTOldContainsStrategyNumber 13 /* for old spelling of @> */ #define RTOldContainedByStrategyNumber 14 /* for old spelling of <@ */ #define RTKNNSearchStrategyNumber 15 /* * Page opaque data in a GiST index page. */ #define F_LEAF (1 << 0) /* leaf page */ #define F_DELETED (1 << 1) /* the page has been deleted */ #define F_TUPLES_DELETED (1 << 2) /* some tuples on the page are dead */ #define F_FOLLOW_RIGHT (1 << 3) /* page to the right has no downlink */ typedef XLogRecPtr GistNSN; typedef struct GISTPageOpaqueData { GistNSN nsn; /* this value must change on page split */ BlockNumber rightlink; /* next page if any */ uint16 flags; /* see bit definitions above */ uint16 gist_page_id; /* for identification of GiST indexes */ } GISTPageOpaqueData; typedef GISTPageOpaqueData *GISTPageOpaque; /* * The page ID is for the convenience of pg_filedump and similar utilities, * which otherwise would have a hard time telling pages of different index * types apart. It should be the last 2 bytes on the page. This is more or * less "free" due to alignment considerations. */ #define GIST_PAGE_ID 0xFF81 /* * This is the Split Vector to be returned by the PickSplit method. * PickSplit should fill the indexes of tuples to go to the left side into * spl_left[], and those to go to the right into spl_right[] (note the method * is responsible for palloc'ing both of these arrays!). The tuple counts * go into spl_nleft/spl_nright, and spl_ldatum/spl_rdatum must be set to * the union keys for each side. * * If spl_ldatum_exists and spl_rdatum_exists are true, then we are performing * a "secondary split" using a non-first index column. In this case some * decisions have already been made about a page split, and the set of tuples * being passed to PickSplit is just the tuples about which we are undecided. * spl_ldatum/spl_rdatum then contain the union keys for the tuples already * chosen to go left or right. Ideally the PickSplit method should take those * keys into account while deciding what to do with the remaining tuples, ie * it should try to "build out" from those unions so as to minimally expand * them. If it does so, it should union the given tuples' keys into the * existing spl_ldatum/spl_rdatum values rather than just setting those values * from scratch, and then set spl_ldatum_exists/spl_rdatum_exists to false to * show it has done this. * * If the PickSplit method fails to clear spl_ldatum_exists/spl_rdatum_exists, * the core GiST code will make its own decision about how to merge the * secondary-split results with the previously-chosen tuples, and will then * recompute the union keys from scratch. This is a workable though often not * optimal approach. */ typedef struct GIST_SPLITVEC { OffsetNumber *spl_left; /* array of entries that go left */ int spl_nleft; /* size of this array */ Datum spl_ldatum; /* Union of keys in spl_left */ bool spl_ldatum_exists; /* true, if spl_ldatum already exists. */ OffsetNumber *spl_right; /* array of entries that go right */ int spl_nright; /* size of the array */ Datum spl_rdatum; /* Union of keys in spl_right */ bool spl_rdatum_exists; /* true, if spl_rdatum already exists. */ } GIST_SPLITVEC; /* * An entry on a GiST node. Contains the key, as well as its own * location (rel,page,offset) which can supply the matching pointer. * leafkey is a flag to tell us if the entry is in a leaf node. */ typedef struct GISTENTRY { Datum key; Relation rel; Page page; OffsetNumber offset; bool leafkey; } GISTENTRY; #define GistPageGetOpaque(page) ( (GISTPageOpaque) PageGetSpecialPointer(page) ) #define GistPageIsLeaf(page) ( GistPageGetOpaque(page)->flags & F_LEAF) #define GIST_LEAF(entry) (GistPageIsLeaf((entry)->page)) #define GistPageSetLeaf(page) ( GistPageGetOpaque(page)->flags |= F_LEAF) #define GistPageSetNonLeaf(page) ( GistPageGetOpaque(page)->flags &= ~F_LEAF) #define GistPageIsDeleted(page) ( GistPageGetOpaque(page)->flags & F_DELETED) #define GistPageSetDeleted(page) ( GistPageGetOpaque(page)->flags |= F_DELETED) #define GistPageSetNonDeleted(page) ( GistPageGetOpaque(page)->flags &= ~F_DELETED) #define GistTuplesDeleted(page) ( GistPageGetOpaque(page)->flags & F_TUPLES_DELETED) #define GistMarkTuplesDeleted(page) ( GistPageGetOpaque(page)->flags |= F_TUPLES_DELETED) #define GistClearTuplesDeleted(page) ( GistPageGetOpaque(page)->flags &= ~F_TUPLES_DELETED) #define GistFollowRight(page) ( GistPageGetOpaque(page)->flags & F_FOLLOW_RIGHT) #define GistMarkFollowRight(page) ( GistPageGetOpaque(page)->flags |= F_FOLLOW_RIGHT) #define GistClearFollowRight(page) ( GistPageGetOpaque(page)->flags &= ~F_FOLLOW_RIGHT) /* * Vector of GISTENTRY structs; user-defined methods union and picksplit * take it as one of their arguments */ typedef struct { int32 n; /* number of elements */ GISTENTRY vector[FLEXIBLE_ARRAY_MEMBER]; } GistEntryVector; #define GEVHDRSZ (offsetof(GistEntryVector, vector)) /* * macro to initialize a GISTENTRY */ #define gistentryinit(e, k, r, pg, o, l) \ do { (e).key = (k); (e).rel = (r); (e).page = (pg); \ (e).offset = (o); (e).leafkey = (l); } while (0) #endif /* GIST_H */ PKBiZtma%a%server/access/xlog_internal.hnu[/* * xlog_internal.h * * PostgreSQL transaction log internal declarations * * NOTE: this file is intended to contain declarations useful for * manipulating the XLOG files directly, but it is not supposed to be * needed by rmgr routines (redo support for individual record types). * So the XLogRecord typedef and associated stuff appear in xlog.h. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/xlog_internal.h */ #ifndef XLOG_INTERNAL_H #define XLOG_INTERNAL_H #include "access/xlog.h" #include "fmgr.h" #include "pgtime.h" #include "storage/block.h" #include "storage/relfilenode.h" /* * Header info for a backup block appended to an XLOG record. * * As a trivial form of data compression, the XLOG code is aware that * PG data pages usually contain an unused "hole" in the middle, which * contains only zero bytes. If hole_length > 0 then we have removed * such a "hole" from the stored data (and it's not counted in the * XLOG record's CRC, either). Hence, the amount of block data actually * present following the BkpBlock struct is BLCKSZ - hole_length bytes. * * Note that we don't attempt to align either the BkpBlock struct or the * block's data. So, the struct must be copied to aligned local storage * before use. */ typedef struct BkpBlock { RelFileNode node; /* relation containing block */ ForkNumber fork; /* fork within the relation */ BlockNumber block; /* block number */ uint16 hole_offset; /* number of bytes before "hole" */ uint16 hole_length; /* number of bytes in "hole" */ /* ACTUAL BLOCK DATA FOLLOWS AT END OF STRUCT */ } BkpBlock; /* * When there is not enough space on current page for whole record, we * continue on the next page with continuation record. (However, the * XLogRecord header will never be split across pages; if there's less than * SizeOfXLogRecord space left at the end of a page, we just waste it.) * * Note that xl_rem_len includes backup-block data; that is, it tracks * xl_tot_len not xl_len in the initial header. Also note that the * continuation data isn't necessarily aligned. */ typedef struct XLogContRecord { uint32 xl_rem_len; /* total len of remaining data for record */ /* ACTUAL LOG DATA FOLLOWS AT END OF STRUCT */ } XLogContRecord; #define SizeOfXLogContRecord sizeof(XLogContRecord) /* * Each page of XLOG file has a header like this: */ #define XLOG_PAGE_MAGIC 0xD071 /* can be used as WAL version indicator */ typedef struct XLogPageHeaderData { uint16 xlp_magic; /* magic value for correctness checks */ uint16 xlp_info; /* flag bits, see below */ TimeLineID xlp_tli; /* TimeLineID of first record on page */ XLogRecPtr xlp_pageaddr; /* XLOG address of this page */ } XLogPageHeaderData; #define SizeOfXLogShortPHD MAXALIGN(sizeof(XLogPageHeaderData)) typedef XLogPageHeaderData *XLogPageHeader; /* * When the XLP_LONG_HEADER flag is set, we store additional fields in the * page header. (This is ordinarily done just in the first page of an * XLOG file.) The additional fields serve to identify the file accurately. */ typedef struct XLogLongPageHeaderData { XLogPageHeaderData std; /* standard header fields */ uint64 xlp_sysid; /* system identifier from pg_control */ uint32 xlp_seg_size; /* just as a cross-check */ uint32 xlp_xlog_blcksz; /* just as a cross-check */ } XLogLongPageHeaderData; #define SizeOfXLogLongPHD MAXALIGN(sizeof(XLogLongPageHeaderData)) typedef XLogLongPageHeaderData *XLogLongPageHeader; /* When record crosses page boundary, set this flag in new page's header */ #define XLP_FIRST_IS_CONTRECORD 0x0001 /* This flag indicates a "long" page header */ #define XLP_LONG_HEADER 0x0002 /* This flag indicates backup blocks starting in this page are optional */ #define XLP_BKP_REMOVABLE 0x0004 /* All defined flag bits in xlp_info (used for validity checking of header) */ #define XLP_ALL_FLAGS 0x0007 #define XLogPageHeaderSize(hdr) \ (((hdr)->xlp_info & XLP_LONG_HEADER) ? SizeOfXLogLongPHD : SizeOfXLogShortPHD) /* * We break each logical log file (xlogid value) into segment files of the * size indicated by XLOG_SEG_SIZE. One possible segment at the end of each * log file is wasted, to ensure that we don't have problems representing * last-byte-position-plus-1. */ #define XLogSegSize ((uint32) XLOG_SEG_SIZE) #define XLogSegsPerFile (((uint32) 0xffffffff) / XLogSegSize) #define XLogFileSize (XLogSegsPerFile * XLogSegSize) /* * Macros for manipulating XLOG pointers */ /* Increment an xlogid/segment pair */ #define NextLogSeg(logId, logSeg) \ do { \ if ((logSeg) >= XLogSegsPerFile-1) \ { \ (logId)++; \ (logSeg) = 0; \ } \ else \ (logSeg)++; \ } while (0) /* Decrement an xlogid/segment pair (assume it's not 0,0) */ #define PrevLogSeg(logId, logSeg) \ do { \ if (logSeg) \ (logSeg)--; \ else \ { \ (logId)--; \ (logSeg) = XLogSegsPerFile-1; \ } \ } while (0) /* Align a record pointer to next page */ #define NextLogPage(recptr) \ do { \ if ((recptr).xrecoff % XLOG_BLCKSZ != 0) \ (recptr).xrecoff += \ (XLOG_BLCKSZ - (recptr).xrecoff % XLOG_BLCKSZ); \ if ((recptr).xrecoff >= XLogFileSize) \ { \ ((recptr).xlogid)++; \ (recptr).xrecoff = 0; \ } \ } while (0) /* * Compute ID and segment from an XLogRecPtr. * * For XLByteToSeg, do the computation at face value. For XLByteToPrevSeg, * a boundary byte is taken to be in the previous segment. This is suitable * for deciding which segment to write given a pointer to a record end, * for example. (We can assume xrecoff is not zero, since no valid recptr * can have that.) */ #define XLByteToSeg(xlrp, logId, logSeg) \ ( logId = (xlrp).xlogid, \ logSeg = (xlrp).xrecoff / XLogSegSize \ ) #define XLByteToPrevSeg(xlrp, logId, logSeg) \ ( logId = (xlrp).xlogid, \ logSeg = ((xlrp).xrecoff - 1) / XLogSegSize \ ) /* * Is an XLogRecPtr within a particular XLOG segment? * * For XLByteInSeg, do the computation at face value. For XLByteInPrevSeg, * a boundary byte is taken to be in the previous segment. */ #define XLByteInSeg(xlrp, logId, logSeg) \ ((xlrp).xlogid == (logId) && \ (xlrp).xrecoff / XLogSegSize == (logSeg)) #define XLByteInPrevSeg(xlrp, logId, logSeg) \ ((xlrp).xlogid == (logId) && \ ((xlrp).xrecoff - 1) / XLogSegSize == (logSeg)) /* Check if an xrecoff value is in a plausible range */ #define XRecOffIsValid(xrecoff) \ ((xrecoff) % XLOG_BLCKSZ >= SizeOfXLogShortPHD && \ (XLOG_BLCKSZ - (xrecoff) % XLOG_BLCKSZ) >= SizeOfXLogRecord) /* * The XLog directory and control file (relative to $PGDATA) */ #define XLOGDIR "pg_xlog" #define XLOG_CONTROL_FILE "global/pg_control" /* * These macros encapsulate knowledge about the exact layout of XLog file * names, timeline history file names, and archive-status file names. */ #define MAXFNAMELEN 64 #define XLogFileName(fname, tli, log, seg) \ snprintf(fname, MAXFNAMELEN, "%08X%08X%08X", tli, log, seg) #define XLogFromFileName(fname, tli, log, seg) \ sscanf(fname, "%08X%08X%08X", tli, log, seg) #define XLogFilePath(path, tli, log, seg) \ snprintf(path, MAXPGPATH, XLOGDIR "/%08X%08X%08X", tli, log, seg) #define TLHistoryFileName(fname, tli) \ snprintf(fname, MAXFNAMELEN, "%08X.history", tli) #define TLHistoryFilePath(path, tli) \ snprintf(path, MAXPGPATH, XLOGDIR "/%08X.history", tli) #define StatusFilePath(path, xlog, suffix) \ snprintf(path, MAXPGPATH, XLOGDIR "/archive_status/%s%s", xlog, suffix) #define BackupHistoryFileName(fname, tli, log, seg, offset) \ snprintf(fname, MAXFNAMELEN, "%08X%08X%08X.%08X.backup", tli, log, seg, offset) #define BackupHistoryFilePath(path, tli, log, seg, offset) \ snprintf(path, MAXPGPATH, XLOGDIR "/%08X%08X%08X.%08X.backup", tli, log, seg, offset) /* * Method table for resource managers. * * RmgrTable[] is indexed by RmgrId values (see rmgr.h). */ typedef struct RmgrData { const char *rm_name; void (*rm_redo) (XLogRecPtr lsn, XLogRecord *rptr); void (*rm_desc) (StringInfo buf, uint8 xl_info, char *rec); void (*rm_startup) (void); void (*rm_cleanup) (void); bool (*rm_safe_restartpoint) (void); } RmgrData; extern const RmgrData RmgrTable[]; /* * Exported to support xlog switching from checkpointer */ extern pg_time_t GetLastSegSwitchTime(void); extern XLogRecPtr RequestXLogSwitch(void); /* * Exported to support xlog archive status setting from WALReceiver */ extern void XLogArchiveForceDone(const char *xlog); /* * These aren't in xlog.h because I'd rather not include fmgr.h there. */ extern Datum pg_start_backup(PG_FUNCTION_ARGS); extern Datum pg_stop_backup(PG_FUNCTION_ARGS); extern Datum pg_switch_xlog(PG_FUNCTION_ARGS); extern Datum pg_create_restore_point(PG_FUNCTION_ARGS); extern Datum pg_current_xlog_location(PG_FUNCTION_ARGS); extern Datum pg_current_xlog_insert_location(PG_FUNCTION_ARGS); extern Datum pg_last_xlog_receive_location(PG_FUNCTION_ARGS); extern Datum pg_last_xlog_replay_location(PG_FUNCTION_ARGS); extern Datum pg_last_xact_replay_timestamp(PG_FUNCTION_ARGS); extern Datum pg_xlogfile_name_offset(PG_FUNCTION_ARGS); extern Datum pg_xlogfile_name(PG_FUNCTION_ARGS); extern Datum pg_is_in_recovery(PG_FUNCTION_ARGS); extern Datum pg_xlog_replay_pause(PG_FUNCTION_ARGS); extern Datum pg_xlog_replay_resume(PG_FUNCTION_ARGS); extern Datum pg_is_xlog_replay_paused(PG_FUNCTION_ARGS); extern Datum pg_xlog_location_diff(PG_FUNCTION_ARGS); #endif /* XLOG_INTERNAL_H */ PKBiZ~[[server/access/gin_private.hnu[/*-------------------------------------------------------------------------- * gin_private.h * header file for postgres inverted index access method implementation. * * Copyright (c) 2006-2012, PostgreSQL Global Development Group * * src/include/access/gin_private.h *-------------------------------------------------------------------------- */ #ifndef GIN_PRIVATE_H #define GIN_PRIVATE_H #include "access/genam.h" #include "access/gin.h" #include "access/itup.h" #include "fmgr.h" #include "storage/bufmgr.h" #include "utils/rbtree.h" /* * Page opaque data in a inverted index page. * * Note: GIN does not include a page ID word as do the other index types. * This is OK because the opaque data is only 8 bytes and so can be reliably * distinguished by size. Revisit this if the size ever increases. * Further note: as of 9.2, SP-GiST also uses 8-byte special space. This is * still OK, as long as GIN isn't using all of the high-order bits in its * flags word, because that way the flags word cannot match the page ID used * by SP-GiST. */ typedef struct GinPageOpaqueData { BlockNumber rightlink; /* next page if any */ OffsetNumber maxoff; /* number entries on GIN_DATA page: number of * heap ItemPointers on GIN_DATA|GIN_LEAF page * or number of PostingItems on GIN_DATA & * ~GIN_LEAF page. On GIN_LIST page, number of * heap tuples. */ uint16 flags; /* see bit definitions below */ } GinPageOpaqueData; typedef GinPageOpaqueData *GinPageOpaque; #define GIN_DATA (1 << 0) #define GIN_LEAF (1 << 1) #define GIN_DELETED (1 << 2) #define GIN_META (1 << 3) #define GIN_LIST (1 << 4) #define GIN_LIST_FULLROW (1 << 5) /* makes sense only on GIN_LIST page */ /* Page numbers of fixed-location pages */ #define GIN_METAPAGE_BLKNO (0) #define GIN_ROOT_BLKNO (1) typedef struct GinMetaPageData { /* * Pointers to head and tail of pending list, which consists of GIN_LIST * pages. These store fast-inserted entries that haven't yet been moved * into the regular GIN structure. */ BlockNumber head; BlockNumber tail; /* * Free space in bytes in the pending list's tail page. */ uint32 tailFreeSize; /* * We store both number of pages and number of heap tuples that are in the * pending list. */ BlockNumber nPendingPages; int64 nPendingHeapTuples; /* * Statistics for planner use (accurate as of last VACUUM) */ BlockNumber nTotalPages; BlockNumber nEntryPages; BlockNumber nDataPages; int64 nEntries; /* * GIN version number (ideally this should have been at the front, but too * late now. Don't move it!) * * Currently 1 (for indexes initialized in 9.1 or later) * * Version 0 (indexes initialized in 9.0 or before) is compatible but may * be missing null entries, including both null keys and placeholders. * Reject full-index-scan attempts on such indexes. */ int32 ginVersion; } GinMetaPageData; #define GIN_CURRENT_VERSION 1 #define GinPageGetMeta(p) \ ((GinMetaPageData *) PageGetContents(p)) /* * Macros for accessing a GIN index page's opaque data */ #define GinPageGetOpaque(page) ( (GinPageOpaque) PageGetSpecialPointer(page) ) #define GinPageIsLeaf(page) ( (GinPageGetOpaque(page)->flags & GIN_LEAF) != 0 ) #define GinPageSetLeaf(page) ( GinPageGetOpaque(page)->flags |= GIN_LEAF ) #define GinPageSetNonLeaf(page) ( GinPageGetOpaque(page)->flags &= ~GIN_LEAF ) #define GinPageIsData(page) ( (GinPageGetOpaque(page)->flags & GIN_DATA) != 0 ) #define GinPageSetData(page) ( GinPageGetOpaque(page)->flags |= GIN_DATA ) #define GinPageIsList(page) ( (GinPageGetOpaque(page)->flags & GIN_LIST) != 0 ) #define GinPageSetList(page) ( GinPageGetOpaque(page)->flags |= GIN_LIST ) #define GinPageHasFullRow(page) ( (GinPageGetOpaque(page)->flags & GIN_LIST_FULLROW) != 0 ) #define GinPageSetFullRow(page) ( GinPageGetOpaque(page)->flags |= GIN_LIST_FULLROW ) #define GinPageIsDeleted(page) ( (GinPageGetOpaque(page)->flags & GIN_DELETED) != 0 ) #define GinPageSetDeleted(page) ( GinPageGetOpaque(page)->flags |= GIN_DELETED) #define GinPageSetNonDeleted(page) ( GinPageGetOpaque(page)->flags &= ~GIN_DELETED) #define GinPageRightMost(page) ( GinPageGetOpaque(page)->rightlink == InvalidBlockNumber) /* * We use our own ItemPointerGet(BlockNumber|GetOffsetNumber) * to avoid Asserts, since sometimes the ip_posid isn't "valid" */ #define GinItemPointerGetBlockNumber(pointer) \ BlockIdGetBlockNumber(&(pointer)->ip_blkid) #define GinItemPointerGetOffsetNumber(pointer) \ ((pointer)->ip_posid) /* * Special-case item pointer values needed by the GIN search logic. * MIN: sorts less than any valid item pointer * MAX: sorts greater than any valid item pointer * LOSSY PAGE: indicates a whole heap page, sorts after normal item * pointers for that page * Note that these are all distinguishable from an "invalid" item pointer * (which is InvalidBlockNumber/0) as well as from all normal item * pointers (which have item numbers in the range 1..MaxHeapTuplesPerPage). */ #define ItemPointerSetMin(p) \ ItemPointerSet((p), (BlockNumber)0, (OffsetNumber)0) #define ItemPointerIsMin(p) \ (GinItemPointerGetOffsetNumber(p) == (OffsetNumber)0 && \ GinItemPointerGetBlockNumber(p) == (BlockNumber)0) #define ItemPointerSetMax(p) \ ItemPointerSet((p), InvalidBlockNumber, (OffsetNumber)0xffff) #define ItemPointerIsMax(p) \ (GinItemPointerGetOffsetNumber(p) == (OffsetNumber)0xffff && \ GinItemPointerGetBlockNumber(p) == InvalidBlockNumber) #define ItemPointerSetLossyPage(p, b) \ ItemPointerSet((p), (b), (OffsetNumber)0xffff) #define ItemPointerIsLossyPage(p) \ (GinItemPointerGetOffsetNumber(p) == (OffsetNumber)0xffff && \ GinItemPointerGetBlockNumber(p) != InvalidBlockNumber) /* * Posting item in a non-leaf posting-tree page */ typedef struct { /* We use BlockIdData not BlockNumber to avoid padding space wastage */ BlockIdData child_blkno; ItemPointerData key; } PostingItem; #define PostingItemGetBlockNumber(pointer) \ BlockIdGetBlockNumber(&(pointer)->child_blkno) #define PostingItemSetBlockNumber(pointer, blockNumber) \ BlockIdSet(&((pointer)->child_blkno), (blockNumber)) /* * Category codes to distinguish placeholder nulls from ordinary NULL keys. * Note that the datatype size and the first two code values are chosen to be * compatible with the usual usage of bool isNull flags. * * GIN_CAT_EMPTY_QUERY is never stored in the index; and notice that it is * chosen to sort before not after regular key values. */ typedef signed char GinNullCategory; #define GIN_CAT_NORM_KEY 0 /* normal, non-null key value */ #define GIN_CAT_NULL_KEY 1 /* null key value */ #define GIN_CAT_EMPTY_ITEM 2 /* placeholder for zero-key item */ #define GIN_CAT_NULL_ITEM 3 /* placeholder for null item */ #define GIN_CAT_EMPTY_QUERY (-1) /* placeholder for full-scan query */ /* * Access macros for null category byte in entry tuples */ #define GinCategoryOffset(itup,ginstate) \ (IndexInfoFindDataOffset((itup)->t_info) + \ ((ginstate)->oneCol ? 0 : sizeof(int2))) #define GinGetNullCategory(itup,ginstate) \ (*((GinNullCategory *) ((char*)(itup) + GinCategoryOffset(itup,ginstate)))) #define GinSetNullCategory(itup,ginstate,c) \ (*((GinNullCategory *) ((char*)(itup) + GinCategoryOffset(itup,ginstate))) = (c)) /* * Access macros for leaf-page entry tuples (see discussion in README) */ #define GinGetNPosting(itup) GinItemPointerGetOffsetNumber(&(itup)->t_tid) #define GinSetNPosting(itup,n) ItemPointerSetOffsetNumber(&(itup)->t_tid,n) #define GIN_TREE_POSTING ((OffsetNumber)0xffff) #define GinIsPostingTree(itup) (GinGetNPosting(itup) == GIN_TREE_POSTING) #define GinSetPostingTree(itup, blkno) ( GinSetNPosting((itup),GIN_TREE_POSTING), ItemPointerSetBlockNumber(&(itup)->t_tid, blkno) ) #define GinGetPostingTree(itup) GinItemPointerGetBlockNumber(&(itup)->t_tid) #define GinGetPostingOffset(itup) GinItemPointerGetBlockNumber(&(itup)->t_tid) #define GinSetPostingOffset(itup,n) ItemPointerSetBlockNumber(&(itup)->t_tid,n) #define GinGetPosting(itup) ((ItemPointer) ((char*)(itup) + GinGetPostingOffset(itup))) #define GinMaxItemSize \ MAXALIGN_DOWN(((BLCKSZ - SizeOfPageHeaderData - \ MAXALIGN(sizeof(GinPageOpaqueData))) / 3 - sizeof(ItemIdData))) /* * Access macros for non-leaf entry tuples */ #define GinGetDownlink(itup) GinItemPointerGetBlockNumber(&(itup)->t_tid) #define GinSetDownlink(itup,blkno) ItemPointerSet(&(itup)->t_tid, blkno, InvalidOffsetNumber) /* * Data (posting tree) pages */ #define GinDataPageGetRightBound(page) ((ItemPointer) PageGetContents(page)) #define GinDataPageGetData(page) \ (PageGetContents(page) + MAXALIGN(sizeof(ItemPointerData))) #define GinSizeOfDataPageItem(page) \ (GinPageIsLeaf(page) ? sizeof(ItemPointerData) : sizeof(PostingItem)) #define GinDataPageGetItem(page,i) \ (GinDataPageGetData(page) + ((i)-1) * GinSizeOfDataPageItem(page)) #define GinDataPageGetFreeSpace(page) \ (BLCKSZ - MAXALIGN(SizeOfPageHeaderData) \ - MAXALIGN(sizeof(ItemPointerData)) \ - GinPageGetOpaque(page)->maxoff * GinSizeOfDataPageItem(page) \ - MAXALIGN(sizeof(GinPageOpaqueData))) #define GinMaxLeafDataItems \ ((BLCKSZ - MAXALIGN(SizeOfPageHeaderData) - \ MAXALIGN(sizeof(ItemPointerData)) - \ MAXALIGN(sizeof(GinPageOpaqueData))) \ / sizeof(ItemPointerData)) /* * List pages */ #define GinListPageSize \ ( BLCKSZ - SizeOfPageHeaderData - MAXALIGN(sizeof(GinPageOpaqueData)) ) /* * Storage type for GIN's reloptions */ typedef struct GinOptions { int32 vl_len_; /* varlena header (do not touch directly!) */ bool useFastUpdate; /* use fast updates? */ } GinOptions; #define GIN_DEFAULT_USE_FASTUPDATE true #define GinGetUseFastUpdate(relation) \ ((relation)->rd_options ? \ ((GinOptions *) (relation)->rd_options)->useFastUpdate : GIN_DEFAULT_USE_FASTUPDATE) /* Macros for buffer lock/unlock operations */ #define GIN_UNLOCK BUFFER_LOCK_UNLOCK #define GIN_SHARE BUFFER_LOCK_SHARE #define GIN_EXCLUSIVE BUFFER_LOCK_EXCLUSIVE /* * GinState: working data structure describing the index being worked on */ typedef struct GinState { Relation index; bool oneCol; /* true if single-column index */ /* * origTupDesc is the nominal tuple descriptor of the index, ie, the i'th * attribute shows the key type (not the input data type!) of the i'th * index column. In a single-column index this describes the actual leaf * index tuples. In a multi-column index, the actual leaf tuples contain * a smallint column number followed by a key datum of the appropriate * type for that column. We set up tupdesc[i] to describe the actual * rowtype of the index tuples for the i'th column, ie, (int2, keytype). * Note that in any case, leaf tuples contain more data than is known to * the TupleDesc; see access/gin/README for details. */ TupleDesc origTupdesc; TupleDesc tupdesc[INDEX_MAX_KEYS]; /* * Per-index-column opclass support functions */ FmgrInfo compareFn[INDEX_MAX_KEYS]; FmgrInfo extractValueFn[INDEX_MAX_KEYS]; FmgrInfo extractQueryFn[INDEX_MAX_KEYS]; FmgrInfo consistentFn[INDEX_MAX_KEYS]; FmgrInfo comparePartialFn[INDEX_MAX_KEYS]; /* optional method */ /* canPartialMatch[i] is true if comparePartialFn[i] is valid */ bool canPartialMatch[INDEX_MAX_KEYS]; /* Collations to pass to the support functions */ Oid supportCollation[INDEX_MAX_KEYS]; } GinState; /* XLog stuff */ #define XLOG_GIN_CREATE_INDEX 0x00 #define XLOG_GIN_CREATE_PTREE 0x10 typedef struct ginxlogCreatePostingTree { RelFileNode node; BlockNumber blkno; uint32 nitem; /* follows list of heap's ItemPointer */ } ginxlogCreatePostingTree; #define XLOG_GIN_INSERT 0x20 typedef struct ginxlogInsert { RelFileNode node; BlockNumber blkno; BlockNumber updateBlkno; OffsetNumber offset; bool isDelete; bool isData; bool isLeaf; OffsetNumber nitem; /* * follows: tuples or ItemPointerData or PostingItem or list of * ItemPointerData */ } ginxlogInsert; #define XLOG_GIN_SPLIT 0x30 typedef struct ginxlogSplit { RelFileNode node; BlockNumber lblkno; BlockNumber rootBlkno; BlockNumber rblkno; BlockNumber rrlink; OffsetNumber separator; OffsetNumber nitem; bool isData; bool isLeaf; bool isRootSplit; BlockNumber leftChildBlkno; BlockNumber updateBlkno; ItemPointerData rightbound; /* used only in posting tree */ /* follows: list of tuple or ItemPointerData or PostingItem */ } ginxlogSplit; #define XLOG_GIN_VACUUM_PAGE 0x40 typedef struct ginxlogVacuumPage { RelFileNode node; BlockNumber blkno; OffsetNumber nitem; /* follows content of page */ } ginxlogVacuumPage; #define XLOG_GIN_DELETE_PAGE 0x50 typedef struct ginxlogDeletePage { RelFileNode node; BlockNumber blkno; BlockNumber parentBlkno; OffsetNumber parentOffset; BlockNumber leftBlkno; BlockNumber rightLink; } ginxlogDeletePage; #define XLOG_GIN_UPDATE_META_PAGE 0x60 typedef struct ginxlogUpdateMeta { RelFileNode node; GinMetaPageData metadata; BlockNumber prevTail; BlockNumber newRightlink; int32 ntuples; /* if ntuples > 0 then metadata.tail was * updated with that many tuples; else new sub * list was inserted */ /* array of inserted tuples follows */ } ginxlogUpdateMeta; #define XLOG_GIN_INSERT_LISTPAGE 0x70 typedef struct ginxlogInsertListPage { RelFileNode node; BlockNumber blkno; BlockNumber rightlink; int32 ntuples; /* array of inserted tuples follows */ } ginxlogInsertListPage; #define XLOG_GIN_DELETE_LISTPAGE 0x80 #define GIN_NDELETE_AT_ONCE 16 typedef struct ginxlogDeleteListPages { RelFileNode node; GinMetaPageData metadata; int32 ndeleted; BlockNumber toDelete[GIN_NDELETE_AT_ONCE]; } ginxlogDeleteListPages; /* ginutil.c */ extern Datum ginoptions(PG_FUNCTION_ARGS); extern void initGinState(GinState *state, Relation index); extern Buffer GinNewBuffer(Relation index); extern void GinInitBuffer(Buffer b, uint32 f); extern void GinInitPage(Page page, uint32 f, Size pageSize); extern void GinInitMetabuffer(Buffer b); extern int ginCompareEntries(GinState *ginstate, OffsetNumber attnum, Datum a, GinNullCategory categorya, Datum b, GinNullCategory categoryb); extern int ginCompareAttEntries(GinState *ginstate, OffsetNumber attnuma, Datum a, GinNullCategory categorya, OffsetNumber attnumb, Datum b, GinNullCategory categoryb); extern Datum *ginExtractEntries(GinState *ginstate, OffsetNumber attnum, Datum value, bool isNull, int32 *nentries, GinNullCategory **categories); extern OffsetNumber gintuple_get_attrnum(GinState *ginstate, IndexTuple tuple); extern Datum gintuple_get_key(GinState *ginstate, IndexTuple tuple, GinNullCategory *category); /* gininsert.c */ extern Datum ginbuild(PG_FUNCTION_ARGS); extern Datum ginbuildempty(PG_FUNCTION_ARGS); extern Datum gininsert(PG_FUNCTION_ARGS); extern void ginEntryInsert(GinState *ginstate, OffsetNumber attnum, Datum key, GinNullCategory category, ItemPointerData *items, uint32 nitem, GinStatsData *buildStats); /* ginbtree.c */ typedef struct GinBtreeStack { BlockNumber blkno; Buffer buffer; OffsetNumber off; /* predictNumber contains predicted number of pages on current level */ uint32 predictNumber; struct GinBtreeStack *parent; } GinBtreeStack; typedef struct GinBtreeData *GinBtree; typedef struct GinBtreeData { /* search methods */ BlockNumber (*findChildPage) (GinBtree, GinBtreeStack *); bool (*isMoveRight) (GinBtree, Page); bool (*findItem) (GinBtree, GinBtreeStack *); /* insert methods */ OffsetNumber (*findChildPtr) (GinBtree, Page, BlockNumber, OffsetNumber); BlockNumber (*getLeftMostPage) (GinBtree, Page); bool (*isEnoughSpace) (GinBtree, Buffer, OffsetNumber); void (*placeToPage) (GinBtree, Buffer, OffsetNumber, XLogRecData **); Page (*splitPage) (GinBtree, Buffer, Buffer, OffsetNumber, XLogRecData **); void (*fillRoot) (GinBtree, Buffer, Buffer, Buffer); bool isData; bool searchMode; Relation index; GinState *ginstate; /* not valid in a data scan */ bool fullScan; bool isBuild; BlockNumber rightblkno; /* Entry options */ OffsetNumber entryAttnum; Datum entryKey; GinNullCategory entryCategory; IndexTuple entry; bool isDelete; /* Data (posting tree) options */ ItemPointerData *items; uint32 nitem; uint32 curitem; PostingItem pitem; } GinBtreeData; extern GinBtreeStack *ginPrepareFindLeafPage(GinBtree btree, BlockNumber blkno); extern GinBtreeStack *ginFindLeafPage(GinBtree btree, GinBtreeStack *stack); extern Buffer ginStepRight(Buffer buffer, Relation index, int lockmode); extern void freeGinBtreeStack(GinBtreeStack *stack); extern void ginInsertValue(GinBtree btree, GinBtreeStack *stack, GinStatsData *buildStats); extern void ginFindParents(GinBtree btree, GinBtreeStack *stack, BlockNumber rootBlkno); /* ginentrypage.c */ extern IndexTuple GinFormTuple(GinState *ginstate, OffsetNumber attnum, Datum key, GinNullCategory category, ItemPointerData *ipd, uint32 nipd, bool errorTooBig); extern void GinShortenTuple(IndexTuple itup, uint32 nipd); extern void ginPrepareEntryScan(GinBtree btree, OffsetNumber attnum, Datum key, GinNullCategory category, GinState *ginstate); extern void ginEntryFillRoot(GinBtree btree, Buffer root, Buffer lbuf, Buffer rbuf); extern IndexTuple ginPageGetLinkItup(Buffer buf); /* gindatapage.c */ extern int ginCompareItemPointers(ItemPointer a, ItemPointer b); extern uint32 ginMergeItemPointers(ItemPointerData *dst, ItemPointerData *a, uint32 na, ItemPointerData *b, uint32 nb); extern void GinDataPageAddItem(Page page, void *data, OffsetNumber offset); extern void GinPageDeletePostingItem(Page page, OffsetNumber offset); typedef struct { GinBtreeData btree; GinBtreeStack *stack; } GinPostingTreeScan; extern GinPostingTreeScan *ginPrepareScanPostingTree(Relation index, BlockNumber rootBlkno, bool searchMode); extern void ginInsertItemPointers(GinPostingTreeScan *gdi, ItemPointerData *items, uint32 nitem, GinStatsData *buildStats); extern Buffer ginScanBeginPostingTree(GinPostingTreeScan *gdi); extern void ginDataFillRoot(GinBtree btree, Buffer root, Buffer lbuf, Buffer rbuf); extern void ginPrepareDataScan(GinBtree btree, Relation index); /* ginscan.c */ /* * GinScanKeyData describes a single GIN index qualifier expression. * * From each qual expression, we extract one or more specific index search * conditions, which are represented by GinScanEntryData. It's quite * possible for identical search conditions to be requested by more than * one qual expression, in which case we merge such conditions to have just * one unique GinScanEntry --- this is particularly important for efficiency * when dealing with full-index-scan entries. So there can be multiple * GinScanKeyData.scanEntry pointers to the same GinScanEntryData. * * In each GinScanKeyData, nentries is the true number of entries, while * nuserentries is the number that extractQueryFn returned (which is what * we report to consistentFn). The "user" entries must come first. */ typedef struct GinScanKeyData *GinScanKey; typedef struct GinScanEntryData *GinScanEntry; typedef struct GinScanKeyData { /* Real number of entries in scanEntry[] (always > 0) */ uint32 nentries; /* Number of entries that extractQueryFn and consistentFn know about */ uint32 nuserentries; /* array of GinScanEntry pointers, one per extracted search condition */ GinScanEntry *scanEntry; /* array of check flags, reported to consistentFn */ bool *entryRes; /* other data needed for calling consistentFn */ Datum query; /* NB: these three arrays have only nuserentries elements! */ Datum *queryValues; GinNullCategory *queryCategories; Pointer *extra_data; StrategyNumber strategy; int32 searchMode; OffsetNumber attnum; /* * Match status data. curItem is the TID most recently tested (could be a * lossy-page pointer). curItemMatches is TRUE if it passes the * consistentFn test; if so, recheckCurItem is the recheck flag. * isFinished means that all the input entry streams are finished, so this * key cannot succeed for any later TIDs. */ ItemPointerData curItem; bool curItemMatches; bool recheckCurItem; bool isFinished; } GinScanKeyData; typedef struct GinScanEntryData { /* query key and other information from extractQueryFn */ Datum queryKey; GinNullCategory queryCategory; bool isPartialMatch; Pointer extra_data; StrategyNumber strategy; int32 searchMode; OffsetNumber attnum; /* Current page in posting tree */ Buffer buffer; /* current ItemPointer to heap */ ItemPointerData curItem; /* for a partial-match or full-scan query, we accumulate all TIDs here */ TIDBitmap *matchBitmap; TBMIterator *matchIterator; TBMIterateResult *matchResult; /* used for Posting list and one page in Posting tree */ ItemPointerData *list; uint32 nlist; OffsetNumber offset; bool isFinished; bool reduceResult; uint32 predictNumberResult; } GinScanEntryData; typedef struct GinScanOpaqueData { MemoryContext tempCtx; GinState ginstate; GinScanKey keys; /* one per scan qualifier expr */ uint32 nkeys; GinScanEntry *entries; /* one per index search condition */ uint32 totalentries; uint32 allocentries; /* allocated length of entries[] */ bool isVoidRes; /* true if query is unsatisfiable */ } GinScanOpaqueData; typedef GinScanOpaqueData *GinScanOpaque; extern Datum ginbeginscan(PG_FUNCTION_ARGS); extern Datum ginendscan(PG_FUNCTION_ARGS); extern Datum ginrescan(PG_FUNCTION_ARGS); extern Datum ginmarkpos(PG_FUNCTION_ARGS); extern Datum ginrestrpos(PG_FUNCTION_ARGS); extern void ginNewScanKey(IndexScanDesc scan); /* ginget.c */ extern Datum gingetbitmap(PG_FUNCTION_ARGS); /* ginvacuum.c */ extern Datum ginbulkdelete(PG_FUNCTION_ARGS); extern Datum ginvacuumcleanup(PG_FUNCTION_ARGS); /* ginbulk.c */ typedef struct GinEntryAccumulator { RBNode rbnode; Datum key; GinNullCategory category; OffsetNumber attnum; bool shouldSort; ItemPointerData *list; uint32 maxcount; /* allocated size of list[] */ uint32 count; /* current number of list[] entries */ } GinEntryAccumulator; typedef struct { GinState *ginstate; long allocatedMemory; GinEntryAccumulator *entryallocator; uint32 eas_used; RBTree *tree; } BuildAccumulator; extern void ginInitBA(BuildAccumulator *accum); extern void ginInsertBAEntries(BuildAccumulator *accum, ItemPointer heapptr, OffsetNumber attnum, Datum *entries, GinNullCategory *categories, int32 nentries); extern void ginBeginBAScan(BuildAccumulator *accum); extern ItemPointerData *ginGetBAEntry(BuildAccumulator *accum, OffsetNumber *attnum, Datum *key, GinNullCategory *category, uint32 *n); /* ginfast.c */ typedef struct GinTupleCollector { IndexTuple *tuples; uint32 ntuples; uint32 lentuples; uint32 sumsize; } GinTupleCollector; extern void ginHeapTupleFastInsert(GinState *ginstate, GinTupleCollector *collector); extern void ginHeapTupleFastCollect(GinState *ginstate, GinTupleCollector *collector, OffsetNumber attnum, Datum value, bool isNull, ItemPointer ht_ctid); extern void ginInsertCleanup(GinState *ginstate, bool vac_delay, IndexBulkDeleteResult *stats); #endif /* GIN_PRIVATE_H */ PKBiZserver/access/printtup.hnu[/*------------------------------------------------------------------------- * * printtup.h * * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/printtup.h * *------------------------------------------------------------------------- */ #ifndef PRINTTUP_H #define PRINTTUP_H #include "utils/portal.h" extern DestReceiver *printtup_create_DR(CommandDest dest); extern void SetRemoteDestReceiverParams(DestReceiver *self, Portal portal); extern void SendRowDescriptionMessage(TupleDesc typeinfo, List *targetlist, int16 *formats); extern void debugStartup(DestReceiver *self, int operation, TupleDesc typeinfo); extern void debugtup(TupleTableSlot *slot, DestReceiver *self); /* XXX these are really in executor/spi.c */ extern void spi_dest_startup(DestReceiver *self, int operation, TupleDesc typeinfo); extern void spi_printtup(TupleTableSlot *slot, DestReceiver *self); #endif /* PRINTTUP_H */ PKBiZ^[L[Lserver/access/gist_private.hnu[/*------------------------------------------------------------------------- * * gist_private.h * private declarations for GiST -- declarations related to the * internal implementation of GiST, not the public API * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/gist_private.h * *------------------------------------------------------------------------- */ #ifndef GIST_PRIVATE_H #define GIST_PRIVATE_H #include "access/gist.h" #include "access/itup.h" #include "fmgr.h" #include "storage/bufmgr.h" #include "storage/buffile.h" #include "utils/rbtree.h" #include "utils/hsearch.h" /* * Maximum number of "halves" a page can be split into in one operation. * Typically a split produces 2 halves, but can be more if keys have very * different lengths, or when inserting multiple keys in one operation (as * when inserting downlinks to an internal node). There is no theoretical * limit on this, but in practice if you get more than a handful page halves * in one split, there's something wrong with the opclass implementation. * GIST_MAX_SPLIT_PAGES is an arbitrary limit on that, used to size some * local arrays used during split. Note that there is also a limit on the * number of buffers that can be held locked at a time, MAX_SIMUL_LWLOCKS, * so if you raise this higher than that limit, you'll just get a different * error. */ #define GIST_MAX_SPLIT_PAGES 75 /* Buffer lock modes */ #define GIST_SHARE BUFFER_LOCK_SHARE #define GIST_EXCLUSIVE BUFFER_LOCK_EXCLUSIVE #define GIST_UNLOCK BUFFER_LOCK_UNLOCK typedef struct { BlockNumber prev; uint32 freespace; char tupledata[1]; } GISTNodeBufferPage; #define BUFFER_PAGE_DATA_OFFSET MAXALIGN(offsetof(GISTNodeBufferPage, tupledata)) /* Returns free space in node buffer page */ #define PAGE_FREE_SPACE(nbp) (nbp->freespace) /* Checks if node buffer page is empty */ #define PAGE_IS_EMPTY(nbp) (nbp->freespace == BLCKSZ - BUFFER_PAGE_DATA_OFFSET) /* Checks if node buffers page don't contain sufficient space for index tuple */ #define PAGE_NO_SPACE(nbp, itup) (PAGE_FREE_SPACE(nbp) < \ MAXALIGN(IndexTupleSize(itup))) /* * GISTSTATE: information needed for any GiST index operation * * This struct retains call info for the index's opclass-specific support * functions (per index column), plus the index's tuple descriptor. * * scanCxt holds the GISTSTATE itself as well as any data that lives for the * lifetime of the index operation. We pass this to the support functions * via fn_mcxt, so that they can store scan-lifespan data in it. The * functions are invoked in tempCxt, which is typically short-lifespan * (that is, it's reset after each tuple). However, tempCxt can be the same * as scanCxt if we're not bothering with per-tuple context resets. */ typedef struct GISTSTATE { MemoryContext scanCxt; /* context for scan-lifespan data */ MemoryContext tempCxt; /* short-term context for calling functions */ TupleDesc tupdesc; /* index's tuple descriptor */ FmgrInfo consistentFn[INDEX_MAX_KEYS]; FmgrInfo unionFn[INDEX_MAX_KEYS]; FmgrInfo compressFn[INDEX_MAX_KEYS]; FmgrInfo decompressFn[INDEX_MAX_KEYS]; FmgrInfo penaltyFn[INDEX_MAX_KEYS]; FmgrInfo picksplitFn[INDEX_MAX_KEYS]; FmgrInfo equalFn[INDEX_MAX_KEYS]; FmgrInfo distanceFn[INDEX_MAX_KEYS]; /* Collations to pass to the support functions */ Oid supportCollation[INDEX_MAX_KEYS]; } GISTSTATE; /* * During a GiST index search, we must maintain a queue of unvisited items, * which can be either individual heap tuples or whole index pages. If it * is an ordered search, the unvisited items should be visited in distance * order. Unvisited items at the same distance should be visited in * depth-first order, that is heap items first, then lower index pages, then * upper index pages; this rule avoids doing extra work during a search that * ends early due to LIMIT. * * To perform an ordered search, we use an RBTree to manage the distance-order * queue. Each GISTSearchTreeItem stores all unvisited items of the same * distance; they are GISTSearchItems chained together via their next fields. * * In a non-ordered search (no order-by operators), the RBTree degenerates * to a single item, which we use as a queue of unvisited index pages only. * In this case matched heap items from the current index leaf page are * remembered in GISTScanOpaqueData.pageData[] and returned directly from * there, instead of building a separate GISTSearchItem for each one. */ /* Individual heap tuple to be visited */ typedef struct GISTSearchHeapItem { ItemPointerData heapPtr; bool recheck; /* T if quals must be rechecked */ } GISTSearchHeapItem; /* Unvisited item, either index page or heap tuple */ typedef struct GISTSearchItem { struct GISTSearchItem *next; /* list link */ BlockNumber blkno; /* index page number, or InvalidBlockNumber */ union { GistNSN parentlsn; /* parent page's LSN, if index page */ /* we must store parentlsn to detect whether a split occurred */ GISTSearchHeapItem heap; /* heap info, if heap tuple */ } data; } GISTSearchItem; #define GISTSearchItemIsHeap(item) ((item).blkno == InvalidBlockNumber) /* * Within a GISTSearchTreeItem's chain, heap items always appear before * index-page items, since we want to visit heap items first. lastHeap points * to the last heap item in the chain, or is NULL if there are none. */ typedef struct GISTSearchTreeItem { RBNode rbnode; /* this is an RBTree item */ GISTSearchItem *head; /* first chain member */ GISTSearchItem *lastHeap; /* last heap-tuple member, if any */ double distances[1]; /* array with numberOfOrderBys entries */ } GISTSearchTreeItem; #define GSTIHDRSZ offsetof(GISTSearchTreeItem, distances) /* * GISTScanOpaqueData: private state for a scan of a GiST index */ typedef struct GISTScanOpaqueData { GISTSTATE *giststate; /* index information, see above */ RBTree *queue; /* queue of unvisited items */ MemoryContext queueCxt; /* context holding the queue */ bool qual_ok; /* false if qual can never be satisfied */ bool firstCall; /* true until first gistgettuple call */ GISTSearchTreeItem *curTreeItem; /* current queue item, if any */ /* pre-allocated workspace arrays */ GISTSearchTreeItem *tmpTreeItem; /* workspace to pass to rb_insert */ double *distances; /* output area for gistindex_keytest */ /* In a non-ordered search, returnable heap items are stored here: */ GISTSearchHeapItem pageData[BLCKSZ / sizeof(IndexTupleData)]; OffsetNumber nPageData; /* number of valid items in array */ OffsetNumber curPageData; /* next item to return */ } GISTScanOpaqueData; typedef GISTScanOpaqueData *GISTScanOpaque; /* XLog stuff */ #define XLOG_GIST_PAGE_UPDATE 0x00 /* #define XLOG_GIST_NEW_ROOT 0x20 */ /* not used anymore */ #define XLOG_GIST_PAGE_SPLIT 0x30 /* #define XLOG_GIST_INSERT_COMPLETE 0x40 */ /* not used anymore */ #define XLOG_GIST_CREATE_INDEX 0x50 #define XLOG_GIST_PAGE_DELETE 0x60 typedef struct gistxlogPageUpdate { RelFileNode node; BlockNumber blkno; /* * If this operation completes a page split, by inserting a downlink for * the split page, leftchild points to the left half of the split. */ BlockNumber leftchild; /* number of deleted offsets */ uint16 ntodelete; /* * follow: 1. todelete OffsetNumbers 2. tuples to insert */ } gistxlogPageUpdate; typedef struct gistxlogPageSplit { RelFileNode node; BlockNumber origblkno; /* splitted page */ BlockNumber origrlink; /* rightlink of the page before split */ GistNSN orignsn; /* NSN of the page before split */ bool origleaf; /* was splitted page a leaf page? */ BlockNumber leftchild; /* like in gistxlogPageUpdate */ uint16 npage; /* # of pages in the split */ bool markfollowright; /* set F_FOLLOW_RIGHT flags */ /* * follow: 1. gistxlogPage and array of IndexTupleData per page */ } gistxlogPageSplit; typedef struct gistxlogPage { BlockNumber blkno; int num; /* number of index tuples following */ } gistxlogPage; typedef struct gistxlogPageDelete { RelFileNode node; BlockNumber blkno; } gistxlogPageDelete; /* SplitedPageLayout - gistSplit function result */ typedef struct SplitedPageLayout { gistxlogPage block; IndexTupleData *list; int lenlist; IndexTuple itup; /* union key for page */ Page page; /* to operate */ Buffer buffer; /* to write after all proceed */ struct SplitedPageLayout *next; } SplitedPageLayout; /* * GISTInsertStack used for locking buffers and transfer arguments during * insertion */ typedef struct GISTInsertStack { /* current page */ BlockNumber blkno; Buffer buffer; Page page; /* * log sequence number from page->lsn to recognize page update and compare * it with page's nsn to recognize page split */ GistNSN lsn; /* offset of the downlink in the parent page, that points to this page */ OffsetNumber downlinkoffnum; /* pointer to parent */ struct GISTInsertStack *parent; } GISTInsertStack; /* Working state and results for multi-column split logic in gistsplit.c */ typedef struct GistSplitVector { GIST_SPLITVEC splitVector; /* passed to/from user PickSplit method */ Datum spl_lattr[INDEX_MAX_KEYS]; /* Union of subkeys in * splitVector.spl_left */ bool spl_lisnull[INDEX_MAX_KEYS]; Datum spl_rattr[INDEX_MAX_KEYS]; /* Union of subkeys in * splitVector.spl_right */ bool spl_risnull[INDEX_MAX_KEYS]; bool *spl_dontcare; /* flags tuples which could go to either side * of the split for zero penalty */ } GistSplitVector; typedef struct { Relation r; Size freespace; /* free space to be left */ GISTInsertStack *stack; } GISTInsertState; /* root page of a gist index */ #define GIST_ROOT_BLKNO 0 /* * Before PostgreSQL 9.1, we used rely on so-called "invalid tuples" on inner * pages to finish crash recovery of incomplete page splits. If a crash * happened in the middle of a page split, so that the downlink pointers were * not yet inserted, crash recovery inserted a special downlink pointer. The * semantics of an invalid tuple was that it if you encounter one in a scan, * it must always be followed, because we don't know if the tuples on the * child page match or not. * * We no longer create such invalid tuples, we now mark the left-half of such * an incomplete split with the F_FOLLOW_RIGHT flag instead, and finish the * split properly the next time we need to insert on that page. To retain * on-disk compatibility for the sake of pg_upgrade, we still store 0xffff as * the offset number of all inner tuples. If we encounter any invalid tuples * with 0xfffe during insertion, we throw an error, though scans still handle * them. You should only encounter invalid tuples if you pg_upgrade a pre-9.1 * gist index which already has invalid tuples in it because of a crash. That * should be rare, and you are recommended to REINDEX anyway if you have any * invalid tuples in an index, so throwing an error is as far as we go with * supporting that. */ #define TUPLE_IS_VALID 0xffff #define TUPLE_IS_INVALID 0xfffe #define GistTupleIsInvalid(itup) ( ItemPointerGetOffsetNumber( &((itup)->t_tid) ) == TUPLE_IS_INVALID ) #define GistTupleSetValid(itup) ItemPointerSetOffsetNumber( &((itup)->t_tid), TUPLE_IS_VALID ) /* * A buffer attached to an internal node, used when building an index in * buffering mode. */ typedef struct { BlockNumber nodeBlocknum; /* index block # this buffer is for */ int32 blocksCount; /* current # of blocks occupied by buffer */ BlockNumber pageBlocknum; /* temporary file block # */ GISTNodeBufferPage *pageBuffer; /* in-memory buffer page */ /* is this buffer queued for emptying? */ bool queuedForEmptying; /* is this a temporary copy, not in the hash table? */ bool isTemp; int level; /* 0 == leaf */ } GISTNodeBuffer; /* * Does specified level have buffers? (Beware of multiple evaluation of * arguments.) */ #define LEVEL_HAS_BUFFERS(nlevel, gfbb) \ ((nlevel) != 0 && (nlevel) % (gfbb)->levelStep == 0 && \ (nlevel) != (gfbb)->rootlevel) /* Is specified buffer at least half-filled (should be queued for emptying)? */ #define BUFFER_HALF_FILLED(nodeBuffer, gfbb) \ ((nodeBuffer)->blocksCount > (gfbb)->pagesPerBuffer / 2) /* * Is specified buffer full? Our buffers can actually grow indefinitely, * beyond the "maximum" size, so this just means whether the buffer has grown * beyond the nominal maximum size. */ #define BUFFER_OVERFLOWED(nodeBuffer, gfbb) \ ((nodeBuffer)->blocksCount > (gfbb)->pagesPerBuffer) /* * Data structure with general information about build buffers. */ typedef struct GISTBuildBuffers { /* Persistent memory context for the buffers and metadata. */ MemoryContext context; BufFile *pfile; /* Temporary file to store buffers in */ long nFileBlocks; /* Current size of the temporary file */ /* * resizable array of free blocks. */ long *freeBlocks; int nFreeBlocks; /* # of currently free blocks in the array */ int freeBlocksLen; /* current allocated length of the array */ /* Hash for buffers by block number */ HTAB *nodeBuffersTab; /* List of buffers scheduled for emptying */ List *bufferEmptyingQueue; /* * Parameters to the buffering build algorithm. levelStep determines which * levels in the tree have buffers, and pagesPerBuffer determines how * large each buffer is. */ int levelStep; int pagesPerBuffer; /* Array of lists of buffers on each level, for final emptying */ List **buffersOnLevels; int buffersOnLevelsLen; /* * Dynamically-sized array of buffers that currently have their last page * loaded in main memory. */ GISTNodeBuffer **loadedBuffers; int loadedBuffersCount; /* # of entries in loadedBuffers */ int loadedBuffersLen; /* allocated size of loadedBuffers */ /* Level of the current root node (= height of the index tree - 1) */ int rootlevel; } GISTBuildBuffers; /* * Storage type for GiST's reloptions */ typedef struct GiSTOptions { int32 vl_len_; /* varlena header (do not touch directly!) */ int fillfactor; /* page fill factor in percent (0..100) */ int bufferingModeOffset; /* use buffering build? */ } GiSTOptions; /* gist.c */ extern Datum gistbuildempty(PG_FUNCTION_ARGS); extern Datum gistinsert(PG_FUNCTION_ARGS); extern MemoryContext createTempGistContext(void); extern GISTSTATE *initGISTstate(Relation index); extern void freeGISTstate(GISTSTATE *giststate); extern void gistdoinsert(Relation r, IndexTuple itup, Size freespace, GISTSTATE *GISTstate); /* A List of these is returned from gistplacetopage() in *splitinfo */ typedef struct { Buffer buf; /* the split page "half" */ IndexTuple downlink; /* downlink for this half. */ } GISTPageSplitInfo; extern bool gistplacetopage(Relation rel, Size freespace, GISTSTATE *giststate, Buffer buffer, IndexTuple *itup, int ntup, OffsetNumber oldoffnum, BlockNumber *newblkno, Buffer leftchildbuf, List **splitinfo, bool markleftchild); extern SplitedPageLayout *gistSplit(Relation r, Page page, IndexTuple *itup, int len, GISTSTATE *giststate); /* gistxlog.c */ extern void gist_redo(XLogRecPtr lsn, XLogRecord *record); extern void gist_desc(StringInfo buf, uint8 xl_info, char *rec); extern void gist_xlog_startup(void); extern void gist_xlog_cleanup(void); extern XLogRecPtr gistXLogUpdate(RelFileNode node, Buffer buffer, OffsetNumber *todelete, int ntodelete, IndexTuple *itup, int ntup, Buffer leftchild); extern XLogRecPtr gistXLogSplit(RelFileNode node, BlockNumber blkno, bool page_is_leaf, SplitedPageLayout *dist, BlockNumber origrlink, GistNSN oldnsn, Buffer leftchild, bool markfollowright); /* gistget.c */ extern Datum gistgettuple(PG_FUNCTION_ARGS); extern Datum gistgetbitmap(PG_FUNCTION_ARGS); /* gistutil.c */ #define GiSTPageSize \ ( BLCKSZ - SizeOfPageHeaderData - MAXALIGN(sizeof(GISTPageOpaqueData)) ) #define GIST_MIN_FILLFACTOR 10 #define GIST_DEFAULT_FILLFACTOR 90 extern Datum gistoptions(PG_FUNCTION_ARGS); extern bool gistfitpage(IndexTuple *itvec, int len); extern bool gistnospace(Page page, IndexTuple *itvec, int len, OffsetNumber todelete, Size freespace); extern void gistcheckpage(Relation rel, Buffer buf); extern Buffer gistNewBuffer(Relation r); extern void gistfillbuffer(Page page, IndexTuple *itup, int len, OffsetNumber off); extern IndexTuple *gistextractpage(Page page, int *len /* out */ ); extern IndexTuple *gistjoinvector( IndexTuple *itvec, int *len, IndexTuple *additvec, int addlen); extern IndexTupleData *gistfillitupvec(IndexTuple *vec, int veclen, int *memlen); extern IndexTuple gistunion(Relation r, IndexTuple *itvec, int len, GISTSTATE *giststate); extern IndexTuple gistgetadjusted(Relation r, IndexTuple oldtup, IndexTuple addtup, GISTSTATE *giststate); extern IndexTuple gistFormTuple(GISTSTATE *giststate, Relation r, Datum *attdata, bool *isnull, bool newValues); extern OffsetNumber gistchoose(Relation r, Page p, IndexTuple it, GISTSTATE *giststate); extern void gistcentryinit(GISTSTATE *giststate, int nkey, GISTENTRY *e, Datum k, Relation r, Page pg, OffsetNumber o, bool l, bool isNull); extern void GISTInitBuffer(Buffer b, uint32 f); extern void gistdentryinit(GISTSTATE *giststate, int nkey, GISTENTRY *e, Datum k, Relation r, Page pg, OffsetNumber o, bool l, bool isNull); extern float gistpenalty(GISTSTATE *giststate, int attno, GISTENTRY *key1, bool isNull1, GISTENTRY *key2, bool isNull2); extern void gistMakeUnionItVec(GISTSTATE *giststate, IndexTuple *itvec, int len, Datum *attr, bool *isnull); extern bool gistKeyIsEQ(GISTSTATE *giststate, int attno, Datum a, Datum b); extern void gistDeCompressAtt(GISTSTATE *giststate, Relation r, IndexTuple tuple, Page p, OffsetNumber o, GISTENTRY *attdata, bool *isnull); extern void gistMakeUnionKey(GISTSTATE *giststate, int attno, GISTENTRY *entry1, bool isnull1, GISTENTRY *entry2, bool isnull2, Datum *dst, bool *dstisnull); extern XLogRecPtr GetXLogRecPtrForTemp(void); /* gistvacuum.c */ extern Datum gistbulkdelete(PG_FUNCTION_ARGS); extern Datum gistvacuumcleanup(PG_FUNCTION_ARGS); /* gistsplit.c */ extern void gistSplitByKey(Relation r, Page page, IndexTuple *itup, int len, GISTSTATE *giststate, GistSplitVector *v, int attno); /* gistbuild.c */ extern Datum gistbuild(PG_FUNCTION_ARGS); extern void gistValidateBufferingOption(char *value); /* gistbuildbuffers.c */ extern GISTBuildBuffers *gistInitBuildBuffers(int pagesPerBuffer, int levelStep, int maxLevel); extern GISTNodeBuffer *gistGetNodeBuffer(GISTBuildBuffers *gfbb, GISTSTATE *giststate, BlockNumber blkno, int level); extern void gistPushItupToNodeBuffer(GISTBuildBuffers *gfbb, GISTNodeBuffer *nodeBuffer, IndexTuple item); extern bool gistPopItupFromNodeBuffer(GISTBuildBuffers *gfbb, GISTNodeBuffer *nodeBuffer, IndexTuple *item); extern void gistFreeBuildBuffers(GISTBuildBuffers *gfbb); extern void gistRelocateBuildBuffersOnSplit(GISTBuildBuffers *gfbb, GISTSTATE *giststate, Relation r, int level, Buffer buffer, List *splitinfo); extern void gistUnloadNodeBuffers(GISTBuildBuffers *gfbb); #endif /* GIST_PRIVATE_H */ PKBiZKserver/access/xlogutils.hnu[/* * xlogutils.h * * PostgreSQL transaction log manager utility routines * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/xlogutils.h */ #ifndef XLOG_UTILS_H #define XLOG_UTILS_H #include "storage/bufmgr.h" extern bool XLogHaveInvalidPages(void); extern void XLogCheckInvalidPages(void); extern void XLogDropRelation(RelFileNode rnode, ForkNumber forknum); extern void XLogDropDatabase(Oid dbid); extern void XLogTruncateRelation(RelFileNode rnode, ForkNumber forkNum, BlockNumber nblocks); extern Buffer XLogReadBuffer(RelFileNode rnode, BlockNumber blkno, bool init); extern Buffer XLogReadBufferExtended(RelFileNode rnode, ForkNumber forknum, BlockNumber blkno, ReadBufferMode mode); extern Relation CreateFakeRelcacheEntry(RelFileNode rnode); extern void FreeFakeRelcacheEntry(Relation fakerel); #endif PKBiZmAserver/access/tuptoaster.hnu[/*------------------------------------------------------------------------- * * tuptoaster.h * POSTGRES definitions for external and compressed storage * of variable size attributes. * * Copyright (c) 2000-2012, PostgreSQL Global Development Group * * src/include/access/tuptoaster.h * *------------------------------------------------------------------------- */ #ifndef TUPTOASTER_H #define TUPTOASTER_H #include "access/htup.h" #include "utils/relcache.h" /* * This enables de-toasting of index entries. Needed until VACUUM is * smart enough to rebuild indexes from scratch. */ #define TOAST_INDEX_HACK /* * Find the maximum size of a tuple if there are to be N tuples per page. */ #define MaximumBytesPerTuple(tuplesPerPage) \ MAXALIGN_DOWN((BLCKSZ - \ MAXALIGN(SizeOfPageHeaderData + (tuplesPerPage) * sizeof(ItemIdData))) \ / (tuplesPerPage)) /* * These symbols control toaster activation. If a tuple is larger than * TOAST_TUPLE_THRESHOLD, we will try to toast it down to no more than * TOAST_TUPLE_TARGET bytes through compressing compressible fields and * moving EXTENDED and EXTERNAL data out-of-line. * * The numbers need not be the same, though they currently are. It doesn't * make sense for TARGET to exceed THRESHOLD, but it could be useful to make * it be smaller. * * Currently we choose both values to match the largest tuple size for which * TOAST_TUPLES_PER_PAGE tuples can fit on a heap page. * * XXX while these can be modified without initdb, some thought needs to be * given to needs_toast_table() in toasting.c before unleashing random * changes. Also see LOBLKSIZE in large_object.h, which can *not* be * changed without initdb. */ #define TOAST_TUPLES_PER_PAGE 4 #define TOAST_TUPLE_THRESHOLD MaximumBytesPerTuple(TOAST_TUPLES_PER_PAGE) #define TOAST_TUPLE_TARGET TOAST_TUPLE_THRESHOLD /* * The code will also consider moving MAIN data out-of-line, but only as a * last resort if the previous steps haven't reached the target tuple size. * In this phase we use a different target size, currently equal to the * largest tuple that will fit on a heap page. This is reasonable since * the user has told us to keep the data in-line if at all possible. */ #define TOAST_TUPLES_PER_PAGE_MAIN 1 #define TOAST_TUPLE_TARGET_MAIN MaximumBytesPerTuple(TOAST_TUPLES_PER_PAGE_MAIN) /* * If an index value is larger than TOAST_INDEX_TARGET, we will try to * compress it (we can't move it out-of-line, however). Note that this * number is per-datum, not per-tuple, for simplicity in index_form_tuple(). */ #define TOAST_INDEX_TARGET (MaxHeapTupleSize / 16) /* * When we store an oversize datum externally, we divide it into chunks * containing at most TOAST_MAX_CHUNK_SIZE data bytes. This number *must* * be small enough that the completed toast-table tuple (including the * ID and sequence fields and all overhead) will fit on a page. * The coding here sets the size on the theory that we want to fit * EXTERN_TUPLES_PER_PAGE tuples of maximum size onto a page. * * NB: Changing TOAST_MAX_CHUNK_SIZE requires an initdb. */ #define EXTERN_TUPLES_PER_PAGE 4 /* tweak only this */ #define EXTERN_TUPLE_MAX_SIZE MaximumBytesPerTuple(EXTERN_TUPLES_PER_PAGE) #define TOAST_MAX_CHUNK_SIZE \ (EXTERN_TUPLE_MAX_SIZE - \ MAXALIGN(offsetof(HeapTupleHeaderData, t_bits)) - \ sizeof(Oid) - \ sizeof(int32) - \ VARHDRSZ) /* ---------- * toast_insert_or_update - * * Called by heap_insert() and heap_update(). * ---------- */ extern HeapTuple toast_insert_or_update(Relation rel, HeapTuple newtup, HeapTuple oldtup, int options); /* ---------- * toast_delete - * * Called by heap_delete(). * ---------- */ extern void toast_delete(Relation rel, HeapTuple oldtup); /* ---------- * heap_tuple_fetch_attr() - * * Fetches an external stored attribute from the toast * relation. Does NOT decompress it, if stored external * in compressed format. * ---------- */ extern struct varlena *heap_tuple_fetch_attr(struct varlena * attr); /* ---------- * heap_tuple_untoast_attr() - * * Fully detoasts one attribute, fetching and/or decompressing * it as needed. * ---------- */ extern struct varlena *heap_tuple_untoast_attr(struct varlena * attr); /* ---------- * heap_tuple_untoast_attr_slice() - * * Fetches only the specified portion of an attribute. * (Handles all cases for attribute storage) * ---------- */ extern struct varlena *heap_tuple_untoast_attr_slice(struct varlena * attr, int32 sliceoffset, int32 slicelength); /* ---------- * toast_flatten_tuple - * * "Flatten" a tuple to contain no out-of-line toasted fields. * (This does not eliminate compressed or short-header datums.) * ---------- */ extern HeapTuple toast_flatten_tuple(HeapTuple tup, TupleDesc tupleDesc); /* ---------- * toast_flatten_tuple_to_datum - * * "Flatten" a tuple containing out-of-line toasted fields into a Datum. * ---------- */ extern Datum toast_flatten_tuple_to_datum(HeapTupleHeader tup, uint32 tup_len, TupleDesc tupleDesc); /* ---------- * toast_compress_datum - * * Create a compressed version of a varlena datum, if possible * ---------- */ extern Datum toast_compress_datum(Datum value); /* ---------- * toast_raw_datum_size - * * Return the raw (detoasted) size of a varlena datum * ---------- */ extern Size toast_raw_datum_size(Datum value); /* ---------- * toast_datum_size - * * Return the storage size of a varlena datum * ---------- */ extern Size toast_datum_size(Datum value); #endif /* TUPTOASTER_H */ PKBiZ,Sserver/access/spgist.hnu[/*------------------------------------------------------------------------- * * spgist.h * Public header file for SP-GiST access method. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/spgist.h * *------------------------------------------------------------------------- */ #ifndef SPGIST_H #define SPGIST_H #include "access/skey.h" #include "access/xlog.h" #include "fmgr.h" /* reloption parameters */ #define SPGIST_MIN_FILLFACTOR 10 #define SPGIST_DEFAULT_FILLFACTOR 80 /* SPGiST opclass support function numbers */ #define SPGIST_CONFIG_PROC 1 #define SPGIST_CHOOSE_PROC 2 #define SPGIST_PICKSPLIT_PROC 3 #define SPGIST_INNER_CONSISTENT_PROC 4 #define SPGIST_LEAF_CONSISTENT_PROC 5 #define SPGISTNProc 5 /* * Argument structs for spg_config method */ typedef struct spgConfigIn { Oid attType; /* Data type to be indexed */ } spgConfigIn; typedef struct spgConfigOut { Oid prefixType; /* Data type of inner-tuple prefixes */ Oid labelType; /* Data type of inner-tuple node labels */ bool canReturnData; /* Opclass can reconstruct original data */ bool longValuesOK; /* Opclass can cope with values > 1 page */ } spgConfigOut; /* * Argument structs for spg_choose method */ typedef struct spgChooseIn { Datum datum; /* original datum to be indexed */ Datum leafDatum; /* current datum to be stored at leaf */ int level; /* current level (counting from zero) */ /* Data from current inner tuple */ bool allTheSame; /* tuple is marked all-the-same? */ bool hasPrefix; /* tuple has a prefix? */ Datum prefixDatum; /* if so, the prefix value */ int nNodes; /* number of nodes in the inner tuple */ Datum *nodeLabels; /* node label values (NULL if none) */ } spgChooseIn; typedef enum spgChooseResultType { spgMatchNode = 1, /* descend into existing node */ spgAddNode, /* add a node to the inner tuple */ spgSplitTuple /* split inner tuple (change its prefix) */ } spgChooseResultType; typedef struct spgChooseOut { spgChooseResultType resultType; /* action code, see above */ union { struct /* results for spgMatchNode */ { int nodeN; /* descend to this node (index from 0) */ int levelAdd; /* increment level by this much */ Datum restDatum; /* new leaf datum */ } matchNode; struct /* results for spgAddNode */ { Datum nodeLabel; /* new node's label */ int nodeN; /* where to insert it (index from 0) */ } addNode; struct /* results for spgSplitTuple */ { /* Info to form new inner tuple with one node */ bool prefixHasPrefix; /* tuple should have a prefix? */ Datum prefixPrefixDatum; /* if so, its value */ Datum nodeLabel; /* node's label */ /* Info to form new lower-level inner tuple with all old nodes */ bool postfixHasPrefix; /* tuple should have a prefix? */ Datum postfixPrefixDatum; /* if so, its value */ } splitTuple; } result; } spgChooseOut; /* * Argument structs for spg_picksplit method */ typedef struct spgPickSplitIn { int nTuples; /* number of leaf tuples */ Datum *datums; /* their datums (array of length nTuples) */ int level; /* current level (counting from zero) */ } spgPickSplitIn; typedef struct spgPickSplitOut { bool hasPrefix; /* new inner tuple should have a prefix? */ Datum prefixDatum; /* if so, its value */ int nNodes; /* number of nodes for new inner tuple */ Datum *nodeLabels; /* their labels (or NULL for no labels) */ int *mapTuplesToNodes; /* node index for each leaf tuple */ Datum *leafTupleDatums; /* datum to store in each new leaf tuple */ } spgPickSplitOut; /* * Argument structs for spg_inner_consistent method */ typedef struct spgInnerConsistentIn { ScanKey scankeys; /* array of operators and comparison values */ int nkeys; /* length of array */ Datum reconstructedValue; /* value reconstructed at parent */ int level; /* current level (counting from zero) */ bool returnData; /* original data must be returned? */ /* Data from current inner tuple */ bool allTheSame; /* tuple is marked all-the-same? */ bool hasPrefix; /* tuple has a prefix? */ Datum prefixDatum; /* if so, the prefix value */ int nNodes; /* number of nodes in the inner tuple */ Datum *nodeLabels; /* node label values (NULL if none) */ } spgInnerConsistentIn; typedef struct spgInnerConsistentOut { int nNodes; /* number of child nodes to be visited */ int *nodeNumbers; /* their indexes in the node array */ int *levelAdds; /* increment level by this much for each */ Datum *reconstructedValues; /* associated reconstructed values */ } spgInnerConsistentOut; /* * Argument structs for spg_leaf_consistent method */ typedef struct spgLeafConsistentIn { ScanKey scankeys; /* array of operators and comparison values */ int nkeys; /* length of array */ Datum reconstructedValue; /* value reconstructed at parent */ int level; /* current level (counting from zero) */ bool returnData; /* original data must be returned? */ Datum leafDatum; /* datum in leaf tuple */ } spgLeafConsistentIn; typedef struct spgLeafConsistentOut { Datum leafValue; /* reconstructed original data, if any */ bool recheck; /* set true if operator must be rechecked */ } spgLeafConsistentOut; /* spginsert.c */ extern Datum spgbuild(PG_FUNCTION_ARGS); extern Datum spgbuildempty(PG_FUNCTION_ARGS); extern Datum spginsert(PG_FUNCTION_ARGS); /* spgscan.c */ extern Datum spgbeginscan(PG_FUNCTION_ARGS); extern Datum spgendscan(PG_FUNCTION_ARGS); extern Datum spgrescan(PG_FUNCTION_ARGS); extern Datum spgmarkpos(PG_FUNCTION_ARGS); extern Datum spgrestrpos(PG_FUNCTION_ARGS); extern Datum spggetbitmap(PG_FUNCTION_ARGS); extern Datum spggettuple(PG_FUNCTION_ARGS); extern Datum spgcanreturn(PG_FUNCTION_ARGS); /* spgutils.c */ extern Datum spgoptions(PG_FUNCTION_ARGS); /* spgvacuum.c */ extern Datum spgbulkdelete(PG_FUNCTION_ARGS); extern Datum spgvacuumcleanup(PG_FUNCTION_ARGS); /* spgxlog.c */ extern void spg_redo(XLogRecPtr lsn, XLogRecord *record); extern void spg_desc(StringInfo buf, uint8 xl_info, char *rec); extern void spg_xlog_startup(void); extern void spg_xlog_cleanup(void); #endif /* SPGIST_H */ PKBiZͱserver/access/valid.hnu[/*------------------------------------------------------------------------- * * valid.h * POSTGRES tuple qualification validity definitions. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/valid.h * *------------------------------------------------------------------------- */ #ifndef VALID_H #define VALID_H /* * HeapKeyTest * * Test a heap tuple to see if it satisfies a scan key. */ #define HeapKeyTest(tuple, \ tupdesc, \ nkeys, \ keys, \ result) \ do \ { \ /* Use underscores to protect the variables passed in as parameters */ \ int __cur_nkeys = (nkeys); \ ScanKey __cur_keys = (keys); \ \ (result) = true; /* may change */ \ for (; __cur_nkeys--; __cur_keys++) \ { \ Datum __atp; \ bool __isnull; \ Datum __test; \ \ if (__cur_keys->sk_flags & SK_ISNULL) \ { \ (result) = false; \ break; \ } \ \ __atp = heap_getattr((tuple), \ __cur_keys->sk_attno, \ (tupdesc), \ &__isnull); \ \ if (__isnull) \ { \ (result) = false; \ break; \ } \ \ __test = FunctionCall2Coll(&__cur_keys->sk_func, \ __cur_keys->sk_collation, \ __atp, __cur_keys->sk_argument); \ \ if (!DatumGetBool(__test)) \ { \ (result) = false; \ break; \ } \ } \ } while (0) #endif /* VALID_H */ PKBiZ;;server/getopt_long.hnu[/* * Portions Copyright (c) 1987, 1993, 1994 * The Regents of the University of California. All rights reserved. * * Portions Copyright (c) 2003-2012, PostgreSQL Global Development Group * * src/include/getopt_long.h */ #ifndef GETOPT_LONG_H #define GETOPT_LONG_H #ifdef HAVE_GETOPT_H #include #endif /* These are picked up from the system's getopt() facility. */ extern int opterr; extern int optind; extern int optopt; extern char *optarg; #ifndef HAVE_STRUCT_OPTION struct option { const char *name; int has_arg; int *flag; int val; }; #define no_argument 0 #define required_argument 1 #endif #ifndef HAVE_GETOPT_LONG extern int getopt_long(int argc, char *const argv[], const char *optstring, const struct option * longopts, int *longindex); #endif #endif /* GETOPT_LONG_H */ PKBiZ_:UUserver/commands/comment.hnu[/* * src/include/commands/comment.h * *------------------------------------------------------------------------- * * comment.h * * Prototypes for functions in commands/comment.c * * Copyright (c) 1999-2012, PostgreSQL Global Development Group * *------------------------------------------------------------------------- */ #ifndef COMMENT_H #define COMMENT_H #include "nodes/parsenodes.h" /*------------------------------------------------------------------ * Function Prototypes -- * * The following prototypes define the public functions of the comment * related routines. CommentObject() implements the SQL "COMMENT ON" * command. DeleteComments() deletes all comments for an object. * CreateComments creates (or deletes, if comment is NULL) a comment * for a specific key. There are versions of these two methods for * both normal and shared objects. *------------------------------------------------------------------ */ extern void CommentObject(CommentStmt *stmt); extern void DeleteComments(Oid oid, Oid classoid, int32 subid); extern void CreateComments(Oid oid, Oid classoid, int32 subid, char *comment); extern void DeleteSharedComments(Oid oid, Oid classoid); extern void CreateSharedComments(Oid oid, Oid classoid, char *comment); extern char *GetComment(Oid oid, Oid classoid, int32 subid); #endif /* COMMENT_H */ PKBiZrserver/commands/seclabel.hnu[/* * seclabel.h * * Prototypes for functions in commands/seclabel.c * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California */ #ifndef SECLABEL_H #define SECLABEL_H #include "catalog/objectaddress.h" /* * Internal APIs */ extern char *GetSecurityLabel(const ObjectAddress *object, const char *provider); extern void SetSecurityLabel(const ObjectAddress *object, const char *provider, const char *label); extern void DeleteSecurityLabel(const ObjectAddress *object); extern void DeleteSharedSecurityLabel(Oid objectId, Oid classId); /* * Statement and ESP hook support */ extern void ExecSecLabelStmt(SecLabelStmt *stmt); typedef void (*check_object_relabel_type) (const ObjectAddress *object, const char *seclabel); extern void register_label_provider(const char *provider, check_object_relabel_type hook); #endif /* SECLABEL_H */ PKBiZ*EEserver/commands/dbcommands.hnu[/*------------------------------------------------------------------------- * * dbcommands.h * Database management commands (create/drop database). * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/commands/dbcommands.h * *------------------------------------------------------------------------- */ #ifndef DBCOMMANDS_H #define DBCOMMANDS_H #include "access/xlog.h" #include "nodes/parsenodes.h" /* XLOG stuff */ #define XLOG_DBASE_CREATE 0x00 #define XLOG_DBASE_DROP 0x10 typedef struct xl_dbase_create_rec_old { /* Records copying of a single subdirectory incl. contents */ Oid db_id; char src_path[1]; /* VARIABLE LENGTH STRING */ /* dst_path follows src_path */ } xl_dbase_create_rec_old; typedef struct xl_dbase_drop_rec_old { /* Records dropping of a single subdirectory incl. contents */ Oid db_id; char dir_path[1]; /* VARIABLE LENGTH STRING */ } xl_dbase_drop_rec_old; typedef struct xl_dbase_create_rec { /* Records copying of a single subdirectory incl. contents */ Oid db_id; Oid tablespace_id; Oid src_db_id; Oid src_tablespace_id; } xl_dbase_create_rec; typedef struct xl_dbase_drop_rec { /* Records dropping of a single subdirectory incl. contents */ Oid db_id; Oid tablespace_id; } xl_dbase_drop_rec; extern void createdb(const CreatedbStmt *stmt); extern void dropdb(const char *dbname, bool missing_ok); extern void RenameDatabase(const char *oldname, const char *newname); extern void AlterDatabase(AlterDatabaseStmt *stmt, bool isTopLevel); extern void AlterDatabaseSet(AlterDatabaseSetStmt *stmt); extern void AlterDatabaseOwner(const char *dbname, Oid newOwnerId); extern Oid get_database_oid(const char *dbname, bool missingok); extern char *get_database_name(Oid dbid); extern void dbase_redo(XLogRecPtr lsn, XLogRecord *rptr); extern void dbase_desc(StringInfo buf, uint8 xl_info, char *rec); extern void check_encoding_locale_matches(int encoding, const char *collate, const char *ctype); #endif /* DBCOMMANDS_H */ PKBiZDz server/commands/explain.hnu[/*------------------------------------------------------------------------- * * explain.h * prototypes for explain.c * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994-5, Regents of the University of California * * src/include/commands/explain.h * *------------------------------------------------------------------------- */ #ifndef EXPLAIN_H #define EXPLAIN_H #include "executor/executor.h" typedef enum ExplainFormat { EXPLAIN_FORMAT_TEXT, EXPLAIN_FORMAT_XML, EXPLAIN_FORMAT_JSON, EXPLAIN_FORMAT_YAML } ExplainFormat; typedef struct ExplainState { StringInfo str; /* output buffer */ /* options */ bool verbose; /* be verbose */ bool analyze; /* print actual times */ bool costs; /* print costs */ bool buffers; /* print buffer usage */ bool timing; /* print timing */ ExplainFormat format; /* output format */ /* other states */ PlannedStmt *pstmt; /* top of plan */ List *rtable; /* range table */ int indent; /* current indentation level */ List *grouping_stack; /* format-specific grouping state */ } ExplainState; /* Hook for plugins to get control in ExplainOneQuery() */ typedef void (*ExplainOneQuery_hook_type) (Query *query, IntoClause *into, ExplainState *es, const char *queryString, ParamListInfo params); extern PGDLLIMPORT ExplainOneQuery_hook_type ExplainOneQuery_hook; /* Hook for plugins to get control in explain_get_index_name() */ typedef const char *(*explain_get_index_name_hook_type) (Oid indexId); extern PGDLLIMPORT explain_get_index_name_hook_type explain_get_index_name_hook; extern void ExplainQuery(ExplainStmt *stmt, const char *queryString, ParamListInfo params, DestReceiver *dest); extern void ExplainInitState(ExplainState *es); extern TupleDesc ExplainResultDesc(ExplainStmt *stmt); extern void ExplainOneUtility(Node *utilityStmt, IntoClause *into, ExplainState *es, const char *queryString, ParamListInfo params); extern void ExplainOnePlan(PlannedStmt *plannedstmt, IntoClause *into, ExplainState *es, const char *queryString, ParamListInfo params); extern void ExplainPrintPlan(ExplainState *es, QueryDesc *queryDesc); extern void ExplainQueryText(ExplainState *es, QueryDesc *queryDesc); extern void ExplainBeginOutput(ExplainState *es); extern void ExplainEndOutput(ExplainState *es); extern void ExplainSeparatePlans(ExplainState *es); extern void ExplainPropertyList(const char *qlabel, List *data, ExplainState *es); extern void ExplainPropertyText(const char *qlabel, const char *value, ExplainState *es); extern void ExplainPropertyInteger(const char *qlabel, int value, ExplainState *es); extern void ExplainPropertyLong(const char *qlabel, long value, ExplainState *es); extern void ExplainPropertyFloat(const char *qlabel, double value, int ndigits, ExplainState *es); #endif /* EXPLAIN_H */ PKBiZhRserver/commands/portalcmds.hnu[/*------------------------------------------------------------------------- * * portalcmds.h * prototypes for portalcmds.c. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/commands/portalcmds.h * *------------------------------------------------------------------------- */ #ifndef PORTALCMDS_H #define PORTALCMDS_H #include "nodes/parsenodes.h" #include "utils/portal.h" extern void PerformCursorOpen(PlannedStmt *stmt, ParamListInfo params, const char *queryString, bool isTopLevel); extern void PerformPortalFetch(FetchStmt *stmt, DestReceiver *dest, char *completionTag); extern void PerformPortalClose(const char *name); extern void PortalCleanup(Portal portal); extern void PersistHoldablePortal(Portal portal); #endif /* PORTALCMDS_H */ PKBiZAQQserver/commands/user.hnu[/*------------------------------------------------------------------------- * * user.h * Commands for manipulating roles (formerly called users). * * * src/include/commands/user.h * *------------------------------------------------------------------------- */ #ifndef USER_H #define USER_H #include "nodes/parsenodes.h" /* Hook to check passwords in CreateRole() and AlterRole() */ #define PASSWORD_TYPE_PLAINTEXT 0 #define PASSWORD_TYPE_MD5 1 typedef void (*check_password_hook_type) (const char *username, const char *password, int password_type, Datum validuntil_time, bool validuntil_null); extern PGDLLIMPORT check_password_hook_type check_password_hook; extern void CreateRole(CreateRoleStmt *stmt); extern void AlterRole(AlterRoleStmt *stmt); extern void AlterRoleSet(AlterRoleSetStmt *stmt); extern void DropRole(DropRoleStmt *stmt); extern void GrantRole(GrantRoleStmt *stmt); extern void RenameRole(const char *oldname, const char *newname); extern void DropOwnedObjects(DropOwnedStmt *stmt); extern void ReassignOwnedObjects(ReassignOwnedStmt *stmt); #endif /* USER_H */ PKBiZěϕserver/commands/prepare.hnu[/*------------------------------------------------------------------------- * * prepare.h * PREPARE, EXECUTE and DEALLOCATE commands, and prepared-stmt storage * * * Copyright (c) 2002-2012, PostgreSQL Global Development Group * * src/include/commands/prepare.h * *------------------------------------------------------------------------- */ #ifndef PREPARE_H #define PREPARE_H #include "commands/explain.h" #include "utils/plancache.h" /* * The data structure representing a prepared statement. This is now just * a thin veneer over a plancache entry --- the main addition is that of * a name. * * Note: all subsidiary storage lives in the referenced plancache entry. */ typedef struct { /* dynahash.c requires key to be first field */ char stmt_name[NAMEDATALEN]; CachedPlanSource *plansource; /* the actual cached plan */ bool from_sql; /* prepared via SQL, not FE/BE protocol? */ TimestampTz prepare_time; /* the time when the stmt was prepared */ } PreparedStatement; /* Utility statements PREPARE, EXECUTE, DEALLOCATE, EXPLAIN EXECUTE */ extern void PrepareQuery(PrepareStmt *stmt, const char *queryString); extern void ExecuteQuery(ExecuteStmt *stmt, IntoClause *intoClause, const char *queryString, ParamListInfo params, DestReceiver *dest, char *completionTag); extern void DeallocateQuery(DeallocateStmt *stmt); extern void ExplainExecuteQuery(ExecuteStmt *execstmt, IntoClause *into, ExplainState *es, const char *queryString, ParamListInfo params); /* Low-level access to stored prepared statements */ extern void StorePreparedStatement(const char *stmt_name, CachedPlanSource *plansource, bool from_sql); extern PreparedStatement *FetchPreparedStatement(const char *stmt_name, bool throwError); extern void DropPreparedStatement(const char *stmt_name, bool showError); extern TupleDesc FetchPreparedStatementResultDesc(PreparedStatement *stmt); extern List *FetchPreparedStatementTargetList(PreparedStatement *stmt); extern void DropAllPreparedStatements(void); #endif /* PREPARE_H */ PKBiZ񉬗server/commands/collationcmds.hnu[/*------------------------------------------------------------------------- * * collationcmds.h * prototypes for collationcmds.c. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/commands/collationcmds.h * *------------------------------------------------------------------------- */ #ifndef COLLATIONCMDS_H #define COLLATIONCMDS_H #include "nodes/parsenodes.h" extern void DefineCollation(List *names, List *parameters); extern void RenameCollation(List *name, const char *newname); extern void AlterCollationOwner(List *name, Oid newOwnerId); extern void AlterCollationOwner_oid(Oid collationOid, Oid newOwnerId); extern void AlterCollationNamespace(List *name, const char *newschema); extern Oid AlterCollationNamespace_oid(Oid collOid, Oid newNspOid); #endif /* COLLATIONCMDS_H */ PKBiZgZ server/commands/conversioncmds.hnu[/*------------------------------------------------------------------------- * * conversioncmds.h * prototypes for conversioncmds.c. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/commands/conversioncmds.h * *------------------------------------------------------------------------- */ #ifndef CONVERSIONCMDS_H #define CONVERSIONCMDS_H #include "nodes/parsenodes.h" extern void CreateConversionCommand(CreateConversionStmt *parsetree); extern void RenameConversion(List *name, const char *newname); extern void AlterConversionOwner(List *name, Oid newOwnerId); extern void AlterConversionOwner_oid(Oid conversionOid, Oid newOwnerId); extern void AlterConversionNamespace(List *name, const char *newschema); extern Oid AlterConversionNamespace_oid(Oid convOid, Oid newNspOid); #endif /* CONVERSIONCMDS_H */ PKBiZE oJ  server/commands/tablespace.hnu[/*------------------------------------------------------------------------- * * tablespace.h * Tablespace management commands (create/drop tablespace). * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/commands/tablespace.h * *------------------------------------------------------------------------- */ #ifndef TABLESPACE_H #define TABLESPACE_H #include "access/xlog.h" #include "nodes/parsenodes.h" /* XLOG stuff */ #define XLOG_TBLSPC_CREATE 0x00 #define XLOG_TBLSPC_DROP 0x10 typedef struct xl_tblspc_create_rec { Oid ts_id; char ts_path[1]; /* VARIABLE LENGTH STRING */ } xl_tblspc_create_rec; typedef struct xl_tblspc_drop_rec { Oid ts_id; } xl_tblspc_drop_rec; typedef struct TableSpaceOpts { int32 vl_len_; /* varlena header (do not touch directly!) */ float8 random_page_cost; float8 seq_page_cost; } TableSpaceOpts; extern void CreateTableSpace(CreateTableSpaceStmt *stmt); extern void DropTableSpace(DropTableSpaceStmt *stmt); extern void RenameTableSpace(const char *oldname, const char *newname); extern void AlterTableSpaceOwner(const char *name, Oid newOwnerId); extern void AlterTableSpaceOptions(AlterTableSpaceOptionsStmt *stmt); extern void TablespaceCreateDbspace(Oid spcNode, Oid dbNode, bool isRedo); extern Oid GetDefaultTablespace(char relpersistence); extern void PrepareTempTablespaces(void); extern Oid get_tablespace_oid(const char *tablespacename, bool missing_ok); extern char *get_tablespace_name(Oid spc_oid); extern bool directory_is_empty(const char *path); extern void tblspc_redo(XLogRecPtr lsn, XLogRecord *rptr); extern void tblspc_desc(StringInfo buf, uint8 xl_info, char *rec); #endif /* TABLESPACE_H */ PKBiZ͔//server/commands/lockcmds.hnu[/*------------------------------------------------------------------------- * * lockcmds.h * prototypes for lockcmds.c. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/commands/lockcmds.h * *------------------------------------------------------------------------- */ #ifndef LOCKCMDS_H #define LOCKCMDS_H #include "nodes/parsenodes.h" /* * LOCK */ extern void LockTableCommand(LockStmt *lockstmt); #endif /* LOCKCMDS_H */ PKBiZ_server/commands/proclang.hnu[/* * src/include/commands/proclang.h * *------------------------------------------------------------------------- * * proclang.h * prototypes for proclang.c. * * *------------------------------------------------------------------------- */ #ifndef PROCLANG_H #define PROCLANG_H #include "nodes/parsenodes.h" extern void CreateProceduralLanguage(CreatePLangStmt *stmt); extern void DropProceduralLanguageById(Oid langOid); extern void RenameLanguage(const char *oldname, const char *newname); extern void AlterLanguageOwner(const char *name, Oid newOwnerId); extern void AlterLanguageOwner_oid(Oid oid, Oid newOwnerId); extern bool PLTemplateExists(const char *languageName); extern Oid get_language_oid(const char *langname, bool missing_ok); #endif /* PROCLANG_H */ PKBiZ93server/commands/alter.hnu[/*------------------------------------------------------------------------- * * alter.h * prototypes for commands/alter.c * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/commands/alter.h * *------------------------------------------------------------------------- */ #ifndef ALTER_H #define ALTER_H #include "catalog/dependency.h" #include "utils/acl.h" #include "utils/relcache.h" extern void ExecRenameStmt(RenameStmt *stmt); extern void ExecAlterObjectSchemaStmt(AlterObjectSchemaStmt *stmt); extern Oid AlterObjectNamespace_oid(Oid classId, Oid objid, Oid nspOid, ObjectAddresses *objsMoved); extern Oid AlterObjectNamespace(Relation rel, int oidCacheId, int nameCacheId, Oid objid, Oid nspOid, int Anum_name, int Anum_namespace, int Anum_owner, AclObjectKind acl_kind); extern void ExecAlterOwnerStmt(AlterOwnerStmt *stmt); #endif /* ALTER_H */ PKBiZ^L!!server/commands/createas.hnu[/*------------------------------------------------------------------------- * * createas.h * prototypes for createas.c. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/commands/createas.h * *------------------------------------------------------------------------- */ #ifndef CREATEAS_H #define CREATEAS_H #include "nodes/params.h" #include "nodes/parsenodes.h" #include "tcop/dest.h" extern void ExecCreateTableAs(CreateTableAsStmt *stmt, const char *queryString, ParamListInfo params, char *completionTag); extern int GetIntoRelEFlags(IntoClause *intoClause); extern DestReceiver *CreateIntoRelDestReceiver(IntoClause *intoClause); #endif /* CREATEAS_H */ PKBiZ3^server/commands/typecmds.hnu[/*------------------------------------------------------------------------- * * typecmds.h * prototypes for typecmds.c. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/commands/typecmds.h * *------------------------------------------------------------------------- */ #ifndef TYPECMDS_H #define TYPECMDS_H #include "access/htup.h" #include "catalog/dependency.h" #include "nodes/parsenodes.h" #define DEFAULT_TYPDELIM ',' extern void DefineType(List *names, List *parameters); extern void RemoveTypeById(Oid typeOid); extern void DefineDomain(CreateDomainStmt *stmt); extern void DefineEnum(CreateEnumStmt *stmt); extern void DefineRange(CreateRangeStmt *stmt); extern void AlterEnum(AlterEnumStmt *stmt); extern Oid DefineCompositeType(RangeVar *typevar, List *coldeflist); extern Oid AssignTypeArrayOid(void); extern void AlterDomainDefault(List *names, Node *defaultRaw); extern void AlterDomainNotNull(List *names, bool notNull); extern void AlterDomainAddConstraint(List *names, Node *constr); extern void AlterDomainValidateConstraint(List *names, char *constrName); extern void AlterDomainDropConstraint(List *names, const char *constrName, DropBehavior behavior, bool missing_ok); extern void checkDomainOwner(HeapTuple tup); extern List *GetDomainConstraints(Oid typeOid); extern void RenameType(RenameStmt *stmt); extern void AlterTypeOwner(List *names, Oid newOwnerId, ObjectType objecttype); extern void AlterTypeOwner_oid(Oid typeOid, Oid newOwnerId, bool hasDependEntry); extern void AlterTypeOwnerInternal(Oid typeOid, Oid newOwnerId); extern void AlterTypeNamespace(List *names, const char *newschema, ObjectType objecttype); extern Oid AlterTypeNamespace_oid(Oid typeOid, Oid nspOid, ObjectAddresses *objsMoved); extern Oid AlterTypeNamespaceInternal(Oid typeOid, Oid nspOid, bool isImplicitArray, bool errorOnTableType, ObjectAddresses *objsMoved); #endif /* TYPECMDS_H */ PKBiZj=*V V server/commands/tablecmds.hnu[/*------------------------------------------------------------------------- * * tablecmds.h * prototypes for tablecmds.c. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/commands/tablecmds.h * *------------------------------------------------------------------------- */ #ifndef TABLECMDS_H #define TABLECMDS_H #include "access/htup.h" #include "catalog/dependency.h" #include "nodes/parsenodes.h" #include "storage/lock.h" #include "utils/relcache.h" extern Oid DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId); extern void RemoveRelations(DropStmt *drop); extern Oid AlterTableLookupRelation(AlterTableStmt *stmt, LOCKMODE lockmode); extern void AlterTable(Oid relid, LOCKMODE lockmode, AlterTableStmt *stmt); extern LOCKMODE AlterTableGetLockLevel(List *cmds); extern void ATExecChangeOwner(Oid relationOid, Oid newOwnerId, bool recursing, LOCKMODE lockmode); extern void AlterTableInternal(Oid relid, List *cmds, bool recurse); extern void AlterTableNamespace(AlterObjectSchemaStmt *stmt); extern void AlterTableNamespaceInternal(Relation rel, Oid oldNspOid, Oid nspOid, ObjectAddresses *objsMoved); extern void AlterRelationNamespaceInternal(Relation classRel, Oid relOid, Oid oldNspOid, Oid newNspOid, bool hasDependEntry, ObjectAddresses *objsMoved); extern void CheckTableNotInUse(Relation rel, const char *stmt); extern void ExecuteTruncate(TruncateStmt *stmt); extern void SetRelationHasSubclass(Oid relationId, bool relhassubclass); extern void renameatt(RenameStmt *stmt); extern void RenameConstraint(RenameStmt *stmt); extern void RenameRelation(RenameStmt *stmt); extern void RenameRelationInternal(Oid myrelid, const char *newrelname); extern void find_composite_type_dependencies(Oid typeOid, Relation origRelation, const char *origTypeName); extern void check_of_type(HeapTuple typetuple); extern void register_on_commit_action(Oid relid, OnCommitAction action); extern void remove_on_commit_action(Oid relid); extern void PreCommit_on_commit_actions(void); extern void AtEOXact_on_commit_actions(bool isCommit); extern void AtEOSubXact_on_commit_actions(bool isCommit, SubTransactionId mySubid, SubTransactionId parentSubid); extern void RangeVarCallbackOwnsTable(const RangeVar *relation, Oid relId, Oid oldRelId, void *arg); extern void RangeVarCallbackOwnsRelation(const RangeVar *relation, Oid relId, Oid oldRelId, void *noCatalogs); #endif /* TABLECMDS_H */ PKBiZn   server/commands/vacuum.hnu[/*------------------------------------------------------------------------- * * vacuum.h * header file for postgres vacuum cleaner and statistics analyzer * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/commands/vacuum.h * *------------------------------------------------------------------------- */ #ifndef VACUUM_H #define VACUUM_H #include "access/htup.h" #include "catalog/pg_statistic.h" #include "catalog/pg_type.h" #include "nodes/parsenodes.h" #include "storage/buf.h" #include "storage/lock.h" #include "utils/relcache.h" /*---------- * ANALYZE builds one of these structs for each attribute (column) that is * to be analyzed. The struct and subsidiary data are in anl_context, * so they live until the end of the ANALYZE operation. * * The type-specific typanalyze function is passed a pointer to this struct * and must return TRUE to continue analysis, FALSE to skip analysis of this * column. In the TRUE case it must set the compute_stats and minrows fields, * and can optionally set extra_data to pass additional info to compute_stats. * minrows is its request for the minimum number of sample rows to be gathered * (but note this request might not be honored, eg if there are fewer rows * than that in the table). * * The compute_stats routine will be called after sample rows have been * gathered. Aside from this struct, it is passed: * fetchfunc: a function for accessing the column values from the * sample rows * samplerows: the number of sample tuples * totalrows: estimated total number of rows in relation * The fetchfunc may be called with rownum running from 0 to samplerows-1. * It returns a Datum and an isNull flag. * * compute_stats should set stats_valid TRUE if it is able to compute * any useful statistics. If it does, the remainder of the struct holds * the information to be stored in a pg_statistic row for the column. Be * careful to allocate any pointed-to data in anl_context, which will NOT * be CurrentMemoryContext when compute_stats is called. * * Note: for the moment, all comparisons done for statistical purposes * should use the database's default collation (DEFAULT_COLLATION_OID). * This might change in some future release. *---------- */ typedef struct VacAttrStats *VacAttrStatsP; typedef Datum (*AnalyzeAttrFetchFunc) (VacAttrStatsP stats, int rownum, bool *isNull); typedef void (*AnalyzeAttrComputeStatsFunc) (VacAttrStatsP stats, AnalyzeAttrFetchFunc fetchfunc, int samplerows, double totalrows); typedef struct VacAttrStats { /* * These fields are set up by the main ANALYZE code before invoking the * type-specific typanalyze function. * * Note: do not assume that the data being analyzed has the same datatype * shown in attr, ie do not trust attr->atttypid, attlen, etc. This is * because some index opclasses store a different type than the underlying * column/expression. Instead use attrtypid, attrtypmod, and attrtype for * information about the datatype being fed to the typanalyze function. */ Form_pg_attribute attr; /* copy of pg_attribute row for column */ Oid attrtypid; /* type of data being analyzed */ int32 attrtypmod; /* typmod of data being analyzed */ Form_pg_type attrtype; /* copy of pg_type row for attrtypid */ MemoryContext anl_context; /* where to save long-lived data */ /* * These fields must be filled in by the typanalyze routine, unless it * returns FALSE. */ AnalyzeAttrComputeStatsFunc compute_stats; /* function pointer */ int minrows; /* Minimum # of rows wanted for stats */ void *extra_data; /* for extra type-specific data */ /* * These fields are to be filled in by the compute_stats routine. (They * are initialized to zero when the struct is created.) */ bool stats_valid; float4 stanullfrac; /* fraction of entries that are NULL */ int4 stawidth; /* average width of column values */ float4 stadistinct; /* # distinct values */ int2 stakind[STATISTIC_NUM_SLOTS]; Oid staop[STATISTIC_NUM_SLOTS]; int numnumbers[STATISTIC_NUM_SLOTS]; float4 *stanumbers[STATISTIC_NUM_SLOTS]; int numvalues[STATISTIC_NUM_SLOTS]; Datum *stavalues[STATISTIC_NUM_SLOTS]; /* * These fields describe the stavalues[n] element types. They will be * initialized to match attrtypid, but a custom typanalyze function might * want to store an array of something other than the analyzed column's * elements. It should then overwrite these fields. */ Oid statypid[STATISTIC_NUM_SLOTS]; int2 statyplen[STATISTIC_NUM_SLOTS]; bool statypbyval[STATISTIC_NUM_SLOTS]; char statypalign[STATISTIC_NUM_SLOTS]; /* * These fields are private to the main ANALYZE code and should not be * looked at by type-specific functions. */ int tupattnum; /* attribute number within tuples */ HeapTuple *rows; /* access info for std fetch function */ TupleDesc tupDesc; Datum *exprvals; /* access info for index fetch function */ bool *exprnulls; int rowstride; } VacAttrStats; /* GUC parameters */ extern PGDLLIMPORT int default_statistics_target; /* PGDLLIMPORT for * PostGIS */ extern int vacuum_freeze_min_age; extern int vacuum_freeze_table_age; /* in commands/vacuum.c */ extern void vacuum(VacuumStmt *vacstmt, Oid relid, bool do_toast, BufferAccessStrategy bstrategy, bool for_wraparound, bool isTopLevel); extern void vac_open_indexes(Relation relation, LOCKMODE lockmode, int *nindexes, Relation **Irel); extern void vac_close_indexes(int nindexes, Relation *Irel, LOCKMODE lockmode); extern double vac_estimate_reltuples(Relation relation, bool is_analyze, BlockNumber total_pages, BlockNumber scanned_pages, double scanned_tuples); extern void vac_update_relstats(Relation relation, BlockNumber num_pages, double num_tuples, BlockNumber num_all_visible_pages, bool hasindex, TransactionId frozenxid, bool in_outer_xact); extern void vacuum_set_xid_limits(int freeze_min_age, int freeze_table_age, bool sharedRel, TransactionId *oldestXmin, TransactionId *freezeLimit, TransactionId *freezeTableLimit); extern void vac_update_datfrozenxid(void); extern void vacuum_delay_point(void); /* in commands/vacuumlazy.c */ extern void lazy_vacuum_rel(Relation onerel, VacuumStmt *vacstmt, BufferAccessStrategy bstrategy); /* in commands/analyze.c */ extern void analyze_rel(Oid relid, VacuumStmt *vacstmt, bool in_outer_xact, BufferAccessStrategy bstrategy); extern bool std_typanalyze(VacAttrStats *stats); extern double anl_random_fract(void); extern double anl_init_selection_state(int n); extern double anl_get_next_S(double t, int n, double *stateptr); #endif /* VACUUM_H */ PKBiZeserver/commands/extension.hnu[/*------------------------------------------------------------------------- * * extension.h * Extension management commands (create/drop extension). * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/commands/extension.h * *------------------------------------------------------------------------- */ #ifndef EXTENSION_H #define EXTENSION_H #include "nodes/parsenodes.h" /* * creating_extension is only true while running a CREATE EXTENSION command. * It instructs recordDependencyOnCurrentExtension() to register a dependency * on the current pg_extension object for each SQL object created by its * installation script. */ extern bool creating_extension; extern Oid CurrentExtensionObject; extern void CreateExtension(CreateExtensionStmt *stmt); extern void RemoveExtensionById(Oid extId); extern Oid InsertExtensionTuple(const char *extName, Oid extOwner, Oid schemaOid, bool relocatable, const char *extVersion, Datum extConfig, Datum extCondition, List *requiredExtensions); extern void ExecAlterExtensionStmt(AlterExtensionStmt *stmt); extern void ExecAlterExtensionContentsStmt(AlterExtensionContentsStmt *stmt); extern Oid get_extension_oid(const char *extname, bool missing_ok); extern char *get_extension_name(Oid ext_oid); extern void AlterExtensionNamespace(List *names, const char *newschema); extern void AlterExtensionOwner_oid(Oid extensionOid, Oid newOwnerId); #endif /* EXTENSION_H */ PKBiZ"*server/commands/sequence.hnu[/*------------------------------------------------------------------------- * * sequence.h * prototypes for sequence.c. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/commands/sequence.h * *------------------------------------------------------------------------- */ #ifndef SEQUENCE_H #define SEQUENCE_H #include "access/xlog.h" #include "fmgr.h" #include "nodes/parsenodes.h" #include "storage/relfilenode.h" typedef struct FormData_pg_sequence { NameData sequence_name; int64 last_value; int64 start_value; int64 increment_by; int64 max_value; int64 min_value; int64 cache_value; int64 log_cnt; bool is_cycled; bool is_called; } FormData_pg_sequence; typedef FormData_pg_sequence *Form_pg_sequence; /* * Columns of a sequence relation */ #define SEQ_COL_NAME 1 #define SEQ_COL_LASTVAL 2 #define SEQ_COL_STARTVAL 3 #define SEQ_COL_INCBY 4 #define SEQ_COL_MAXVALUE 5 #define SEQ_COL_MINVALUE 6 #define SEQ_COL_CACHE 7 #define SEQ_COL_LOG 8 #define SEQ_COL_CYCLE 9 #define SEQ_COL_CALLED 10 #define SEQ_COL_FIRSTCOL SEQ_COL_NAME #define SEQ_COL_LASTCOL SEQ_COL_CALLED /* XLOG stuff */ #define XLOG_SEQ_LOG 0x00 typedef struct xl_seq_rec { RelFileNode node; /* SEQUENCE TUPLE DATA FOLLOWS AT THE END */ } xl_seq_rec; extern Datum nextval(PG_FUNCTION_ARGS); extern Datum nextval_oid(PG_FUNCTION_ARGS); extern Datum currval_oid(PG_FUNCTION_ARGS); extern Datum setval_oid(PG_FUNCTION_ARGS); extern Datum setval3_oid(PG_FUNCTION_ARGS); extern Datum lastval(PG_FUNCTION_ARGS); extern Datum pg_sequence_parameters(PG_FUNCTION_ARGS); extern void DefineSequence(CreateSeqStmt *stmt); extern void AlterSequence(AlterSeqStmt *stmt); extern void ResetSequence(Oid seq_relid); extern void seq_redo(XLogRecPtr lsn, XLogRecord *rptr); extern void seq_desc(StringInfo buf, uint8 xl_info, char *rec); #endif /* SEQUENCE_H */ PKBiZiqserver/commands/defrem.hnu[/*------------------------------------------------------------------------- * * defrem.h * POSTGRES define and remove utility definitions. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/commands/defrem.h * *------------------------------------------------------------------------- */ #ifndef DEFREM_H #define DEFREM_H #include "nodes/parsenodes.h" /* commands/dropcmds.c */ extern void RemoveObjects(DropStmt *stmt); /* commands/indexcmds.c */ extern Oid DefineIndex(Oid relationId, IndexStmt *stmt, Oid indexRelationId, bool is_alter_table, bool check_rights, bool skip_build, bool quiet); extern void ReindexIndex(RangeVar *indexRelation); extern void ReindexTable(RangeVar *relation); extern void ReindexDatabase(const char *databaseName, bool do_system, bool do_user); extern char *makeObjectName(const char *name1, const char *name2, const char *label); extern char *ChooseRelationName(const char *name1, const char *name2, const char *label, Oid namespaceid); extern bool CheckIndexCompatible(Oid oldId, char *accessMethodName, List *attributeList, List *exclusionOpNames); extern Oid GetDefaultOpClass(Oid type_id, Oid am_id); /* commands/functioncmds.c */ extern void CreateFunction(CreateFunctionStmt *stmt, const char *queryString); extern void RemoveFunctionById(Oid funcOid); extern void SetFunctionReturnType(Oid funcOid, Oid newRetType); extern void SetFunctionArgType(Oid funcOid, int argIndex, Oid newArgType); extern void RenameFunction(List *name, List *argtypes, const char *newname); extern void AlterFunctionOwner(List *name, List *argtypes, Oid newOwnerId); extern void AlterFunctionOwner_oid(Oid procOid, Oid newOwnerId); extern void AlterFunction(AlterFunctionStmt *stmt); extern void CreateCast(CreateCastStmt *stmt); extern void DropCastById(Oid castOid); extern void AlterFunctionNamespace(List *name, List *argtypes, bool isagg, const char *newschema); extern Oid AlterFunctionNamespace_oid(Oid procOid, Oid nspOid); extern void ExecuteDoStmt(DoStmt *stmt); extern Oid get_cast_oid(Oid sourcetypeid, Oid targettypeid, bool missing_ok); /* commands/operatorcmds.c */ extern void DefineOperator(List *names, List *parameters); extern void RemoveOperatorById(Oid operOid); extern void AlterOperatorOwner(List *name, TypeName *typeName1, TypeName *typename2, Oid newOwnerId); extern void AlterOperatorOwner_oid(Oid operOid, Oid newOwnerId); extern void AlterOperatorNamespace(List *names, List *argtypes, const char *newschema); extern Oid AlterOperatorNamespace_oid(Oid operOid, Oid newNspOid); /* commands/aggregatecmds.c */ extern void DefineAggregate(List *name, List *args, bool oldstyle, List *parameters); extern void RenameAggregate(List *name, List *args, const char *newname); extern void AlterAggregateOwner(List *name, List *args, Oid newOwnerId); /* commands/opclasscmds.c */ extern void DefineOpClass(CreateOpClassStmt *stmt); extern void DefineOpFamily(CreateOpFamilyStmt *stmt); extern void AlterOpFamily(AlterOpFamilyStmt *stmt); extern void RemoveOpClassById(Oid opclassOid); extern void RemoveOpFamilyById(Oid opfamilyOid); extern void RemoveAmOpEntryById(Oid entryOid); extern void RemoveAmProcEntryById(Oid entryOid); extern void RenameOpClass(List *name, const char *access_method, const char *newname); extern void RenameOpFamily(List *name, const char *access_method, const char *newname); extern void AlterOpClassOwner(List *name, const char *access_method, Oid newOwnerId); extern void AlterOpClassOwner_oid(Oid opclassOid, Oid newOwnerId); extern void AlterOpClassNamespace(List *name, char *access_method, const char *newschema); extern Oid AlterOpClassNamespace_oid(Oid opclassOid, Oid newNspOid); extern void AlterOpFamilyOwner(List *name, const char *access_method, Oid newOwnerId); extern void AlterOpFamilyOwner_oid(Oid opfamilyOid, Oid newOwnerId); extern void AlterOpFamilyNamespace(List *name, char *access_method, const char *newschema); extern Oid AlterOpFamilyNamespace_oid(Oid opfamilyOid, Oid newNspOid); extern Oid get_am_oid(const char *amname, bool missing_ok); extern Oid get_opclass_oid(Oid amID, List *opclassname, bool missing_ok); extern Oid get_opfamily_oid(Oid amID, List *opfamilyname, bool missing_ok); /* commands/tsearchcmds.c */ extern void DefineTSParser(List *names, List *parameters); extern void RenameTSParser(List *oldname, const char *newname); extern void AlterTSParserNamespace(List *name, const char *newschema); extern Oid AlterTSParserNamespace_oid(Oid prsId, Oid newNspOid); extern void RemoveTSParserById(Oid prsId); extern void DefineTSDictionary(List *names, List *parameters); extern void RenameTSDictionary(List *oldname, const char *newname); extern void RemoveTSDictionaryById(Oid dictId); extern void AlterTSDictionary(AlterTSDictionaryStmt *stmt); extern void AlterTSDictionaryOwner(List *name, Oid newOwnerId); extern void AlterTSDictionaryOwner_oid(Oid dictId, Oid newOwnerId); extern void AlterTSDictionaryNamespace(List *name, const char *newschema); extern Oid AlterTSDictionaryNamespace_oid(Oid dictId, Oid newNspOid); extern void DefineTSTemplate(List *names, List *parameters); extern void RenameTSTemplate(List *oldname, const char *newname); extern void AlterTSTemplateNamespace(List *name, const char *newschema); extern Oid AlterTSTemplateNamespace_oid(Oid tmplId, Oid newNspOid); extern void RemoveTSTemplateById(Oid tmplId); extern void DefineTSConfiguration(List *names, List *parameters); extern void RenameTSConfiguration(List *oldname, const char *newname); extern void RemoveTSConfigurationById(Oid cfgId); extern void AlterTSConfiguration(AlterTSConfigurationStmt *stmt); extern void AlterTSConfigurationOwner(List *name, Oid newOwnerId); extern void AlterTSConfigurationOwner_oid(Oid cfgId, Oid newOwnerId); extern void AlterTSConfigurationNamespace(List *name, const char *newschema); extern Oid AlterTSConfigurationNamespace_oid(Oid cfgId, Oid newNspOid); extern text *serialize_deflist(List *deflist); extern List *deserialize_deflist(Datum txt); /* commands/foreigncmds.c */ extern void RenameForeignServer(const char *oldname, const char *newname); extern void RenameForeignDataWrapper(const char *oldname, const char *newname); extern void AlterForeignServerOwner(const char *name, Oid newOwnerId); extern void AlterForeignServerOwner_oid(Oid, Oid newOwnerId); extern void AlterForeignDataWrapperOwner(const char *name, Oid newOwnerId); extern void AlterForeignDataWrapperOwner_oid(Oid fwdId, Oid newOwnerId); extern void CreateForeignDataWrapper(CreateFdwStmt *stmt); extern void AlterForeignDataWrapper(AlterFdwStmt *stmt); extern void RemoveForeignDataWrapperById(Oid fdwId); extern void CreateForeignServer(CreateForeignServerStmt *stmt); extern void AlterForeignServer(AlterForeignServerStmt *stmt); extern void RemoveForeignServerById(Oid srvId); extern void CreateUserMapping(CreateUserMappingStmt *stmt); extern void AlterUserMapping(AlterUserMappingStmt *stmt); extern void RemoveUserMapping(DropUserMappingStmt *stmt); extern void RemoveUserMappingById(Oid umId); extern void CreateForeignTable(CreateForeignTableStmt *stmt, Oid relid); extern Datum transformGenericOptions(Oid catalogId, Datum oldOptions, List *options, Oid fdwvalidator); /* support routines in commands/define.c */ extern char *defGetString(DefElem *def); extern double defGetNumeric(DefElem *def); extern bool defGetBoolean(DefElem *def); extern int64 defGetInt64(DefElem *def); extern List *defGetQualifiedName(DefElem *def); extern TypeName *defGetTypeName(DefElem *def); extern int defGetTypeLength(DefElem *def); extern DefElem *defWithOids(bool value); #endif /* DEFREM_H */ PKBiZdMserver/commands/cluster.hnu[/*------------------------------------------------------------------------- * * cluster.h * header file for postgres cluster command stuff * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994-5, Regents of the University of California * * src/include/commands/cluster.h * *------------------------------------------------------------------------- */ #ifndef CLUSTER_H #define CLUSTER_H #include "nodes/parsenodes.h" #include "storage/lock.h" #include "utils/relcache.h" extern void cluster(ClusterStmt *stmt, bool isTopLevel); extern void cluster_rel(Oid tableOid, Oid indexOid, bool recheck, bool verbose, int freeze_min_age, int freeze_table_age); extern void check_index_is_clusterable(Relation OldHeap, Oid indexOid, bool recheck, LOCKMODE lockmode); extern void mark_index_clustered(Relation rel, Oid indexOid); extern Oid make_new_heap(Oid OIDOldHeap, Oid NewTableSpace); extern void finish_heap_swap(Oid OIDOldHeap, Oid OIDNewHeap, bool is_system_catalog, bool swap_toast_by_content, bool check_constraints, TransactionId frozenXid); #endif /* CLUSTER_H */ PKBiZ^server/commands/view.hnu[/*------------------------------------------------------------------------- * * view.h * * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/commands/view.h * *------------------------------------------------------------------------- */ #ifndef VIEW_H #define VIEW_H #include "nodes/parsenodes.h" extern void DefineView(ViewStmt *stmt, const char *queryString); #endif /* VIEW_H */ PKBiZF?om((server/commands/async.hnu[/*------------------------------------------------------------------------- * * async.h * Asynchronous notification: NOTIFY, LISTEN, UNLISTEN * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/commands/async.h * *------------------------------------------------------------------------- */ #ifndef ASYNC_H #define ASYNC_H #include "fmgr.h" /* * The number of SLRU page buffers we use for the notification queue. */ #define NUM_ASYNC_BUFFERS 8 extern bool Trace_notify; extern Size AsyncShmemSize(void); extern void AsyncShmemInit(void); /* notify-related SQL statements */ extern void Async_Notify(const char *channel, const char *payload); extern void Async_Listen(const char *channel); extern void Async_Unlisten(const char *channel); extern void Async_UnlistenAll(void); /* notify-related SQL functions */ extern Datum pg_listening_channels(PG_FUNCTION_ARGS); extern Datum pg_notify(PG_FUNCTION_ARGS); /* perform (or cancel) outbound notify processing at transaction commit */ extern void PreCommit_Notify(void); extern void AtCommit_Notify(void); extern void AtAbort_Notify(void); extern void AtSubStart_Notify(void); extern void AtSubCommit_Notify(void); extern void AtSubAbort_Notify(void); extern void AtPrepare_Notify(void); extern void ProcessCompletedNotifies(void); /* signal handler for inbound notifies (PROCSIG_NOTIFY_INTERRUPT) */ extern void HandleNotifyInterrupt(void); /* * enable/disable processing of inbound notifies directly from signal handler. * The enable routine first performs processing of any inbound notifies that * have occurred since the last disable. */ extern void EnableNotifyInterrupt(void); extern bool DisableNotifyInterrupt(void); #endif /* ASYNC_H */ PKBiZserver/commands/trigger.hnu[/*------------------------------------------------------------------------- * * trigger.h * Declarations for trigger handling. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/commands/trigger.h * *------------------------------------------------------------------------- */ #ifndef TRIGGER_H #define TRIGGER_H #include "nodes/execnodes.h" #include "nodes/parsenodes.h" /* * TriggerData is the node type that is passed as fmgr "context" info * when a function is called by the trigger manager. */ #define CALLED_AS_TRIGGER(fcinfo) \ ((fcinfo)->context != NULL && IsA((fcinfo)->context, TriggerData)) typedef uint32 TriggerEvent; typedef struct TriggerData { NodeTag type; TriggerEvent tg_event; Relation tg_relation; HeapTuple tg_trigtuple; HeapTuple tg_newtuple; Trigger *tg_trigger; Buffer tg_trigtuplebuf; Buffer tg_newtuplebuf; } TriggerData; /* * TriggerEvent bit flags * * Note that we assume different event types (INSERT/DELETE/UPDATE/TRUNCATE) * can't be OR'd together in a single TriggerEvent. This is unlike the * situation for pg_trigger rows, so pg_trigger.tgtype uses a different * representation! */ #define TRIGGER_EVENT_INSERT 0x00000000 #define TRIGGER_EVENT_DELETE 0x00000001 #define TRIGGER_EVENT_UPDATE 0x00000002 #define TRIGGER_EVENT_TRUNCATE 0x00000003 #define TRIGGER_EVENT_OPMASK 0x00000003 #define TRIGGER_EVENT_ROW 0x00000004 #define TRIGGER_EVENT_BEFORE 0x00000008 #define TRIGGER_EVENT_AFTER 0x00000000 #define TRIGGER_EVENT_INSTEAD 0x00000010 #define TRIGGER_EVENT_TIMINGMASK 0x00000018 /* More TriggerEvent flags, used only within trigger.c */ #define AFTER_TRIGGER_DEFERRABLE 0x00000020 #define AFTER_TRIGGER_INITDEFERRED 0x00000040 #define TRIGGER_FIRED_BY_INSERT(event) \ (((event) & TRIGGER_EVENT_OPMASK) == TRIGGER_EVENT_INSERT) #define TRIGGER_FIRED_BY_DELETE(event) \ (((event) & TRIGGER_EVENT_OPMASK) == TRIGGER_EVENT_DELETE) #define TRIGGER_FIRED_BY_UPDATE(event) \ (((event) & TRIGGER_EVENT_OPMASK) == TRIGGER_EVENT_UPDATE) #define TRIGGER_FIRED_BY_TRUNCATE(event) \ (((event) & TRIGGER_EVENT_OPMASK) == TRIGGER_EVENT_TRUNCATE) #define TRIGGER_FIRED_FOR_ROW(event) \ ((event) & TRIGGER_EVENT_ROW) #define TRIGGER_FIRED_FOR_STATEMENT(event) \ (!TRIGGER_FIRED_FOR_ROW(event)) #define TRIGGER_FIRED_BEFORE(event) \ (((event) & TRIGGER_EVENT_TIMINGMASK) == TRIGGER_EVENT_BEFORE) #define TRIGGER_FIRED_AFTER(event) \ (((event) & TRIGGER_EVENT_TIMINGMASK) == TRIGGER_EVENT_AFTER) #define TRIGGER_FIRED_INSTEAD(event) \ (((event) & TRIGGER_EVENT_TIMINGMASK) == TRIGGER_EVENT_INSTEAD) /* * Definitions for replication role based firing. */ #define SESSION_REPLICATION_ROLE_ORIGIN 0 #define SESSION_REPLICATION_ROLE_REPLICA 1 #define SESSION_REPLICATION_ROLE_LOCAL 2 extern PGDLLIMPORT int SessionReplicationRole; /* * States at which a trigger can be fired. These are the * possible values for pg_trigger.tgenabled. */ #define TRIGGER_FIRES_ON_ORIGIN 'O' #define TRIGGER_FIRES_ALWAYS 'A' #define TRIGGER_FIRES_ON_REPLICA 'R' #define TRIGGER_DISABLED 'D' extern Oid CreateTrigger(CreateTrigStmt *stmt, const char *queryString, Oid relOid, Oid refRelOid, Oid constraintOid, Oid indexOid, bool isInternal); extern void RemoveTriggerById(Oid trigOid); extern Oid get_trigger_oid(Oid relid, const char *name, bool missing_ok); extern void renametrig(RenameStmt *stmt); extern void EnableDisableTrigger(Relation rel, const char *tgname, char fires_when, bool skip_system); extern void RelationBuildTriggers(Relation relation); extern TriggerDesc *CopyTriggerDesc(TriggerDesc *trigdesc); extern void FreeTriggerDesc(TriggerDesc *trigdesc); extern void ExecBSInsertTriggers(EState *estate, ResultRelInfo *relinfo); extern void ExecASInsertTriggers(EState *estate, ResultRelInfo *relinfo); extern TupleTableSlot *ExecBRInsertTriggers(EState *estate, ResultRelInfo *relinfo, TupleTableSlot *slot); extern void ExecARInsertTriggers(EState *estate, ResultRelInfo *relinfo, HeapTuple trigtuple, List *recheckIndexes); extern TupleTableSlot *ExecIRInsertTriggers(EState *estate, ResultRelInfo *relinfo, TupleTableSlot *slot); extern void ExecBSDeleteTriggers(EState *estate, ResultRelInfo *relinfo); extern void ExecASDeleteTriggers(EState *estate, ResultRelInfo *relinfo); extern bool ExecBRDeleteTriggers(EState *estate, EPQState *epqstate, ResultRelInfo *relinfo, ItemPointer tupleid); extern void ExecARDeleteTriggers(EState *estate, ResultRelInfo *relinfo, ItemPointer tupleid); extern bool ExecIRDeleteTriggers(EState *estate, ResultRelInfo *relinfo, HeapTuple trigtuple); extern void ExecBSUpdateTriggers(EState *estate, ResultRelInfo *relinfo); extern void ExecASUpdateTriggers(EState *estate, ResultRelInfo *relinfo); extern TupleTableSlot *ExecBRUpdateTriggers(EState *estate, EPQState *epqstate, ResultRelInfo *relinfo, ItemPointer tupleid, TupleTableSlot *slot); extern void ExecARUpdateTriggers(EState *estate, ResultRelInfo *relinfo, ItemPointer tupleid, HeapTuple newtuple, List *recheckIndexes); extern TupleTableSlot *ExecIRUpdateTriggers(EState *estate, ResultRelInfo *relinfo, HeapTuple trigtuple, TupleTableSlot *slot); extern void ExecBSTruncateTriggers(EState *estate, ResultRelInfo *relinfo); extern void ExecASTruncateTriggers(EState *estate, ResultRelInfo *relinfo); extern void AfterTriggerBeginXact(void); extern void AfterTriggerBeginQuery(void); extern void AfterTriggerEndQuery(EState *estate); extern void AfterTriggerFireDeferred(void); extern void AfterTriggerEndXact(bool isCommit); extern void AfterTriggerBeginSubXact(void); extern void AfterTriggerEndSubXact(bool isCommit); extern void AfterTriggerSetState(ConstraintsSetStmt *stmt); extern bool AfterTriggerPendingOnRel(Oid relid); /* * in utils/adt/ri_triggers.c */ extern bool RI_FKey_keyequal_upd_pk(Trigger *trigger, Relation pk_rel, HeapTuple old_row, HeapTuple new_row); extern bool RI_FKey_keyequal_upd_fk(Trigger *trigger, Relation fk_rel, HeapTuple old_row, HeapTuple new_row); extern bool RI_Initial_Check(Trigger *trigger, Relation fk_rel, Relation pk_rel); /* result values for RI_FKey_trigger_type: */ #define RI_TRIGGER_PK 1 /* is a trigger on the PK relation */ #define RI_TRIGGER_FK 2 /* is a trigger on the FK relation */ #define RI_TRIGGER_NONE 0 /* is not an RI trigger function */ extern int RI_FKey_trigger_type(Oid tgfoid); extern Datum pg_trigger_depth(PG_FUNCTION_ARGS); #endif /* TRIGGER_H */ PKBiZx;]KKserver/commands/schemacmds.hnu[/*------------------------------------------------------------------------- * * schemacmds.h * prototypes for schemacmds.c. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/commands/schemacmds.h * *------------------------------------------------------------------------- */ #ifndef SCHEMACMDS_H #define SCHEMACMDS_H #include "nodes/parsenodes.h" extern void CreateSchemaCommand(CreateSchemaStmt *parsetree, const char *queryString); extern void RemoveSchemaById(Oid schemaOid); extern void RenameSchema(const char *oldname, const char *newname); extern void AlterSchemaOwner(const char *name, Oid newOwnerId); extern void AlterSchemaOwner_oid(Oid schemaOid, Oid newOwnerId); #endif /* SCHEMACMDS_H */ PKBiZQ fYYserver/commands/variable.hnu[/* * variable.h * Routines for handling specialized SET variables. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/commands/variable.h */ #ifndef VARIABLE_H #define VARIABLE_H #include "utils/guc.h" extern bool check_datestyle(char **newval, void **extra, GucSource source); extern void assign_datestyle(const char *newval, void *extra); extern bool check_timezone(char **newval, void **extra, GucSource source); extern void assign_timezone(const char *newval, void *extra); extern const char *show_timezone(void); extern bool check_log_timezone(char **newval, void **extra, GucSource source); extern void assign_log_timezone(const char *newval, void *extra); extern const char *show_log_timezone(void); extern bool check_transaction_read_only(bool *newval, void **extra, GucSource source); extern bool check_XactIsoLevel(char **newval, void **extra, GucSource source); extern void assign_XactIsoLevel(const char *newval, void *extra); extern const char *show_XactIsoLevel(void); extern bool check_transaction_deferrable(bool *newval, void **extra, GucSource source); extern bool check_random_seed(double *newval, void **extra, GucSource source); extern void assign_random_seed(double newval, void *extra); extern const char *show_random_seed(void); extern bool check_client_encoding(char **newval, void **extra, GucSource source); extern void assign_client_encoding(const char *newval, void *extra); extern bool check_session_authorization(char **newval, void **extra, GucSource source); extern void assign_session_authorization(const char *newval, void *extra); extern bool check_role(char **newval, void **extra, GucSource source); extern void assign_role(const char *newval, void *extra); extern const char *show_role(void); #endif /* VARIABLE_H */ PKBiZserver/commands/discard.hnu[/*------------------------------------------------------------------------- * * discard.h * prototypes for discard.c. * * * Copyright (c) 1996-2012, PostgreSQL Global Development Group * * src/include/commands/discard.h * *------------------------------------------------------------------------- */ #ifndef DISCARD_H #define DISCARD_H #include "nodes/parsenodes.h" extern void DiscardCommand(DiscardStmt *stmt, bool isTopLevel); #endif /* DISCARD_H */ PKBiZ4%server/commands/copy.hnu[/*------------------------------------------------------------------------- * * copy.h * Definitions for using the POSTGRES copy command. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/commands/copy.h * *------------------------------------------------------------------------- */ #ifndef COPY_H #define COPY_H #include "nodes/execnodes.h" #include "nodes/parsenodes.h" #include "tcop/dest.h" /* CopyStateData is private in commands/copy.c */ typedef struct CopyStateData *CopyState; extern uint64 DoCopy(const CopyStmt *stmt, const char *queryString); extern void ProcessCopyOptions(CopyState cstate, bool is_from, List *options); extern CopyState BeginCopyFrom(Relation rel, const char *filename, List *attnamelist, List *options); extern void EndCopyFrom(CopyState cstate); extern bool NextCopyFrom(CopyState cstate, ExprContext *econtext, Datum *values, bool *nulls, Oid *tupleOid); extern bool NextCopyFromRawFields(CopyState cstate, char ***fields, int *nfields); extern void CopyFromErrorCallback(void *arg); extern DestReceiver *CreateCopyDestReceiver(void); #endif /* COPY_H */ PKBiZT. . server/foreign/foreign.hnu[/*------------------------------------------------------------------------- * * foreign.h * support for foreign-data wrappers, servers and user mappings. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * * src/include/foreign/foreign.h * *------------------------------------------------------------------------- */ #ifndef FOREIGN_H #define FOREIGN_H #include "nodes/parsenodes.h" /* Helper for obtaining username for user mapping */ #define MappingUserName(userid) \ (OidIsValid(userid) ? GetUserNameFromId(userid) : "public") /* * Generic option types for validation. * NB! Thes are treated as flags, so use only powers of two here. */ typedef enum { ServerOpt = 1, /* options applicable to SERVER */ UserMappingOpt = 2, /* options for USER MAPPING */ FdwOpt = 4 /* options for FOREIGN DATA WRAPPER */ } GenericOptionFlags; typedef struct ForeignDataWrapper { Oid fdwid; /* FDW Oid */ Oid owner; /* FDW owner user Oid */ char *fdwname; /* Name of the FDW */ Oid fdwhandler; /* Oid of handler function, or 0 */ Oid fdwvalidator; /* Oid of validator function, or 0 */ List *options; /* fdwoptions as DefElem list */ } ForeignDataWrapper; typedef struct ForeignServer { Oid serverid; /* server Oid */ Oid fdwid; /* foreign-data wrapper */ Oid owner; /* server owner user Oid */ char *servername; /* name of the server */ char *servertype; /* server type, optional */ char *serverversion; /* server version, optional */ List *options; /* srvoptions as DefElem list */ } ForeignServer; typedef struct UserMapping { Oid userid; /* local user Oid */ Oid serverid; /* server Oid */ List *options; /* useoptions as DefElem list */ } UserMapping; typedef struct ForeignTable { Oid relid; /* relation Oid */ Oid serverid; /* server Oid */ List *options; /* ftoptions as DefElem list */ } ForeignTable; extern ForeignServer *GetForeignServer(Oid serverid); extern ForeignServer *GetForeignServerByName(const char *name, bool missing_ok); extern UserMapping *GetUserMapping(Oid userid, Oid serverid); extern ForeignDataWrapper *GetForeignDataWrapper(Oid fdwid); extern ForeignDataWrapper *GetForeignDataWrapperByName(const char *name, bool missing_ok); extern ForeignTable *GetForeignTable(Oid relid); extern List *GetForeignColumnOptions(Oid relid, AttrNumber attnum); extern Oid get_foreign_data_wrapper_oid(const char *fdwname, bool missing_ok); extern Oid get_foreign_server_oid(const char *servername, bool missing_ok); #endif /* FOREIGN_H */ PKBiZ8 server/foreign/fdwapi.hnu[/*------------------------------------------------------------------------- * * fdwapi.h * API for foreign-data wrappers * * Copyright (c) 2010-2012, PostgreSQL Global Development Group * * src/include/foreign/fdwapi.h * *------------------------------------------------------------------------- */ #ifndef FDWAPI_H #define FDWAPI_H #include "nodes/execnodes.h" #include "nodes/relation.h" /* To avoid including explain.h here, reference ExplainState thus: */ struct ExplainState; /* * Callback function signatures --- see fdwhandler.sgml for more info. */ typedef void (*GetForeignRelSize_function) (PlannerInfo *root, RelOptInfo *baserel, Oid foreigntableid); typedef void (*GetForeignPaths_function) (PlannerInfo *root, RelOptInfo *baserel, Oid foreigntableid); typedef ForeignScan *(*GetForeignPlan_function) (PlannerInfo *root, RelOptInfo *baserel, Oid foreigntableid, ForeignPath *best_path, List *tlist, List *scan_clauses); typedef void (*ExplainForeignScan_function) (ForeignScanState *node, struct ExplainState *es); typedef void (*BeginForeignScan_function) (ForeignScanState *node, int eflags); typedef TupleTableSlot *(*IterateForeignScan_function) (ForeignScanState *node); typedef void (*ReScanForeignScan_function) (ForeignScanState *node); typedef void (*EndForeignScan_function) (ForeignScanState *node); typedef int (*AcquireSampleRowsFunc) (Relation relation, int elevel, HeapTuple *rows, int targrows, double *totalrows, double *totaldeadrows); typedef bool (*AnalyzeForeignTable_function) (Relation relation, AcquireSampleRowsFunc *func, BlockNumber *totalpages); /* * FdwRoutine is the struct returned by a foreign-data wrapper's handler * function. It provides pointers to the callback functions needed by the * planner and executor. * * More function pointers are likely to be added in the future. Therefore * it's recommended that the handler initialize the struct with * makeNode(FdwRoutine) so that all fields are set to NULL. This will * ensure that no fields are accidentally left undefined. */ typedef struct FdwRoutine { NodeTag type; /* * These functions are required. */ GetForeignRelSize_function GetForeignRelSize; GetForeignPaths_function GetForeignPaths; GetForeignPlan_function GetForeignPlan; ExplainForeignScan_function ExplainForeignScan; BeginForeignScan_function BeginForeignScan; IterateForeignScan_function IterateForeignScan; ReScanForeignScan_function ReScanForeignScan; EndForeignScan_function EndForeignScan; /* * These functions are optional. Set the pointer to NULL for any that are * not provided. */ AnalyzeForeignTable_function AnalyzeForeignTable; } FdwRoutine; /* Functions in foreign/foreign.c */ extern FdwRoutine *GetFdwRoutine(Oid fdwhandler); extern FdwRoutine *GetFdwRoutineByRelId(Oid relid); #endif /* FDWAPI_H */ PKBiZaq server/optimizer/geqo_mutation.hnu[/*------------------------------------------------------------------------- * * geqo_mutation.h * prototypes for mutation functions in optimizer/geqo * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/optimizer/geqo_mutation.h * *------------------------------------------------------------------------- */ /* contributed by: =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= * Martin Utesch * Institute of Automatic Control * = = University of Mining and Technology = * utesch@aut.tu-freiberg.de * Freiberg, Germany * =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= */ #ifndef GEQO_MUTATION_H #define GEQO_MUTATION_H #include "optimizer/geqo.h" extern void geqo_mutation(PlannerInfo *root, Gene *tour, int num_gene); #endif /* GEQO_MUTATION_H */ PKBiZ]mddserver/optimizer/geqo_misc.hnu[/*------------------------------------------------------------------------- * * geqo_misc.h * prototypes for printout routines in optimizer/geqo * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/optimizer/geqo_misc.h * *------------------------------------------------------------------------- */ /* contributed by: =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= * Martin Utesch * Institute of Automatic Control * = = University of Mining and Technology = * utesch@aut.tu-freiberg.de * Freiberg, Germany * =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= */ #ifndef GEQO_MISC_H #define GEQO_MISC_H #include "optimizer/geqo_recombination.h" #ifdef GEQO_DEBUG extern void print_pool(FILE *fp, Pool *pool, int start, int stop); extern void print_gen(FILE *fp, Pool *pool, int generation); extern void print_edge_table(FILE *fp, Edge *edge_table, int num_gene); #endif /* GEQO_DEBUG */ #endif /* GEQO_MISC_H */ PKBiZ$*server/optimizer/geqo_copy.hnu[/*------------------------------------------------------------------------- * * geqo_copy.h * prototypes for copy functions in optimizer/geqo * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/optimizer/geqo_copy.h * *------------------------------------------------------------------------- */ /* contributed by: =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= * Martin Utesch * Institute of Automatic Control * = = University of Mining and Technology = * utesch@aut.tu-freiberg.de * Freiberg, Germany * =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= */ #ifndef GEQO_COPY_H #define GEQO_COPY_H #include "optimizer/geqo.h" extern void geqo_copy(PlannerInfo *root, Chromosome *chromo1, Chromosome *chromo2, int string_length); #endif /* GEQO_COPY_H */ PKBiZVpserver/optimizer/predtest.hnu[/*------------------------------------------------------------------------- * * predtest.h * prototypes for predtest.c * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/optimizer/predtest.h * *------------------------------------------------------------------------- */ #ifndef PREDTEST_H #define PREDTEST_H #include "nodes/primnodes.h" extern bool predicate_implied_by(List *predicate_list, List *restrictinfo_list); extern bool predicate_refuted_by(List *predicate_list, List *restrictinfo_list); #endif /* PREDTEST_H */ PKBiZ8T T %server/optimizer/geqo_recombination.hnu[/*------------------------------------------------------------------------- * * geqo_recombination.h * prototypes for recombination in the genetic query optimizer * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/optimizer/geqo_recombination.h * *------------------------------------------------------------------------- */ /* contributed by: =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= * Martin Utesch * Institute of Automatic Control * = = University of Mining and Technology = * utesch@aut.tu-freiberg.de * Freiberg, Germany * =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= */ /* -- parts of this are adapted from D. Whitley's Genitor algorithm -- */ #ifndef GEQO_RECOMBINATION_H #define GEQO_RECOMBINATION_H #include "optimizer/geqo.h" extern void init_tour(PlannerInfo *root, Gene *tour, int num_gene); /* edge recombination crossover [ERX] */ typedef struct Edge { Gene edge_list[4]; /* list of edges */ int total_edges; int unused_edges; } Edge; extern Edge *alloc_edge_table(PlannerInfo *root, int num_gene); extern void free_edge_table(PlannerInfo *root, Edge *edge_table); extern float gimme_edge_table(PlannerInfo *root, Gene *tour1, Gene *tour2, int num_gene, Edge *edge_table); extern int gimme_tour(PlannerInfo *root, Edge *edge_table, Gene *new_gene, int num_gene); /* partially matched crossover [PMX] */ #define DAD 1 /* indicator for gene from dad */ #define MOM 0 /* indicator for gene from mom */ extern void pmx(PlannerInfo *root, Gene *tour1, Gene *tour2, Gene *offspring, int num_gene); typedef struct City { int tour2_position; int tour1_position; int used; int select_list; } City; extern City *alloc_city_table(PlannerInfo *root, int num_gene); extern void free_city_table(PlannerInfo *root, City *city_table); /* cycle crossover [CX] */ extern int cx(PlannerInfo *root, Gene *tour1, Gene *tour2, Gene *offspring, int num_gene, City *city_table); /* position crossover [PX] */ extern void px(PlannerInfo *root, Gene *tour1, Gene *tour2, Gene *offspring, int num_gene, City *city_table); /* order crossover [OX1] according to Davis */ extern void ox1(PlannerInfo *root, Gene *mom, Gene *dad, Gene *offspring, int num_gene, City *city_table); /* order crossover [OX2] according to Syswerda */ extern void ox2(PlannerInfo *root, Gene *mom, Gene *dad, Gene *offspring, int num_gene, City *city_table); #endif /* GEQO_RECOMBINATION_H */ PKBiZ?server/optimizer/plancat.hnu[/*------------------------------------------------------------------------- * * plancat.h * prototypes for plancat.c. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/optimizer/plancat.h * *------------------------------------------------------------------------- */ #ifndef PLANCAT_H #define PLANCAT_H #include "nodes/relation.h" #include "utils/relcache.h" /* Hook for plugins to get control in get_relation_info() */ typedef void (*get_relation_info_hook_type) (PlannerInfo *root, Oid relationObjectId, bool inhparent, RelOptInfo *rel); extern PGDLLIMPORT get_relation_info_hook_type get_relation_info_hook; extern void get_relation_info(PlannerInfo *root, Oid relationObjectId, bool inhparent, RelOptInfo *rel); extern void estimate_rel_size(Relation rel, int32 *attr_widths, BlockNumber *pages, double *tuples, double *allvisfrac); extern int32 get_relation_data_width(Oid relid, int32 *attr_widths); extern bool relation_excluded_by_constraints(PlannerInfo *root, RelOptInfo *rel, RangeTblEntry *rte); extern List *build_physical_tlist(PlannerInfo *root, RelOptInfo *rel); extern bool has_unique_index(RelOptInfo *rel, AttrNumber attno); extern Selectivity restriction_selectivity(PlannerInfo *root, Oid operatorid, List *args, Oid inputcollid, int varRelid); extern Selectivity join_selectivity(PlannerInfo *root, Oid operatorid, List *args, Oid inputcollid, JoinType jointype, SpecialJoinInfo *sjinfo); #endif /* PLANCAT_H */ PKBiZz(##server/optimizer/pathnode.hnu[/*------------------------------------------------------------------------- * * pathnode.h * prototypes for pathnode.c, relnode.c. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/optimizer/pathnode.h * *------------------------------------------------------------------------- */ #ifndef PATHNODE_H #define PATHNODE_H #include "nodes/relation.h" /* * prototypes for pathnode.c */ extern int compare_path_costs(Path *path1, Path *path2, CostSelector criterion); extern int compare_fractional_path_costs(Path *path1, Path *path2, double fraction); extern void set_cheapest(RelOptInfo *parent_rel); extern void add_path(RelOptInfo *parent_rel, Path *new_path); extern bool add_path_precheck(RelOptInfo *parent_rel, Cost startup_cost, Cost total_cost, List *pathkeys, Relids required_outer); extern Path *create_seqscan_path(PlannerInfo *root, RelOptInfo *rel, Relids required_outer); extern IndexPath *create_index_path(PlannerInfo *root, IndexOptInfo *index, List *indexclauses, List *indexclausecols, List *indexorderbys, List *indexorderbycols, List *pathkeys, ScanDirection indexscandir, bool indexonly, Relids required_outer, double loop_count); extern BitmapHeapPath *create_bitmap_heap_path(PlannerInfo *root, RelOptInfo *rel, Path *bitmapqual, Relids required_outer, double loop_count); extern BitmapAndPath *create_bitmap_and_path(PlannerInfo *root, RelOptInfo *rel, List *bitmapquals); extern BitmapOrPath *create_bitmap_or_path(PlannerInfo *root, RelOptInfo *rel, List *bitmapquals); extern TidPath *create_tidscan_path(PlannerInfo *root, RelOptInfo *rel, List *tidquals); extern AppendPath *create_append_path(RelOptInfo *rel, List *subpaths, Relids required_outer); extern MergeAppendPath *create_merge_append_path(PlannerInfo *root, RelOptInfo *rel, List *subpaths, List *pathkeys, Relids required_outer); extern ResultPath *create_result_path(List *quals); extern MaterialPath *create_material_path(RelOptInfo *rel, Path *subpath); extern UniquePath *create_unique_path(PlannerInfo *root, RelOptInfo *rel, Path *subpath, SpecialJoinInfo *sjinfo); extern Path *create_subqueryscan_path(PlannerInfo *root, RelOptInfo *rel, List *pathkeys, Relids required_outer); extern Path *create_functionscan_path(PlannerInfo *root, RelOptInfo *rel); extern Path *create_valuesscan_path(PlannerInfo *root, RelOptInfo *rel); extern Path *create_ctescan_path(PlannerInfo *root, RelOptInfo *rel); extern Path *create_worktablescan_path(PlannerInfo *root, RelOptInfo *rel); extern ForeignPath *create_foreignscan_path(PlannerInfo *root, RelOptInfo *rel, double rows, Cost startup_cost, Cost total_cost, List *pathkeys, Relids required_outer, List *fdw_private); extern Relids calc_nestloop_required_outer(Path *outer_path, Path *inner_path); extern Relids calc_non_nestloop_required_outer(Path *outer_path, Path *inner_path); extern NestPath *create_nestloop_path(PlannerInfo *root, RelOptInfo *joinrel, JoinType jointype, JoinCostWorkspace *workspace, SpecialJoinInfo *sjinfo, SemiAntiJoinFactors *semifactors, Path *outer_path, Path *inner_path, List *restrict_clauses, List *pathkeys, Relids required_outer); extern MergePath *create_mergejoin_path(PlannerInfo *root, RelOptInfo *joinrel, JoinType jointype, JoinCostWorkspace *workspace, SpecialJoinInfo *sjinfo, Path *outer_path, Path *inner_path, List *restrict_clauses, List *pathkeys, Relids required_outer, List *mergeclauses, List *outersortkeys, List *innersortkeys); extern HashPath *create_hashjoin_path(PlannerInfo *root, RelOptInfo *joinrel, JoinType jointype, JoinCostWorkspace *workspace, SpecialJoinInfo *sjinfo, SemiAntiJoinFactors *semifactors, Path *outer_path, Path *inner_path, List *restrict_clauses, Relids required_outer, List *hashclauses); extern Path *reparameterize_path(PlannerInfo *root, Path *path, Relids required_outer, double loop_count); /* * prototypes for relnode.c */ extern void setup_simple_rel_arrays(PlannerInfo *root); extern RelOptInfo *build_simple_rel(PlannerInfo *root, int relid, RelOptKind reloptkind); extern RelOptInfo *find_base_rel(PlannerInfo *root, int relid); extern RelOptInfo *find_join_rel(PlannerInfo *root, Relids relids); extern RelOptInfo *build_join_rel(PlannerInfo *root, Relids joinrelids, RelOptInfo *outer_rel, RelOptInfo *inner_rel, SpecialJoinInfo *sjinfo, List **restrictlist_ptr); extern AppendRelInfo *find_childrel_appendrelinfo(PlannerInfo *root, RelOptInfo *rel); extern RelOptInfo *find_childrel_top_parent(PlannerInfo *root, RelOptInfo *rel); extern Relids find_childrel_parents(PlannerInfo *root, RelOptInfo *rel); extern ParamPathInfo *get_baserel_parampathinfo(PlannerInfo *root, RelOptInfo *baserel, Relids required_outer); extern ParamPathInfo *get_joinrel_parampathinfo(PlannerInfo *root, RelOptInfo *joinrel, Path *outer_path, Path *inner_path, SpecialJoinInfo *sjinfo, Relids required_outer, List **restrict_clauses); extern ParamPathInfo *get_appendrel_parampathinfo(RelOptInfo *appendrel, Relids required_outer); #endif /* PATHNODE_H */ PKBiZYN}}server/optimizer/geqo.hnu[/*------------------------------------------------------------------------- * * geqo.h * prototypes for various files in optimizer/geqo * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/optimizer/geqo.h * *------------------------------------------------------------------------- */ /* contributed by: =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= * Martin Utesch * Institute of Automatic Control * = = University of Mining and Technology = * utesch@aut.tu-freiberg.de * Freiberg, Germany * =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= */ #ifndef GEQO_H #define GEQO_H #include "nodes/relation.h" #include "optimizer/geqo_gene.h" /* GEQO debug flag */ /* #define GEQO_DEBUG */ /* recombination mechanism */ /* #define ERX #define PMX #define CX #define PX #define OX1 #define OX2 */ #define ERX /* * Configuration options * * If you change these, update backend/utils/misc/postgresql.conf.sample */ extern int Geqo_effort; /* 1 .. 10, knob for adjustment of defaults */ #define DEFAULT_GEQO_EFFORT 5 #define MIN_GEQO_EFFORT 1 #define MAX_GEQO_EFFORT 10 extern int Geqo_pool_size; /* 2 .. inf, or 0 to use default */ extern int Geqo_generations; /* 1 .. inf, or 0 to use default */ extern double Geqo_selection_bias; #define DEFAULT_GEQO_SELECTION_BIAS 2.0 #define MIN_GEQO_SELECTION_BIAS 1.5 #define MAX_GEQO_SELECTION_BIAS 2.0 extern double Geqo_seed; /* 0 .. 1 */ /* * Private state for a GEQO run --- accessible via root->join_search_private */ typedef struct { List *initial_rels; /* the base relations we are joining */ unsigned short random_state[3]; /* state for pg_erand48() */ } GeqoPrivateData; /* routines in geqo_main.c */ extern RelOptInfo *geqo(PlannerInfo *root, int number_of_rels, List *initial_rels); /* routines in geqo_eval.c */ extern Cost geqo_eval(PlannerInfo *root, Gene *tour, int num_gene); extern RelOptInfo *gimme_tree(PlannerInfo *root, Gene *tour, int num_gene); #endif /* GEQO_H */ PKBiZDDserver/optimizer/joininfo.hnu[/*------------------------------------------------------------------------- * * joininfo.h * prototypes for joininfo.c. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/optimizer/joininfo.h * *------------------------------------------------------------------------- */ #ifndef JOININFO_H #define JOININFO_H #include "nodes/relation.h" extern bool have_relevant_joinclause(PlannerInfo *root, RelOptInfo *rel1, RelOptInfo *rel2); extern void add_join_clause_to_rels(PlannerInfo *root, RestrictInfo *restrictinfo, Relids join_relids); extern void remove_join_clause_from_rels(PlannerInfo *root, RestrictInfo *restrictinfo, Relids join_relids); #endif /* JOININFO_H */ PKBiZ#qTNNserver/optimizer/cost.hnu[/*------------------------------------------------------------------------- * * cost.h * prototypes for costsize.c and clausesel.c. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/optimizer/cost.h * *------------------------------------------------------------------------- */ #ifndef COST_H #define COST_H #include "nodes/plannodes.h" #include "nodes/relation.h" /* defaults for costsize.c's Cost parameters */ /* NB: cost-estimation code should use the variables, not these constants! */ /* If you change these, update backend/utils/misc/postgresql.sample.conf */ #define DEFAULT_SEQ_PAGE_COST 1.0 #define DEFAULT_RANDOM_PAGE_COST 4.0 #define DEFAULT_CPU_TUPLE_COST 0.01 #define DEFAULT_CPU_INDEX_TUPLE_COST 0.005 #define DEFAULT_CPU_OPERATOR_COST 0.0025 #define DEFAULT_EFFECTIVE_CACHE_SIZE 16384 /* measured in pages */ typedef enum { CONSTRAINT_EXCLUSION_OFF, /* do not use c_e */ CONSTRAINT_EXCLUSION_ON, /* apply c_e to all rels */ CONSTRAINT_EXCLUSION_PARTITION /* apply c_e to otherrels only */ } ConstraintExclusionType; /* * prototypes for costsize.c * routines to compute costs and sizes */ /* parameter variables and flags */ extern PGDLLIMPORT double seq_page_cost; extern PGDLLIMPORT double random_page_cost; extern PGDLLIMPORT double cpu_tuple_cost; extern PGDLLIMPORT double cpu_index_tuple_cost; extern PGDLLIMPORT double cpu_operator_cost; extern PGDLLIMPORT int effective_cache_size; extern Cost disable_cost; extern bool enable_seqscan; extern bool enable_indexscan; extern bool enable_indexonlyscan; extern bool enable_bitmapscan; extern bool enable_tidscan; extern bool enable_sort; extern bool enable_hashagg; extern bool enable_nestloop; extern bool enable_material; extern bool enable_mergejoin; extern bool enable_hashjoin; extern int constraint_exclusion; extern double clamp_row_est(double nrows); extern double index_pages_fetched(double tuples_fetched, BlockNumber pages, double index_pages, PlannerInfo *root); extern void cost_seqscan(Path *path, PlannerInfo *root, RelOptInfo *baserel, ParamPathInfo *param_info); extern void cost_index(IndexPath *path, PlannerInfo *root, double loop_count); extern void cost_bitmap_heap_scan(Path *path, PlannerInfo *root, RelOptInfo *baserel, ParamPathInfo *param_info, Path *bitmapqual, double loop_count); extern void cost_bitmap_and_node(BitmapAndPath *path, PlannerInfo *root); extern void cost_bitmap_or_node(BitmapOrPath *path, PlannerInfo *root); extern void cost_bitmap_tree_node(Path *path, Cost *cost, Selectivity *selec); extern void cost_tidscan(Path *path, PlannerInfo *root, RelOptInfo *baserel, List *tidquals); extern void cost_subqueryscan(Path *path, PlannerInfo *root, RelOptInfo *baserel, ParamPathInfo *param_info); extern void cost_functionscan(Path *path, PlannerInfo *root, RelOptInfo *baserel); extern void cost_valuesscan(Path *path, PlannerInfo *root, RelOptInfo *baserel); extern void cost_ctescan(Path *path, PlannerInfo *root, RelOptInfo *baserel); extern void cost_recursive_union(Plan *runion, Plan *nrterm, Plan *rterm); extern void cost_sort(Path *path, PlannerInfo *root, List *pathkeys, Cost input_cost, double tuples, int width, Cost comparison_cost, int sort_mem, double limit_tuples); extern void cost_merge_append(Path *path, PlannerInfo *root, List *pathkeys, int n_streams, Cost input_startup_cost, Cost input_total_cost, double tuples); extern void cost_material(Path *path, Cost input_startup_cost, Cost input_total_cost, double tuples, int width); extern void cost_agg(Path *path, PlannerInfo *root, AggStrategy aggstrategy, const AggClauseCosts *aggcosts, int numGroupCols, double numGroups, Cost input_startup_cost, Cost input_total_cost, double input_tuples); extern void cost_windowagg(Path *path, PlannerInfo *root, List *windowFuncs, int numPartCols, int numOrderCols, Cost input_startup_cost, Cost input_total_cost, double input_tuples); extern void cost_group(Path *path, PlannerInfo *root, int numGroupCols, double numGroups, Cost input_startup_cost, Cost input_total_cost, double input_tuples); extern void initial_cost_nestloop(PlannerInfo *root, JoinCostWorkspace *workspace, JoinType jointype, Path *outer_path, Path *inner_path, SpecialJoinInfo *sjinfo, SemiAntiJoinFactors *semifactors); extern void final_cost_nestloop(PlannerInfo *root, NestPath *path, JoinCostWorkspace *workspace, SpecialJoinInfo *sjinfo, SemiAntiJoinFactors *semifactors); extern void initial_cost_mergejoin(PlannerInfo *root, JoinCostWorkspace *workspace, JoinType jointype, List *mergeclauses, Path *outer_path, Path *inner_path, List *outersortkeys, List *innersortkeys, SpecialJoinInfo *sjinfo); extern void final_cost_mergejoin(PlannerInfo *root, MergePath *path, JoinCostWorkspace *workspace, SpecialJoinInfo *sjinfo); extern void initial_cost_hashjoin(PlannerInfo *root, JoinCostWorkspace *workspace, JoinType jointype, List *hashclauses, Path *outer_path, Path *inner_path, SpecialJoinInfo *sjinfo, SemiAntiJoinFactors *semifactors); extern void final_cost_hashjoin(PlannerInfo *root, HashPath *path, JoinCostWorkspace *workspace, SpecialJoinInfo *sjinfo, SemiAntiJoinFactors *semifactors); extern void cost_subplan(PlannerInfo *root, SubPlan *subplan, Plan *plan); extern void cost_qual_eval(QualCost *cost, List *quals, PlannerInfo *root); extern void cost_qual_eval_node(QualCost *cost, Node *qual, PlannerInfo *root); extern void compute_semi_anti_join_factors(PlannerInfo *root, RelOptInfo *outerrel, RelOptInfo *innerrel, JoinType jointype, SpecialJoinInfo *sjinfo, List *restrictlist, SemiAntiJoinFactors *semifactors); extern void set_baserel_size_estimates(PlannerInfo *root, RelOptInfo *rel); extern double get_parameterized_baserel_size(PlannerInfo *root, RelOptInfo *rel, List *param_clauses); extern double get_parameterized_joinrel_size(PlannerInfo *root, RelOptInfo *rel, double outer_rows, double inner_rows, SpecialJoinInfo *sjinfo, List *restrict_clauses); extern void set_joinrel_size_estimates(PlannerInfo *root, RelOptInfo *rel, RelOptInfo *outer_rel, RelOptInfo *inner_rel, SpecialJoinInfo *sjinfo, List *restrictlist); extern void set_subquery_size_estimates(PlannerInfo *root, RelOptInfo *rel); extern void set_function_size_estimates(PlannerInfo *root, RelOptInfo *rel); extern void set_values_size_estimates(PlannerInfo *root, RelOptInfo *rel); extern void set_cte_size_estimates(PlannerInfo *root, RelOptInfo *rel, Plan *cteplan); extern void set_foreign_size_estimates(PlannerInfo *root, RelOptInfo *rel); /* * prototypes for clausesel.c * routines to compute clause selectivities */ extern Selectivity clauselist_selectivity(PlannerInfo *root, List *clauses, int varRelid, JoinType jointype, SpecialJoinInfo *sjinfo); extern Selectivity clause_selectivity(PlannerInfo *root, Node *clause, int varRelid, JoinType jointype, SpecialJoinInfo *sjinfo); #endif /* COST_H */ PKBiZq SSserver/optimizer/planner.hnu[/*------------------------------------------------------------------------- * * planner.h * prototypes for planner.c. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/optimizer/planner.h * *------------------------------------------------------------------------- */ #ifndef PLANNER_H #define PLANNER_H #include "nodes/plannodes.h" #include "nodes/relation.h" /* Hook for plugins to get control in planner() */ typedef PlannedStmt *(*planner_hook_type) (Query *parse, int cursorOptions, ParamListInfo boundParams); extern PGDLLIMPORT planner_hook_type planner_hook; extern PlannedStmt *planner(Query *parse, int cursorOptions, ParamListInfo boundParams); extern PlannedStmt *standard_planner(Query *parse, int cursorOptions, ParamListInfo boundParams); extern Plan *subquery_planner(PlannerGlobal *glob, Query *parse, PlannerInfo *parent_root, bool hasRecursion, double tuple_fraction, PlannerInfo **subroot); extern void add_tlist_costs_to_plan(PlannerInfo *root, Plan *plan, List *tlist); extern bool is_dummy_plan(Plan *plan); extern Expr *expression_planner(Expr *expr); extern bool plan_cluster_use_sort(Oid tableOid, Oid indexOid); #endif /* PLANNER_H */ PKBiZP!server/optimizer/geqo_selection.hnu[/*------------------------------------------------------------------------- * * geqo_selection.h * prototypes for selection routines in optimizer/geqo * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/optimizer/geqo_selection.h * *------------------------------------------------------------------------- */ /* contributed by: =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= * Martin Utesch * Institute of Automatic Control * = = University of Mining and Technology = * utesch@aut.tu-freiberg.de * Freiberg, Germany * =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= */ #ifndef GEQO_SELECTION_H #define GEQO_SELECTION_H #include "optimizer/geqo.h" extern void geqo_selection(PlannerInfo *root, Chromosome *momma, Chromosome *daddy, Pool *pool, double bias); #endif /* GEQO_SELECTION_H */ PKBiZ̃ server/optimizer/clauses.hnu[/*------------------------------------------------------------------------- * * clauses.h * prototypes for clauses.c. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/optimizer/clauses.h * *------------------------------------------------------------------------- */ #ifndef CLAUSES_H #define CLAUSES_H #include "nodes/relation.h" #define is_opclause(clause) ((clause) != NULL && IsA(clause, OpExpr)) #define is_funcclause(clause) ((clause) != NULL && IsA(clause, FuncExpr)) typedef struct { int numWindowFuncs; /* total number of WindowFuncs found */ Index maxWinRef; /* windowFuncs[] is indexed 0 .. maxWinRef */ List **windowFuncs; /* lists of WindowFuncs for each winref */ } WindowFuncLists; extern Expr *make_opclause(Oid opno, Oid opresulttype, bool opretset, Expr *leftop, Expr *rightop, Oid opcollid, Oid inputcollid); extern Node *get_leftop(const Expr *clause); extern Node *get_rightop(const Expr *clause); extern bool not_clause(Node *clause); extern Expr *make_notclause(Expr *notclause); extern Expr *get_notclausearg(Expr *notclause); extern bool or_clause(Node *clause); extern Expr *make_orclause(List *orclauses); extern bool and_clause(Node *clause); extern Expr *make_andclause(List *andclauses); extern Node *make_and_qual(Node *qual1, Node *qual2); extern Expr *make_ands_explicit(List *andclauses); extern List *make_ands_implicit(Expr *clause); extern bool contain_agg_clause(Node *clause); extern void count_agg_clauses(PlannerInfo *root, Node *clause, AggClauseCosts *costs); extern bool contain_window_function(Node *clause); extern WindowFuncLists *find_window_functions(Node *clause, Index maxWinRef); extern double expression_returns_set_rows(Node *clause); extern double tlist_returns_set_rows(List *tlist); extern bool contain_subplans(Node *clause); extern bool contain_mutable_functions(Node *clause); extern bool contain_volatile_functions(Node *clause); extern bool contain_nonstrict_functions(Node *clause); extern bool contain_leaky_functions(Node *clause); extern Relids find_nonnullable_rels(Node *clause); extern List *find_nonnullable_vars(Node *clause); extern List *find_forced_null_vars(Node *clause); extern Var *find_forced_null_var(Node *clause); extern bool is_pseudo_constant_clause(Node *clause); extern bool is_pseudo_constant_clause_relids(Node *clause, Relids relids); extern int NumRelids(Node *clause); extern void CommuteOpExpr(OpExpr *clause); extern void CommuteRowCompareExpr(RowCompareExpr *clause); extern Node *strip_implicit_coercions(Node *node); extern Node *eval_const_expressions(PlannerInfo *root, Node *node); extern Node *estimate_expression_value(PlannerInfo *root, Node *node); extern Query *inline_set_returning_function(PlannerInfo *root, RangeTblEntry *rte); #endif /* CLAUSES_H */ PKBiZkserver/optimizer/restrictinfo.hnu[/*------------------------------------------------------------------------- * * restrictinfo.h * prototypes for restrictinfo.c. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/optimizer/restrictinfo.h * *------------------------------------------------------------------------- */ #ifndef RESTRICTINFO_H #define RESTRICTINFO_H #include "nodes/relation.h" /* Convenience macro for the common case of a valid-everywhere qual */ #define make_simple_restrictinfo(clause) \ make_restrictinfo(clause, true, false, false, NULL, NULL, NULL) extern RestrictInfo *make_restrictinfo(Expr *clause, bool is_pushed_down, bool outerjoin_delayed, bool pseudoconstant, Relids required_relids, Relids outer_relids, Relids nullable_relids); extern List *make_restrictinfo_from_bitmapqual(Path *bitmapqual, bool is_pushed_down, bool include_predicates); extern List *make_restrictinfos_from_actual_clauses(PlannerInfo *root, List *clause_list); extern bool restriction_is_or_clause(RestrictInfo *restrictinfo); extern List *get_actual_clauses(List *restrictinfo_list); extern List *get_all_actual_clauses(List *restrictinfo_list); extern List *extract_actual_clauses(List *restrictinfo_list, bool pseudoconstant); extern void extract_actual_join_clauses(List *restrictinfo_list, List **joinquals, List **otherquals); extern bool join_clause_is_movable_to(RestrictInfo *rinfo, Index baserelid); extern bool join_clause_is_movable_into(RestrictInfo *rinfo, Relids currentrelids, Relids current_and_outer); #endif /* RESTRICTINFO_H */ PKBiZ2Oserver/optimizer/subselect.hnu[/*------------------------------------------------------------------------- * * subselect.h * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/optimizer/subselect.h * *------------------------------------------------------------------------- */ #ifndef SUBSELECT_H #define SUBSELECT_H #include "nodes/plannodes.h" #include "nodes/relation.h" extern void SS_process_ctes(PlannerInfo *root); extern JoinExpr *convert_ANY_sublink_to_join(PlannerInfo *root, SubLink *sublink, Relids available_rels); extern JoinExpr *convert_EXISTS_sublink_to_join(PlannerInfo *root, SubLink *sublink, bool under_not, Relids available_rels); extern Node *SS_replace_correlation_vars(PlannerInfo *root, Node *expr); extern Node *SS_process_sublinks(PlannerInfo *root, Node *expr, bool isQual); extern void SS_finalize_plan(PlannerInfo *root, Plan *plan, bool attach_initplans); extern Param *SS_make_initplan_from_plan(PlannerInfo *root, Plan *plan, Oid resulttype, int32 resulttypmod, Oid resultcollation); extern Param *assign_nestloop_param_var(PlannerInfo *root, Var *var); extern Param *assign_nestloop_param_placeholdervar(PlannerInfo *root, PlaceHolderVar *phv); extern int SS_assign_special_param(PlannerInfo *root); #endif /* SUBSELECT_H */ PKBiZd|mUUserver/optimizer/paths.hnu[/*------------------------------------------------------------------------- * * paths.h * prototypes for various files in optimizer/path * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/optimizer/paths.h * *------------------------------------------------------------------------- */ #ifndef PATHS_H #define PATHS_H #include "nodes/relation.h" /* * allpaths.c */ extern bool enable_geqo; extern int geqo_threshold; /* Hook for plugins to replace standard_join_search() */ typedef RelOptInfo *(*join_search_hook_type) (PlannerInfo *root, int levels_needed, List *initial_rels); extern PGDLLIMPORT join_search_hook_type join_search_hook; extern RelOptInfo *make_one_rel(PlannerInfo *root, List *joinlist); extern RelOptInfo *standard_join_search(PlannerInfo *root, int levels_needed, List *initial_rels); #ifdef OPTIMIZER_DEBUG extern void debug_print_rel(PlannerInfo *root, RelOptInfo *rel); #endif /* * indxpath.c * routines to generate index paths */ extern void create_index_paths(PlannerInfo *root, RelOptInfo *rel); extern List *generate_bitmap_or_paths(PlannerInfo *root, RelOptInfo *rel, List *clauses, List *other_clauses, bool restriction_only); extern bool relation_has_unique_index_for(PlannerInfo *root, RelOptInfo *rel, List *restrictlist, List *exprlist, List *oprlist); extern bool eclass_member_matches_indexcol(EquivalenceClass *ec, EquivalenceMember *em, IndexOptInfo *index, int indexcol); extern bool match_index_to_operand(Node *operand, int indexcol, IndexOptInfo *index); extern void expand_indexqual_conditions(IndexOptInfo *index, List *indexclauses, List *indexclausecols, List **indexquals_p, List **indexqualcols_p); extern void check_partial_indexes(PlannerInfo *root, RelOptInfo *rel); extern Expr *adjust_rowcompare_for_index(RowCompareExpr *clause, IndexOptInfo *index, int indexcol, List **indexcolnos, bool *var_on_left_p); /* * orindxpath.c * additional routines for indexable OR clauses */ extern bool create_or_index_quals(PlannerInfo *root, RelOptInfo *rel); /* * tidpath.h * routines to generate tid paths */ extern void create_tidscan_paths(PlannerInfo *root, RelOptInfo *rel); /* * joinpath.c * routines to create join paths */ extern void add_paths_to_joinrel(PlannerInfo *root, RelOptInfo *joinrel, RelOptInfo *outerrel, RelOptInfo *innerrel, JoinType jointype, SpecialJoinInfo *sjinfo, List *restrictlist); /* * joinrels.c * routines to determine which relations to join */ extern void join_search_one_level(PlannerInfo *root, int level); extern RelOptInfo *make_join_rel(PlannerInfo *root, RelOptInfo *rel1, RelOptInfo *rel2); extern bool have_join_order_restriction(PlannerInfo *root, RelOptInfo *rel1, RelOptInfo *rel2); /* * equivclass.c * routines for managing EquivalenceClasses */ extern bool process_equivalence(PlannerInfo *root, RestrictInfo *restrictinfo, bool below_outer_join); extern Expr *canonicalize_ec_expression(Expr *expr, Oid req_type, Oid req_collation); extern void reconsider_outer_join_clauses(PlannerInfo *root); extern EquivalenceClass *get_eclass_for_sort_expr(PlannerInfo *root, Expr *expr, Relids nullable_relids, List *opfamilies, Oid opcintype, Oid collation, Index sortref, Relids rel, bool create_it); extern void generate_base_implied_equalities(PlannerInfo *root); extern List *generate_join_implied_equalities(PlannerInfo *root, Relids join_relids, Relids outer_relids, RelOptInfo *inner_rel); extern List *generate_join_implied_equalities_for_ecs(PlannerInfo *root, List *eclasses, Relids join_relids, Relids outer_relids, RelOptInfo *inner_rel); extern bool exprs_known_equal(PlannerInfo *root, Node *item1, Node *item2); extern void add_child_rel_equivalences(PlannerInfo *root, AppendRelInfo *appinfo, RelOptInfo *parent_rel, RelOptInfo *child_rel); extern void mutate_eclass_expressions(PlannerInfo *root, Node *(*mutator) (), void *context, bool include_child_exprs); extern List *generate_implied_equalities_for_indexcol(PlannerInfo *root, IndexOptInfo *index, int indexcol); extern bool have_relevant_eclass_joinclause(PlannerInfo *root, RelOptInfo *rel1, RelOptInfo *rel2); extern bool has_relevant_eclass_joinclause(PlannerInfo *root, RelOptInfo *rel1); extern bool eclass_useful_for_merging(EquivalenceClass *eclass, RelOptInfo *rel); extern bool is_redundant_derived_clause(RestrictInfo *rinfo, List *clauselist); /* * pathkeys.c * utilities for matching and building path keys */ typedef enum { PATHKEYS_EQUAL, /* pathkeys are identical */ PATHKEYS_BETTER1, /* pathkey 1 is a superset of pathkey 2 */ PATHKEYS_BETTER2, /* vice versa */ PATHKEYS_DIFFERENT /* neither pathkey includes the other */ } PathKeysComparison; extern List *canonicalize_pathkeys(PlannerInfo *root, List *pathkeys); extern PathKeysComparison compare_pathkeys(List *keys1, List *keys2); extern bool pathkeys_contained_in(List *keys1, List *keys2); extern Path *get_cheapest_path_for_pathkeys(List *paths, List *pathkeys, Relids required_outer, CostSelector cost_criterion); extern Path *get_cheapest_fractional_path_for_pathkeys(List *paths, List *pathkeys, Relids required_outer, double fraction); extern List *build_index_pathkeys(PlannerInfo *root, IndexOptInfo *index, ScanDirection scandir); extern List *convert_subquery_pathkeys(PlannerInfo *root, RelOptInfo *rel, List *subquery_pathkeys); extern List *build_join_pathkeys(PlannerInfo *root, RelOptInfo *joinrel, JoinType jointype, List *outer_pathkeys); extern List *make_pathkeys_for_sortclauses(PlannerInfo *root, List *sortclauses, List *tlist, bool canonicalize); extern void initialize_mergeclause_eclasses(PlannerInfo *root, RestrictInfo *restrictinfo); extern void update_mergeclause_eclasses(PlannerInfo *root, RestrictInfo *restrictinfo); extern List *find_mergeclauses_for_pathkeys(PlannerInfo *root, List *pathkeys, bool outer_keys, List *restrictinfos); extern List *select_outer_pathkeys_for_merge(PlannerInfo *root, List *mergeclauses, RelOptInfo *joinrel); extern List *make_inner_pathkeys_for_merge(PlannerInfo *root, List *mergeclauses, List *outer_pathkeys); extern List *truncate_useless_pathkeys(PlannerInfo *root, RelOptInfo *rel, List *pathkeys); extern bool has_useful_pathkeys(PlannerInfo *root, RelOptInfo *rel); #endif /* PATHS_H */ PKBiZ4dserver/optimizer/tlist.hnu[/*------------------------------------------------------------------------- * * tlist.h * prototypes for tlist.c. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/optimizer/tlist.h * *------------------------------------------------------------------------- */ #ifndef TLIST_H #define TLIST_H #include "optimizer/var.h" extern TargetEntry *tlist_member(Node *node, List *targetlist); extern TargetEntry *tlist_member_ignore_relabel(Node *node, List *targetlist); extern TargetEntry *tlist_member_match_var(Var *var, List *targetlist); extern List *flatten_tlist(List *tlist, PVCAggregateBehavior aggbehavior, PVCPlaceHolderBehavior phbehavior); extern List *add_to_flat_tlist(List *tlist, List *exprs); extern List *get_tlist_exprs(List *tlist, bool includeJunk); extern bool tlist_same_exprs(List *tlist1, List *tlist2); extern bool tlist_same_datatypes(List *tlist, List *colTypes, bool junkOK); extern bool tlist_same_collations(List *tlist, List *colCollations, bool junkOK); extern TargetEntry *get_sortgroupref_tle(Index sortref, List *targetList); extern TargetEntry *get_sortgroupclause_tle(SortGroupClause *sgClause, List *targetList); extern Node *get_sortgroupclause_expr(SortGroupClause *sgClause, List *targetList); extern List *get_sortgrouplist_exprs(List *sgClauses, List *targetList); extern Oid *extract_grouping_ops(List *groupClause); extern AttrNumber *extract_grouping_cols(List *groupClause, List *tlist); extern bool grouping_is_sortable(List *groupClause); extern bool grouping_is_hashable(List *groupClause); #endif /* TLIST_H */ PKBiZ  server/optimizer/geqo_random.hnu[/*------------------------------------------------------------------------- * * geqo_random.h * random number generator * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/optimizer/geqo_random.h * *------------------------------------------------------------------------- */ /* contributed by: =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= * Martin Utesch * Institute of Automatic Control * = = University of Mining and Technology = * utesch@aut.tu-freiberg.de * Freiberg, Germany * =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= */ /* -- parts of this are adapted from D. Whitley's Genitor algorithm -- */ #ifndef GEQO_RANDOM_H #define GEQO_RANDOM_H #include #include "optimizer/geqo.h" extern void geqo_set_seed(PlannerInfo *root, double seed); /* geqo_rand returns a random float value between 0 and 1 inclusive */ extern double geqo_rand(PlannerInfo *root); /* geqo_randint returns integer value between lower and upper inclusive */ #define geqo_randint(root, upper, lower) \ ( (int) floor( geqo_rand(root)*(((upper)-(lower))+0.999999) ) + (lower) ) #endif /* GEQO_RANDOM_H */ PKBiZSϞserver/optimizer/prep.hnu[/*------------------------------------------------------------------------- * * prep.h * prototypes for files in optimizer/prep/ * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/optimizer/prep.h * *------------------------------------------------------------------------- */ #ifndef PREP_H #define PREP_H #include "nodes/plannodes.h" #include "nodes/relation.h" /* * prototypes for prepjointree.c */ extern void pull_up_sublinks(PlannerInfo *root); extern void inline_set_returning_functions(PlannerInfo *root); extern Node *pull_up_subqueries(PlannerInfo *root, Node *jtnode, JoinExpr *lowest_outer_join, AppendRelInfo *containing_appendrel); extern void flatten_simple_union_all(PlannerInfo *root); extern void reduce_outer_joins(PlannerInfo *root); extern Relids get_relids_in_jointree(Node *jtnode, bool include_joins); extern Relids get_relids_for_join(PlannerInfo *root, int joinrelid); /* * prototypes for prepqual.c */ extern Node *negate_clause(Node *node); extern Expr *canonicalize_qual(Expr *qual); /* * prototypes for preptlist.c */ extern List *preprocess_targetlist(PlannerInfo *root, List *tlist); extern PlanRowMark *get_plan_rowmark(List *rowmarks, Index rtindex); /* * prototypes for prepunion.c */ extern Plan *plan_set_operations(PlannerInfo *root, double tuple_fraction, List **sortClauses); extern void expand_inherited_tables(PlannerInfo *root); extern Node *adjust_appendrel_attrs(PlannerInfo *root, Node *node, AppendRelInfo *appinfo); extern Node *adjust_appendrel_attrs_multilevel(PlannerInfo *root, Node *node, RelOptInfo *child_rel); #endif /* PREP_H */ PKBiZ=server/optimizer/placeholder.hnu[/*------------------------------------------------------------------------- * * placeholder.h * prototypes for optimizer/util/placeholder.c. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/optimizer/placeholder.h * *------------------------------------------------------------------------- */ #ifndef PLACEHOLDER_H #define PLACEHOLDER_H #include "nodes/relation.h" extern PlaceHolderVar *make_placeholder_expr(PlannerInfo *root, Expr *expr, Relids phrels); extern PlaceHolderInfo *find_placeholder_info(PlannerInfo *root, PlaceHolderVar *phv, bool create_new_ph); extern void find_placeholders_in_jointree(PlannerInfo *root); extern void mark_placeholder_maybe_needed(PlannerInfo *root, PlaceHolderInfo *phinfo, Relids relids); extern void update_placeholder_eval_levels(PlannerInfo *root, SpecialJoinInfo *new_sjinfo); extern void fix_placeholder_input_needed_levels(PlannerInfo *root); extern void add_placeholders_to_base_rels(PlannerInfo *root); extern void add_placeholders_to_joinrel(PlannerInfo *root, RelOptInfo *joinrel); #endif /* PLACEHOLDER_H */ PKBiZpserver/optimizer/var.hnu[/*------------------------------------------------------------------------- * * var.h * prototypes for optimizer/util/var.c. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/optimizer/var.h * *------------------------------------------------------------------------- */ #ifndef VAR_H #define VAR_H #include "nodes/relation.h" typedef enum { PVC_REJECT_AGGREGATES, /* throw error if Aggref found */ PVC_INCLUDE_AGGREGATES, /* include Aggrefs in output list */ PVC_RECURSE_AGGREGATES /* recurse into Aggref arguments */ } PVCAggregateBehavior; typedef enum { PVC_REJECT_PLACEHOLDERS, /* throw error if PlaceHolderVar found */ PVC_INCLUDE_PLACEHOLDERS, /* include PlaceHolderVars in output list */ PVC_RECURSE_PLACEHOLDERS /* recurse into PlaceHolderVar arguments */ } PVCPlaceHolderBehavior; extern Relids pull_varnos(Node *node); extern void pull_varattnos(Node *node, Index varno, Bitmapset **varattnos); extern bool contain_var_clause(Node *node); extern bool contain_vars_of_level(Node *node, int levelsup); extern int locate_var_of_level(Node *node, int levelsup); extern int locate_var_of_relation(Node *node, int relid, int levelsup); extern int find_minimum_var_level(Node *node); extern List *pull_var_clause(Node *node, PVCAggregateBehavior aggbehavior, PVCPlaceHolderBehavior phbehavior); extern Node *flatten_join_alias_vars(PlannerInfo *root, Node *node); #endif /* VAR_H */ PKBiZZZserver/optimizer/geqo_gene.hnu[/*------------------------------------------------------------------------- * * geqo_gene.h * genome representation in optimizer/geqo * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/optimizer/geqo_gene.h * *------------------------------------------------------------------------- */ /* contributed by: =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= * Martin Utesch * Institute of Automatic Control * = = University of Mining and Technology = * utesch@aut.tu-freiberg.de * Freiberg, Germany * =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= */ #ifndef GEQO_GENE_H #define GEQO_GENE_H #include "nodes/nodes.h" /* we presume that int instead of Relid is o.k. for Gene; so don't change it! */ typedef int Gene; typedef struct Chromosome { Gene *string; Cost worth; } Chromosome; typedef struct Pool { Chromosome *data; int size; int string_length; } Pool; #endif /* GEQO_GENE_H */ PKBiZDc+hhserver/optimizer/planmain.hnu[/*------------------------------------------------------------------------- * * planmain.h * prototypes for various files in optimizer/plan * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/optimizer/planmain.h * *------------------------------------------------------------------------- */ #ifndef PLANMAIN_H #define PLANMAIN_H #include "nodes/plannodes.h" #include "nodes/relation.h" /* GUC parameters */ #define DEFAULT_CURSOR_TUPLE_FRACTION 0.1 extern double cursor_tuple_fraction; /* query_planner callback to compute query_pathkeys */ typedef void (*query_pathkeys_callback) (PlannerInfo *root, void *extra); /* * prototypes for plan/planmain.c */ extern void query_planner(PlannerInfo *root, List *tlist, double tuple_fraction, double limit_tuples, query_pathkeys_callback qp_callback, void *qp_extra, Path **cheapest_path, Path **sorted_path, double *num_groups); /* * prototypes for plan/planagg.c */ extern void preprocess_minmax_aggregates(PlannerInfo *root, List *tlist); extern Plan *optimize_minmax_aggregates(PlannerInfo *root, List *tlist, const AggClauseCosts *aggcosts, Path *best_path); /* * prototypes for plan/createplan.c */ extern Plan *create_plan(PlannerInfo *root, Path *best_path); extern SubqueryScan *make_subqueryscan(List *qptlist, List *qpqual, Index scanrelid, Plan *subplan); extern ForeignScan *make_foreignscan(List *qptlist, List *qpqual, Index scanrelid, List *fdw_exprs, List *fdw_private); extern Append *make_append(List *appendplans, List *tlist); extern RecursiveUnion *make_recursive_union(List *tlist, Plan *lefttree, Plan *righttree, int wtParam, List *distinctList, long numGroups); extern Sort *make_sort_from_pathkeys(PlannerInfo *root, Plan *lefttree, List *pathkeys, double limit_tuples); extern Sort *make_sort_from_sortclauses(PlannerInfo *root, List *sortcls, Plan *lefttree); extern Sort *make_sort_from_groupcols(PlannerInfo *root, List *groupcls, AttrNumber *grpColIdx, Plan *lefttree); extern Agg *make_agg(PlannerInfo *root, List *tlist, List *qual, AggStrategy aggstrategy, const AggClauseCosts *aggcosts, int numGroupCols, AttrNumber *grpColIdx, Oid *grpOperators, long numGroups, Plan *lefttree); extern WindowAgg *make_windowagg(PlannerInfo *root, List *tlist, List *windowFuncs, Index winref, int partNumCols, AttrNumber *partColIdx, Oid *partOperators, int ordNumCols, AttrNumber *ordColIdx, Oid *ordOperators, int frameOptions, Node *startOffset, Node *endOffset, Plan *lefttree); extern Group *make_group(PlannerInfo *root, List *tlist, List *qual, int numGroupCols, AttrNumber *grpColIdx, Oid *grpOperators, double numGroups, Plan *lefttree); extern Plan *materialize_finished_plan(Plan *subplan); extern Unique *make_unique(Plan *lefttree, List *distinctList); extern LockRows *make_lockrows(Plan *lefttree, List *rowMarks, int epqParam); extern Limit *make_limit(Plan *lefttree, Node *limitOffset, Node *limitCount, int64 offset_est, int64 count_est); extern SetOp *make_setop(SetOpCmd cmd, SetOpStrategy strategy, Plan *lefttree, List *distinctList, AttrNumber flagColIdx, int firstFlag, long numGroups, double outputRows); extern Result *make_result(PlannerInfo *root, List *tlist, Node *resconstantqual, Plan *subplan); extern ModifyTable *make_modifytable(CmdType operation, bool canSetTag, List *resultRelations, List *subplans, List *returningLists, List *rowMarks, int epqParam); extern bool is_projection_capable_plan(Plan *plan); /* * prototypes for plan/initsplan.c */ extern int from_collapse_limit; extern int join_collapse_limit; extern void add_base_rels_to_query(PlannerInfo *root, Node *jtnode); extern void build_base_rel_tlists(PlannerInfo *root, List *final_tlist); extern void add_vars_to_targetlist(PlannerInfo *root, List *vars, Relids where_needed, bool create_new_ph); extern List *deconstruct_jointree(PlannerInfo *root); extern void distribute_restrictinfo_to_rels(PlannerInfo *root, RestrictInfo *restrictinfo); extern void process_implied_equality(PlannerInfo *root, Oid opno, Oid collation, Expr *item1, Expr *item2, Relids qualscope, Relids nullable_relids, bool below_outer_join, bool both_const); extern RestrictInfo *build_implied_join_equality(Oid opno, Oid collation, Expr *item1, Expr *item2, Relids qualscope, Relids nullable_relids); /* * prototypes for plan/analyzejoins.c */ extern List *remove_useless_joins(PlannerInfo *root, List *joinlist); /* * prototypes for plan/setrefs.c */ extern Plan *set_plan_references(PlannerInfo *root, Plan *plan); extern void fix_opfuncids(Node *node); extern void set_opfuncid(OpExpr *opexpr); extern void set_sa_opfuncid(ScalarArrayOpExpr *opexpr); extern void record_plan_function_dependency(PlannerInfo *root, Oid funcid); extern void extract_query_dependencies(Node *query, List **relationOids, List **invalItems); #endif /* PLANMAIN_H */ PKBiZA',%%server/optimizer/geqo_pool.hnu[/*------------------------------------------------------------------------- * * geqo_pool.h * pool representation in optimizer/geqo * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/optimizer/geqo_pool.h * *------------------------------------------------------------------------- */ /* contributed by: =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= * Martin Utesch * Institute of Automatic Control * = = University of Mining and Technology = * utesch@aut.tu-freiberg.de * Freiberg, Germany * =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= */ #ifndef GEQO_POOL_H #define GEQO_POOL_H #include "optimizer/geqo.h" extern Pool *alloc_pool(PlannerInfo *root, int pool_size, int string_length); extern void free_pool(PlannerInfo *root, Pool *pool); extern void random_init_pool(PlannerInfo *root, Pool *pool); extern Chromosome *alloc_chromo(PlannerInfo *root, int string_length); extern void free_chromo(PlannerInfo *root, Chromosome *chromo); extern void spread_chromo(PlannerInfo *root, Chromosome *chromo, Pool *pool); extern void sort_pool(PlannerInfo *root, Pool *pool); #endif /* GEQO_POOL_H */ PKBiZAeAe server/c.hnu[/*------------------------------------------------------------------------- * * c.h * Fundamental C definitions. This is included by every .c file in * PostgreSQL (via either postgres.h or postgres_fe.h, as appropriate). * * Note that the definitions here are not intended to be exposed to clients * of the frontend interface libraries --- so we don't worry much about * polluting the namespace with lots of stuff... * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/c.h * *------------------------------------------------------------------------- */ /* *---------------------------------------------------------------- * TABLE OF CONTENTS * * When adding stuff to this file, please try to put stuff * into the relevant section, or add new sections as appropriate. * * section description * ------- ------------------------------------------------ * 0) pg_config.h and standard system headers * 1) hacks to cope with non-ANSI C compilers * 2) bool, true, false, TRUE, FALSE, NULL * 3) standard system types * 4) IsValid macros for system types * 5) offsetof, lengthof, endof, alignment * 6) widely useful macros * 7) random stuff * 8) system-specific hacks * * NOTE: since this file is included by both frontend and backend modules, it's * almost certainly wrong to put an "extern" declaration here. typedefs and * macros are the kind of thing that might go here. * *---------------------------------------------------------------- */ #ifndef C_H #define C_H /* * We have to include stdlib.h here because it defines many of these macros * on some platforms, and we only want our definitions used if stdlib.h doesn't * have its own. The same goes for stddef and stdarg if present. */ #include "pg_config.h" #include "pg_config_manual.h" /* must be after pg_config.h */ #if !defined(WIN32) && !defined(__CYGWIN__) /* win32 will include further * down */ #include "pg_config_os.h" /* must be before any system header files */ #endif #include "postgres_ext.h" #if _MSC_VER >= 1400 || defined(HAVE_CRTDEFS_H) #define errcode __msvc_errcode #include #undef errcode #endif #include #include #include #include #include #ifdef HAVE_STRINGS_H #include #endif #ifdef HAVE_STDINT_H #include #endif #include #include #if defined(WIN32) || defined(__CYGWIN__) #include /* ensure O_BINARY is available */ #endif #if defined(WIN32) || defined(__CYGWIN__) /* We have to redefine some system functions after they are included above. */ #include "pg_config_os.h" #endif /* Must be before gettext() games below */ #include #define _(x) gettext(x) #ifdef ENABLE_NLS #include #else #define gettext(x) (x) #define dgettext(d,x) (x) #define ngettext(s,p,n) ((n) == 1 ? (s) : (p)) #define dngettext(d,s,p,n) ((n) == 1 ? (s) : (p)) #endif /* * Use this to mark string constants as needing translation at some later * time, rather than immediately. This is useful for cases where you need * access to the original string and translated string, and for cases where * immediate translation is not possible, like when initializing global * variables. * http://www.gnu.org/software/autoconf/manual/gettext/Special-cases.html */ #define gettext_noop(x) (x) /* ---------------------------------------------------------------- * Section 1: hacks to cope with non-ANSI C compilers * * type prefixes (const, signed, volatile, inline) are handled in pg_config.h. * ---------------------------------------------------------------- */ /* * Hints to the compiler about the likelihood of a branch. Both likely() and * unlikely() return the boolean value of the contained expression. * * These should only be used sparingly, in very hot code paths. It's very easy * to mis-estimate likelihoods. */ #if __GNUC__ >= 3 #define likely(x) __builtin_expect((x) != 0, 1) #define unlikely(x) __builtin_expect((x) != 0, 0) #else #define likely(x) ((x) != 0) #define unlikely(x) ((x) != 0) #endif /* * CppAsString * Convert the argument to a string, using the C preprocessor. * CppConcat * Concatenate two arguments together, using the C preprocessor. * * Note: the standard Autoconf macro AC_C_STRINGIZE actually only checks * whether #identifier works, but if we have that we likely have ## too. */ #if defined(HAVE_STRINGIZE) #define CppAsString(identifier) #identifier #define CppConcat(x, y) x##y #else /* !HAVE_STRINGIZE */ #define CppAsString(identifier) "identifier" /* * CppIdentity -- On Reiser based cpp's this is used to concatenate * two tokens. That is * CppIdentity(A)B ==> AB * We renamed it to _private_CppIdentity because it should not * be referenced outside this file. On other cpp's it * produces A B. */ #define _priv_CppIdentity(x)x #define CppConcat(x, y) _priv_CppIdentity(x)y #endif /* !HAVE_STRINGIZE */ /* * dummyret is used to set return values in macros that use ?: to make * assignments. gcc wants these to be void, other compilers like char */ #ifdef __GNUC__ /* GNU cc */ #define dummyret void #else #define dummyret char #endif #ifndef __GNUC__ #define __attribute__(_arg_) #endif /* ---------------------------------------------------------------- * Section 2: bool, true, false, TRUE, FALSE, NULL * ---------------------------------------------------------------- */ /* * bool * Boolean value, either true or false. * * XXX for C++ compilers, we assume the compiler has a compatible * built-in definition of bool. */ #ifndef __cplusplus #ifndef bool typedef char bool; #endif #ifndef true #define true ((bool) 1) #endif #ifndef false #define false ((bool) 0) #endif #endif /* not C++ */ typedef bool *BoolPtr; #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif /* * NULL * Null pointer. */ #ifndef NULL #define NULL ((void *) 0) #endif /* ---------------------------------------------------------------- * Section 3: standard system types * ---------------------------------------------------------------- */ /* * stdint.h limits aren't guaranteed to be present and aren't guaranteed to * have compatible types with our fixed width types. So just define our own. */ #define PG_INT8_MIN (-0x7F-1) #define PG_INT8_MAX (0x7F) #define PG_UINT8_MAX (0xFF) #define PG_INT16_MIN (-0x7FFF-1) #define PG_INT16_MAX (0x7FFF) #define PG_UINT16_MAX (0xFFFF) #define PG_INT32_MIN (-0x7FFFFFFF-1) #define PG_INT32_MAX (0x7FFFFFFF) #define PG_UINT32_MAX (0xFFFFFFFFU) #define PG_INT64_MIN (-INT64CONST(0x7FFFFFFFFFFFFFFF) - 1) #define PG_INT64_MAX INT64CONST(0x7FFFFFFFFFFFFFFF) #define PG_UINT64_MAX UINT64CONST(0xFFFFFFFFFFFFFFFF) /* * Pointer * Variable holding address of any memory resident object. * * XXX Pointer arithmetic is done with this, so it can't be void * * under "true" ANSI compilers. */ typedef char *Pointer; /* * intN * Signed integer, EXACTLY N BITS IN SIZE, * used for numerical computations and the * frontend/backend protocol. */ #ifndef HAVE_INT8 typedef signed char int8; /* == 8 bits */ typedef signed short int16; /* == 16 bits */ typedef signed int int32; /* == 32 bits */ #endif /* not HAVE_INT8 */ /* * uintN * Unsigned integer, EXACTLY N BITS IN SIZE, * used for numerical computations and the * frontend/backend protocol. */ #ifndef HAVE_UINT8 typedef unsigned char uint8; /* == 8 bits */ typedef unsigned short uint16; /* == 16 bits */ typedef unsigned int uint32; /* == 32 bits */ #endif /* not HAVE_UINT8 */ /* * bitsN * Unit of bitwise operation, AT LEAST N BITS IN SIZE. */ typedef uint8 bits8; /* >= 8 bits */ typedef uint16 bits16; /* >= 16 bits */ typedef uint32 bits32; /* >= 32 bits */ /* * 64-bit integers */ #ifdef HAVE_LONG_INT_64 /* Plain "long int" fits, use it */ #ifndef HAVE_INT64 typedef long int int64; #endif #ifndef HAVE_UINT64 typedef unsigned long int uint64; #endif #define INT64CONST(x) (x##L) #define UINT64CONST(x) (x##UL) #elif defined(HAVE_LONG_LONG_INT_64) /* We have working support for "long long int", use that */ #ifndef HAVE_INT64 typedef long long int int64; #endif #ifndef HAVE_UINT64 typedef unsigned long long int uint64; #endif #define INT64CONST(x) (x##LL) #define UINT64CONST(x) (x##ULL) #else /* neither HAVE_LONG_INT_64 nor HAVE_LONG_LONG_INT_64 */ #error must have a working 64-bit integer datatype #endif /* Max value of size_t might be missing if we don't have stdint.h */ #ifndef SIZE_MAX #if SIZEOF_SIZE_T == 8 #define SIZE_MAX UINT64CONST(0xFFFFFFFFFFFFFFFF) #else #define SIZE_MAX (0xFFFFFFFFU) #endif #endif /* Select timestamp representation (float8 or int64) */ #ifdef USE_INTEGER_DATETIMES #define HAVE_INT64_TIMESTAMP #endif /* sig_atomic_t is required by ANSI C, but may be missing on old platforms */ #ifndef HAVE_SIG_ATOMIC_T typedef int sig_atomic_t; #endif /* * Size * Size of any memory resident object, as returned by sizeof. */ typedef size_t Size; /* * Index * Index into any memory resident array. * * Note: * Indices are non negative. */ typedef unsigned int Index; /* * Offset * Offset into any memory resident array. * * Note: * This differs from an Index in that an Index is always * non negative, whereas Offset may be negative. */ typedef signed int Offset; /* * Common Postgres datatype names (as used in the catalogs) */ typedef int16 int2; typedef int32 int4; typedef float float4; typedef double float8; /* * Oid, RegProcedure, TransactionId, SubTransactionId, MultiXactId, * CommandId */ /* typedef Oid is in postgres_ext.h */ /* * regproc is the type name used in the include/catalog headers, but * RegProcedure is the preferred name in C code. */ typedef Oid regproc; typedef regproc RegProcedure; typedef uint32 TransactionId; typedef uint32 LocalTransactionId; typedef uint32 SubTransactionId; #define InvalidSubTransactionId ((SubTransactionId) 0) #define TopSubTransactionId ((SubTransactionId) 1) /* MultiXactId must be equivalent to TransactionId, to fit in t_xmax */ typedef TransactionId MultiXactId; typedef uint32 MultiXactOffset; typedef uint32 CommandId; #define FirstCommandId ((CommandId) 0) /* * Array indexing support */ #define MAXDIM 6 typedef struct { int indx[MAXDIM]; } IntArray; /* ---------------- * Variable-length datatypes all share the 'struct varlena' header. * * NOTE: for TOASTable types, this is an oversimplification, since the value * may be compressed or moved out-of-line. However datatype-specific routines * are mostly content to deal with de-TOASTed values only, and of course * client-side routines should never see a TOASTed value. But even in a * de-TOASTed value, beware of touching vl_len_ directly, as its representation * is no longer convenient. It's recommended that code always use the VARDATA, * VARSIZE, and SET_VARSIZE macros instead of relying on direct mentions of * the struct fields. See postgres.h for details of the TOASTed form. * ---------------- */ struct varlena { char vl_len_[4]; /* Do not touch this field directly! */ char vl_dat[1]; }; #define VARHDRSZ ((int32) sizeof(int32)) /* * These widely-used datatypes are just a varlena header and the data bytes. * There is no terminating null or anything like that --- the data length is * always VARSIZE(ptr) - VARHDRSZ. */ typedef struct varlena bytea; typedef struct varlena text; typedef struct varlena BpChar; /* blank-padded char, ie SQL char(n) */ typedef struct varlena VarChar; /* var-length char, ie SQL varchar(n) */ /* * Specialized array types. These are physically laid out just the same * as regular arrays (so that the regular array subscripting code works * with them). They exist as distinct types mostly for historical reasons: * they have nonstandard I/O behavior which we don't want to change for fear * of breaking applications that look at the system catalogs. There is also * an implementation issue for oidvector: it's part of the primary key for * pg_proc, and we can't use the normal btree array support routines for that * without circularity. */ typedef struct { int32 vl_len_; /* these fields must match ArrayType! */ int ndim; /* always 1 for int2vector */ int32 dataoffset; /* always 0 for int2vector */ Oid elemtype; int dim1; int lbound1; int2 values[1]; /* VARIABLE LENGTH ARRAY */ } int2vector; /* VARIABLE LENGTH STRUCT */ typedef struct { int32 vl_len_; /* these fields must match ArrayType! */ int ndim; /* always 1 for oidvector */ int32 dataoffset; /* always 0 for oidvector */ Oid elemtype; int dim1; int lbound1; Oid values[1]; /* VARIABLE LENGTH ARRAY */ } oidvector; /* VARIABLE LENGTH STRUCT */ /* * Representation of a Name: effectively just a C string, but null-padded to * exactly NAMEDATALEN bytes. The use of a struct is historical. */ typedef struct nameData { char data[NAMEDATALEN]; } NameData; typedef NameData *Name; #define NameStr(name) ((name).data) /* * Support macros for escaping strings. escape_backslash should be TRUE * if generating a non-standard-conforming string. Prefixing a string * with ESCAPE_STRING_SYNTAX guarantees it is non-standard-conforming. * Beware of multiple evaluation of the "ch" argument! */ #define SQL_STR_DOUBLE(ch, escape_backslash) \ ((ch) == '\'' || ((ch) == '\\' && (escape_backslash))) #define ESCAPE_STRING_SYNTAX 'E' /* ---------------------------------------------------------------- * Section 4: IsValid macros for system types * ---------------------------------------------------------------- */ /* * BoolIsValid * True iff bool is valid. */ #define BoolIsValid(boolean) ((boolean) == false || (boolean) == true) /* * PointerIsValid * True iff pointer is valid. */ #define PointerIsValid(pointer) ((const void*)(pointer) != NULL) /* * PointerIsAligned * True iff pointer is properly aligned to point to the given type. */ #define PointerIsAligned(pointer, type) \ (((intptr_t)(pointer) % (sizeof (type))) == 0) #define OidIsValid(objectId) ((bool) ((objectId) != InvalidOid)) #define RegProcedureIsValid(p) OidIsValid(p) /* ---------------------------------------------------------------- * Section 5: offsetof, lengthof, endof, alignment * ---------------------------------------------------------------- */ /* * offsetof * Offset of a structure/union field within that structure/union. * * XXX This is supposed to be part of stddef.h, but isn't on * some systems (like SunOS 4). */ #ifndef offsetof #define offsetof(type, field) ((long) &((type *)0)->field) #endif /* offsetof */ /* * lengthof * Number of elements in an array. */ #define lengthof(array) (sizeof (array) / sizeof ((array)[0])) /* * endof * Address of the element one past the last in an array. */ #define endof(array) (&(array)[lengthof(array)]) /* ---------------- * Alignment macros: align a length or address appropriately for a given type. * The fooALIGN() macros round up to a multiple of the required alignment, * while the fooALIGN_DOWN() macros round down. The latter are more useful * for problems like "how many X-sized structures will fit in a page?". * * NOTE: TYPEALIGN[_DOWN] will not work if ALIGNVAL is not a power of 2. * That case seems extremely unlikely to be needed in practice, however. * ---------------- */ #define TYPEALIGN(ALIGNVAL,LEN) \ (((intptr_t) (LEN) + ((ALIGNVAL) - 1)) & ~((intptr_t) ((ALIGNVAL) - 1))) #define SHORTALIGN(LEN) TYPEALIGN(ALIGNOF_SHORT, (LEN)) #define INTALIGN(LEN) TYPEALIGN(ALIGNOF_INT, (LEN)) #define LONGALIGN(LEN) TYPEALIGN(ALIGNOF_LONG, (LEN)) #define DOUBLEALIGN(LEN) TYPEALIGN(ALIGNOF_DOUBLE, (LEN)) #define MAXALIGN(LEN) TYPEALIGN(MAXIMUM_ALIGNOF, (LEN)) /* MAXALIGN covers only built-in types, not buffers */ #define BUFFERALIGN(LEN) TYPEALIGN(ALIGNOF_BUFFER, (LEN)) #define TYPEALIGN_DOWN(ALIGNVAL,LEN) \ (((intptr_t) (LEN)) & ~((intptr_t) ((ALIGNVAL) - 1))) #define SHORTALIGN_DOWN(LEN) TYPEALIGN_DOWN(ALIGNOF_SHORT, (LEN)) #define INTALIGN_DOWN(LEN) TYPEALIGN_DOWN(ALIGNOF_INT, (LEN)) #define LONGALIGN_DOWN(LEN) TYPEALIGN_DOWN(ALIGNOF_LONG, (LEN)) #define DOUBLEALIGN_DOWN(LEN) TYPEALIGN_DOWN(ALIGNOF_DOUBLE, (LEN)) #define MAXALIGN_DOWN(LEN) TYPEALIGN_DOWN(MAXIMUM_ALIGNOF, (LEN)) /* ---------------------------------------------------------------- * Section 6: widely useful macros * ---------------------------------------------------------------- */ /* * Max * Return the maximum of two numbers. */ #define Max(x, y) ((x) > (y) ? (x) : (y)) /* * Min * Return the minimum of two numbers. */ #define Min(x, y) ((x) < (y) ? (x) : (y)) /* * Abs * Return the absolute value of the argument. */ #define Abs(x) ((x) >= 0 ? (x) : -(x)) /* * StrNCpy * Like standard library function strncpy(), except that result string * is guaranteed to be null-terminated --- that is, at most N-1 bytes * of the source string will be kept. * Also, the macro returns no result (too hard to do that without * evaluating the arguments multiple times, which seems worse). * * BTW: when you need to copy a non-null-terminated string (like a text * datum) and add a null, do not do it with StrNCpy(..., len+1). That * might seem to work, but it fetches one byte more than there is in the * text object. One fine day you'll have a SIGSEGV because there isn't * another byte before the end of memory. Don't laugh, we've had real * live bug reports from real live users over exactly this mistake. * Do it honestly with "memcpy(dst,src,len); dst[len] = '\0';", instead. */ #define StrNCpy(dst,src,len) \ do \ { \ char * _dst = (dst); \ Size _len = (len); \ \ if (_len > 0) \ { \ strncpy(_dst, (src), _len); \ _dst[_len-1] = '\0'; \ } \ } while (0) /* Get a bit mask of the bits set in non-long aligned addresses */ #define LONG_ALIGN_MASK (sizeof(long) - 1) /* * MemSet * Exactly the same as standard library function memset(), but considerably * faster for zeroing small word-aligned structures (such as parsetree nodes). * This has to be a macro because the main point is to avoid function-call * overhead. However, we have also found that the loop is faster than * native libc memset() on some platforms, even those with assembler * memset() functions. More research needs to be done, perhaps with * MEMSET_LOOP_LIMIT tests in configure. */ #define MemSet(start, val, len) \ do \ { \ /* must be void* because we don't know if it is integer aligned yet */ \ void *_vstart = (void *) (start); \ int _val = (val); \ Size _len = (len); \ \ if ((((intptr_t) _vstart) & LONG_ALIGN_MASK) == 0 && \ (_len & LONG_ALIGN_MASK) == 0 && \ _val == 0 && \ _len <= MEMSET_LOOP_LIMIT && \ /* \ * If MEMSET_LOOP_LIMIT == 0, optimizer should find \ * the whole "if" false at compile time. \ */ \ MEMSET_LOOP_LIMIT != 0) \ { \ long *_start = (long *) _vstart; \ long *_stop = (long *) ((char *) _start + _len); \ while (_start < _stop) \ *_start++ = 0; \ } \ else \ memset(_vstart, _val, _len); \ } while (0) /* * MemSetAligned is the same as MemSet except it omits the test to see if * "start" is word-aligned. This is okay to use if the caller knows a-priori * that the pointer is suitably aligned (typically, because he just got it * from palloc(), which always delivers a max-aligned pointer). */ #define MemSetAligned(start, val, len) \ do \ { \ long *_start = (long *) (start); \ int _val = (val); \ Size _len = (len); \ \ if ((_len & LONG_ALIGN_MASK) == 0 && \ _val == 0 && \ _len <= MEMSET_LOOP_LIMIT && \ MEMSET_LOOP_LIMIT != 0) \ { \ long *_stop = (long *) ((char *) _start + _len); \ while (_start < _stop) \ *_start++ = 0; \ } \ else \ memset(_start, _val, _len); \ } while (0) /* * MemSetTest/MemSetLoop are a variant version that allow all the tests in * MemSet to be done at compile time in cases where "val" and "len" are * constants *and* we know the "start" pointer must be word-aligned. * If MemSetTest succeeds, then it is okay to use MemSetLoop, otherwise use * MemSetAligned. Beware of multiple evaluations of the arguments when using * this approach. */ #define MemSetTest(val, len) \ ( ((len) & LONG_ALIGN_MASK) == 0 && \ (len) <= MEMSET_LOOP_LIMIT && \ MEMSET_LOOP_LIMIT != 0 && \ (val) == 0 ) #define MemSetLoop(start, val, len) \ do \ { \ long * _start = (long *) (start); \ long * _stop = (long *) ((char *) _start + (Size) (len)); \ \ while (_start < _stop) \ *_start++ = 0; \ } while (0) /* ---------------------------------------------------------------- * Section 7: random stuff * ---------------------------------------------------------------- */ /* msb for char */ #define HIGHBIT (0x80) #define IS_HIGHBIT_SET(ch) ((unsigned char)(ch) & HIGHBIT) #define STATUS_OK (0) #define STATUS_ERROR (-1) #define STATUS_EOF (-2) #define STATUS_FOUND (1) #define STATUS_WAITING (2) /* * Append PG_USED_FOR_ASSERTS_ONLY to definitions of variables that are only * used in assert-enabled builds, to avoid compiler warnings about unused * variables in assert-disabled builds. */ #ifdef USE_ASSERT_CHECKING #define PG_USED_FOR_ASSERTS_ONLY #else #define PG_USED_FOR_ASSERTS_ONLY __attribute__((unused)) #endif /* gettext domain name mangling */ /* * To better support parallel installations of major PostgreSQL * versions as well as parallel installations of major library soname * versions, we mangle the gettext domain name by appending those * version numbers. The coding rule ought to be that whereever the * domain name is mentioned as a literal, it must be wrapped into * PG_TEXTDOMAIN(). The macros below do not work on non-literals; but * that is somewhat intentional because it avoids having to worry * about multiple states of premangling and postmangling as the values * are being passed around. * * Make sure this matches the installation rules in nls-global.mk. */ /* need a second indirection because we want to stringize the macro value, not the name */ #define CppAsString2(x) CppAsString(x) #ifdef SO_MAJOR_VERSION #define PG_TEXTDOMAIN(domain) (domain CppAsString2(SO_MAJOR_VERSION) "-" PG_MAJORVERSION) #else #define PG_TEXTDOMAIN(domain) (domain "-" PG_MAJORVERSION) #endif /* ---------------------------------------------------------------- * Section 8: system-specific hacks * * This should be limited to things that absolutely have to be * included in every source file. The port-specific header file * is usually a better place for this sort of thing. * ---------------------------------------------------------------- */ /* * NOTE: this is also used for opening text files. * WIN32 treats Control-Z as EOF in files opened in text mode. * Therefore, we open files in binary mode on Win32 so we can read * literal control-Z. The other affect is that we see CRLF, but * that is OK because we can already handle those cleanly. */ #if defined(WIN32) || defined(__CYGWIN__) #define PG_BINARY O_BINARY #define PG_BINARY_A "ab" #define PG_BINARY_R "rb" #define PG_BINARY_W "wb" #else #define PG_BINARY 0 #define PG_BINARY_A "a" #define PG_BINARY_R "r" #define PG_BINARY_W "w" #endif /* * Provide prototypes for routines not present in a particular machine's * standard C library. */ #if !HAVE_DECL_SNPRINTF extern int snprintf(char *str, size_t count, const char *fmt,...) /* This extension allows gcc to check the format string */ __attribute__((format(PG_PRINTF_ATTRIBUTE, 3, 4))); #endif #if !HAVE_DECL_VSNPRINTF extern int vsnprintf(char *str, size_t count, const char *fmt, va_list args); #endif #if !defined(HAVE_MEMMOVE) && !defined(memmove) #define memmove(d, s, c) bcopy(s, d, c) #endif /* no special DLL markers on most ports */ #ifndef PGDLLIMPORT #define PGDLLIMPORT #endif #ifndef PGDLLEXPORT #define PGDLLEXPORT #endif /* * The following is used as the arg list for signal handlers. Any ports * that take something other than an int argument should override this in * their pg_config_os.h file. Note that variable names are required * because it is used in both the prototypes as well as the definitions. * Note also the long name. We expect that this won't collide with * other names causing compiler warnings. */ #ifndef SIGNAL_ARGS #define SIGNAL_ARGS int postgres_signal_arg #endif /* * When there is no sigsetjmp, its functionality is provided by plain * setjmp. Incidentally, nothing provides setjmp's functionality in * that case. */ #ifndef HAVE_SIGSETJMP #define sigjmp_buf jmp_buf #define sigsetjmp(x,y) setjmp(x) #define siglongjmp longjmp #endif #if defined(HAVE_FDATASYNC) && !HAVE_DECL_FDATASYNC extern int fdatasync(int fildes); #endif /* If strtoq() exists, rename it to the more standard strtoll() */ #if defined(HAVE_LONG_LONG_INT_64) && !defined(HAVE_STRTOLL) && defined(HAVE_STRTOQ) #define strtoll strtoq #define HAVE_STRTOLL 1 #endif /* If strtouq() exists, rename it to the more standard strtoull() */ #if defined(HAVE_LONG_LONG_INT_64) && !defined(HAVE_STRTOULL) && defined(HAVE_STRTOUQ) #define strtoull strtouq #define HAVE_STRTOULL 1 #endif /* * We assume if we have these two functions, we have their friends too, and * can use the wide-character functions. */ #if defined(HAVE_WCSTOMBS) && defined(HAVE_TOWLOWER) #define USE_WIDE_UPPER_LOWER #endif /* EXEC_BACKEND defines */ #ifdef EXEC_BACKEND #define NON_EXEC_STATIC #else #define NON_EXEC_STATIC static #endif /* /port compatibility functions */ #include "port.h" #endif /* C_H */ PKBiZ'server/nodes/params.hnu[/*------------------------------------------------------------------------- * * params.h * Support for finding the values associated with Param nodes. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/nodes/params.h * *------------------------------------------------------------------------- */ #ifndef PARAMS_H #define PARAMS_H /* To avoid including a pile of parser headers, reference ParseState thus: */ struct ParseState; /* ---------------- * ParamListInfo * * ParamListInfo arrays are used to pass parameters into the executor * for parameterized plans. Each entry in the array defines the value * to be substituted for a PARAM_EXTERN parameter. The "paramid" * of a PARAM_EXTERN Param can range from 1 to numParams. * * Although parameter numbers are normally consecutive, we allow * ptype == InvalidOid to signal an unused array entry. * * pflags is a flags field. Currently the only used bit is: * PARAM_FLAG_CONST signals the planner that it may treat this parameter * as a constant (i.e., generate a plan that works only for this value * of the parameter). * * There are two hook functions that can be associated with a ParamListInfo * array to support dynamic parameter handling. First, if paramFetch * isn't null and the executor requires a value for an invalid parameter * (one with ptype == InvalidOid), the paramFetch hook is called to give * it a chance to fill in the parameter value. Second, a parserSetup * hook can be supplied to re-instantiate the original parsing hooks if * a query needs to be re-parsed/planned (as a substitute for supposing * that the current ptype values represent a fixed set of parameter types). * Although the data structure is really an array, not a list, we keep * the old typedef name to avoid unnecessary code changes. * ---------------- */ #define PARAM_FLAG_CONST 0x0001 /* parameter is constant */ typedef struct ParamExternData { Datum value; /* parameter value */ bool isnull; /* is it NULL? */ uint16 pflags; /* flag bits, see above */ Oid ptype; /* parameter's datatype, or 0 */ } ParamExternData; typedef struct ParamListInfoData *ParamListInfo; typedef void (*ParamFetchHook) (ParamListInfo params, int paramid); typedef void (*ParserSetupHook) (struct ParseState *pstate, void *arg); typedef struct ParamListInfoData { ParamFetchHook paramFetch; /* parameter fetch hook */ void *paramFetchArg; ParserSetupHook parserSetup; /* parser setup hook */ void *parserSetupArg; int numParams; /* number of ParamExternDatas following */ ParamExternData params[1]; /* VARIABLE LENGTH ARRAY */ } ParamListInfoData; /* ---------------- * ParamExecData * * ParamExecData entries are used for executor internal parameters * (that is, values being passed into or out of a sub-query). The * paramid of a PARAM_EXEC Param is a (zero-based) index into an * array of ParamExecData records, which is referenced through * es_param_exec_vals or ecxt_param_exec_vals. * * If execPlan is not NULL, it points to a SubPlanState node that needs * to be executed to produce the value. (This is done so that we can have * lazy evaluation of InitPlans: they aren't executed until/unless a * result value is needed.) Otherwise the value is assumed to be valid * when needed. * ---------------- */ typedef struct ParamExecData { void *execPlan; /* should be "SubPlanState *" */ Datum value; bool isnull; } ParamExecData; /* Functions found in src/backend/nodes/params.c */ extern ParamListInfo copyParamList(ParamListInfo from); #endif /* PARAMS_H */ PKBiZ_Hrserver/nodes/value.hnu[/*------------------------------------------------------------------------- * * value.h * interface for Value nodes * * * Copyright (c) 2003-2012, PostgreSQL Global Development Group * * src/include/nodes/value.h * *------------------------------------------------------------------------- */ #ifndef VALUE_H #define VALUE_H #include "nodes/nodes.h" /*---------------------- * Value node * * The same Value struct is used for five node types: T_Integer, * T_Float, T_String, T_BitString, T_Null. * * Integral values are actually represented by a machine integer, * but both floats and strings are represented as strings. * Using T_Float as the node type simply indicates that * the contents of the string look like a valid numeric literal. * * (Before Postgres 7.0, we used a double to represent T_Float, * but that creates loss-of-precision problems when the value is * ultimately destined to be converted to NUMERIC. Since Value nodes * are only used in the parsing process, not for runtime data, it's * better to use the more general representation.) * * Note that an integer-looking string will get lexed as T_Float if * the value is too large to fit in a 'long'. * * Nulls, of course, don't need the value part at all. *---------------------- */ typedef struct Value { NodeTag type; /* tag appropriately (eg. T_String) */ union ValUnion { long ival; /* machine integer */ char *str; /* string */ } val; } Value; #define intVal(v) (((Value *)(v))->val.ival) #define floatVal(v) atof(((Value *)(v))->val.str) #define strVal(v) (((Value *)(v))->val.str) extern Value *makeInteger(long i); extern Value *makeFloat(char *numericStr); extern Value *makeString(char *str); extern Value *makeBitString(char *str); #endif /* VALUE_H */ PKBiZx~--server/nodes/pg_list.hnu[/*------------------------------------------------------------------------- * * pg_list.h * interface for PostgreSQL generic linked list package * * This package implements singly-linked homogeneous lists. * * It is important to have constant-time length, append, and prepend * operations. To achieve this, we deal with two distinct data * structures: * * 1. A set of "list cells": each cell contains a data field and * a link to the next cell in the list or NULL. * 2. A single structure containing metadata about the list: the * type of the list, pointers to the head and tail cells, and * the length of the list. * * We support three types of lists: * * T_List: lists of pointers * (in practice usually pointers to Nodes, but not always; * declared as "void *" to minimize casting annoyances) * T_IntList: lists of integers * T_OidList: lists of Oids * * (At the moment, ints and Oids are the same size, but they may not * always be so; try to be careful to maintain the distinction.) * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/nodes/pg_list.h * *------------------------------------------------------------------------- */ #ifndef PG_LIST_H #define PG_LIST_H #include "nodes/nodes.h" typedef struct ListCell ListCell; typedef struct List { NodeTag type; /* T_List, T_IntList, or T_OidList */ int length; ListCell *head; ListCell *tail; } List; struct ListCell { union { void *ptr_value; int int_value; Oid oid_value; } data; ListCell *next; }; /* * The *only* valid representation of an empty list is NIL; in other * words, a non-NIL list is guaranteed to have length >= 1 and * head/tail != NULL */ #define NIL ((List *) NULL) /* * These routines are used frequently. However, we can't implement * them as macros, since we want to avoid double-evaluation of macro * arguments. Therefore, we implement them using static inline functions * if supported by the compiler, or as regular functions otherwise. */ #ifdef USE_INLINE static inline ListCell * list_head(const List *l) { return l ? l->head : NULL; } static inline ListCell * list_tail(List *l) { return l ? l->tail : NULL; } static inline int list_length(const List *l) { return l ? l->length : 0; } #else extern ListCell *list_head(const List *l); extern ListCell *list_tail(List *l); extern int list_length(const List *l); #endif /* USE_INLINE */ /* * NB: There is an unfortunate legacy from a previous incarnation of * the List API: the macro lfirst() was used to mean "the data in this * cons cell". To avoid changing every usage of lfirst(), that meaning * has been kept. As a result, lfirst() takes a ListCell and returns * the data it contains; to get the data in the first cell of a * List, use linitial(). Worse, lsecond() is more closely related to * linitial() than lfirst(): given a List, lsecond() returns the data * in the second cons cell. */ #define lnext(lc) ((lc)->next) #define lfirst(lc) ((lc)->data.ptr_value) #define lfirst_int(lc) ((lc)->data.int_value) #define lfirst_oid(lc) ((lc)->data.oid_value) #define lfirst_node(type,lc) castNode(type, lfirst(lc)) #define linitial(l) lfirst(list_head(l)) #define linitial_int(l) lfirst_int(list_head(l)) #define linitial_oid(l) lfirst_oid(list_head(l)) #define linitial_node(type,l) castNode(type, linitial(l)) #define lsecond(l) lfirst(lnext(list_head(l))) #define lsecond_int(l) lfirst_int(lnext(list_head(l))) #define lsecond_oid(l) lfirst_oid(lnext(list_head(l))) #define lsecond_node(type,l) castNode(type, lsecond(l)) #define lthird(l) lfirst(lnext(lnext(list_head(l)))) #define lthird_int(l) lfirst_int(lnext(lnext(list_head(l)))) #define lthird_oid(l) lfirst_oid(lnext(lnext(list_head(l)))) #define lthird_node(type,l) castNode(type, lthird(l)) #define lfourth(l) lfirst(lnext(lnext(lnext(list_head(l))))) #define lfourth_int(l) lfirst_int(lnext(lnext(lnext(list_head(l))))) #define lfourth_oid(l) lfirst_oid(lnext(lnext(lnext(list_head(l))))) #define lfourth_node(type,l) castNode(type, lfourth(l)) #define llast(l) lfirst(list_tail(l)) #define llast_int(l) lfirst_int(list_tail(l)) #define llast_oid(l) lfirst_oid(list_tail(l)) #define llast_node(type,l) castNode(type, llast(l)) /* * Convenience macros for building fixed-length lists */ #define list_make1(x1) lcons(x1, NIL) #define list_make2(x1,x2) lcons(x1, list_make1(x2)) #define list_make3(x1,x2,x3) lcons(x1, list_make2(x2, x3)) #define list_make4(x1,x2,x3,x4) lcons(x1, list_make3(x2, x3, x4)) #define list_make1_int(x1) lcons_int(x1, NIL) #define list_make2_int(x1,x2) lcons_int(x1, list_make1_int(x2)) #define list_make3_int(x1,x2,x3) lcons_int(x1, list_make2_int(x2, x3)) #define list_make4_int(x1,x2,x3,x4) lcons_int(x1, list_make3_int(x2, x3, x4)) #define list_make1_oid(x1) lcons_oid(x1, NIL) #define list_make2_oid(x1,x2) lcons_oid(x1, list_make1_oid(x2)) #define list_make3_oid(x1,x2,x3) lcons_oid(x1, list_make2_oid(x2, x3)) #define list_make4_oid(x1,x2,x3,x4) lcons_oid(x1, list_make3_oid(x2, x3, x4)) /* * foreach - * a convenience macro which loops through the list */ #define foreach(cell, l) \ for ((cell) = list_head(l); (cell) != NULL; (cell) = lnext(cell)) /* * for_each_cell - * a convenience macro which loops through a list starting from a * specified cell */ #define for_each_cell(cell, initcell) \ for ((cell) = (initcell); (cell) != NULL; (cell) = lnext(cell)) /* * forboth - * a convenience macro for advancing through two linked lists * simultaneously. This macro loops through both lists at the same * time, stopping when either list runs out of elements. Depending * on the requirements of the call site, it may also be wise to * assert that the lengths of the two lists are equal. */ #define forboth(cell1, list1, cell2, list2) \ for ((cell1) = list_head(list1), (cell2) = list_head(list2); \ (cell1) != NULL && (cell2) != NULL; \ (cell1) = lnext(cell1), (cell2) = lnext(cell2)) /* * forthree - * the same for three lists */ #define forthree(cell1, list1, cell2, list2, cell3, list3) \ for ((cell1) = list_head(list1), (cell2) = list_head(list2), (cell3) = list_head(list3); \ (cell1) != NULL && (cell2) != NULL && (cell3) != NULL; \ (cell1) = lnext(cell1), (cell2) = lnext(cell2), (cell3) = lnext(cell3)) extern List *lappend(List *list, void *datum); extern List *lappend_int(List *list, int datum); extern List *lappend_oid(List *list, Oid datum); extern ListCell *lappend_cell(List *list, ListCell *prev, void *datum); extern ListCell *lappend_cell_int(List *list, ListCell *prev, int datum); extern ListCell *lappend_cell_oid(List *list, ListCell *prev, Oid datum); extern List *lcons(void *datum, List *list); extern List *lcons_int(int datum, List *list); extern List *lcons_oid(Oid datum, List *list); extern List *list_concat(List *list1, List *list2); extern List *list_truncate(List *list, int new_size); extern void *list_nth(const List *list, int n); extern int list_nth_int(const List *list, int n); extern Oid list_nth_oid(const List *list, int n); #define list_nth_node(type,list,n) castNode(type, list_nth(list, n)) extern bool list_member(const List *list, const void *datum); extern bool list_member_ptr(const List *list, const void *datum); extern bool list_member_int(const List *list, int datum); extern bool list_member_oid(const List *list, Oid datum); extern List *list_delete(List *list, void *datum); extern List *list_delete_ptr(List *list, void *datum); extern List *list_delete_int(List *list, int datum); extern List *list_delete_oid(List *list, Oid datum); extern List *list_delete_first(List *list); extern List *list_delete_cell(List *list, ListCell *cell, ListCell *prev); extern List *list_union(const List *list1, const List *list2); extern List *list_union_ptr(const List *list1, const List *list2); extern List *list_union_int(const List *list1, const List *list2); extern List *list_union_oid(const List *list1, const List *list2); extern List *list_intersection(const List *list1, const List *list2); /* currently, there's no need for list_intersection_int etc */ extern List *list_difference(const List *list1, const List *list2); extern List *list_difference_ptr(const List *list1, const List *list2); extern List *list_difference_int(const List *list1, const List *list2); extern List *list_difference_oid(const List *list1, const List *list2); extern List *list_append_unique(List *list, void *datum); extern List *list_append_unique_ptr(List *list, void *datum); extern List *list_append_unique_int(List *list, int datum); extern List *list_append_unique_oid(List *list, Oid datum); extern List *list_concat_unique(List *list1, List *list2); extern List *list_concat_unique_ptr(List *list1, List *list2); extern List *list_concat_unique_int(List *list1, List *list2); extern List *list_concat_unique_oid(List *list1, List *list2); extern void list_free(List *list); extern void list_free_deep(List *list); extern List *list_copy(const List *list); extern List *list_copy_tail(const List *list, int nskip); /* * To ease migration to the new list API, a set of compatibility * macros are provided that reduce the impact of the list API changes * as far as possible. Until client code has been rewritten to use the * new list API, the ENABLE_LIST_COMPAT symbol can be defined before * including pg_list.h */ #ifdef ENABLE_LIST_COMPAT #define lfirsti(lc) lfirst_int(lc) #define lfirsto(lc) lfirst_oid(lc) #define makeList1(x1) list_make1(x1) #define makeList2(x1, x2) list_make2(x1, x2) #define makeList3(x1, x2, x3) list_make3(x1, x2, x3) #define makeList4(x1, x2, x3, x4) list_make4(x1, x2, x3, x4) #define makeListi1(x1) list_make1_int(x1) #define makeListi2(x1, x2) list_make2_int(x1, x2) #define makeListo1(x1) list_make1_oid(x1) #define makeListo2(x1, x2) list_make2_oid(x1, x2) #define lconsi(datum, list) lcons_int(datum, list) #define lconso(datum, list) lcons_oid(datum, list) #define lappendi(list, datum) lappend_int(list, datum) #define lappendo(list, datum) lappend_oid(list, datum) #define nconc(l1, l2) list_concat(l1, l2) #define nth(n, list) list_nth(list, n) #define member(datum, list) list_member(list, datum) #define ptrMember(datum, list) list_member_ptr(list, datum) #define intMember(datum, list) list_member_int(list, datum) #define oidMember(datum, list) list_member_oid(list, datum) /* * Note that the old lremove() determined equality via pointer * comparison, whereas the new list_delete() uses equal(); in order to * keep the same behavior, we therefore need to map lremove() calls to * list_delete_ptr() rather than list_delete() */ #define lremove(elem, list) list_delete_ptr(list, elem) #define LispRemove(elem, list) list_delete(list, elem) #define lremovei(elem, list) list_delete_int(list, elem) #define lremoveo(elem, list) list_delete_oid(list, elem) #define ltruncate(n, list) list_truncate(list, n) #define set_union(l1, l2) list_union(l1, l2) #define set_uniono(l1, l2) list_union_oid(l1, l2) #define set_ptrUnion(l1, l2) list_union_ptr(l1, l2) #define set_difference(l1, l2) list_difference(l1, l2) #define set_differenceo(l1, l2) list_difference_oid(l1, l2) #define set_ptrDifference(l1, l2) list_difference_ptr(l1, l2) #define equali(l1, l2) equal(l1, l2) #define equalo(l1, l2) equal(l1, l2) #define freeList(list) list_free(list) #define listCopy(list) list_copy(list) extern int length(List *list); #endif /* ENABLE_LIST_COMPAT */ #endif /* PG_LIST_H */ PKBiZ2:p p server/nodes/bitmapset.hnu[/*------------------------------------------------------------------------- * * bitmapset.h * PostgreSQL generic bitmap set package * * A bitmap set can represent any set of nonnegative integers, although * it is mainly intended for sets where the maximum value is not large, * say at most a few hundred. By convention, a NULL pointer is always * accepted by all operations to represent the empty set. (But beware * that this is not the only representation of the empty set. Use * bms_is_empty() in preference to testing for NULL.) * * * Copyright (c) 2003-2012, PostgreSQL Global Development Group * * src/include/nodes/bitmapset.h * *------------------------------------------------------------------------- */ #ifndef BITMAPSET_H #define BITMAPSET_H /* * Data representation */ /* The unit size can be adjusted by changing these three declarations: */ #define BITS_PER_BITMAPWORD 32 typedef uint32 bitmapword; /* must be an unsigned type */ typedef int32 signedbitmapword; /* must be the matching signed type */ typedef struct Bitmapset { int nwords; /* number of words in array */ bitmapword words[1]; /* really [nwords] */ } Bitmapset; /* VARIABLE LENGTH STRUCT */ /* result of bms_subset_compare */ typedef enum { BMS_EQUAL, /* sets are equal */ BMS_SUBSET1, /* first set is a subset of the second */ BMS_SUBSET2, /* second set is a subset of the first */ BMS_DIFFERENT /* neither set is a subset of the other */ } BMS_Comparison; /* result of bms_membership */ typedef enum { BMS_EMPTY_SET, /* 0 members */ BMS_SINGLETON, /* 1 member */ BMS_MULTIPLE /* >1 member */ } BMS_Membership; /* * function prototypes in nodes/bitmapset.c */ extern Bitmapset *bms_copy(const Bitmapset *a); extern bool bms_equal(const Bitmapset *a, const Bitmapset *b); extern Bitmapset *bms_make_singleton(int x); extern void bms_free(Bitmapset *a); extern Bitmapset *bms_union(const Bitmapset *a, const Bitmapset *b); extern Bitmapset *bms_intersect(const Bitmapset *a, const Bitmapset *b); extern Bitmapset *bms_difference(const Bitmapset *a, const Bitmapset *b); extern bool bms_is_subset(const Bitmapset *a, const Bitmapset *b); extern BMS_Comparison bms_subset_compare(const Bitmapset *a, const Bitmapset *b); extern bool bms_is_member(int x, const Bitmapset *a); extern bool bms_overlap(const Bitmapset *a, const Bitmapset *b); extern bool bms_nonempty_difference(const Bitmapset *a, const Bitmapset *b); extern int bms_singleton_member(const Bitmapset *a); extern int bms_num_members(const Bitmapset *a); /* optimized tests when we don't need to know exact membership count: */ extern BMS_Membership bms_membership(const Bitmapset *a); extern bool bms_is_empty(const Bitmapset *a); /* these routines recycle (modify or free) their non-const inputs: */ extern Bitmapset *bms_add_member(Bitmapset *a, int x); extern Bitmapset *bms_del_member(Bitmapset *a, int x); extern Bitmapset *bms_add_members(Bitmapset *a, const Bitmapset *b); extern Bitmapset *bms_int_members(Bitmapset *a, const Bitmapset *b); extern Bitmapset *bms_del_members(Bitmapset *a, const Bitmapset *b); extern Bitmapset *bms_join(Bitmapset *a, Bitmapset *b); /* support for iterating through the integer elements of a set: */ extern int bms_first_member(Bitmapset *a); /* support for hashtables using Bitmapsets as keys: */ extern uint32 bms_hash_value(const Bitmapset *a); #endif /* BITMAPSET_H */ PKBiZsL L server/nodes/makefuncs.hnu[/*------------------------------------------------------------------------- * * makefuncs.h * prototypes for the creator functions (for primitive nodes) * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/nodes/makefuncs.h * *------------------------------------------------------------------------- */ #ifndef MAKEFUNC_H #define MAKEFUNC_H #include "nodes/parsenodes.h" extern A_Expr *makeA_Expr(A_Expr_Kind kind, List *name, Node *lexpr, Node *rexpr, int location); extern A_Expr *makeSimpleA_Expr(A_Expr_Kind kind, char *name, Node *lexpr, Node *rexpr, int location); extern Var *makeVar(Index varno, AttrNumber varattno, Oid vartype, int32 vartypmod, Oid varcollid, Index varlevelsup); extern Var *makeVarFromTargetEntry(Index varno, TargetEntry *tle); extern Var *makeWholeRowVar(RangeTblEntry *rte, Index varno, Index varlevelsup, bool allowScalar); extern TargetEntry *makeTargetEntry(Expr *expr, AttrNumber resno, char *resname, bool resjunk); extern TargetEntry *flatCopyTargetEntry(TargetEntry *src_tle); extern FromExpr *makeFromExpr(List *fromlist, Node *quals); extern Const *makeConst(Oid consttype, int32 consttypmod, Oid constcollid, int constlen, Datum constvalue, bool constisnull, bool constbyval); extern Const *makeNullConst(Oid consttype, int32 consttypmod, Oid constcollid); extern Node *makeBoolConst(bool value, bool isnull); extern Expr *makeBoolExpr(BoolExprType boolop, List *args, int location); extern Alias *makeAlias(const char *aliasname, List *colnames); extern RelabelType *makeRelabelType(Expr *arg, Oid rtype, int32 rtypmod, Oid rcollid, CoercionForm rformat); extern RangeVar *makeRangeVar(char *schemaname, char *relname, int location); extern TypeName *makeTypeName(char *typnam); extern TypeName *makeTypeNameFromNameList(List *names); extern TypeName *makeTypeNameFromOid(Oid typeOid, int32 typmod); extern FuncExpr *makeFuncExpr(Oid funcid, Oid rettype, List *args, Oid funccollid, Oid inputcollid, CoercionForm fformat); extern DefElem *makeDefElem(char *name, Node *arg); extern DefElem *makeDefElemExtended(char *nameSpace, char *name, Node *arg, DefElemAction defaction); #endif /* MAKEFUNC_H */ PKBiZӀ server/nodes/nodeFuncs.hnu[/*------------------------------------------------------------------------- * * nodeFuncs.h * Various general-purpose manipulations of Node trees * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/nodes/nodeFuncs.h * *------------------------------------------------------------------------- */ #ifndef NODEFUNCS_H #define NODEFUNCS_H #include "nodes/parsenodes.h" /* flags bits for query_tree_walker and query_tree_mutator */ #define QTW_IGNORE_RT_SUBQUERIES 0x01 /* subqueries in rtable */ #define QTW_IGNORE_CTE_SUBQUERIES 0x02 /* subqueries in cteList */ #define QTW_IGNORE_RC_SUBQUERIES 0x03 /* both of above */ #define QTW_IGNORE_JOINALIASES 0x04 /* JOIN alias var lists */ #define QTW_IGNORE_RANGE_TABLE 0x08 /* skip rangetable entirely */ #define QTW_EXAMINE_RTES 0x10 /* examine RTEs */ #define QTW_DONT_COPY_QUERY 0x20 /* do not copy top Query */ extern Oid exprType(const Node *expr); extern int32 exprTypmod(const Node *expr); extern bool exprIsLengthCoercion(const Node *expr, int32 *coercedTypmod); extern Node *relabel_to_typmod(Node *expr, int32 typmod); extern bool expression_returns_set(Node *clause); extern Oid exprCollation(const Node *expr); extern Oid exprInputCollation(const Node *expr); extern void exprSetCollation(Node *expr, Oid collation); extern void exprSetInputCollation(Node *expr, Oid inputcollation); extern int exprLocation(const Node *expr); extern bool expression_tree_walker(Node *node, bool (*walker) (), void *context); extern Node *expression_tree_mutator(Node *node, Node *(*mutator) (), void *context); extern bool query_tree_walker(Query *query, bool (*walker) (), void *context, int flags); extern Query *query_tree_mutator(Query *query, Node *(*mutator) (), void *context, int flags); extern bool range_table_walker(List *rtable, bool (*walker) (), void *context, int flags); extern List *range_table_mutator(List *rtable, Node *(*mutator) (), void *context, int flags); extern bool query_or_expression_tree_walker(Node *node, bool (*walker) (), void *context, int flags); extern Node *query_or_expression_tree_mutator(Node *node, Node *(*mutator) (), void *context, int flags); extern bool raw_expression_tree_walker(Node *node, bool (*walker) (), void *context); #endif /* NODEFUNCS_H */ PKBiZ(3server/nodes/tidbitmap.hnu[/*------------------------------------------------------------------------- * * tidbitmap.h * PostgreSQL tuple-id (TID) bitmap package * * This module provides bitmap data structures that are spiritually * similar to Bitmapsets, but are specially adapted to store sets of * tuple identifiers (TIDs), or ItemPointers. In particular, the division * of an ItemPointer into BlockNumber and OffsetNumber is catered for. * Also, since we wish to be able to store very large tuple sets in * memory with this data structure, we support "lossy" storage, in which * we no longer remember individual tuple offsets on a page but only the * fact that a particular page needs to be visited. * * * Copyright (c) 2003-2012, PostgreSQL Global Development Group * * src/include/nodes/tidbitmap.h * *------------------------------------------------------------------------- */ #ifndef TIDBITMAP_H #define TIDBITMAP_H #include "storage/itemptr.h" /* * Actual bitmap representation is private to tidbitmap.c. Callers can * do IsA(x, TIDBitmap) on it, but nothing else. */ typedef struct TIDBitmap TIDBitmap; /* Likewise, TBMIterator is private */ typedef struct TBMIterator TBMIterator; /* Result structure for tbm_iterate */ typedef struct { BlockNumber blockno; /* page number containing tuples */ int ntuples; /* -1 indicates lossy result */ bool recheck; /* should the tuples be rechecked? */ /* Note: recheck is always true if ntuples < 0 */ OffsetNumber offsets[1]; /* VARIABLE LENGTH ARRAY */ } TBMIterateResult; /* VARIABLE LENGTH STRUCT */ /* function prototypes in nodes/tidbitmap.c */ extern TIDBitmap *tbm_create(long maxbytes); extern void tbm_free(TIDBitmap *tbm); extern void tbm_add_tuples(TIDBitmap *tbm, const ItemPointer tids, int ntids, bool recheck); extern void tbm_add_page(TIDBitmap *tbm, BlockNumber pageno); extern void tbm_union(TIDBitmap *a, const TIDBitmap *b); extern void tbm_intersect(TIDBitmap *a, const TIDBitmap *b); extern bool tbm_is_empty(const TIDBitmap *tbm); extern TBMIterator *tbm_begin_iterate(TIDBitmap *tbm); extern TBMIterateResult *tbm_iterate(TBMIterator *iterator); extern void tbm_end_iterate(TBMIterator *iterator); #endif /* TIDBITMAP_H */ PKBiZazqnqnserver/nodes/plannodes.hnu[/*------------------------------------------------------------------------- * * plannodes.h * definitions for query plan nodes * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/nodes/plannodes.h * *------------------------------------------------------------------------- */ #ifndef PLANNODES_H #define PLANNODES_H #include "access/sdir.h" #include "nodes/bitmapset.h" #include "nodes/primnodes.h" /* ---------------------------------------------------------------- * node definitions * ---------------------------------------------------------------- */ /* ---------------- * PlannedStmt node * * The output of the planner is a Plan tree headed by a PlannedStmt node. * PlannedStmt holds the "one time" information needed by the executor. * ---------------- */ typedef struct PlannedStmt { NodeTag type; CmdType commandType; /* select|insert|update|delete */ uint32 queryId; /* query identifier (copied from Query) */ bool hasReturning; /* is it insert|update|delete RETURNING? */ bool hasModifyingCTE; /* has insert|update|delete in WITH? */ bool canSetTag; /* do I set the command result tag? */ bool transientPlan; /* redo plan when TransactionXmin changes? */ struct Plan *planTree; /* tree of Plan nodes */ List *rtable; /* list of RangeTblEntry nodes */ /* rtable indexes of target relations for INSERT/UPDATE/DELETE */ List *resultRelations; /* integer list of RT indexes, or NIL */ Node *utilityStmt; /* non-null if this is DECLARE CURSOR */ List *subplans; /* Plan trees for SubPlan expressions */ Bitmapset *rewindPlanIDs; /* indices of subplans that require REWIND */ List *rowMarks; /* a list of PlanRowMark's */ List *relationOids; /* OIDs of relations the plan depends on */ List *invalItems; /* other dependencies, as PlanInvalItems */ int nParamExec; /* number of PARAM_EXEC Params used */ } PlannedStmt; /* macro for fetching the Plan associated with a SubPlan node */ #define exec_subplan_get_plan(plannedstmt, subplan) \ ((Plan *) list_nth((plannedstmt)->subplans, (subplan)->plan_id - 1)) /* ---------------- * Plan node * * All plan nodes "derive" from the Plan structure by having the * Plan structure as the first field. This ensures that everything works * when nodes are cast to Plan's. (node pointers are frequently cast to Plan* * when passed around generically in the executor) * * We never actually instantiate any Plan nodes; this is just the common * abstract superclass for all Plan-type nodes. * ---------------- */ typedef struct Plan { NodeTag type; /* * estimated execution costs for plan (see costsize.c for more info) */ Cost startup_cost; /* cost expended before fetching any tuples */ Cost total_cost; /* total cost (assuming all tuples fetched) */ /* * planner's estimate of result size of this plan step */ double plan_rows; /* number of rows plan is expected to emit */ int plan_width; /* average row width in bytes */ /* * Common structural data for all Plan types. */ List *targetlist; /* target list to be computed at this node */ List *qual; /* implicitly-ANDed qual conditions */ struct Plan *lefttree; /* input plan tree(s) */ struct Plan *righttree; List *initPlan; /* Init Plan nodes (un-correlated expr * subselects) */ /* * Information for management of parameter-change-driven rescanning * * extParam includes the paramIDs of all external PARAM_EXEC params * affecting this plan node or its children. setParam params from the * node's initPlans are not included, but their extParams are. * * allParam includes all the extParam paramIDs, plus the IDs of local * params that affect the node (i.e., the setParams of its initplans). * These are _all_ the PARAM_EXEC params that affect this node. */ Bitmapset *extParam; Bitmapset *allParam; } Plan; /* ---------------- * these are defined to avoid confusion problems with "left" * and "right" and "inner" and "outer". The convention is that * the "left" plan is the "outer" plan and the "right" plan is * the inner plan, but these make the code more readable. * ---------------- */ #define innerPlan(node) (((Plan *)(node))->righttree) #define outerPlan(node) (((Plan *)(node))->lefttree) /* ---------------- * Result node - * If no outer plan, evaluate a variable-free targetlist. * If outer plan, return tuples from outer plan (after a level of * projection as shown by targetlist). * * If resconstantqual isn't NULL, it represents a one-time qualification * test (i.e., one that doesn't depend on any variables from the outer plan, * so needs to be evaluated only once). * ---------------- */ typedef struct Result { Plan plan; Node *resconstantqual; } Result; /* ---------------- * ModifyTable node - * Apply rows produced by subplan(s) to result table(s), * by inserting, updating, or deleting. * * Note that rowMarks and epqParam are presumed to be valid for all the * subplan(s); they can't contain any info that varies across subplans. * ---------------- */ typedef struct ModifyTable { Plan plan; CmdType operation; /* INSERT, UPDATE, or DELETE */ bool canSetTag; /* do we set the command tag/es_processed? */ List *resultRelations; /* integer list of RT indexes */ int resultRelIndex; /* index of first resultRel in plan's list */ List *plans; /* plan(s) producing source data */ List *returningLists; /* per-target-table RETURNING tlists */ List *rowMarks; /* PlanRowMarks (non-locking only) */ int epqParam; /* ID of Param for EvalPlanQual re-eval */ } ModifyTable; /* ---------------- * Append node - * Generate the concatenation of the results of sub-plans. * ---------------- */ typedef struct Append { Plan plan; List *appendplans; } Append; /* ---------------- * MergeAppend node - * Merge the results of pre-sorted sub-plans to preserve the ordering. * ---------------- */ typedef struct MergeAppend { Plan plan; List *mergeplans; /* remaining fields are just like the sort-key info in struct Sort */ int numCols; /* number of sort-key columns */ AttrNumber *sortColIdx; /* their indexes in the target list */ Oid *sortOperators; /* OIDs of operators to sort them by */ Oid *collations; /* OIDs of collations */ bool *nullsFirst; /* NULLS FIRST/LAST directions */ } MergeAppend; /* ---------------- * RecursiveUnion node - * Generate a recursive union of two subplans. * * The "outer" subplan is always the non-recursive term, and the "inner" * subplan is the recursive term. * ---------------- */ typedef struct RecursiveUnion { Plan plan; int wtParam; /* ID of Param representing work table */ /* Remaining fields are zero/null in UNION ALL case */ int numCols; /* number of columns to check for * duplicate-ness */ AttrNumber *dupColIdx; /* their indexes in the target list */ Oid *dupOperators; /* equality operators to compare with */ long numGroups; /* estimated number of groups in input */ } RecursiveUnion; /* ---------------- * BitmapAnd node - * Generate the intersection of the results of sub-plans. * * The subplans must be of types that yield tuple bitmaps. The targetlist * and qual fields of the plan are unused and are always NIL. * ---------------- */ typedef struct BitmapAnd { Plan plan; List *bitmapplans; } BitmapAnd; /* ---------------- * BitmapOr node - * Generate the union of the results of sub-plans. * * The subplans must be of types that yield tuple bitmaps. The targetlist * and qual fields of the plan are unused and are always NIL. * ---------------- */ typedef struct BitmapOr { Plan plan; List *bitmapplans; } BitmapOr; /* * ========== * Scan nodes * ========== */ typedef struct Scan { Plan plan; Index scanrelid; /* relid is index into the range table */ } Scan; /* ---------------- * sequential scan node * ---------------- */ typedef Scan SeqScan; /* ---------------- * index scan node * * indexqualorig is an implicitly-ANDed list of index qual expressions, each * in the same form it appeared in the query WHERE condition. Each should * be of the form (indexkey OP comparisonval) or (comparisonval OP indexkey). * The indexkey is a Var or expression referencing column(s) of the index's * base table. The comparisonval might be any expression, but it won't use * any columns of the base table. The expressions are ordered by index * column position (but items referencing the same index column can appear * in any order). indexqualorig is used at runtime only if we have to recheck * a lossy indexqual. * * indexqual has the same form, but the expressions have been commuted if * necessary to put the indexkeys on the left, and the indexkeys are replaced * by Var nodes identifying the index columns (their varno is INDEX_VAR and * their varattno is the index column number). * * indexorderbyorig is similarly the original form of any ORDER BY expressions * that are being implemented by the index, while indexorderby is modified to * have index column Vars on the left-hand side. Here, multiple expressions * must appear in exactly the ORDER BY order, and this is not necessarily the * index column order. Only the expressions are provided, not the auxiliary * sort-order information from the ORDER BY SortGroupClauses; it's assumed * that the sort ordering is fully determinable from the top-level operators. * indexorderbyorig is unused at run time, but is needed for EXPLAIN. * (Note these fields are used for amcanorderbyop cases, not amcanorder cases.) * * indexorderdir specifies the scan ordering, for indexscans on amcanorder * indexes (for other indexes it should be "don't care"). * ---------------- */ typedef struct IndexScan { Scan scan; Oid indexid; /* OID of index to scan */ List *indexqual; /* list of index quals (usually OpExprs) */ List *indexqualorig; /* the same in original form */ List *indexorderby; /* list of index ORDER BY exprs */ List *indexorderbyorig; /* the same in original form */ ScanDirection indexorderdir; /* forward or backward or don't care */ } IndexScan; /* ---------------- * index-only scan node * * IndexOnlyScan is very similar to IndexScan, but it specifies an * index-only scan, in which the data comes from the index not the heap. * Because of this, *all* Vars in the plan node's targetlist, qual, and * index expressions reference index columns and have varno = INDEX_VAR. * Hence we do not need separate indexqualorig and indexorderbyorig lists, * since their contents would be equivalent to indexqual and indexorderby. * * To help EXPLAIN interpret the index Vars for display, we provide * indextlist, which represents the contents of the index as a targetlist * with one TLE per index column. Vars appearing in this list reference * the base table, and this is the only field in the plan node that may * contain such Vars. * ---------------- */ typedef struct IndexOnlyScan { Scan scan; Oid indexid; /* OID of index to scan */ List *indexqual; /* list of index quals (usually OpExprs) */ List *indexorderby; /* list of index ORDER BY exprs */ List *indextlist; /* TargetEntry list describing index's cols */ ScanDirection indexorderdir; /* forward or backward or don't care */ } IndexOnlyScan; /* ---------------- * bitmap index scan node * * BitmapIndexScan delivers a bitmap of potential tuple locations; * it does not access the heap itself. The bitmap is used by an * ancestor BitmapHeapScan node, possibly after passing through * intermediate BitmapAnd and/or BitmapOr nodes to combine it with * the results of other BitmapIndexScans. * * The fields have the same meanings as for IndexScan, except we don't * store a direction flag because direction is uninteresting. * * In a BitmapIndexScan plan node, the targetlist and qual fields are * not used and are always NIL. The indexqualorig field is unused at * run time too, but is saved for the benefit of EXPLAIN. * ---------------- */ typedef struct BitmapIndexScan { Scan scan; Oid indexid; /* OID of index to scan */ List *indexqual; /* list of index quals (OpExprs) */ List *indexqualorig; /* the same in original form */ } BitmapIndexScan; /* ---------------- * bitmap sequential scan node * * This needs a copy of the qual conditions being used by the input index * scans because there are various cases where we need to recheck the quals; * for example, when the bitmap is lossy about the specific rows on a page * that meet the index condition. * ---------------- */ typedef struct BitmapHeapScan { Scan scan; List *bitmapqualorig; /* index quals, in standard expr form */ } BitmapHeapScan; /* ---------------- * tid scan node * * tidquals is an implicitly OR'ed list of qual expressions of the form * "CTID = pseudoconstant" or "CTID = ANY(pseudoconstant_array)". * ---------------- */ typedef struct TidScan { Scan scan; List *tidquals; /* qual(s) involving CTID = something */ } TidScan; /* ---------------- * subquery scan node * * SubqueryScan is for scanning the output of a sub-query in the range table. * We often need an extra plan node above the sub-query's plan to perform * expression evaluations (which we can't push into the sub-query without * risking changing its semantics). Although we are not scanning a physical * relation, we make this a descendant of Scan anyway for code-sharing * purposes. * * Note: we store the sub-plan in the type-specific subplan field, not in * the generic lefttree field as you might expect. This is because we do * not want plan-tree-traversal routines to recurse into the subplan without * knowing that they are changing Query contexts. * ---------------- */ typedef struct SubqueryScan { Scan scan; Plan *subplan; } SubqueryScan; /* ---------------- * FunctionScan node * ---------------- */ typedef struct FunctionScan { Scan scan; Node *funcexpr; /* expression tree for func call */ List *funccolnames; /* output column names (string Value nodes) */ List *funccoltypes; /* OID list of column type OIDs */ List *funccoltypmods; /* integer list of column typmods */ List *funccolcollations; /* OID list of column collation OIDs */ } FunctionScan; /* ---------------- * ValuesScan node * ---------------- */ typedef struct ValuesScan { Scan scan; List *values_lists; /* list of expression lists */ } ValuesScan; /* ---------------- * CteScan node * ---------------- */ typedef struct CteScan { Scan scan; int ctePlanId; /* ID of init SubPlan for CTE */ int cteParam; /* ID of Param representing CTE output */ } CteScan; /* ---------------- * WorkTableScan node * ---------------- */ typedef struct WorkTableScan { Scan scan; int wtParam; /* ID of Param representing work table */ } WorkTableScan; /* ---------------- * ForeignScan node * * fdw_exprs and fdw_private are both under the control of the foreign-data * wrapper, but fdw_exprs is presumed to contain expression trees and will * be post-processed accordingly by the planner; fdw_private won't be. * Note that everything in both lists must be copiable by copyObject(). * One way to store an arbitrary blob of bytes is to represent it as a bytea * Const. Usually, though, you'll be better off choosing a representation * that can be dumped usefully by nodeToString(). * ---------------- */ typedef struct ForeignScan { Scan scan; List *fdw_exprs; /* expressions that FDW may evaluate */ List *fdw_private; /* private data for FDW */ bool fsSystemCol; /* true if any "system column" is needed */ } ForeignScan; /* * ========== * Join nodes * ========== */ /* ---------------- * Join node * * jointype: rule for joining tuples from left and right subtrees * joinqual: qual conditions that came from JOIN/ON or JOIN/USING * (plan.qual contains conditions that came from WHERE) * * When jointype is INNER, joinqual and plan.qual are semantically * interchangeable. For OUTER jointypes, the two are *not* interchangeable; * only joinqual is used to determine whether a match has been found for * the purpose of deciding whether to generate null-extended tuples. * (But plan.qual is still applied before actually returning a tuple.) * For an outer join, only joinquals are allowed to be used as the merge * or hash condition of a merge or hash join. * ---------------- */ typedef struct Join { Plan plan; JoinType jointype; List *joinqual; /* JOIN quals (in addition to plan.qual) */ } Join; /* ---------------- * nest loop join node * * The nestParams list identifies any executor Params that must be passed * into execution of the inner subplan carrying values from the current row * of the outer subplan. Currently we restrict these values to be simple * Vars, but perhaps someday that'd be worth relaxing. (Note: during plan * creation, the paramval can actually be a PlaceHolderVar expression; but it * must be a Var with varno OUTER_VAR by the time it gets to the executor.) * ---------------- */ typedef struct NestLoop { Join join; List *nestParams; /* list of NestLoopParam nodes */ } NestLoop; typedef struct NestLoopParam { NodeTag type; int paramno; /* number of the PARAM_EXEC Param to set */ Var *paramval; /* outer-relation Var to assign to Param */ } NestLoopParam; /* ---------------- * merge join node * * The expected ordering of each mergeable column is described by a btree * opfamily OID, a collation OID, a direction (BTLessStrategyNumber or * BTGreaterStrategyNumber) and a nulls-first flag. Note that the two sides * of each mergeclause may be of different datatypes, but they are ordered the * same way according to the common opfamily and collation. The operator in * each mergeclause must be an equality operator of the indicated opfamily. * ---------------- */ typedef struct MergeJoin { Join join; List *mergeclauses; /* mergeclauses as expression trees */ /* these are arrays, but have the same length as the mergeclauses list: */ Oid *mergeFamilies; /* per-clause OIDs of btree opfamilies */ Oid *mergeCollations; /* per-clause OIDs of collations */ int *mergeStrategies; /* per-clause ordering (ASC or DESC) */ bool *mergeNullsFirst; /* per-clause nulls ordering */ } MergeJoin; /* ---------------- * hash join node * ---------------- */ typedef struct HashJoin { Join join; List *hashclauses; } HashJoin; /* ---------------- * materialization node * ---------------- */ typedef struct Material { Plan plan; } Material; /* ---------------- * sort node * ---------------- */ typedef struct Sort { Plan plan; int numCols; /* number of sort-key columns */ AttrNumber *sortColIdx; /* their indexes in the target list */ Oid *sortOperators; /* OIDs of operators to sort them by */ Oid *collations; /* OIDs of collations */ bool *nullsFirst; /* NULLS FIRST/LAST directions */ } Sort; /* --------------- * group node - * Used for queries with GROUP BY (but no aggregates) specified. * The input must be presorted according to the grouping columns. * --------------- */ typedef struct Group { Plan plan; int numCols; /* number of grouping columns */ AttrNumber *grpColIdx; /* their indexes in the target list */ Oid *grpOperators; /* equality operators to compare with */ } Group; /* --------------- * aggregate node * * An Agg node implements plain or grouped aggregation. For grouped * aggregation, we can work with presorted input or unsorted input; * the latter strategy uses an internal hashtable. * * Notice the lack of any direct info about the aggregate functions to be * computed. They are found by scanning the node's tlist and quals during * executor startup. (It is possible that there are no aggregate functions; * this could happen if they get optimized away by constant-folding, or if * we are using the Agg node to implement hash-based grouping.) * --------------- */ typedef enum AggStrategy { AGG_PLAIN, /* simple agg across all input rows */ AGG_SORTED, /* grouped agg, input must be sorted */ AGG_HASHED /* grouped agg, use internal hashtable */ } AggStrategy; typedef struct Agg { Plan plan; AggStrategy aggstrategy; int numCols; /* number of grouping columns */ AttrNumber *grpColIdx; /* their indexes in the target list */ Oid *grpOperators; /* equality operators to compare with */ long numGroups; /* estimated number of groups in input */ Bitmapset *aggParams; /* IDs of Params used in Aggref inputs */ /* Note: planner provides numGroups & aggParams only in AGG_HASHED case */ } Agg; /* ---------------- * window aggregate node * ---------------- */ typedef struct WindowAgg { Plan plan; Index winref; /* ID referenced by window functions */ int partNumCols; /* number of columns in partition clause */ AttrNumber *partColIdx; /* their indexes in the target list */ Oid *partOperators; /* equality operators for partition columns */ int ordNumCols; /* number of columns in ordering clause */ AttrNumber *ordColIdx; /* their indexes in the target list */ Oid *ordOperators; /* equality operators for ordering columns */ int frameOptions; /* frame_clause options, see WindowDef */ Node *startOffset; /* expression for starting bound, if any */ Node *endOffset; /* expression for ending bound, if any */ } WindowAgg; /* ---------------- * unique node * ---------------- */ typedef struct Unique { Plan plan; int numCols; /* number of columns to check for uniqueness */ AttrNumber *uniqColIdx; /* their indexes in the target list */ Oid *uniqOperators; /* equality operators to compare with */ } Unique; /* ---------------- * hash build node * * If the executor is supposed to try to apply skew join optimization, then * skewTable/skewColumn/skewInherit identify the outer relation's join key * column, from which the relevant MCV statistics can be fetched. Also, its * type information is provided to save a lookup. * ---------------- */ typedef struct Hash { Plan plan; Oid skewTable; /* outer join key's table OID, or InvalidOid */ AttrNumber skewColumn; /* outer join key's column #, or zero */ bool skewInherit; /* is outer join rel an inheritance tree? */ Oid skewColType; /* datatype of the outer key column */ int32 skewColTypmod; /* typmod of the outer key column */ /* all other info is in the parent HashJoin node */ } Hash; /* ---------------- * setop node * ---------------- */ typedef enum SetOpCmd { SETOPCMD_INTERSECT, SETOPCMD_INTERSECT_ALL, SETOPCMD_EXCEPT, SETOPCMD_EXCEPT_ALL } SetOpCmd; typedef enum SetOpStrategy { SETOP_SORTED, /* input must be sorted */ SETOP_HASHED /* use internal hashtable */ } SetOpStrategy; typedef struct SetOp { Plan plan; SetOpCmd cmd; /* what to do */ SetOpStrategy strategy; /* how to do it */ int numCols; /* number of columns to check for * duplicate-ness */ AttrNumber *dupColIdx; /* their indexes in the target list */ Oid *dupOperators; /* equality operators to compare with */ AttrNumber flagColIdx; /* where is the flag column, if any */ int firstFlag; /* flag value for first input relation */ long numGroups; /* estimated number of groups in input */ } SetOp; /* ---------------- * lock-rows node * * rowMarks identifies the rels to be locked by this node; it should be * a subset of the rowMarks listed in the top-level PlannedStmt. * epqParam is a Param that all scan nodes below this one must depend on. * It is used to force re-evaluation of the plan during EvalPlanQual. * ---------------- */ typedef struct LockRows { Plan plan; List *rowMarks; /* a list of PlanRowMark's */ int epqParam; /* ID of Param for EvalPlanQual re-eval */ } LockRows; /* ---------------- * limit node * * Note: as of Postgres 8.2, the offset and count expressions are expected * to yield int8, rather than int4 as before. * ---------------- */ typedef struct Limit { Plan plan; Node *limitOffset; /* OFFSET parameter, or NULL if none */ Node *limitCount; /* COUNT parameter, or NULL if none */ } Limit; /* * RowMarkType - * enums for types of row-marking operations * * When doing UPDATE, DELETE, or SELECT FOR UPDATE/SHARE, we have to uniquely * identify all the source rows, not only those from the target relations, so * that we can perform EvalPlanQual rechecking at need. For plain tables we * can just fetch the TID, the same as for a target relation. Otherwise (for * example for VALUES or FUNCTION scans) we have to copy the whole row value. * The latter is pretty inefficient but fortunately the case is not * performance-critical in practice. */ typedef enum RowMarkType { ROW_MARK_EXCLUSIVE, /* obtain exclusive tuple lock */ ROW_MARK_SHARE, /* obtain shared tuple lock */ ROW_MARK_REFERENCE, /* just fetch the TID */ ROW_MARK_COPY /* physically copy the row value */ } RowMarkType; #define RowMarkRequiresRowShareLock(marktype) ((marktype) <= ROW_MARK_SHARE) /* * PlanRowMark - * plan-time representation of FOR UPDATE/SHARE clauses * * When doing UPDATE, DELETE, or SELECT FOR UPDATE/SHARE, we create a separate * PlanRowMark node for each non-target relation in the query. Relations that * are not specified as FOR UPDATE/SHARE are marked ROW_MARK_REFERENCE (if * real tables) or ROW_MARK_COPY (if not). * * Initially all PlanRowMarks have rti == prti and isParent == false. * When the planner discovers that a relation is the root of an inheritance * tree, it sets isParent true, and adds an additional PlanRowMark to the * list for each child relation (including the target rel itself in its role * as a child). The child entries have rti == child rel's RT index and * prti == parent's RT index, and can therefore be recognized as children by * the fact that prti != rti. * * The planner also adds resjunk output columns to the plan that carry * information sufficient to identify the locked or fetched rows. For * tables (markType != ROW_MARK_COPY), these columns are named * tableoid%u OID of table * ctid%u TID of row * The tableoid column is only present for an inheritance hierarchy. * When markType == ROW_MARK_COPY, there is instead a single column named * wholerow%u whole-row value of relation * In all three cases, %u represents the rowmark ID number (rowmarkId). * This number is unique within a plan tree, except that child relation * entries copy their parent's rowmarkId. (Assigning unique numbers * means we needn't renumber rowmarkIds when flattening subqueries, which * would require finding and renaming the resjunk columns as well.) * Note this means that all tables in an inheritance hierarchy share the * same resjunk column names. However, in an inherited UPDATE/DELETE the * columns could have different physical column numbers in each subplan. */ typedef struct PlanRowMark { NodeTag type; Index rti; /* range table index of markable relation */ Index prti; /* range table index of parent relation */ Index rowmarkId; /* unique identifier for resjunk columns */ RowMarkType markType; /* see enum above */ bool noWait; /* NOWAIT option */ bool isParent; /* true if this is a "dummy" parent entry */ } PlanRowMark; /* * Plan invalidation info * * We track the objects on which a PlannedStmt depends in two ways: * relations are recorded as a simple list of OIDs, and everything else * is represented as a list of PlanInvalItems. A PlanInvalItem is designed * to be used with the syscache invalidation mechanism, so it identifies a * system catalog entry by cache ID and hash value. */ typedef struct PlanInvalItem { NodeTag type; int cacheId; /* a syscache ID, see utils/syscache.h */ uint32 hashValue; /* hash value of object's cache lookup key */ } PlanInvalItem; #endif /* PLANNODES_H */ PKBiZXCd9d9server/nodes/nodes.hnu[/*------------------------------------------------------------------------- * * nodes.h * Definitions for tagged nodes. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/nodes/nodes.h * *------------------------------------------------------------------------- */ #ifndef NODES_H #define NODES_H /* * The first field of every node is NodeTag. Each node created (with makeNode) * will have one of the following tags as the value of its first field. * * Note that the numbers of the node tags are not contiguous. We left holes * here so that we can add more tags without changing the existing enum's. * (Since node tag numbers never exist outside backend memory, there's no * real harm in renumbering, it just costs a full rebuild ...) */ typedef enum NodeTag { T_Invalid = 0, /* * TAGS FOR EXECUTOR NODES (execnodes.h) */ T_IndexInfo = 10, T_ExprContext, T_ProjectionInfo, T_JunkFilter, T_ResultRelInfo, T_EState, T_TupleTableSlot, /* * TAGS FOR PLAN NODES (plannodes.h) */ T_Plan = 100, T_Result, T_ModifyTable, T_Append, T_MergeAppend, T_RecursiveUnion, T_BitmapAnd, T_BitmapOr, T_Scan, T_SeqScan, T_IndexScan, T_IndexOnlyScan, T_BitmapIndexScan, T_BitmapHeapScan, T_TidScan, T_SubqueryScan, T_FunctionScan, T_ValuesScan, T_CteScan, T_WorkTableScan, T_ForeignScan, T_Join, T_NestLoop, T_MergeJoin, T_HashJoin, T_Material, T_Sort, T_Group, T_Agg, T_WindowAgg, T_Unique, T_Hash, T_SetOp, T_LockRows, T_Limit, /* these aren't subclasses of Plan: */ T_NestLoopParam, T_PlanRowMark, T_PlanInvalItem, /* * TAGS FOR PLAN STATE NODES (execnodes.h) * * These should correspond one-to-one with Plan node types. */ T_PlanState = 200, T_ResultState, T_ModifyTableState, T_AppendState, T_MergeAppendState, T_RecursiveUnionState, T_BitmapAndState, T_BitmapOrState, T_ScanState, T_SeqScanState, T_IndexScanState, T_IndexOnlyScanState, T_BitmapIndexScanState, T_BitmapHeapScanState, T_TidScanState, T_SubqueryScanState, T_FunctionScanState, T_ValuesScanState, T_CteScanState, T_WorkTableScanState, T_ForeignScanState, T_JoinState, T_NestLoopState, T_MergeJoinState, T_HashJoinState, T_MaterialState, T_SortState, T_GroupState, T_AggState, T_WindowAggState, T_UniqueState, T_HashState, T_SetOpState, T_LockRowsState, T_LimitState, /* * TAGS FOR PRIMITIVE NODES (primnodes.h) */ T_Alias = 300, T_RangeVar, T_Expr, T_Var, T_Const, T_Param, T_Aggref, T_WindowFunc, T_ArrayRef, T_FuncExpr, T_NamedArgExpr, T_OpExpr, T_DistinctExpr, T_NullIfExpr, T_ScalarArrayOpExpr, T_BoolExpr, T_SubLink, T_SubPlan, T_AlternativeSubPlan, T_FieldSelect, T_FieldStore, T_RelabelType, T_CoerceViaIO, T_ArrayCoerceExpr, T_ConvertRowtypeExpr, T_CollateExpr, T_CaseExpr, T_CaseWhen, T_CaseTestExpr, T_ArrayExpr, T_RowExpr, T_RowCompareExpr, T_CoalesceExpr, T_MinMaxExpr, T_XmlExpr, T_NullTest, T_BooleanTest, T_CoerceToDomain, T_CoerceToDomainValue, T_SetToDefault, T_CurrentOfExpr, T_TargetEntry, T_RangeTblRef, T_JoinExpr, T_FromExpr, T_IntoClause, /* * TAGS FOR EXPRESSION STATE NODES (execnodes.h) * * These correspond (not always one-for-one) to primitive nodes derived * from Expr. */ T_ExprState = 400, T_GenericExprState, T_AggrefExprState, T_WindowFuncExprState, T_ArrayRefExprState, T_FuncExprState, T_ScalarArrayOpExprState, T_BoolExprState, T_SubPlanState, T_AlternativeSubPlanState, T_FieldSelectState, T_FieldStoreState, T_CoerceViaIOState, T_ArrayCoerceExprState, T_ConvertRowtypeExprState, T_CaseExprState, T_CaseWhenState, T_ArrayExprState, T_RowExprState, T_RowCompareExprState, T_CoalesceExprState, T_MinMaxExprState, T_XmlExprState, T_NullTestState, T_CoerceToDomainState, T_DomainConstraintState, T_WholeRowVarExprState, /* will be in a more natural position in 9.3 */ /* * TAGS FOR PLANNER NODES (relation.h) */ T_PlannerInfo = 500, T_PlannerGlobal, T_RelOptInfo, T_IndexOptInfo, T_ParamPathInfo, T_Path, T_IndexPath, T_BitmapHeapPath, T_BitmapAndPath, T_BitmapOrPath, T_NestPath, T_MergePath, T_HashPath, T_TidPath, T_ForeignPath, T_AppendPath, T_MergeAppendPath, T_ResultPath, T_MaterialPath, T_UniquePath, T_EquivalenceClass, T_EquivalenceMember, T_PathKey, T_RestrictInfo, T_PlaceHolderVar, T_SpecialJoinInfo, T_AppendRelInfo, T_PlaceHolderInfo, T_MinMaxAggInfo, T_PlannerParamItem, /* * TAGS FOR MEMORY NODES (memnodes.h) */ T_MemoryContext = 600, T_AllocSetContext, /* * TAGS FOR VALUE NODES (value.h) */ T_Value = 650, T_Integer, T_Float, T_String, T_BitString, T_Null, /* * TAGS FOR LIST NODES (pg_list.h) */ T_List, T_IntList, T_OidList, /* * TAGS FOR STATEMENT NODES (mostly in parsenodes.h) */ T_Query = 700, T_PlannedStmt, T_InsertStmt, T_DeleteStmt, T_UpdateStmt, T_SelectStmt, T_AlterTableStmt, T_AlterTableCmd, T_AlterDomainStmt, T_SetOperationStmt, T_GrantStmt, T_GrantRoleStmt, T_AlterDefaultPrivilegesStmt, T_ClosePortalStmt, T_ClusterStmt, T_CopyStmt, T_CreateStmt, T_DefineStmt, T_DropStmt, T_TruncateStmt, T_CommentStmt, T_FetchStmt, T_IndexStmt, T_CreateFunctionStmt, T_AlterFunctionStmt, T_DoStmt, T_RenameStmt, T_RuleStmt, T_NotifyStmt, T_ListenStmt, T_UnlistenStmt, T_TransactionStmt, T_ViewStmt, T_LoadStmt, T_CreateDomainStmt, T_CreatedbStmt, T_DropdbStmt, T_VacuumStmt, T_ExplainStmt, T_CreateTableAsStmt, T_CreateSeqStmt, T_AlterSeqStmt, T_VariableSetStmt, T_VariableShowStmt, T_DiscardStmt, T_CreateTrigStmt, T_CreatePLangStmt, T_CreateRoleStmt, T_AlterRoleStmt, T_DropRoleStmt, T_LockStmt, T_ConstraintsSetStmt, T_ReindexStmt, T_CheckPointStmt, T_CreateSchemaStmt, T_AlterDatabaseStmt, T_AlterDatabaseSetStmt, T_AlterRoleSetStmt, T_CreateConversionStmt, T_CreateCastStmt, T_CreateOpClassStmt, T_CreateOpFamilyStmt, T_AlterOpFamilyStmt, T_PrepareStmt, T_ExecuteStmt, T_DeallocateStmt, T_DeclareCursorStmt, T_CreateTableSpaceStmt, T_DropTableSpaceStmt, T_AlterObjectSchemaStmt, T_AlterOwnerStmt, T_DropOwnedStmt, T_ReassignOwnedStmt, T_CompositeTypeStmt, T_CreateEnumStmt, T_CreateRangeStmt, T_AlterEnumStmt, T_AlterTSDictionaryStmt, T_AlterTSConfigurationStmt, T_CreateFdwStmt, T_AlterFdwStmt, T_CreateForeignServerStmt, T_AlterForeignServerStmt, T_CreateUserMappingStmt, T_AlterUserMappingStmt, T_DropUserMappingStmt, T_AlterTableSpaceOptionsStmt, T_SecLabelStmt, T_CreateForeignTableStmt, T_CreateExtensionStmt, T_AlterExtensionStmt, T_AlterExtensionContentsStmt, /* * TAGS FOR PARSE TREE NODES (parsenodes.h) */ T_A_Expr = 900, T_ColumnRef, T_ParamRef, T_A_Const, T_FuncCall, T_A_Star, T_A_Indices, T_A_Indirection, T_A_ArrayExpr, T_ResTarget, T_TypeCast, T_CollateClause, T_SortBy, T_WindowDef, T_RangeSubselect, T_RangeFunction, T_TypeName, T_ColumnDef, T_IndexElem, T_Constraint, T_DefElem, T_RangeTblEntry, T_SortGroupClause, T_WindowClause, T_PrivGrantee, T_FuncWithArgs, T_AccessPriv, T_CreateOpClassItem, T_TableLikeClause, T_FunctionParameter, T_LockingClause, T_RowMarkClause, T_XmlSerialize, T_WithClause, T_CommonTableExpr, /* * TAGS FOR REPLICATION GRAMMAR PARSE NODES (replnodes.h) */ T_IdentifySystemCmd, T_BaseBackupCmd, T_StartReplicationCmd, /* * TAGS FOR RANDOM OTHER STUFF * * These are objects that aren't part of parse/plan/execute node tree * structures, but we give them NodeTags anyway for identification * purposes (usually because they are involved in APIs where we want to * pass multiple object types through the same pointer). */ T_TriggerData = 950, /* in commands/trigger.h */ T_ReturnSetInfo, /* in nodes/execnodes.h */ T_WindowObjectData, /* private in nodeWindowAgg.c */ T_TIDBitmap, /* in nodes/tidbitmap.h */ T_InlineCodeBlock, /* in nodes/parsenodes.h */ T_FdwRoutine /* in foreign/fdwapi.h */ } NodeTag; /* * The first field of a node of any type is guaranteed to be the NodeTag. * Hence the type of any node can be gotten by casting it to Node. Declaring * a variable to be of Node * (instead of void *) can also facilitate * debugging. */ typedef struct Node { NodeTag type; } Node; #define nodeTag(nodeptr) (((const Node*)(nodeptr))->type) /* * newNode - * create a new node of the specified size and tag the node with the * specified tag. * * !WARNING!: Avoid using newNode directly. You should be using the * macro makeNode. eg. to create a Query node, use makeNode(Query) * * Note: the size argument should always be a compile-time constant, so the * apparent risk of multiple evaluation doesn't matter in practice. */ #ifdef __GNUC__ /* With GCC, we can use a compound statement within an expression */ #define newNode(size, tag) \ ({ Node *_result; \ AssertMacro((size) >= sizeof(Node)); /* need the tag, at least */ \ _result = (Node *) palloc0fast(size); \ _result->type = (tag); \ _result; \ }) #else /* * There is no way to dereference the palloc'ed pointer to assign the * tag, and also return the pointer itself, so we need a holder variable. * Fortunately, this macro isn't recursive so we just define * a global variable for this purpose. */ extern PGDLLIMPORT Node *newNodeMacroHolder; #define newNode(size, tag) \ ( \ AssertMacro((size) >= sizeof(Node)), /* need the tag, at least */ \ newNodeMacroHolder = (Node *) palloc0fast(size), \ newNodeMacroHolder->type = (tag), \ newNodeMacroHolder \ ) #endif /* __GNUC__ */ #define makeNode(_type_) ((_type_ *) newNode(sizeof(_type_),T_##_type_)) #define NodeSetTag(nodeptr,t) (((Node*)(nodeptr))->type = (t)) #define IsA(nodeptr,_type_) (nodeTag(nodeptr) == T_##_type_) /* * castNode(type, ptr) casts ptr to "type *", and if assertions are enabled, * verifies that the node has the appropriate type (using its nodeTag()). * * Use an inline function when assertions are enabled, to avoid multiple * evaluations of the ptr argument (which could e.g. be a function call). * If inline functions are not available - only a small number of platforms - * don't Assert, but use the non-checking version. */ #if defined(USE_ASSERT_CHECKING) && defined(PG_USE_INLINE) static inline Node * castNodeImpl(NodeTag type, void *ptr) { Assert(ptr == NULL || nodeTag(ptr) == type); return (Node *) ptr; } #define castNode(_type_, nodeptr) ((_type_ *) castNodeImpl(T_##_type_, nodeptr)) #else #define castNode(_type_, nodeptr) ((_type_ *) (nodeptr)) #endif /* USE_ASSERT_CHECKING && PG_USE_INLINE */ /* ---------------------------------------------------------------- * extern declarations follow * ---------------------------------------------------------------- */ /* * nodes/{outfuncs.c,print.c} */ extern char *nodeToString(const void *obj); /* * nodes/{readfuncs.c,read.c} */ extern void *stringToNode(char *str); /* * nodes/copyfuncs.c */ extern void *copyObject(const void *obj); /* * nodes/equalfuncs.c */ extern bool equal(const void *a, const void *b); /* * Typedefs for identifying qualifier selectivities and plan costs as such. * These are just plain "double"s, but declaring a variable as Selectivity * or Cost makes the intent more obvious. * * These could have gone into plannodes.h or some such, but many files * depend on them... */ typedef double Selectivity; /* fraction of tuples a qualifier will pass */ typedef double Cost; /* execution cost (in page-access units) */ /* * CmdType - * enums for type of operation represented by a Query or PlannedStmt * * This is needed in both parsenodes.h and plannodes.h, so put it here... */ typedef enum CmdType { CMD_UNKNOWN, CMD_SELECT, /* select stmt */ CMD_UPDATE, /* update stmt */ CMD_INSERT, /* insert stmt */ CMD_DELETE, CMD_UTILITY, /* cmds like create, destroy, copy, vacuum, * etc. */ CMD_NOTHING /* dummy command for instead nothing rules * with qual */ } CmdType; /* * JoinType - * enums for types of relation joins * * JoinType determines the exact semantics of joining two relations using * a matching qualification. For example, it tells what to do with a tuple * that has no match in the other relation. * * This is needed in both parsenodes.h and plannodes.h, so put it here... */ typedef enum JoinType { /* * The canonical kinds of joins according to the SQL JOIN syntax. Only * these codes can appear in parser output (e.g., JoinExpr nodes). */ JOIN_INNER, /* matching tuple pairs only */ JOIN_LEFT, /* pairs + unmatched LHS tuples */ JOIN_FULL, /* pairs + unmatched LHS + unmatched RHS */ JOIN_RIGHT, /* pairs + unmatched RHS tuples */ /* * Semijoins and anti-semijoins (as defined in relational theory) do not * appear in the SQL JOIN syntax, but there are standard idioms for * representing them (e.g., using EXISTS). The planner recognizes these * cases and converts them to joins. So the planner and executor must * support these codes. NOTE: in JOIN_SEMI output, it is unspecified * which matching RHS row is joined to. In JOIN_ANTI output, the row is * guaranteed to be null-extended. */ JOIN_SEMI, /* 1 copy of each LHS row that has match(es) */ JOIN_ANTI, /* 1 copy of each LHS row that has no match */ /* * These codes are used internally in the planner, but are not supported * by the executor (nor, indeed, by most of the planner). */ JOIN_UNIQUE_OUTER, /* LHS path must be made unique */ JOIN_UNIQUE_INNER /* RHS path must be made unique */ /* * We might need additional join types someday. */ } JoinType; /* * OUTER joins are those for which pushed-down quals must behave differently * from the join's own quals. This is in fact everything except INNER and * SEMI joins. However, this macro must also exclude the JOIN_UNIQUE symbols * since those are temporary proxies for what will eventually be an INNER * join. * * Note: semijoins are a hybrid case, but we choose to treat them as not * being outer joins. This is okay principally because the SQL syntax makes * it impossible to have a pushed-down qual that refers to the inner relation * of a semijoin; so there is no strong need to distinguish join quals from * pushed-down quals. This is convenient because for almost all purposes, * quals attached to a semijoin can be treated the same as innerjoin quals. */ #define IS_OUTER_JOIN(jointype) \ (((1 << (jointype)) & \ ((1 << JOIN_LEFT) | \ (1 << JOIN_FULL) | \ (1 << JOIN_RIGHT) | \ (1 << JOIN_ANTI))) != 0) #endif /* NODES_H */ PKBiZ j[[server/nodes/parsenodes.hnu[/*------------------------------------------------------------------------- * * parsenodes.h * definitions for parse tree nodes * * Many of the node types used in parsetrees include a "location" field. * This is a byte (not character) offset in the original source text, to be * used for positioning an error cursor when there is an error related to * the node. Access to the original source text is needed to make use of * the location. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/nodes/parsenodes.h * *------------------------------------------------------------------------- */ #ifndef PARSENODES_H #define PARSENODES_H #include "nodes/bitmapset.h" #include "nodes/primnodes.h" #include "nodes/value.h" /* Possible sources of a Query */ typedef enum QuerySource { QSRC_ORIGINAL, /* original parsetree (explicit query) */ QSRC_PARSER, /* added by parse analysis (now unused) */ QSRC_INSTEAD_RULE, /* added by unconditional INSTEAD rule */ QSRC_QUAL_INSTEAD_RULE, /* added by conditional INSTEAD rule */ QSRC_NON_INSTEAD_RULE /* added by non-INSTEAD rule */ } QuerySource; /* Sort ordering options for ORDER BY and CREATE INDEX */ typedef enum SortByDir { SORTBY_DEFAULT, SORTBY_ASC, SORTBY_DESC, SORTBY_USING /* not allowed in CREATE INDEX ... */ } SortByDir; typedef enum SortByNulls { SORTBY_NULLS_DEFAULT, SORTBY_NULLS_FIRST, SORTBY_NULLS_LAST } SortByNulls; /* * Grantable rights are encoded so that we can OR them together in a bitmask. * The present representation of AclItem limits us to 16 distinct rights, * even though AclMode is defined as uint32. See utils/acl.h. * * Caution: changing these codes breaks stored ACLs, hence forces initdb. */ typedef uint32 AclMode; /* a bitmask of privilege bits */ #define ACL_INSERT (1<<0) /* for relations */ #define ACL_SELECT (1<<1) #define ACL_UPDATE (1<<2) #define ACL_DELETE (1<<3) #define ACL_TRUNCATE (1<<4) #define ACL_REFERENCES (1<<5) #define ACL_TRIGGER (1<<6) #define ACL_EXECUTE (1<<7) /* for functions */ #define ACL_USAGE (1<<8) /* for languages, namespaces, FDWs, and * servers */ #define ACL_CREATE (1<<9) /* for namespaces and databases */ #define ACL_CREATE_TEMP (1<<10) /* for databases */ #define ACL_CONNECT (1<<11) /* for databases */ #define N_ACL_RIGHTS 12 /* 1 plus the last 1<" */ AEXPR_IN /* [NOT] IN - name must be "=" or "<>" */ } A_Expr_Kind; typedef struct A_Expr { NodeTag type; A_Expr_Kind kind; /* see above */ List *name; /* possibly-qualified name of operator */ Node *lexpr; /* left argument, or NULL if none */ Node *rexpr; /* right argument, or NULL if none */ int location; /* token location, or -1 if unknown */ } A_Expr; /* * A_Const - a literal constant */ typedef struct A_Const { NodeTag type; Value val; /* value (includes type info, see value.h) */ int location; /* token location, or -1 if unknown */ } A_Const; /* * TypeCast - a CAST expression */ typedef struct TypeCast { NodeTag type; Node *arg; /* the expression being casted */ TypeName *typeName; /* the target type */ int location; /* token location, or -1 if unknown */ } TypeCast; /* * CollateClause - a COLLATE expression */ typedef struct CollateClause { NodeTag type; Node *arg; /* input expression */ List *collname; /* possibly-qualified collation name */ int location; /* token location, or -1 if unknown */ } CollateClause; /* * FuncCall - a function or aggregate invocation * * agg_order (if not NIL) indicates we saw 'foo(... ORDER BY ...)'. * agg_star indicates we saw a 'foo(*)' construct, while agg_distinct * indicates we saw 'foo(DISTINCT ...)'. In any of these cases, the * construct *must* be an aggregate call. Otherwise, it might be either an * aggregate or some other kind of function. However, if OVER is present * it had better be an aggregate or window function. */ typedef struct FuncCall { NodeTag type; List *funcname; /* qualified name of function */ List *args; /* the arguments (list of exprs) */ List *agg_order; /* ORDER BY (list of SortBy) */ bool agg_star; /* argument was really '*' */ bool agg_distinct; /* arguments were labeled DISTINCT */ bool func_variadic; /* last argument was labeled VARIADIC */ struct WindowDef *over; /* OVER clause, if any */ int location; /* token location, or -1 if unknown */ } FuncCall; /* * A_Star - '*' representing all columns of a table or compound field * * This can appear within ColumnRef.fields, A_Indirection.indirection, and * ResTarget.indirection lists. */ typedef struct A_Star { NodeTag type; } A_Star; /* * A_Indices - array subscript or slice bounds ([lidx:uidx] or [uidx]) */ typedef struct A_Indices { NodeTag type; Node *lidx; /* NULL if it's a single subscript */ Node *uidx; } A_Indices; /* * A_Indirection - select a field and/or array element from an expression * * The indirection list can contain A_Indices nodes (representing * subscripting), string Value nodes (representing field selection --- the * string value is the name of the field to select), and A_Star nodes * (representing selection of all fields of a composite type). * For example, a complex selection operation like * (foo).field1[42][7].field2 * would be represented with a single A_Indirection node having a 4-element * indirection list. * * Currently, A_Star must appear only as the last list element --- the grammar * is responsible for enforcing this! */ typedef struct A_Indirection { NodeTag type; Node *arg; /* the thing being selected from */ List *indirection; /* subscripts and/or field names and/or * */ } A_Indirection; /* * A_ArrayExpr - an ARRAY[] construct */ typedef struct A_ArrayExpr { NodeTag type; List *elements; /* array element expressions */ int location; /* token location, or -1 if unknown */ } A_ArrayExpr; /* * ResTarget - * result target (used in target list of pre-transformed parse trees) * * In a SELECT target list, 'name' is the column label from an * 'AS ColumnLabel' clause, or NULL if there was none, and 'val' is the * value expression itself. The 'indirection' field is not used. * * INSERT uses ResTarget in its target-column-names list. Here, 'name' is * the name of the destination column, 'indirection' stores any subscripts * attached to the destination, and 'val' is not used. * * In an UPDATE target list, 'name' is the name of the destination column, * 'indirection' stores any subscripts attached to the destination, and * 'val' is the expression to assign. * * See A_Indirection for more info about what can appear in 'indirection'. */ typedef struct ResTarget { NodeTag type; char *name; /* column name or NULL */ List *indirection; /* subscripts, field names, and '*', or NIL */ Node *val; /* the value expression to compute or assign */ int location; /* token location, or -1 if unknown */ } ResTarget; /* * SortBy - for ORDER BY clause */ typedef struct SortBy { NodeTag type; Node *node; /* expression to sort on */ SortByDir sortby_dir; /* ASC/DESC/USING/default */ SortByNulls sortby_nulls; /* NULLS FIRST/LAST */ List *useOp; /* name of op to use, if SORTBY_USING */ int location; /* operator location, or -1 if none/unknown */ } SortBy; /* * WindowDef - raw representation of WINDOW and OVER clauses * * For entries in a WINDOW list, "name" is the window name being defined. * For OVER clauses, we use "name" for the "OVER window" syntax, or "refname" * for the "OVER (window)" syntax, which is subtly different --- the latter * implies overriding the window frame clause. */ typedef struct WindowDef { NodeTag type; char *name; /* window's own name */ char *refname; /* referenced window name, if any */ List *partitionClause; /* PARTITION BY expression list */ List *orderClause; /* ORDER BY (list of SortBy) */ int frameOptions; /* frame_clause options, see below */ Node *startOffset; /* expression for starting bound, if any */ Node *endOffset; /* expression for ending bound, if any */ int location; /* parse location, or -1 if none/unknown */ } WindowDef; /* * frameOptions is an OR of these bits. The NONDEFAULT and BETWEEN bits are * used so that ruleutils.c can tell which properties were specified and * which were defaulted; the correct behavioral bits must be set either way. * The START_foo and END_foo options must come in pairs of adjacent bits for * the convenience of gram.y, even though some of them are useless/invalid. * We will need more bits (and fields) to cover the full SQL:2008 option set. */ #define FRAMEOPTION_NONDEFAULT 0x00001 /* any specified? */ #define FRAMEOPTION_RANGE 0x00002 /* RANGE behavior */ #define FRAMEOPTION_ROWS 0x00004 /* ROWS behavior */ #define FRAMEOPTION_BETWEEN 0x00008 /* BETWEEN given? */ #define FRAMEOPTION_START_UNBOUNDED_PRECEDING 0x00010 /* start is U. P. */ #define FRAMEOPTION_END_UNBOUNDED_PRECEDING 0x00020 /* (disallowed) */ #define FRAMEOPTION_START_UNBOUNDED_FOLLOWING 0x00040 /* (disallowed) */ #define FRAMEOPTION_END_UNBOUNDED_FOLLOWING 0x00080 /* end is U. F. */ #define FRAMEOPTION_START_CURRENT_ROW 0x00100 /* start is C. R. */ #define FRAMEOPTION_END_CURRENT_ROW 0x00200 /* end is C. R. */ #define FRAMEOPTION_START_VALUE_PRECEDING 0x00400 /* start is V. P. */ #define FRAMEOPTION_END_VALUE_PRECEDING 0x00800 /* end is V. P. */ #define FRAMEOPTION_START_VALUE_FOLLOWING 0x01000 /* start is V. F. */ #define FRAMEOPTION_END_VALUE_FOLLOWING 0x02000 /* end is V. F. */ #define FRAMEOPTION_START_VALUE \ (FRAMEOPTION_START_VALUE_PRECEDING | FRAMEOPTION_START_VALUE_FOLLOWING) #define FRAMEOPTION_END_VALUE \ (FRAMEOPTION_END_VALUE_PRECEDING | FRAMEOPTION_END_VALUE_FOLLOWING) #define FRAMEOPTION_DEFAULTS \ (FRAMEOPTION_RANGE | FRAMEOPTION_START_UNBOUNDED_PRECEDING | \ FRAMEOPTION_END_CURRENT_ROW) /* * RangeSubselect - subquery appearing in a FROM clause */ typedef struct RangeSubselect { NodeTag type; Node *subquery; /* the untransformed sub-select clause */ Alias *alias; /* table alias & optional column aliases */ } RangeSubselect; /* * RangeFunction - function call appearing in a FROM clause */ typedef struct RangeFunction { NodeTag type; Node *funccallnode; /* untransformed function call tree */ Alias *alias; /* table alias & optional column aliases */ List *coldeflist; /* list of ColumnDef nodes to describe result * of function returning RECORD */ } RangeFunction; /* * ColumnDef - column definition (used in various creates) * * If the column has a default value, we may have the value expression * in either "raw" form (an untransformed parse tree) or "cooked" form * (a post-parse-analysis, executable expression tree), depending on * how this ColumnDef node was created (by parsing, or by inheritance * from an existing relation). We should never have both in the same node! * * Similarly, we may have a COLLATE specification in either raw form * (represented as a CollateClause with arg==NULL) or cooked form * (the collation's OID). * * The constraints list may contain a CONSTR_DEFAULT item in a raw * parsetree produced by gram.y, but transformCreateStmt will remove * the item and set raw_default instead. CONSTR_DEFAULT items * should not appear in any subsequent processing. */ typedef struct ColumnDef { NodeTag type; char *colname; /* name of column */ TypeName *typeName; /* type of column */ int inhcount; /* number of times column is inherited */ bool is_local; /* column has local (non-inherited) def'n */ bool is_not_null; /* NOT NULL constraint specified? */ bool is_from_type; /* column definition came from table type */ char storage; /* attstorage setting, or 0 for default */ Node *raw_default; /* default value (untransformed parse tree) */ Node *cooked_default; /* default value (transformed expr tree) */ CollateClause *collClause; /* untransformed COLLATE spec, if any */ Oid collOid; /* collation OID (InvalidOid if not set) */ List *constraints; /* other constraints on column */ List *fdwoptions; /* per-column FDW options */ } ColumnDef; /* * TableLikeClause - CREATE TABLE ( ... LIKE ... ) clause */ typedef struct TableLikeClause { NodeTag type; RangeVar *relation; bits32 options; /* OR of TableLikeOption flags */ } TableLikeClause; typedef enum TableLikeOption { CREATE_TABLE_LIKE_DEFAULTS = 1 << 0, CREATE_TABLE_LIKE_CONSTRAINTS = 1 << 1, CREATE_TABLE_LIKE_INDEXES = 1 << 2, CREATE_TABLE_LIKE_STORAGE = 1 << 3, CREATE_TABLE_LIKE_COMMENTS = 1 << 4, CREATE_TABLE_LIKE_ALL = 0x7FFFFFFF } TableLikeOption; /* * IndexElem - index parameters (used in CREATE INDEX) * * For a plain index attribute, 'name' is the name of the table column to * index, and 'expr' is NULL. For an index expression, 'name' is NULL and * 'expr' is the expression tree. */ typedef struct IndexElem { NodeTag type; char *name; /* name of attribute to index, or NULL */ Node *expr; /* expression to index, or NULL */ char *indexcolname; /* name for index column; NULL = default */ List *collation; /* name of collation; NIL = default */ List *opclass; /* name of desired opclass; NIL = default */ SortByDir ordering; /* ASC/DESC/default */ SortByNulls nulls_ordering; /* FIRST/LAST/default */ } IndexElem; /* * DefElem - a generic "name = value" option definition * * In some contexts the name can be qualified. Also, certain SQL commands * allow a SET/ADD/DROP action to be attached to option settings, so it's * convenient to carry a field for that too. (Note: currently, it is our * practice that the grammar allows namespace and action only in statements * where they are relevant; C code can just ignore those fields in other * statements.) */ typedef enum DefElemAction { DEFELEM_UNSPEC, /* no action given */ DEFELEM_SET, DEFELEM_ADD, DEFELEM_DROP } DefElemAction; typedef struct DefElem { NodeTag type; char *defnamespace; /* NULL if unqualified name */ char *defname; Node *arg; /* a (Value *) or a (TypeName *) */ DefElemAction defaction; /* unspecified action, or SET/ADD/DROP */ } DefElem; /* * LockingClause - raw representation of FOR UPDATE/SHARE options * * Note: lockedRels == NIL means "all relations in query". Otherwise it * is a list of RangeVar nodes. (We use RangeVar mainly because it carries * a location field --- currently, parse analysis insists on unqualified * names in LockingClause.) */ typedef struct LockingClause { NodeTag type; List *lockedRels; /* FOR UPDATE or FOR SHARE relations */ bool forUpdate; /* true = FOR UPDATE, false = FOR SHARE */ bool noWait; /* NOWAIT option */ } LockingClause; /* * XMLSERIALIZE (in raw parse tree only) */ typedef struct XmlSerialize { NodeTag type; XmlOptionType xmloption; /* DOCUMENT or CONTENT */ Node *expr; TypeName *typeName; int location; /* token location, or -1 if unknown */ } XmlSerialize; /**************************************************************************** * Nodes for a Query tree ****************************************************************************/ /*-------------------- * RangeTblEntry - * A range table is a List of RangeTblEntry nodes. * * A range table entry may represent a plain relation, a sub-select in * FROM, or the result of a JOIN clause. (Only explicit JOIN syntax * produces an RTE, not the implicit join resulting from multiple FROM * items. This is because we only need the RTE to deal with SQL features * like outer joins and join-output-column aliasing.) Other special * RTE types also exist, as indicated by RTEKind. * * Note that we consider RTE_RELATION to cover anything that has a pg_class * entry. relkind distinguishes the sub-cases. * * alias is an Alias node representing the AS alias-clause attached to the * FROM expression, or NULL if no clause. * * eref is the table reference name and column reference names (either * real or aliases). Note that system columns (OID etc) are not included * in the column list. * eref->aliasname is required to be present, and should generally be used * to identify the RTE for error messages etc. * * In RELATION RTEs, the colnames in both alias and eref are indexed by * physical attribute number; this means there must be colname entries for * dropped columns. When building an RTE we insert empty strings ("") for * dropped columns. Note however that a stored rule may have nonempty * colnames for columns dropped since the rule was created (and for that * matter the colnames might be out of date due to column renamings). * The same comments apply to FUNCTION RTEs when the function's return type * is a named composite type. * * In JOIN RTEs, the colnames in both alias and eref are one-to-one with * joinaliasvars entries. A JOIN RTE will omit columns of its inputs when * those columns are known to be dropped at parse time. Again, however, * a stored rule might contain entries for columns dropped since the rule * was created. (This is only possible for columns not actually referenced * in the rule.) When loading a stored rule, we replace the joinaliasvars * items for any such columns with null pointers. (We can't simply delete * them from the joinaliasvars list, because that would affect the attnums * of Vars referencing the rest of the list.) * * inh is TRUE for relation references that should be expanded to include * inheritance children, if the rel has any. This *must* be FALSE for * RTEs other than RTE_RELATION entries. * * inFromCl marks those range variables that are listed in the FROM clause. * It's false for RTEs that are added to a query behind the scenes, such * as the NEW and OLD variables for a rule, or the subqueries of a UNION. * This flag is not used anymore during parsing, since the parser now uses * a separate "namespace" data structure to control visibility, but it is * needed by ruleutils.c to determine whether RTEs should be shown in * decompiled queries. * * requiredPerms and checkAsUser specify run-time access permissions * checks to be performed at query startup. The user must have *all* * of the permissions that are OR'd together in requiredPerms (zero * indicates no permissions checking). If checkAsUser is not zero, * then do the permissions checks using the access rights of that user, * not the current effective user ID. (This allows rules to act as * setuid gateways.) Permissions checks only apply to RELATION RTEs. * * For SELECT/INSERT/UPDATE permissions, if the user doesn't have * table-wide permissions then it is sufficient to have the permissions * on all columns identified in selectedCols (for SELECT) and/or * modifiedCols (for INSERT/UPDATE; we can tell which from the query type). * selectedCols and modifiedCols are bitmapsets, which cannot have negative * integer members, so we subtract FirstLowInvalidHeapAttributeNumber from * column numbers before storing them in these fields. A whole-row Var * reference is represented by setting the bit for InvalidAttrNumber. *-------------------- */ typedef enum RTEKind { RTE_RELATION, /* ordinary relation reference */ RTE_SUBQUERY, /* subquery in FROM */ RTE_JOIN, /* join */ RTE_FUNCTION, /* function in FROM */ RTE_VALUES, /* VALUES (), (), ... */ RTE_CTE /* common table expr (WITH list element) */ } RTEKind; typedef struct RangeTblEntry { NodeTag type; RTEKind rtekind; /* see above */ /* * XXX the fields applicable to only some rte kinds should be merged into * a union. I didn't do this yet because the diffs would impact a lot of * code that is being actively worked on. FIXME someday. */ /* * Fields valid for a plain relation RTE (else zero): */ Oid relid; /* OID of the relation */ char relkind; /* relation kind (see pg_class.relkind) */ /* * Fields valid for a subquery RTE (else NULL): */ Query *subquery; /* the sub-query */ bool security_barrier; /* subquery from security_barrier view */ /* * Fields valid for a join RTE (else NULL/zero): * * joinaliasvars is a list of (usually) Vars corresponding to the columns * of the join result. An alias Var referencing column K of the join * result can be replaced by the K'th element of joinaliasvars --- but to * simplify the task of reverse-listing aliases correctly, we do not do * that until planning time. In detail: an element of joinaliasvars can * be a Var of one of the join's input relations, or such a Var with an * implicit coercion to the join's output column type, or a COALESCE * expression containing the two input column Vars (possibly coerced). * Within a Query loaded from a stored rule, it is also possible for * joinaliasvars items to be null pointers, which are placeholders for * (necessarily unreferenced) columns dropped since the rule was made. * Also, once planning begins, joinaliasvars items can be almost anything, * as a result of subquery-flattening substitutions. */ JoinType jointype; /* type of join */ List *joinaliasvars; /* list of alias-var expansions */ /* * Fields valid for a function RTE (else NULL): * * If the function returns RECORD, funccoltypes lists the column types * declared in the RTE's column type specification, funccoltypmods lists * their declared typmods, funccolcollations their collations. Otherwise, * those fields are NIL. */ Node *funcexpr; /* expression tree for func call */ List *funccoltypes; /* OID list of column type OIDs */ List *funccoltypmods; /* integer list of column typmods */ List *funccolcollations; /* OID list of column collation OIDs */ /* * Fields valid for a values RTE (else NIL): */ List *values_lists; /* list of expression lists */ List *values_collations; /* OID list of column collation OIDs */ /* * Fields valid for a CTE RTE (else NULL/zero): */ char *ctename; /* name of the WITH list item */ Index ctelevelsup; /* number of query levels up */ bool self_reference; /* is this a recursive self-reference? */ List *ctecoltypes; /* OID list of column type OIDs */ List *ctecoltypmods; /* integer list of column typmods */ List *ctecolcollations; /* OID list of column collation OIDs */ /* * Fields valid in all RTEs: */ Alias *alias; /* user-written alias clause, if any */ Alias *eref; /* expanded reference names */ bool inh; /* inheritance requested? */ bool inFromCl; /* present in FROM clause? */ AclMode requiredPerms; /* bitmask of required access permissions */ Oid checkAsUser; /* if valid, check access as this role */ Bitmapset *selectedCols; /* columns needing SELECT permission */ Bitmapset *modifiedCols; /* columns needing INSERT/UPDATE permission */ } RangeTblEntry; /* * SortGroupClause - * representation of ORDER BY, GROUP BY, PARTITION BY, * DISTINCT, DISTINCT ON items * * You might think that ORDER BY is only interested in defining ordering, * and GROUP/DISTINCT are only interested in defining equality. However, * one way to implement grouping is to sort and then apply a "uniq"-like * filter. So it's also interesting to keep track of possible sort operators * for GROUP/DISTINCT, and in particular to try to sort for the grouping * in a way that will also yield a requested ORDER BY ordering. So we need * to be able to compare ORDER BY and GROUP/DISTINCT lists, which motivates * the decision to give them the same representation. * * tleSortGroupRef must match ressortgroupref of exactly one entry of the * query's targetlist; that is the expression to be sorted or grouped by. * eqop is the OID of the equality operator. * sortop is the OID of the ordering operator (a "<" or ">" operator), * or InvalidOid if not available. * nulls_first means about what you'd expect. If sortop is InvalidOid * then nulls_first is meaningless and should be set to false. * hashable is TRUE if eqop is hashable (note this condition also depends * on the datatype of the input expression). * * In an ORDER BY item, all fields must be valid. (The eqop isn't essential * here, but it's cheap to get it along with the sortop, and requiring it * to be valid eases comparisons to grouping items.) Note that this isn't * actually enough information to determine an ordering: if the sortop is * collation-sensitive, a collation OID is needed too. We don't store the * collation in SortGroupClause because it's not available at the time the * parser builds the SortGroupClause; instead, consult the exposed collation * of the referenced targetlist expression to find out what it is. * * In a grouping item, eqop must be valid. If the eqop is a btree equality * operator, then sortop should be set to a compatible ordering operator. * We prefer to set eqop/sortop/nulls_first to match any ORDER BY item that * the query presents for the same tlist item. If there is none, we just * use the default ordering op for the datatype. * * If the tlist item's type has a hash opclass but no btree opclass, then * we will set eqop to the hash equality operator, sortop to InvalidOid, * and nulls_first to false. A grouping item of this kind can only be * implemented by hashing, and of course it'll never match an ORDER BY item. * * The hashable flag is provided since we generally have the requisite * information readily available when the SortGroupClause is constructed, * and it's relatively expensive to get it again later. Note there is no * need for a "sortable" flag since OidIsValid(sortop) serves the purpose. * * A query might have both ORDER BY and DISTINCT (or DISTINCT ON) clauses. * In SELECT DISTINCT, the distinctClause list is as long or longer than the * sortClause list, while in SELECT DISTINCT ON it's typically shorter. * The two lists must match up to the end of the shorter one --- the parser * rearranges the distinctClause if necessary to make this true. (This * restriction ensures that only one sort step is needed to both satisfy the * ORDER BY and set up for the Unique step. This is semantically necessary * for DISTINCT ON, and presents no real drawback for DISTINCT.) */ typedef struct SortGroupClause { NodeTag type; Index tleSortGroupRef; /* reference into targetlist */ Oid eqop; /* the equality operator ('=' op) */ Oid sortop; /* the ordering operator ('<' op), or 0 */ bool nulls_first; /* do NULLs come before normal values? */ bool hashable; /* can eqop be implemented by hashing? */ } SortGroupClause; /* * WindowClause - * transformed representation of WINDOW and OVER clauses * * A parsed Query's windowClause list contains these structs. "name" is set * if the clause originally came from WINDOW, and is NULL if it originally * was an OVER clause (but note that we collapse out duplicate OVERs). * partitionClause and orderClause are lists of SortGroupClause structs. * winref is an ID number referenced by WindowFunc nodes; it must be unique * among the members of a Query's windowClause list. * When refname isn't null, the partitionClause is always copied from there; * the orderClause might or might not be copied (see copiedOrder); the framing * options are never copied, per spec. */ typedef struct WindowClause { NodeTag type; char *name; /* window name (NULL in an OVER clause) */ char *refname; /* referenced window name, if any */ List *partitionClause; /* PARTITION BY list */ List *orderClause; /* ORDER BY list */ int frameOptions; /* frame_clause options, see WindowDef */ Node *startOffset; /* expression for starting bound, if any */ Node *endOffset; /* expression for ending bound, if any */ Index winref; /* ID referenced by window functions */ bool copiedOrder; /* did we copy orderClause from refname? */ } WindowClause; /* * RowMarkClause - * parser output representation of FOR UPDATE/SHARE clauses * * Query.rowMarks contains a separate RowMarkClause node for each relation * identified as a FOR UPDATE/SHARE target. If FOR UPDATE/SHARE is applied * to a subquery, we generate RowMarkClauses for all normal and subquery rels * in the subquery, but they are marked pushedDown = true to distinguish them * from clauses that were explicitly written at this query level. Also, * Query.hasForUpdate tells whether there were explicit FOR UPDATE/SHARE * clauses in the current query level. */ typedef struct RowMarkClause { NodeTag type; Index rti; /* range table index of target relation */ bool forUpdate; /* true = FOR UPDATE, false = FOR SHARE */ bool noWait; /* NOWAIT option */ bool pushedDown; /* pushed down from higher query level? */ } RowMarkClause; /* * WithClause - * representation of WITH clause * * Note: WithClause does not propagate into the Query representation; * but CommonTableExpr does. */ typedef struct WithClause { NodeTag type; List *ctes; /* list of CommonTableExprs */ bool recursive; /* true = WITH RECURSIVE */ int location; /* token location, or -1 if unknown */ } WithClause; /* * CommonTableExpr - * representation of WITH list element * * We don't currently support the SEARCH or CYCLE clause. */ typedef struct CommonTableExpr { NodeTag type; char *ctename; /* query name (never qualified) */ List *aliascolnames; /* optional list of column names */ /* SelectStmt/InsertStmt/etc before parse analysis, Query afterwards: */ Node *ctequery; /* the CTE's subquery */ int location; /* token location, or -1 if unknown */ /* These fields are set during parse analysis: */ bool cterecursive; /* is this CTE actually recursive? */ int cterefcount; /* number of RTEs referencing this CTE * (excluding internal self-references) */ List *ctecolnames; /* list of output column names */ List *ctecoltypes; /* OID list of output column type OIDs */ List *ctecoltypmods; /* integer list of output column typmods */ List *ctecolcollations; /* OID list of column collation OIDs */ } CommonTableExpr; /* Convenience macro to get the output tlist of a CTE's query */ #define GetCTETargetList(cte) \ (AssertMacro(IsA((cte)->ctequery, Query)), \ ((Query *) (cte)->ctequery)->commandType == CMD_SELECT ? \ ((Query *) (cte)->ctequery)->targetList : \ ((Query *) (cte)->ctequery)->returningList) /***************************************************************************** * Optimizable Statements *****************************************************************************/ /* ---------------------- * Insert Statement * * The source expression is represented by SelectStmt for both the * SELECT and VALUES cases. If selectStmt is NULL, then the query * is INSERT ... DEFAULT VALUES. * ---------------------- */ typedef struct InsertStmt { NodeTag type; RangeVar *relation; /* relation to insert into */ List *cols; /* optional: names of the target columns */ Node *selectStmt; /* the source SELECT/VALUES, or NULL */ List *returningList; /* list of expressions to return */ WithClause *withClause; /* WITH clause */ } InsertStmt; /* ---------------------- * Delete Statement * ---------------------- */ typedef struct DeleteStmt { NodeTag type; RangeVar *relation; /* relation to delete from */ List *usingClause; /* optional using clause for more tables */ Node *whereClause; /* qualifications */ List *returningList; /* list of expressions to return */ WithClause *withClause; /* WITH clause */ } DeleteStmt; /* ---------------------- * Update Statement * ---------------------- */ typedef struct UpdateStmt { NodeTag type; RangeVar *relation; /* relation to update */ List *targetList; /* the target list (of ResTarget) */ Node *whereClause; /* qualifications */ List *fromClause; /* optional from clause for more tables */ List *returningList; /* list of expressions to return */ WithClause *withClause; /* WITH clause */ } UpdateStmt; /* ---------------------- * Select Statement * * A "simple" SELECT is represented in the output of gram.y by a single * SelectStmt node; so is a VALUES construct. A query containing set * operators (UNION, INTERSECT, EXCEPT) is represented by a tree of SelectStmt * nodes, in which the leaf nodes are component SELECTs and the internal nodes * represent UNION, INTERSECT, or EXCEPT operators. Using the same node * type for both leaf and internal nodes allows gram.y to stick ORDER BY, * LIMIT, etc, clause values into a SELECT statement without worrying * whether it is a simple or compound SELECT. * ---------------------- */ typedef enum SetOperation { SETOP_NONE = 0, SETOP_UNION, SETOP_INTERSECT, SETOP_EXCEPT } SetOperation; typedef struct SelectStmt { NodeTag type; /* * These fields are used only in "leaf" SelectStmts. */ List *distinctClause; /* NULL, list of DISTINCT ON exprs, or * lcons(NIL,NIL) for all (SELECT DISTINCT) */ IntoClause *intoClause; /* target for SELECT INTO */ List *targetList; /* the target list (of ResTarget) */ List *fromClause; /* the FROM clause */ Node *whereClause; /* WHERE qualification */ List *groupClause; /* GROUP BY clauses */ Node *havingClause; /* HAVING conditional-expression */ List *windowClause; /* WINDOW window_name AS (...), ... */ WithClause *withClause; /* WITH clause */ /* * In a "leaf" node representing a VALUES list, the above fields are all * null, and instead this field is set. Note that the elements of the * sublists are just expressions, without ResTarget decoration. Also note * that a list element can be DEFAULT (represented as a SetToDefault * node), regardless of the context of the VALUES list. It's up to parse * analysis to reject that where not valid. */ List *valuesLists; /* untransformed list of expression lists */ /* * These fields are used in both "leaf" SelectStmts and upper-level * SelectStmts. */ List *sortClause; /* sort clause (a list of SortBy's) */ Node *limitOffset; /* # of result tuples to skip */ Node *limitCount; /* # of result tuples to return */ List *lockingClause; /* FOR UPDATE (list of LockingClause's) */ /* * These fields are used only in upper-level SelectStmts. */ SetOperation op; /* type of set op */ bool all; /* ALL specified? */ struct SelectStmt *larg; /* left child */ struct SelectStmt *rarg; /* right child */ /* Eventually add fields for CORRESPONDING spec here */ } SelectStmt; /* ---------------------- * Set Operation node for post-analysis query trees * * After parse analysis, a SELECT with set operations is represented by a * top-level Query node containing the leaf SELECTs as subqueries in its * range table. Its setOperations field shows the tree of set operations, * with leaf SelectStmt nodes replaced by RangeTblRef nodes, and internal * nodes replaced by SetOperationStmt nodes. Information about the output * column types is added, too. (Note that the child nodes do not necessarily * produce these types directly, but we've checked that their output types * can be coerced to the output column type.) Also, if it's not UNION ALL, * information about the types' sort/group semantics is provided in the form * of a SortGroupClause list (same representation as, eg, DISTINCT). * The resolved common column collations are provided too; but note that if * it's not UNION ALL, it's okay for a column to not have a common collation, * so a member of the colCollations list could be InvalidOid even though the * column has a collatable type. * ---------------------- */ typedef struct SetOperationStmt { NodeTag type; SetOperation op; /* type of set op */ bool all; /* ALL specified? */ Node *larg; /* left child */ Node *rarg; /* right child */ /* Eventually add fields for CORRESPONDING spec here */ /* Fields derived during parse analysis: */ List *colTypes; /* OID list of output column type OIDs */ List *colTypmods; /* integer list of output column typmods */ List *colCollations; /* OID list of output column collation OIDs */ List *groupClauses; /* a list of SortGroupClause's */ /* groupClauses is NIL if UNION ALL, but must be set otherwise */ } SetOperationStmt; /***************************************************************************** * Other Statements (no optimizations required) * * These are not touched by parser/analyze.c except to put them into * the utilityStmt field of a Query. This is eventually passed to * ProcessUtility (by-passing rewriting and planning). Some of the * statements do need attention from parse analysis, and this is * done by routines in parser/parse_utilcmd.c after ProcessUtility * receives the command for execution. *****************************************************************************/ /* * When a command can act on several kinds of objects with only one * parse structure required, use these constants to designate the * object type. Note that commands typically don't support all the types. */ typedef enum ObjectType { OBJECT_AGGREGATE, OBJECT_ATTRIBUTE, /* type's attribute, when distinct from column */ OBJECT_CAST, OBJECT_COLUMN, OBJECT_CONSTRAINT, OBJECT_COLLATION, OBJECT_CONVERSION, OBJECT_DATABASE, OBJECT_DOMAIN, OBJECT_EXTENSION, OBJECT_FDW, OBJECT_FOREIGN_SERVER, OBJECT_FOREIGN_TABLE, OBJECT_FUNCTION, OBJECT_INDEX, OBJECT_LANGUAGE, OBJECT_LARGEOBJECT, OBJECT_OPCLASS, OBJECT_OPERATOR, OBJECT_OPFAMILY, OBJECT_ROLE, OBJECT_RULE, OBJECT_SCHEMA, OBJECT_SEQUENCE, OBJECT_TABLE, OBJECT_TABLESPACE, OBJECT_TRIGGER, OBJECT_TSCONFIGURATION, OBJECT_TSDICTIONARY, OBJECT_TSPARSER, OBJECT_TSTEMPLATE, OBJECT_TYPE, OBJECT_VIEW } ObjectType; /* ---------------------- * Create Schema Statement * * NOTE: the schemaElts list contains raw parsetrees for component statements * of the schema, such as CREATE TABLE, GRANT, etc. These are analyzed and * executed after the schema itself is created. * ---------------------- */ typedef struct CreateSchemaStmt { NodeTag type; char *schemaname; /* the name of the schema to create */ char *authid; /* the owner of the created schema */ List *schemaElts; /* schema components (list of parsenodes) */ } CreateSchemaStmt; typedef enum DropBehavior { DROP_RESTRICT, /* drop fails if any dependent objects */ DROP_CASCADE /* remove dependent objects too */ } DropBehavior; /* ---------------------- * Alter Table * ---------------------- */ typedef struct AlterTableStmt { NodeTag type; RangeVar *relation; /* table to work on */ List *cmds; /* list of subcommands */ ObjectType relkind; /* type of object */ bool missing_ok; /* skip error if table missing */ } AlterTableStmt; typedef enum AlterTableType { AT_AddColumn, /* add column */ AT_AddColumnRecurse, /* internal to commands/tablecmds.c */ AT_AddColumnToView, /* implicitly via CREATE OR REPLACE VIEW */ AT_ColumnDefault, /* alter column default */ AT_DropNotNull, /* alter column drop not null */ AT_SetNotNull, /* alter column set not null */ AT_SetStatistics, /* alter column set statistics */ AT_SetOptions, /* alter column set ( options ) */ AT_ResetOptions, /* alter column reset ( options ) */ AT_SetStorage, /* alter column set storage */ AT_DropColumn, /* drop column */ AT_DropColumnRecurse, /* internal to commands/tablecmds.c */ AT_AddIndex, /* add index */ AT_ReAddIndex, /* internal to commands/tablecmds.c */ AT_AddConstraint, /* add constraint */ AT_AddConstraintRecurse, /* internal to commands/tablecmds.c */ AT_ValidateConstraint, /* validate constraint */ AT_ValidateConstraintRecurse, /* internal to commands/tablecmds.c */ AT_ProcessedConstraint, /* pre-processed add constraint (local in * parser/parse_utilcmd.c) */ AT_AddIndexConstraint, /* add constraint using existing index */ AT_DropConstraint, /* drop constraint */ AT_DropConstraintRecurse, /* internal to commands/tablecmds.c */ AT_AlterColumnType, /* alter column type */ AT_AlterColumnGenericOptions, /* alter column OPTIONS (...) */ AT_ChangeOwner, /* change owner */ AT_ClusterOn, /* CLUSTER ON */ AT_DropCluster, /* SET WITHOUT CLUSTER */ AT_AddOids, /* SET WITH OIDS */ AT_AddOidsRecurse, /* internal to commands/tablecmds.c */ AT_DropOids, /* SET WITHOUT OIDS */ AT_SetTableSpace, /* SET TABLESPACE */ AT_SetRelOptions, /* SET (...) -- AM specific parameters */ AT_ResetRelOptions, /* RESET (...) -- AM specific parameters */ AT_ReplaceRelOptions, /* replace reloption list in its entirety */ AT_EnableTrig, /* ENABLE TRIGGER name */ AT_EnableAlwaysTrig, /* ENABLE ALWAYS TRIGGER name */ AT_EnableReplicaTrig, /* ENABLE REPLICA TRIGGER name */ AT_DisableTrig, /* DISABLE TRIGGER name */ AT_EnableTrigAll, /* ENABLE TRIGGER ALL */ AT_DisableTrigAll, /* DISABLE TRIGGER ALL */ AT_EnableTrigUser, /* ENABLE TRIGGER USER */ AT_DisableTrigUser, /* DISABLE TRIGGER USER */ AT_EnableRule, /* ENABLE RULE name */ AT_EnableAlwaysRule, /* ENABLE ALWAYS RULE name */ AT_EnableReplicaRule, /* ENABLE REPLICA RULE name */ AT_DisableRule, /* DISABLE RULE name */ AT_AddInherit, /* INHERIT parent */ AT_DropInherit, /* NO INHERIT parent */ AT_AddOf, /* OF */ AT_DropOf, /* NOT OF */ AT_GenericOptions, /* OPTIONS (...) */ /* this will be in a more natural position in 9.3: */ AT_ReAddConstraint /* internal to commands/tablecmds.c */ } AlterTableType; typedef struct AlterTableCmd /* one subcommand of an ALTER TABLE */ { NodeTag type; AlterTableType subtype; /* Type of table alteration to apply */ char *name; /* column, constraint, or trigger to act on, * or new owner or tablespace */ Node *def; /* definition of new column, index, * constraint, or parent table */ DropBehavior behavior; /* RESTRICT or CASCADE for DROP cases */ bool missing_ok; /* skip error if missing? */ } AlterTableCmd; /* ---------------------- * Alter Domain * * The fields are used in different ways by the different variants of * this command. * ---------------------- */ typedef struct AlterDomainStmt { NodeTag type; char subtype; /*------------ * T = alter column default * N = alter column drop not null * O = alter column set not null * C = add constraint * X = drop constraint *------------ */ List *typeName; /* domain to work on */ char *name; /* column or constraint name to act on */ Node *def; /* definition of default or constraint */ DropBehavior behavior; /* RESTRICT or CASCADE for DROP cases */ bool missing_ok; /* skip error if missing? */ } AlterDomainStmt; /* ---------------------- * Grant|Revoke Statement * ---------------------- */ typedef enum GrantTargetType { ACL_TARGET_OBJECT, /* grant on specific named object(s) */ ACL_TARGET_ALL_IN_SCHEMA, /* grant on all objects in given schema(s) */ ACL_TARGET_DEFAULTS /* ALTER DEFAULT PRIVILEGES */ } GrantTargetType; typedef enum GrantObjectType { ACL_OBJECT_COLUMN, /* column */ ACL_OBJECT_RELATION, /* table, view */ ACL_OBJECT_SEQUENCE, /* sequence */ ACL_OBJECT_DATABASE, /* database */ ACL_OBJECT_DOMAIN, /* domain */ ACL_OBJECT_FDW, /* foreign-data wrapper */ ACL_OBJECT_FOREIGN_SERVER, /* foreign server */ ACL_OBJECT_FUNCTION, /* function */ ACL_OBJECT_LANGUAGE, /* procedural language */ ACL_OBJECT_LARGEOBJECT, /* largeobject */ ACL_OBJECT_NAMESPACE, /* namespace */ ACL_OBJECT_TABLESPACE, /* tablespace */ ACL_OBJECT_TYPE /* type */ } GrantObjectType; typedef struct GrantStmt { NodeTag type; bool is_grant; /* true = GRANT, false = REVOKE */ GrantTargetType targtype; /* type of the grant target */ GrantObjectType objtype; /* kind of object being operated on */ List *objects; /* list of RangeVar nodes, FuncWithArgs nodes, * or plain names (as Value strings) */ List *privileges; /* list of AccessPriv nodes */ /* privileges == NIL denotes ALL PRIVILEGES */ List *grantees; /* list of PrivGrantee nodes */ bool grant_option; /* grant or revoke grant option */ DropBehavior behavior; /* drop behavior (for REVOKE) */ } GrantStmt; typedef struct PrivGrantee { NodeTag type; char *rolname; /* if NULL then PUBLIC */ } PrivGrantee; /* * Note: FuncWithArgs carries only the types of the input parameters of the * function. So it is sufficient to identify an existing function, but it * is not enough info to define a function nor to call it. */ typedef struct FuncWithArgs { NodeTag type; List *funcname; /* qualified name of function */ List *funcargs; /* list of Typename nodes */ } FuncWithArgs; /* * An access privilege, with optional list of column names * priv_name == NULL denotes ALL PRIVILEGES (only used with a column list) * cols == NIL denotes "all columns" * Note that simple "ALL PRIVILEGES" is represented as a NIL list, not * an AccessPriv with both fields null. */ typedef struct AccessPriv { NodeTag type; char *priv_name; /* string name of privilege */ List *cols; /* list of Value strings */ } AccessPriv; /* ---------------------- * Grant/Revoke Role Statement * * Note: because of the parsing ambiguity with the GRANT * statement, granted_roles is a list of AccessPriv; the execution code * should complain if any column lists appear. grantee_roles is a list * of role names, as Value strings. * ---------------------- */ typedef struct GrantRoleStmt { NodeTag type; List *granted_roles; /* list of roles to be granted/revoked */ List *grantee_roles; /* list of member roles to add/delete */ bool is_grant; /* true = GRANT, false = REVOKE */ bool admin_opt; /* with admin option */ char *grantor; /* set grantor to other than current role */ DropBehavior behavior; /* drop behavior (for REVOKE) */ } GrantRoleStmt; /* ---------------------- * Alter Default Privileges Statement * ---------------------- */ typedef struct AlterDefaultPrivilegesStmt { NodeTag type; List *options; /* list of DefElem */ GrantStmt *action; /* GRANT/REVOKE action (with objects=NIL) */ } AlterDefaultPrivilegesStmt; /* ---------------------- * Copy Statement * * We support "COPY relation FROM file", "COPY relation TO file", and * "COPY (query) TO file". In any given CopyStmt, exactly one of "relation" * and "query" must be non-NULL. * ---------------------- */ typedef struct CopyStmt { NodeTag type; RangeVar *relation; /* the relation to copy */ Node *query; /* the SELECT query to copy */ List *attlist; /* List of column names (as Strings), or NIL * for all columns */ bool is_from; /* TO or FROM */ char *filename; /* filename, or NULL for STDIN/STDOUT */ List *options; /* List of DefElem nodes */ } CopyStmt; /* ---------------------- * SET Statement (includes RESET) * * "SET var TO DEFAULT" and "RESET var" are semantically equivalent, but we * preserve the distinction in VariableSetKind for CreateCommandTag(). * ---------------------- */ typedef enum { VAR_SET_VALUE, /* SET var = value */ VAR_SET_DEFAULT, /* SET var TO DEFAULT */ VAR_SET_CURRENT, /* SET var FROM CURRENT */ VAR_SET_MULTI, /* special case for SET TRANSACTION ... */ VAR_RESET, /* RESET var */ VAR_RESET_ALL /* RESET ALL */ } VariableSetKind; typedef struct VariableSetStmt { NodeTag type; VariableSetKind kind; char *name; /* variable to be set */ List *args; /* List of A_Const nodes */ bool is_local; /* SET LOCAL? */ } VariableSetStmt; /* ---------------------- * Show Statement * ---------------------- */ typedef struct VariableShowStmt { NodeTag type; char *name; } VariableShowStmt; /* ---------------------- * Create Table Statement * * NOTE: in the raw gram.y output, ColumnDef and Constraint nodes are * intermixed in tableElts, and constraints is NIL. After parse analysis, * tableElts contains just ColumnDefs, and constraints contains just * Constraint nodes (in fact, only CONSTR_CHECK nodes, in the present * implementation). * ---------------------- */ typedef struct CreateStmt { NodeTag type; RangeVar *relation; /* relation to create */ List *tableElts; /* column definitions (list of ColumnDef) */ List *inhRelations; /* relations to inherit from (list of * inhRelation) */ TypeName *ofTypename; /* OF typename */ List *constraints; /* constraints (list of Constraint nodes) */ List *options; /* options from WITH clause */ OnCommitAction oncommit; /* what do we do at COMMIT? */ char *tablespacename; /* table space to use, or NULL */ bool if_not_exists; /* just do nothing if it already exists? */ } CreateStmt; /* ---------- * Definitions for constraints in CreateStmt * * Note that column defaults are treated as a type of constraint, * even though that's a bit odd semantically. * * For constraints that use expressions (CONSTR_CHECK, CONSTR_DEFAULT) * we may have the expression in either "raw" form (an untransformed * parse tree) or "cooked" form (the nodeToString representation of * an executable expression tree), depending on how this Constraint * node was created (by parsing, or by inheritance from an existing * relation). We should never have both in the same node! * * FKCONSTR_ACTION_xxx values are stored into pg_constraint.confupdtype * and pg_constraint.confdeltype columns; FKCONSTR_MATCH_xxx values are * stored into pg_constraint.confmatchtype. Changing the code values may * require an initdb! * * If skip_validation is true then we skip checking that the existing rows * in the table satisfy the constraint, and just install the catalog entries * for the constraint. A new FK constraint is marked as valid iff * initially_valid is true. (Usually skip_validation and initially_valid * are inverses, but we can set both true if the table is known empty.) * * Constraint attributes (DEFERRABLE etc) are initially represented as * separate Constraint nodes for simplicity of parsing. parse_utilcmd.c makes * a pass through the constraints list to insert the info into the appropriate * Constraint node. * ---------- */ typedef enum ConstrType /* types of constraints */ { CONSTR_NULL, /* not SQL92, but a lot of people expect it */ CONSTR_NOTNULL, CONSTR_DEFAULT, CONSTR_CHECK, CONSTR_PRIMARY, CONSTR_UNIQUE, CONSTR_EXCLUSION, CONSTR_FOREIGN, CONSTR_ATTR_DEFERRABLE, /* attributes for previous constraint node */ CONSTR_ATTR_NOT_DEFERRABLE, CONSTR_ATTR_DEFERRED, CONSTR_ATTR_IMMEDIATE } ConstrType; /* Foreign key action codes */ #define FKCONSTR_ACTION_NOACTION 'a' #define FKCONSTR_ACTION_RESTRICT 'r' #define FKCONSTR_ACTION_CASCADE 'c' #define FKCONSTR_ACTION_SETNULL 'n' #define FKCONSTR_ACTION_SETDEFAULT 'd' /* Foreign key matchtype codes */ #define FKCONSTR_MATCH_FULL 'f' #define FKCONSTR_MATCH_PARTIAL 'p' #define FKCONSTR_MATCH_UNSPECIFIED 'u' typedef struct Constraint { NodeTag type; ConstrType contype; /* see above */ /* Fields used for most/all constraint types: */ char *conname; /* Constraint name, or NULL if unnamed */ bool deferrable; /* DEFERRABLE? */ bool initdeferred; /* INITIALLY DEFERRED? */ int location; /* token location, or -1 if unknown */ /* Fields used for constraints with expressions (CHECK and DEFAULT): */ bool is_no_inherit; /* is constraint non-inheritable? */ Node *raw_expr; /* expr, as untransformed parse tree */ char *cooked_expr; /* expr, as nodeToString representation */ /* Fields used for unique constraints (UNIQUE and PRIMARY KEY): */ List *keys; /* String nodes naming referenced column(s) */ /* Fields used for EXCLUSION constraints: */ List *exclusions; /* list of (IndexElem, operator name) pairs */ /* Fields used for index constraints (UNIQUE, PRIMARY KEY, EXCLUSION): */ List *options; /* options from WITH clause */ char *indexname; /* existing index to use; otherwise NULL */ char *indexspace; /* index tablespace; NULL for default */ /* These could be, but currently are not, used for UNIQUE/PKEY: */ char *access_method; /* index access method; NULL for default */ Node *where_clause; /* partial index predicate */ /* Fields used for FOREIGN KEY constraints: */ RangeVar *pktable; /* Primary key table */ List *fk_attrs; /* Attributes of foreign key */ List *pk_attrs; /* Corresponding attrs in PK table */ char fk_matchtype; /* FULL, PARTIAL, UNSPECIFIED */ char fk_upd_action; /* ON UPDATE action */ char fk_del_action; /* ON DELETE action */ List *old_conpfeqop; /* pg_constraint.conpfeqop of my former self */ /* Fields used for constraints that allow a NOT VALID specification */ bool skip_validation; /* skip validation of existing rows? */ bool initially_valid; /* mark the new constraint as valid? */ Oid old_pktable_oid; /* pg_constraint.confrelid of my former self */ } Constraint; /* ---------------------- * Create/Drop Table Space Statements * ---------------------- */ typedef struct CreateTableSpaceStmt { NodeTag type; char *tablespacename; char *owner; char *location; } CreateTableSpaceStmt; typedef struct DropTableSpaceStmt { NodeTag type; char *tablespacename; bool missing_ok; /* skip error if missing? */ } DropTableSpaceStmt; typedef struct AlterTableSpaceOptionsStmt { NodeTag type; char *tablespacename; List *options; bool isReset; } AlterTableSpaceOptionsStmt; /* ---------------------- * Create/Alter Extension Statements * ---------------------- */ typedef struct CreateExtensionStmt { NodeTag type; char *extname; bool if_not_exists; /* just do nothing if it already exists? */ List *options; /* List of DefElem nodes */ } CreateExtensionStmt; /* Only used for ALTER EXTENSION UPDATE; later might need an action field */ typedef struct AlterExtensionStmt { NodeTag type; char *extname; List *options; /* List of DefElem nodes */ } AlterExtensionStmt; typedef struct AlterExtensionContentsStmt { NodeTag type; char *extname; /* Extension's name */ int action; /* +1 = add object, -1 = drop object */ ObjectType objtype; /* Object's type */ List *objname; /* Qualified name of the object */ List *objargs; /* Arguments if needed (eg, for functions) */ } AlterExtensionContentsStmt; /* ---------------------- * Create/Alter FOREIGN DATA WRAPPER Statements * ---------------------- */ typedef struct CreateFdwStmt { NodeTag type; char *fdwname; /* foreign-data wrapper name */ List *func_options; /* HANDLER/VALIDATOR options */ List *options; /* generic options to FDW */ } CreateFdwStmt; typedef struct AlterFdwStmt { NodeTag type; char *fdwname; /* foreign-data wrapper name */ List *func_options; /* HANDLER/VALIDATOR options */ List *options; /* generic options to FDW */ } AlterFdwStmt; /* ---------------------- * Create/Alter FOREIGN SERVER Statements * ---------------------- */ typedef struct CreateForeignServerStmt { NodeTag type; char *servername; /* server name */ char *servertype; /* optional server type */ char *version; /* optional server version */ char *fdwname; /* FDW name */ List *options; /* generic options to server */ } CreateForeignServerStmt; typedef struct AlterForeignServerStmt { NodeTag type; char *servername; /* server name */ char *version; /* optional server version */ List *options; /* generic options to server */ bool has_version; /* version specified */ } AlterForeignServerStmt; /* ---------------------- * Create FOREIGN TABLE Statements * ---------------------- */ typedef struct CreateForeignTableStmt { CreateStmt base; char *servername; List *options; } CreateForeignTableStmt; /* ---------------------- * Create/Drop USER MAPPING Statements * ---------------------- */ typedef struct CreateUserMappingStmt { NodeTag type; char *username; /* username or PUBLIC/CURRENT_USER */ char *servername; /* server name */ List *options; /* generic options to server */ } CreateUserMappingStmt; typedef struct AlterUserMappingStmt { NodeTag type; char *username; /* username or PUBLIC/CURRENT_USER */ char *servername; /* server name */ List *options; /* generic options to server */ } AlterUserMappingStmt; typedef struct DropUserMappingStmt { NodeTag type; char *username; /* username or PUBLIC/CURRENT_USER */ char *servername; /* server name */ bool missing_ok; /* ignore missing mappings */ } DropUserMappingStmt; /* ---------------------- * Create TRIGGER Statement * ---------------------- */ typedef struct CreateTrigStmt { NodeTag type; char *trigname; /* TRIGGER's name */ RangeVar *relation; /* relation trigger is on */ List *funcname; /* qual. name of function to call */ List *args; /* list of (T_String) Values or NIL */ bool row; /* ROW/STATEMENT */ /* timing uses the TRIGGER_TYPE bits defined in catalog/pg_trigger.h */ int16 timing; /* BEFORE, AFTER, or INSTEAD */ /* events uses the TRIGGER_TYPE bits defined in catalog/pg_trigger.h */ int16 events; /* "OR" of INSERT/UPDATE/DELETE/TRUNCATE */ List *columns; /* column names, or NIL for all columns */ Node *whenClause; /* qual expression, or NULL if none */ bool isconstraint; /* This is a constraint trigger */ /* The remaining fields are only used for constraint triggers */ bool deferrable; /* [NOT] DEFERRABLE */ bool initdeferred; /* INITIALLY {DEFERRED|IMMEDIATE} */ RangeVar *constrrel; /* opposite relation, if RI trigger */ } CreateTrigStmt; /* ---------------------- * Create PROCEDURAL LANGUAGE Statements * ---------------------- */ typedef struct CreatePLangStmt { NodeTag type; bool replace; /* T => replace if already exists */ char *plname; /* PL name */ List *plhandler; /* PL call handler function (qual. name) */ List *plinline; /* optional inline function (qual. name) */ List *plvalidator; /* optional validator function (qual. name) */ bool pltrusted; /* PL is trusted */ } CreatePLangStmt; /* ---------------------- * Create/Alter/Drop Role Statements * * Note: these node types are also used for the backwards-compatible * Create/Alter/Drop User/Group statements. In the ALTER and DROP cases * there's really no need to distinguish what the original spelling was, * but for CREATE we mark the type because the defaults vary. * ---------------------- */ typedef enum RoleStmtType { ROLESTMT_ROLE, ROLESTMT_USER, ROLESTMT_GROUP } RoleStmtType; typedef struct CreateRoleStmt { NodeTag type; RoleStmtType stmt_type; /* ROLE/USER/GROUP */ char *role; /* role name */ List *options; /* List of DefElem nodes */ } CreateRoleStmt; typedef struct AlterRoleStmt { NodeTag type; char *role; /* role name */ List *options; /* List of DefElem nodes */ int action; /* +1 = add members, -1 = drop members */ } AlterRoleStmt; typedef struct AlterRoleSetStmt { NodeTag type; char *role; /* role name */ char *database; /* database name, or NULL */ VariableSetStmt *setstmt; /* SET or RESET subcommand */ } AlterRoleSetStmt; typedef struct DropRoleStmt { NodeTag type; List *roles; /* List of roles to remove */ bool missing_ok; /* skip error if a role is missing? */ } DropRoleStmt; /* ---------------------- * {Create|Alter} SEQUENCE Statement * ---------------------- */ typedef struct CreateSeqStmt { NodeTag type; RangeVar *sequence; /* the sequence to create */ List *options; Oid ownerId; /* ID of owner, or InvalidOid for default */ } CreateSeqStmt; typedef struct AlterSeqStmt { NodeTag type; RangeVar *sequence; /* the sequence to alter */ List *options; bool missing_ok; /* skip error if a role is missing? */ } AlterSeqStmt; /* ---------------------- * Create {Aggregate|Operator|Type} Statement * ---------------------- */ typedef struct DefineStmt { NodeTag type; ObjectType kind; /* aggregate, operator, type */ bool oldstyle; /* hack to signal old CREATE AGG syntax */ List *defnames; /* qualified name (list of Value strings) */ List *args; /* a list of TypeName (if needed) */ List *definition; /* a list of DefElem */ } DefineStmt; /* ---------------------- * Create Domain Statement * ---------------------- */ typedef struct CreateDomainStmt { NodeTag type; List *domainname; /* qualified name (list of Value strings) */ TypeName *typeName; /* the base type */ CollateClause *collClause; /* untransformed COLLATE spec, if any */ List *constraints; /* constraints (list of Constraint nodes) */ } CreateDomainStmt; /* ---------------------- * Create Operator Class Statement * ---------------------- */ typedef struct CreateOpClassStmt { NodeTag type; List *opclassname; /* qualified name (list of Value strings) */ List *opfamilyname; /* qualified name (ditto); NIL if omitted */ char *amname; /* name of index AM opclass is for */ TypeName *datatype; /* datatype of indexed column */ List *items; /* List of CreateOpClassItem nodes */ bool isDefault; /* Should be marked as default for type? */ } CreateOpClassStmt; #define OPCLASS_ITEM_OPERATOR 1 #define OPCLASS_ITEM_FUNCTION 2 #define OPCLASS_ITEM_STORAGETYPE 3 typedef struct CreateOpClassItem { NodeTag type; int itemtype; /* see codes above */ /* fields used for an operator or function item: */ List *name; /* operator or function name */ List *args; /* argument types */ int number; /* strategy num or support proc num */ List *order_family; /* only used for ordering operators */ List *class_args; /* only used for functions */ /* fields used for a storagetype item: */ TypeName *storedtype; /* datatype stored in index */ } CreateOpClassItem; /* ---------------------- * Create Operator Family Statement * ---------------------- */ typedef struct CreateOpFamilyStmt { NodeTag type; List *opfamilyname; /* qualified name (list of Value strings) */ char *amname; /* name of index AM opfamily is for */ } CreateOpFamilyStmt; /* ---------------------- * Alter Operator Family Statement * ---------------------- */ typedef struct AlterOpFamilyStmt { NodeTag type; List *opfamilyname; /* qualified name (list of Value strings) */ char *amname; /* name of index AM opfamily is for */ bool isDrop; /* ADD or DROP the items? */ List *items; /* List of CreateOpClassItem nodes */ } AlterOpFamilyStmt; /* ---------------------- * Drop Table|Sequence|View|Index|Type|Domain|Conversion|Schema Statement * ---------------------- */ typedef struct DropStmt { NodeTag type; List *objects; /* list of sublists of names (as Values) */ List *arguments; /* list of sublists of arguments (as Values) */ ObjectType removeType; /* object type */ DropBehavior behavior; /* RESTRICT or CASCADE behavior */ bool missing_ok; /* skip error if object is missing? */ bool concurrent; /* drop index concurrently? */ } DropStmt; /* ---------------------- * Truncate Table Statement * ---------------------- */ typedef struct TruncateStmt { NodeTag type; List *relations; /* relations (RangeVars) to be truncated */ bool restart_seqs; /* restart owned sequences? */ DropBehavior behavior; /* RESTRICT or CASCADE behavior */ } TruncateStmt; /* ---------------------- * Comment On Statement * ---------------------- */ typedef struct CommentStmt { NodeTag type; ObjectType objtype; /* Object's type */ List *objname; /* Qualified name of the object */ List *objargs; /* Arguments if needed (eg, for functions) */ char *comment; /* Comment to insert, or NULL to remove */ } CommentStmt; /* ---------------------- * SECURITY LABEL Statement * ---------------------- */ typedef struct SecLabelStmt { NodeTag type; ObjectType objtype; /* Object's type */ List *objname; /* Qualified name of the object */ List *objargs; /* Arguments if needed (eg, for functions) */ char *provider; /* Label provider (or NULL) */ char *label; /* New security label to be assigned */ } SecLabelStmt; /* ---------------------- * Declare Cursor Statement * * Note: the "query" field of DeclareCursorStmt is only used in the raw grammar * output. After parse analysis it's set to null, and the Query points to the * DeclareCursorStmt, not vice versa. * ---------------------- */ #define CURSOR_OPT_BINARY 0x0001 /* BINARY */ #define CURSOR_OPT_SCROLL 0x0002 /* SCROLL explicitly given */ #define CURSOR_OPT_NO_SCROLL 0x0004 /* NO SCROLL explicitly given */ #define CURSOR_OPT_INSENSITIVE 0x0008 /* INSENSITIVE */ #define CURSOR_OPT_HOLD 0x0010 /* WITH HOLD */ /* these planner-control flags do not correspond to any SQL grammar: */ #define CURSOR_OPT_FAST_PLAN 0x0020 /* prefer fast-start plan */ #define CURSOR_OPT_GENERIC_PLAN 0x0040 /* force use of generic plan */ #define CURSOR_OPT_CUSTOM_PLAN 0x0080 /* force use of custom plan */ typedef struct DeclareCursorStmt { NodeTag type; char *portalname; /* name of the portal (cursor) */ int options; /* bitmask of options (see above) */ Node *query; /* the raw SELECT query */ } DeclareCursorStmt; /* ---------------------- * Close Portal Statement * ---------------------- */ typedef struct ClosePortalStmt { NodeTag type; char *portalname; /* name of the portal (cursor) */ /* NULL means CLOSE ALL */ } ClosePortalStmt; /* ---------------------- * Fetch Statement (also Move) * ---------------------- */ typedef enum FetchDirection { /* for these, howMany is how many rows to fetch; FETCH_ALL means ALL */ FETCH_FORWARD, FETCH_BACKWARD, /* for these, howMany indicates a position; only one row is fetched */ FETCH_ABSOLUTE, FETCH_RELATIVE } FetchDirection; #define FETCH_ALL LONG_MAX typedef struct FetchStmt { NodeTag type; FetchDirection direction; /* see above */ long howMany; /* number of rows, or position argument */ char *portalname; /* name of portal (cursor) */ bool ismove; /* TRUE if MOVE */ } FetchStmt; /* ---------------------- * Create Index Statement * * This represents creation of an index and/or an associated constraint. * If isconstraint is true, we should create a pg_constraint entry along * with the index. But if indexOid isn't InvalidOid, we are not creating an * index, just a UNIQUE/PKEY constraint using an existing index. isconstraint * must always be true in this case, and the fields describing the index * properties are empty. * ---------------------- */ typedef struct IndexStmt { NodeTag type; char *idxname; /* name of new index, or NULL for default */ RangeVar *relation; /* relation to build index on */ char *accessMethod; /* name of access method (eg. btree) */ char *tableSpace; /* tablespace, or NULL for default */ List *indexParams; /* columns to index: a list of IndexElem */ List *options; /* WITH clause options: a list of DefElem */ Node *whereClause; /* qualification (partial-index predicate) */ List *excludeOpNames; /* exclusion operator names, or NIL if none */ char *idxcomment; /* comment to apply to index, or NULL */ Oid indexOid; /* OID of an existing index, if any */ Oid oldNode; /* relfilenode of existing storage, if any */ bool unique; /* is index unique? */ bool primary; /* is index a primary key? */ bool isconstraint; /* is it for a pkey/unique constraint? */ bool deferrable; /* is the constraint DEFERRABLE? */ bool initdeferred; /* is the constraint INITIALLY DEFERRED? */ bool concurrent; /* should this be a concurrent index build? */ } IndexStmt; /* ---------------------- * Create Function Statement * ---------------------- */ typedef struct CreateFunctionStmt { NodeTag type; bool replace; /* T => replace if already exists */ List *funcname; /* qualified name of function to create */ List *parameters; /* a list of FunctionParameter */ TypeName *returnType; /* the return type */ List *options; /* a list of DefElem */ List *withClause; /* a list of DefElem */ } CreateFunctionStmt; typedef enum FunctionParameterMode { /* the assigned enum values appear in pg_proc, don't change 'em! */ FUNC_PARAM_IN = 'i', /* input only */ FUNC_PARAM_OUT = 'o', /* output only */ FUNC_PARAM_INOUT = 'b', /* both */ FUNC_PARAM_VARIADIC = 'v', /* variadic (always input) */ FUNC_PARAM_TABLE = 't' /* table function output column */ } FunctionParameterMode; typedef struct FunctionParameter { NodeTag type; char *name; /* parameter name, or NULL if not given */ TypeName *argType; /* TypeName for parameter type */ FunctionParameterMode mode; /* IN/OUT/etc */ Node *defexpr; /* raw default expr, or NULL if not given */ } FunctionParameter; typedef struct AlterFunctionStmt { NodeTag type; FuncWithArgs *func; /* name and args of function */ List *actions; /* list of DefElem */ } AlterFunctionStmt; /* ---------------------- * DO Statement * * DoStmt is the raw parser output, InlineCodeBlock is the execution-time API * ---------------------- */ typedef struct DoStmt { NodeTag type; List *args; /* List of DefElem nodes */ } DoStmt; typedef struct InlineCodeBlock { NodeTag type; char *source_text; /* source text of anonymous code block */ Oid langOid; /* OID of selected language */ bool langIsTrusted; /* trusted property of the language */ } InlineCodeBlock; /* ---------------------- * Alter Object Rename Statement * ---------------------- */ typedef struct RenameStmt { NodeTag type; ObjectType renameType; /* OBJECT_TABLE, OBJECT_COLUMN, etc */ ObjectType relationType; /* if column name, associated relation type */ RangeVar *relation; /* in case it's a table */ List *object; /* in case it's some other object */ List *objarg; /* argument types, if applicable */ char *subname; /* name of contained object (column, rule, * trigger, etc) */ char *newname; /* the new name */ DropBehavior behavior; /* RESTRICT or CASCADE behavior */ bool missing_ok; /* skip error if missing? */ } RenameStmt; /* ---------------------- * ALTER object SET SCHEMA Statement * ---------------------- */ typedef struct AlterObjectSchemaStmt { NodeTag type; ObjectType objectType; /* OBJECT_TABLE, OBJECT_TYPE, etc */ RangeVar *relation; /* in case it's a table */ List *object; /* in case it's some other object */ List *objarg; /* argument types, if applicable */ char *addname; /* additional name if needed */ char *newschema; /* the new schema */ bool missing_ok; /* skip error if missing? */ } AlterObjectSchemaStmt; /* ---------------------- * Alter Object Owner Statement * ---------------------- */ typedef struct AlterOwnerStmt { NodeTag type; ObjectType objectType; /* OBJECT_TABLE, OBJECT_TYPE, etc */ RangeVar *relation; /* in case it's a table */ List *object; /* in case it's some other object */ List *objarg; /* argument types, if applicable */ char *addname; /* additional name if needed */ char *newowner; /* the new owner */ } AlterOwnerStmt; /* ---------------------- * Create Rule Statement * ---------------------- */ typedef struct RuleStmt { NodeTag type; RangeVar *relation; /* relation the rule is for */ char *rulename; /* name of the rule */ Node *whereClause; /* qualifications */ CmdType event; /* SELECT, INSERT, etc */ bool instead; /* is a 'do instead'? */ List *actions; /* the action statements */ bool replace; /* OR REPLACE */ } RuleStmt; /* ---------------------- * Notify Statement * ---------------------- */ typedef struct NotifyStmt { NodeTag type; char *conditionname; /* condition name to notify */ char *payload; /* the payload string, or NULL if none */ } NotifyStmt; /* ---------------------- * Listen Statement * ---------------------- */ typedef struct ListenStmt { NodeTag type; char *conditionname; /* condition name to listen on */ } ListenStmt; /* ---------------------- * Unlisten Statement * ---------------------- */ typedef struct UnlistenStmt { NodeTag type; char *conditionname; /* name to unlisten on, or NULL for all */ } UnlistenStmt; /* ---------------------- * {Begin|Commit|Rollback} Transaction Statement * ---------------------- */ typedef enum TransactionStmtKind { TRANS_STMT_BEGIN, TRANS_STMT_START, /* semantically identical to BEGIN */ TRANS_STMT_COMMIT, TRANS_STMT_ROLLBACK, TRANS_STMT_SAVEPOINT, TRANS_STMT_RELEASE, TRANS_STMT_ROLLBACK_TO, TRANS_STMT_PREPARE, TRANS_STMT_COMMIT_PREPARED, TRANS_STMT_ROLLBACK_PREPARED } TransactionStmtKind; typedef struct TransactionStmt { NodeTag type; TransactionStmtKind kind; /* see above */ List *options; /* for BEGIN/START and savepoint commands */ char *gid; /* for two-phase-commit related commands */ } TransactionStmt; /* ---------------------- * Create Type Statement, composite types * ---------------------- */ typedef struct CompositeTypeStmt { NodeTag type; RangeVar *typevar; /* the composite type to be created */ List *coldeflist; /* list of ColumnDef nodes */ } CompositeTypeStmt; /* ---------------------- * Create Type Statement, enum types * ---------------------- */ typedef struct CreateEnumStmt { NodeTag type; List *typeName; /* qualified name (list of Value strings) */ List *vals; /* enum values (list of Value strings) */ } CreateEnumStmt; /* ---------------------- * Create Type Statement, range types * ---------------------- */ typedef struct CreateRangeStmt { NodeTag type; List *typeName; /* qualified name (list of Value strings) */ List *params; /* range parameters (list of DefElem) */ } CreateRangeStmt; /* ---------------------- * Alter Type Statement, enum types * ---------------------- */ typedef struct AlterEnumStmt { NodeTag type; List *typeName; /* qualified name (list of Value strings) */ char *newVal; /* new enum value's name */ char *newValNeighbor; /* neighboring enum value, if specified */ bool newValIsAfter; /* place new enum value after neighbor? */ } AlterEnumStmt; /* ---------------------- * Create View Statement * ---------------------- */ typedef struct ViewStmt { NodeTag type; RangeVar *view; /* the view to be created */ List *aliases; /* target column names */ Node *query; /* the SELECT query */ bool replace; /* replace an existing view? */ List *options; /* options from WITH clause */ } ViewStmt; /* ---------------------- * Load Statement * ---------------------- */ typedef struct LoadStmt { NodeTag type; char *filename; /* file to load */ } LoadStmt; /* ---------------------- * Createdb Statement * ---------------------- */ typedef struct CreatedbStmt { NodeTag type; char *dbname; /* name of database to create */ List *options; /* List of DefElem nodes */ } CreatedbStmt; /* ---------------------- * Alter Database * ---------------------- */ typedef struct AlterDatabaseStmt { NodeTag type; char *dbname; /* name of database to alter */ List *options; /* List of DefElem nodes */ } AlterDatabaseStmt; typedef struct AlterDatabaseSetStmt { NodeTag type; char *dbname; /* database name */ VariableSetStmt *setstmt; /* SET or RESET subcommand */ } AlterDatabaseSetStmt; /* ---------------------- * Dropdb Statement * ---------------------- */ typedef struct DropdbStmt { NodeTag type; char *dbname; /* database to drop */ bool missing_ok; /* skip error if db is missing? */ } DropdbStmt; /* ---------------------- * Cluster Statement (support pbrown's cluster index implementation) * ---------------------- */ typedef struct ClusterStmt { NodeTag type; RangeVar *relation; /* relation being indexed, or NULL if all */ char *indexname; /* original index defined */ bool verbose; /* print progress info */ } ClusterStmt; /* ---------------------- * Vacuum and Analyze Statements * * Even though these are nominally two statements, it's convenient to use * just one node type for both. Note that at least one of VACOPT_VACUUM * and VACOPT_ANALYZE must be set in options. VACOPT_FREEZE is an internal * convenience for the grammar and is not examined at runtime --- the * freeze_min_age and freeze_table_age fields are what matter. * ---------------------- */ typedef enum VacuumOption { VACOPT_VACUUM = 1 << 0, /* do VACUUM */ VACOPT_ANALYZE = 1 << 1, /* do ANALYZE */ VACOPT_VERBOSE = 1 << 2, /* print progress info */ VACOPT_FREEZE = 1 << 3, /* FREEZE option */ VACOPT_FULL = 1 << 4, /* FULL (non-concurrent) vacuum */ VACOPT_NOWAIT = 1 << 5 /* don't wait to get lock (autovacuum only) */ } VacuumOption; typedef struct VacuumStmt { NodeTag type; int options; /* OR of VacuumOption flags */ int freeze_min_age; /* min freeze age, or -1 to use default */ int freeze_table_age; /* age at which to scan whole table */ RangeVar *relation; /* single table to process, or NULL */ List *va_cols; /* list of column names, or NIL for all */ } VacuumStmt; /* ---------------------- * Explain Statement * * The "query" field is either a raw parse tree (SelectStmt, InsertStmt, etc) * or a Query node if parse analysis has been done. Note that rewriting and * planning of the query are always postponed until execution of EXPLAIN. * ---------------------- */ typedef struct ExplainStmt { NodeTag type; Node *query; /* the query (see comments above) */ List *options; /* list of DefElem nodes */ } ExplainStmt; /* ---------------------- * CREATE TABLE AS Statement (a/k/a SELECT INTO) * * A query written as CREATE TABLE AS will produce this node type natively. * A query written as SELECT ... INTO will be transformed to this form during * parse analysis. * * The "query" field is handled similarly to EXPLAIN, though note that it * can be a SELECT or an EXECUTE, but not other DML statements. * ---------------------- */ typedef struct CreateTableAsStmt { NodeTag type; Node *query; /* the query (see comments above) */ IntoClause *into; /* destination table */ bool is_select_into; /* it was written as SELECT INTO */ } CreateTableAsStmt; /* ---------------------- * Checkpoint Statement * ---------------------- */ typedef struct CheckPointStmt { NodeTag type; } CheckPointStmt; /* ---------------------- * Discard Statement * ---------------------- */ typedef enum DiscardMode { DISCARD_ALL, DISCARD_PLANS, DISCARD_TEMP } DiscardMode; typedef struct DiscardStmt { NodeTag type; DiscardMode target; } DiscardStmt; /* ---------------------- * LOCK Statement * ---------------------- */ typedef struct LockStmt { NodeTag type; List *relations; /* relations to lock */ int mode; /* lock mode */ bool nowait; /* no wait mode */ } LockStmt; /* ---------------------- * SET CONSTRAINTS Statement * ---------------------- */ typedef struct ConstraintsSetStmt { NodeTag type; List *constraints; /* List of names as RangeVars */ bool deferred; } ConstraintsSetStmt; /* ---------------------- * REINDEX Statement * ---------------------- */ typedef struct ReindexStmt { NodeTag type; ObjectType kind; /* OBJECT_INDEX, OBJECT_TABLE, OBJECT_DATABASE */ RangeVar *relation; /* Table or index to reindex */ const char *name; /* name of database to reindex */ bool do_system; /* include system tables in database case */ bool do_user; /* include user tables in database case */ } ReindexStmt; /* ---------------------- * CREATE CONVERSION Statement * ---------------------- */ typedef struct CreateConversionStmt { NodeTag type; List *conversion_name; /* Name of the conversion */ char *for_encoding_name; /* source encoding name */ char *to_encoding_name; /* destination encoding name */ List *func_name; /* qualified conversion function name */ bool def; /* is this a default conversion? */ } CreateConversionStmt; /* ---------------------- * CREATE CAST Statement * ---------------------- */ typedef struct CreateCastStmt { NodeTag type; TypeName *sourcetype; TypeName *targettype; FuncWithArgs *func; CoercionContext context; bool inout; } CreateCastStmt; /* ---------------------- * PREPARE Statement * ---------------------- */ typedef struct PrepareStmt { NodeTag type; char *name; /* Name of plan, arbitrary */ List *argtypes; /* Types of parameters (List of TypeName) */ Node *query; /* The query itself (as a raw parsetree) */ } PrepareStmt; /* ---------------------- * EXECUTE Statement * ---------------------- */ typedef struct ExecuteStmt { NodeTag type; char *name; /* The name of the plan to execute */ List *params; /* Values to assign to parameters */ } ExecuteStmt; /* ---------------------- * DEALLOCATE Statement * ---------------------- */ typedef struct DeallocateStmt { NodeTag type; char *name; /* The name of the plan to remove */ /* NULL means DEALLOCATE ALL */ } DeallocateStmt; /* * DROP OWNED statement */ typedef struct DropOwnedStmt { NodeTag type; List *roles; DropBehavior behavior; } DropOwnedStmt; /* * REASSIGN OWNED statement */ typedef struct ReassignOwnedStmt { NodeTag type; List *roles; char *newrole; } ReassignOwnedStmt; /* * TS Dictionary stmts: DefineStmt, RenameStmt and DropStmt are default */ typedef struct AlterTSDictionaryStmt { NodeTag type; List *dictname; /* qualified name (list of Value strings) */ List *options; /* List of DefElem nodes */ } AlterTSDictionaryStmt; /* * TS Configuration stmts: DefineStmt, RenameStmt and DropStmt are default */ typedef struct AlterTSConfigurationStmt { NodeTag type; List *cfgname; /* qualified name (list of Value strings) */ /* * dicts will be non-NIL if ADD/ALTER MAPPING was specified. If dicts is * NIL, but tokentype isn't, DROP MAPPING was specified. */ List *tokentype; /* list of Value strings */ List *dicts; /* list of list of Value strings */ bool override; /* if true - remove old variant */ bool replace; /* if true - replace dictionary by another */ bool missing_ok; /* for DROP - skip error if missing? */ } AlterTSConfigurationStmt; #endif /* PARSENODES_H */ PKBiZ"_,server/nodes/execnodes.hnu[/*------------------------------------------------------------------------- * * execnodes.h * definitions for executor state nodes * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/nodes/execnodes.h * *------------------------------------------------------------------------- */ #ifndef EXECNODES_H #define EXECNODES_H #include "access/genam.h" #include "access/heapam.h" #include "executor/instrument.h" #include "nodes/params.h" #include "nodes/plannodes.h" #include "utils/reltrigger.h" #include "utils/sortsupport.h" #include "utils/tuplestore.h" /* ---------------- * IndexInfo information * * this struct holds the information needed to construct new index * entries for a particular index. Used for both index_build and * retail creation of index entries. * * NumIndexAttrs number of columns in this index * KeyAttrNumbers underlying-rel attribute numbers used as keys * (zeroes indicate expressions) * Expressions expr trees for expression entries, or NIL if none * ExpressionsState exec state for expressions, or NIL if none * Predicate partial-index predicate, or NIL if none * PredicateState exec state for predicate, or NIL if none * ExclusionOps Per-column exclusion operators, or NULL if none * ExclusionProcs Underlying function OIDs for ExclusionOps * ExclusionStrats Opclass strategy numbers for ExclusionOps * Unique is it a unique index? * ReadyForInserts is it valid for inserts? * Concurrent are we doing a concurrent index build? * BrokenHotChain did we detect any broken HOT chains? * * ii_Concurrent and ii_BrokenHotChain are used only during index build; * they're conventionally set to false otherwise. * ---------------- */ typedef struct IndexInfo { NodeTag type; int ii_NumIndexAttrs; AttrNumber ii_KeyAttrNumbers[INDEX_MAX_KEYS]; List *ii_Expressions; /* list of Expr */ List *ii_ExpressionsState; /* list of ExprState */ List *ii_Predicate; /* list of Expr */ List *ii_PredicateState; /* list of ExprState */ Oid *ii_ExclusionOps; /* array with one entry per column */ Oid *ii_ExclusionProcs; /* array with one entry per column */ uint16 *ii_ExclusionStrats; /* array with one entry per column */ bool ii_Unique; bool ii_ReadyForInserts; bool ii_Concurrent; bool ii_BrokenHotChain; } IndexInfo; /* ---------------- * ExprContext_CB * * List of callbacks to be called at ExprContext shutdown. * ---------------- */ typedef void (*ExprContextCallbackFunction) (Datum arg); typedef struct ExprContext_CB { struct ExprContext_CB *next; ExprContextCallbackFunction function; Datum arg; } ExprContext_CB; /* ---------------- * ExprContext * * This class holds the "current context" information * needed to evaluate expressions for doing tuple qualifications * and tuple projections. For example, if an expression refers * to an attribute in the current inner tuple then we need to know * what the current inner tuple is and so we look at the expression * context. * * There are two memory contexts associated with an ExprContext: * * ecxt_per_query_memory is a query-lifespan context, typically the same * context the ExprContext node itself is allocated in. This context * can be used for purposes such as storing function call cache info. * * ecxt_per_tuple_memory is a short-term context for expression results. * As the name suggests, it will typically be reset once per tuple, * before we begin to evaluate expressions for that tuple. Each * ExprContext normally has its very own per-tuple memory context. * * CurrentMemoryContext should be set to ecxt_per_tuple_memory before * calling ExecEvalExpr() --- see ExecEvalExprSwitchContext(). * ---------------- */ typedef struct ExprContext { NodeTag type; /* Tuples that Var nodes in expression may refer to */ TupleTableSlot *ecxt_scantuple; TupleTableSlot *ecxt_innertuple; TupleTableSlot *ecxt_outertuple; /* Memory contexts for expression evaluation --- see notes above */ MemoryContext ecxt_per_query_memory; MemoryContext ecxt_per_tuple_memory; /* Values to substitute for Param nodes in expression */ ParamExecData *ecxt_param_exec_vals; /* for PARAM_EXEC params */ ParamListInfo ecxt_param_list_info; /* for other param types */ /* * Values to substitute for Aggref nodes in the expressions of an Agg * node, or for WindowFunc nodes within a WindowAgg node. */ Datum *ecxt_aggvalues; /* precomputed values for aggs/windowfuncs */ bool *ecxt_aggnulls; /* null flags for aggs/windowfuncs */ /* Value to substitute for CaseTestExpr nodes in expression */ Datum caseValue_datum; bool caseValue_isNull; /* Value to substitute for CoerceToDomainValue nodes in expression */ Datum domainValue_datum; bool domainValue_isNull; /* Link to containing EState (NULL if a standalone ExprContext) */ struct EState *ecxt_estate; /* Functions to call back when ExprContext is shut down */ ExprContext_CB *ecxt_callbacks; } ExprContext; /* * Set-result status returned by ExecEvalExpr() */ typedef enum { ExprSingleResult, /* expression does not return a set */ ExprMultipleResult, /* this result is an element of a set */ ExprEndResult /* there are no more elements in the set */ } ExprDoneCond; /* * Return modes for functions returning sets. Note values must be chosen * as separate bits so that a bitmask can be formed to indicate supported * modes. SFRM_Materialize_Random and SFRM_Materialize_Preferred are * auxiliary flags about SFRM_Materialize mode, rather than separate modes. */ typedef enum { SFRM_ValuePerCall = 0x01, /* one value returned per call */ SFRM_Materialize = 0x02, /* result set instantiated in Tuplestore */ SFRM_Materialize_Random = 0x04, /* Tuplestore needs randomAccess */ SFRM_Materialize_Preferred = 0x08 /* caller prefers Tuplestore */ } SetFunctionReturnMode; /* * When calling a function that might return a set (multiple rows), * a node of this type is passed as fcinfo->resultinfo to allow * return status to be passed back. A function returning set should * raise an error if no such resultinfo is provided. */ typedef struct ReturnSetInfo { NodeTag type; /* values set by caller: */ ExprContext *econtext; /* context function is being called in */ TupleDesc expectedDesc; /* tuple descriptor expected by caller */ int allowedModes; /* bitmask: return modes caller can handle */ /* result status from function (but pre-initialized by caller): */ SetFunctionReturnMode returnMode; /* actual return mode */ ExprDoneCond isDone; /* status for ValuePerCall mode */ /* fields filled by function in Materialize return mode: */ Tuplestorestate *setResult; /* holds the complete returned tuple set */ TupleDesc setDesc; /* actual descriptor for returned tuples */ } ReturnSetInfo; /* ---------------- * ProjectionInfo node information * * This is all the information needed to perform projections --- * that is, form new tuples by evaluation of targetlist expressions. * Nodes which need to do projections create one of these. * * ExecProject() evaluates the tlist, forms a tuple, and stores it * in the given slot. Note that the result will be a "virtual" tuple * unless ExecMaterializeSlot() is then called to force it to be * converted to a physical tuple. The slot must have a tupledesc * that matches the output of the tlist! * * The planner very often produces tlists that consist entirely of * simple Var references (lower levels of a plan tree almost always * look like that). And top-level tlists are often mostly Vars too. * We therefore optimize execution of simple-Var tlist entries. * The pi_targetlist list actually contains only the tlist entries that * aren't simple Vars, while those that are Vars are processed using the * varSlotOffsets/varNumbers/varOutputCols arrays. * * The lastXXXVar fields are used to optimize fetching of fields from * input tuples: they let us do a slot_getsomeattrs() call to ensure * that all needed attributes are extracted in one pass. * * targetlist target list for projection (non-Var expressions only) * exprContext expression context in which to evaluate targetlist * slot slot to place projection result in * itemIsDone workspace array for ExecProject * directMap true if varOutputCols[] is an identity map * numSimpleVars number of simple Vars found in original tlist * varSlotOffsets array indicating which slot each simple Var is from * varNumbers array containing input attr numbers of simple Vars * varOutputCols array containing output attr numbers of simple Vars * lastInnerVar highest attnum from inner tuple slot (0 if none) * lastOuterVar highest attnum from outer tuple slot (0 if none) * lastScanVar highest attnum from scan tuple slot (0 if none) * ---------------- */ typedef struct ProjectionInfo { NodeTag type; List *pi_targetlist; ExprContext *pi_exprContext; TupleTableSlot *pi_slot; ExprDoneCond *pi_itemIsDone; bool pi_directMap; int pi_numSimpleVars; int *pi_varSlotOffsets; int *pi_varNumbers; int *pi_varOutputCols; int pi_lastInnerVar; int pi_lastOuterVar; int pi_lastScanVar; } ProjectionInfo; /* ---------------- * JunkFilter * * This class is used to store information regarding junk attributes. * A junk attribute is an attribute in a tuple that is needed only for * storing intermediate information in the executor, and does not belong * in emitted tuples. For example, when we do an UPDATE query, * the planner adds a "junk" entry to the targetlist so that the tuples * returned to ExecutePlan() contain an extra attribute: the ctid of * the tuple to be updated. This is needed to do the update, but we * don't want the ctid to be part of the stored new tuple! So, we * apply a "junk filter" to remove the junk attributes and form the * real output tuple. The junkfilter code also provides routines to * extract the values of the junk attribute(s) from the input tuple. * * targetList: the original target list (including junk attributes). * cleanTupType: the tuple descriptor for the "clean" tuple (with * junk attributes removed). * cleanMap: A map with the correspondence between the non-junk * attribute numbers of the "original" tuple and the * attribute numbers of the "clean" tuple. * resultSlot: tuple slot used to hold cleaned tuple. * junkAttNo: not used by junkfilter code. Can be used by caller * to remember the attno of a specific junk attribute * (execMain.c stores the "ctid" attno here). * ---------------- */ typedef struct JunkFilter { NodeTag type; List *jf_targetList; TupleDesc jf_cleanTupType; AttrNumber *jf_cleanMap; TupleTableSlot *jf_resultSlot; AttrNumber jf_junkAttNo; } JunkFilter; /* ---------------- * ResultRelInfo information * * Whenever we update an existing relation, we have to * update indices on the relation, and perhaps also fire triggers. * The ResultRelInfo class is used to hold all the information needed * about a result relation, including indices.. -cim 10/15/89 * * RangeTableIndex result relation's range table index * RelationDesc relation descriptor for result relation * NumIndices # of indices existing on result relation * IndexRelationDescs array of relation descriptors for indices * IndexRelationInfo array of key/attr info for indices * TrigDesc triggers to be fired, if any * TrigFunctions cached lookup info for trigger functions * TrigWhenExprs array of trigger WHEN expr states * TrigInstrument optional runtime measurements for triggers * ConstraintExprs array of constraint-checking expr states * junkFilter for removing junk attributes from tuples * projectReturning for computing a RETURNING list * ---------------- */ typedef struct ResultRelInfo { NodeTag type; Index ri_RangeTableIndex; Relation ri_RelationDesc; int ri_NumIndices; RelationPtr ri_IndexRelationDescs; IndexInfo **ri_IndexRelationInfo; TriggerDesc *ri_TrigDesc; FmgrInfo *ri_TrigFunctions; List **ri_TrigWhenExprs; Instrumentation *ri_TrigInstrument; List **ri_ConstraintExprs; JunkFilter *ri_junkFilter; ProjectionInfo *ri_projectReturning; } ResultRelInfo; /* ---------------- * EState information * * Master working state for an Executor invocation * ---------------- */ typedef struct EState { NodeTag type; /* Basic state for all query types: */ ScanDirection es_direction; /* current scan direction */ Snapshot es_snapshot; /* time qual to use */ Snapshot es_crosscheck_snapshot; /* crosscheck time qual for RI */ List *es_range_table; /* List of RangeTblEntry */ PlannedStmt *es_plannedstmt; /* link to top of plan tree */ JunkFilter *es_junkFilter; /* top-level junk filter, if any */ /* If query can insert/delete tuples, the command ID to mark them with */ CommandId es_output_cid; /* Info about target table(s) for insert/update/delete queries: */ ResultRelInfo *es_result_relations; /* array of ResultRelInfos */ int es_num_result_relations; /* length of array */ ResultRelInfo *es_result_relation_info; /* currently active array elt */ /* Stuff used for firing triggers: */ List *es_trig_target_relations; /* trigger-only ResultRelInfos */ TupleTableSlot *es_trig_tuple_slot; /* for trigger output tuples */ TupleTableSlot *es_trig_oldtup_slot; /* for TriggerEnabled */ TupleTableSlot *es_trig_newtup_slot; /* for TriggerEnabled */ /* Parameter info: */ ParamListInfo es_param_list_info; /* values of external params */ ParamExecData *es_param_exec_vals; /* values of internal params */ /* Other working state: */ MemoryContext es_query_cxt; /* per-query context in which EState lives */ List *es_tupleTable; /* List of TupleTableSlots */ List *es_rowMarks; /* List of ExecRowMarks */ uint32 es_processed; /* # of tuples processed */ Oid es_lastoid; /* last oid processed (by INSERT) */ int es_top_eflags; /* eflags passed to ExecutorStart */ int es_instrument; /* OR of InstrumentOption flags */ bool es_finished; /* true when ExecutorFinish is done */ List *es_exprcontexts; /* List of ExprContexts within EState */ List *es_subplanstates; /* List of PlanState for SubPlans */ List *es_auxmodifytables; /* List of secondary ModifyTableStates */ /* * this ExprContext is for per-output-tuple operations, such as constraint * checks and index-value computations. It will be reset for each output * tuple. Note that it will be created only if needed. */ ExprContext *es_per_tuple_exprcontext; /* * These fields are for re-evaluating plan quals when an updated tuple is * substituted in READ COMMITTED mode. es_epqTuple[] contains tuples that * scan plan nodes should return instead of whatever they'd normally * return, or NULL if nothing to return; es_epqTupleSet[] is true if a * particular array entry is valid; and es_epqScanDone[] is state to * remember if the tuple has been returned already. Arrays are of size * list_length(es_range_table) and are indexed by scan node scanrelid - 1. */ HeapTuple *es_epqTuple; /* array of EPQ substitute tuples */ bool *es_epqTupleSet; /* true if EPQ tuple is provided */ bool *es_epqScanDone; /* true if EPQ tuple has been fetched */ } EState; /* * ExecRowMark - * runtime representation of FOR UPDATE/SHARE clauses * * When doing UPDATE, DELETE, or SELECT FOR UPDATE/SHARE, we should have an * ExecRowMark for each non-target relation in the query (except inheritance * parent RTEs, which can be ignored at runtime). See PlanRowMark for details * about most of the fields. In addition to fields directly derived from * PlanRowMark, we store curCtid, which is used by the WHERE CURRENT OF code. * * EState->es_rowMarks is a list of these structs. */ typedef struct ExecRowMark { Relation relation; /* opened and suitably locked relation */ Index rti; /* its range table index */ Index prti; /* parent range table index, if child */ Index rowmarkId; /* unique identifier for resjunk columns */ RowMarkType markType; /* see enum in nodes/plannodes.h */ bool noWait; /* NOWAIT option */ ItemPointerData curCtid; /* ctid of currently locked tuple, if any */ } ExecRowMark; /* * ExecAuxRowMark - * additional runtime representation of FOR UPDATE/SHARE clauses * * Each LockRows and ModifyTable node keeps a list of the rowmarks it needs to * deal with. In addition to a pointer to the related entry in es_rowMarks, * this struct carries the column number(s) of the resjunk columns associated * with the rowmark (see comments for PlanRowMark for more detail). In the * case of ModifyTable, there has to be a separate ExecAuxRowMark list for * each child plan, because the resjunk columns could be at different physical * column positions in different subplans. */ typedef struct ExecAuxRowMark { ExecRowMark *rowmark; /* related entry in es_rowMarks */ AttrNumber ctidAttNo; /* resno of ctid junk attribute, if any */ AttrNumber toidAttNo; /* resno of tableoid junk attribute, if any */ AttrNumber wholeAttNo; /* resno of whole-row junk attribute, if any */ } ExecAuxRowMark; /* ---------------------------------------------------------------- * Tuple Hash Tables * * All-in-memory tuple hash tables are used for a number of purposes. * * Note: tab_hash_funcs are for the key datatype(s) stored in the table, * and tab_eq_funcs are non-cross-type equality operators for those types. * Normally these are the only functions used, but FindTupleHashEntry() * supports searching a hashtable using cross-data-type hashing. For that, * the caller must supply hash functions for the LHS datatype as well as * the cross-type equality operators to use. in_hash_funcs and cur_eq_funcs * are set to point to the caller's function arrays while doing such a search. * During LookupTupleHashEntry(), they point to tab_hash_funcs and * tab_eq_funcs respectively. * ---------------------------------------------------------------- */ typedef struct TupleHashEntryData *TupleHashEntry; typedef struct TupleHashTableData *TupleHashTable; typedef struct TupleHashEntryData { /* firstTuple must be the first field in this struct! */ MinimalTuple firstTuple; /* copy of first tuple in this group */ /* there may be additional data beyond the end of this struct */ } TupleHashEntryData; /* VARIABLE LENGTH STRUCT */ typedef struct TupleHashTableData { HTAB *hashtab; /* underlying dynahash table */ int numCols; /* number of columns in lookup key */ AttrNumber *keyColIdx; /* attr numbers of key columns */ FmgrInfo *tab_hash_funcs; /* hash functions for table datatype(s) */ FmgrInfo *tab_eq_funcs; /* equality functions for table datatype(s) */ MemoryContext tablecxt; /* memory context containing table */ MemoryContext tempcxt; /* context for function evaluations */ Size entrysize; /* actual size to make each hash entry */ TupleTableSlot *tableslot; /* slot for referencing table entries */ /* The following fields are set transiently for each table search: */ TupleTableSlot *inputslot; /* current input tuple's slot */ FmgrInfo *in_hash_funcs; /* hash functions for input datatype(s) */ FmgrInfo *cur_eq_funcs; /* equality functions for input vs. table */ } TupleHashTableData; typedef HASH_SEQ_STATUS TupleHashIterator; /* * Use InitTupleHashIterator/TermTupleHashIterator for a read/write scan. * Use ResetTupleHashIterator if the table can be frozen (in this case no * explicit scan termination is needed). */ #define InitTupleHashIterator(htable, iter) \ hash_seq_init(iter, (htable)->hashtab) #define TermTupleHashIterator(iter) \ hash_seq_term(iter) #define ResetTupleHashIterator(htable, iter) \ do { \ hash_freeze((htable)->hashtab); \ hash_seq_init(iter, (htable)->hashtab); \ } while (0) #define ScanTupleHashTable(iter) \ ((TupleHashEntry) hash_seq_search(iter)) /* ---------------------------------------------------------------- * Expression State Trees * * Each executable expression tree has a parallel ExprState tree. * * Unlike PlanState, there is not an exact one-for-one correspondence between * ExprState node types and Expr node types. Many Expr node types have no * need for node-type-specific run-time state, and so they can use plain * ExprState or GenericExprState as their associated ExprState node type. * ---------------------------------------------------------------- */ /* ---------------- * ExprState node * * ExprState is the common superclass for all ExprState-type nodes. * * It can also be instantiated directly for leaf Expr nodes that need no * local run-time state (such as Var, Const, or Param). * * To save on dispatch overhead, each ExprState node contains a function * pointer to the routine to execute to evaluate the node. * ---------------- */ typedef struct ExprState ExprState; typedef Datum (*ExprStateEvalFunc) (ExprState *expression, ExprContext *econtext, bool *isNull, ExprDoneCond *isDone); struct ExprState { NodeTag type; Expr *expr; /* associated Expr node */ ExprStateEvalFunc evalfunc; /* routine to run to execute node */ }; /* ---------------- * GenericExprState node * * This is used for Expr node types that need no local run-time state, * but have one child Expr node. * ---------------- */ typedef struct GenericExprState { ExprState xprstate; ExprState *arg; /* state of my child node */ } GenericExprState; /* ---------------- * WholeRowVarExprState node * ---------------- */ typedef struct WholeRowVarExprState { ExprState xprstate; struct PlanState *parent; /* parent PlanState, or NULL if none */ JunkFilter *wrv_junkFilter; /* JunkFilter to remove resjunk cols */ TupleDesc wrv_tupdesc; /* descriptor for resulting tuples */ } WholeRowVarExprState; /* ---------------- * AggrefExprState node * ---------------- */ typedef struct AggrefExprState { ExprState xprstate; List *args; /* states of argument expressions */ int aggno; /* ID number for agg within its plan node */ } AggrefExprState; /* ---------------- * WindowFuncExprState node * ---------------- */ typedef struct WindowFuncExprState { ExprState xprstate; List *args; /* states of argument expressions */ int wfuncno; /* ID number for wfunc within its plan node */ } WindowFuncExprState; /* ---------------- * ArrayRefExprState node * * Note: array types can be fixed-length (typlen > 0), but only when the * element type is itself fixed-length. Otherwise they are varlena structures * and have typlen = -1. In any case, an array type is never pass-by-value. * ---------------- */ typedef struct ArrayRefExprState { ExprState xprstate; List *refupperindexpr; /* states for child nodes */ List *reflowerindexpr; ExprState *refexpr; ExprState *refassgnexpr; int16 refattrlength; /* typlen of array type */ int16 refelemlength; /* typlen of the array element type */ bool refelembyval; /* is the element type pass-by-value? */ char refelemalign; /* typalign of the element type */ } ArrayRefExprState; /* ---------------- * FuncExprState node * * Although named for FuncExpr, this is also used for OpExpr, DistinctExpr, * and NullIf nodes; be careful to check what xprstate.expr is actually * pointing at! * ---------------- */ typedef struct FuncExprState { ExprState xprstate; List *args; /* states of argument expressions */ /* * Function manager's lookup info for the target function. If func.fn_oid * is InvalidOid, we haven't initialized it yet (nor any of the following * fields). */ FmgrInfo func; /* * For a set-returning function (SRF) that returns a tuplestore, we keep * the tuplestore here and dole out the result rows one at a time. The * slot holds the row currently being returned. */ Tuplestorestate *funcResultStore; TupleTableSlot *funcResultSlot; /* * In some cases we need to compute a tuple descriptor for the function's * output. If so, it's stored here. */ TupleDesc funcResultDesc; bool funcReturnsTuple; /* valid when funcResultDesc isn't * NULL */ /* * setArgsValid is true when we are evaluating a set-returning function * that uses value-per-call mode and we are in the middle of a call * series; we want to pass the same argument values to the function again * (and again, until it returns ExprEndResult). This indicates that * fcinfo_data already contains valid argument data. */ bool setArgsValid; /* * Flag to remember whether we found a set-valued argument to the * function. This causes the function result to be a set as well. Valid * only when setArgsValid is true or funcResultStore isn't NULL. */ bool setHasSetArg; /* some argument returns a set */ /* * Flag to remember whether we have registered a shutdown callback for * this FuncExprState. We do so only if funcResultStore or setArgsValid * has been set at least once (since all the callback is for is to release * the tuplestore or clear setArgsValid). */ bool shutdown_reg; /* a shutdown callback is registered */ /* * Call parameter structure for the function. This has been initialized * (by InitFunctionCallInfoData) if func.fn_oid is valid. It also saves * argument values between calls, when setArgsValid is true. */ FunctionCallInfoData fcinfo_data; } FuncExprState; /* ---------------- * ScalarArrayOpExprState node * * This is a FuncExprState plus some additional data. * ---------------- */ typedef struct ScalarArrayOpExprState { FuncExprState fxprstate; /* Cached info about array element type */ Oid element_type; int16 typlen; bool typbyval; char typalign; } ScalarArrayOpExprState; /* ---------------- * BoolExprState node * ---------------- */ typedef struct BoolExprState { ExprState xprstate; List *args; /* states of argument expression(s) */ } BoolExprState; /* ---------------- * SubPlanState node * ---------------- */ typedef struct SubPlanState { ExprState xprstate; struct PlanState *planstate; /* subselect plan's state tree */ ExprState *testexpr; /* state of combining expression */ List *args; /* states of argument expression(s) */ HeapTuple curTuple; /* copy of most recent tuple from subplan */ Datum curArray; /* most recent array from ARRAY() subplan */ /* these are used when hashing the subselect's output: */ ProjectionInfo *projLeft; /* for projecting lefthand exprs */ ProjectionInfo *projRight; /* for projecting subselect output */ TupleHashTable hashtable; /* hash table for no-nulls subselect rows */ TupleHashTable hashnulls; /* hash table for rows with null(s) */ bool havehashrows; /* TRUE if hashtable is not empty */ bool havenullrows; /* TRUE if hashnulls is not empty */ MemoryContext hashtablecxt; /* memory context containing hash tables */ MemoryContext hashtempcxt; /* temp memory context for hash tables */ ExprContext *innerecontext; /* econtext for computing inner tuples */ AttrNumber *keyColIdx; /* control data for hash tables */ FmgrInfo *tab_hash_funcs; /* hash functions for table datatype(s) */ FmgrInfo *tab_eq_funcs; /* equality functions for table datatype(s) */ FmgrInfo *lhs_hash_funcs; /* hash functions for lefthand datatype(s) */ FmgrInfo *cur_eq_funcs; /* equality functions for LHS vs. table */ } SubPlanState; /* ---------------- * AlternativeSubPlanState node * ---------------- */ typedef struct AlternativeSubPlanState { ExprState xprstate; List *subplans; /* states of alternative subplans */ int active; /* list index of the one we're using */ } AlternativeSubPlanState; /* ---------------- * FieldSelectState node * ---------------- */ typedef struct FieldSelectState { ExprState xprstate; ExprState *arg; /* input expression */ TupleDesc argdesc; /* tupdesc for most recent input */ } FieldSelectState; /* ---------------- * FieldStoreState node * ---------------- */ typedef struct FieldStoreState { ExprState xprstate; ExprState *arg; /* input tuple value */ List *newvals; /* new value(s) for field(s) */ TupleDesc argdesc; /* tupdesc for most recent input */ } FieldStoreState; /* ---------------- * CoerceViaIOState node * ---------------- */ typedef struct CoerceViaIOState { ExprState xprstate; ExprState *arg; /* input expression */ FmgrInfo outfunc; /* lookup info for source output function */ FmgrInfo infunc; /* lookup info for result input function */ Oid intypioparam; /* argument needed for input function */ } CoerceViaIOState; /* ---------------- * ArrayCoerceExprState node * ---------------- */ typedef struct ArrayCoerceExprState { ExprState xprstate; ExprState *arg; /* input array value */ Oid resultelemtype; /* element type of result array */ FmgrInfo elemfunc; /* lookup info for element coercion function */ /* use struct pointer to avoid including array.h here */ struct ArrayMapState *amstate; /* workspace for array_map */ } ArrayCoerceExprState; /* ---------------- * ConvertRowtypeExprState node * ---------------- */ typedef struct ConvertRowtypeExprState { ExprState xprstate; ExprState *arg; /* input tuple value */ TupleDesc indesc; /* tupdesc for source rowtype */ TupleDesc outdesc; /* tupdesc for result rowtype */ /* use "struct" so we needn't include tupconvert.h here */ struct TupleConversionMap *map; bool initialized; } ConvertRowtypeExprState; /* ---------------- * CaseExprState node * ---------------- */ typedef struct CaseExprState { ExprState xprstate; ExprState *arg; /* implicit equality comparison argument */ List *args; /* the arguments (list of WHEN clauses) */ ExprState *defresult; /* the default result (ELSE clause) */ } CaseExprState; /* ---------------- * CaseWhenState node * ---------------- */ typedef struct CaseWhenState { ExprState xprstate; ExprState *expr; /* condition expression */ ExprState *result; /* substitution result */ } CaseWhenState; /* ---------------- * ArrayExprState node * * Note: ARRAY[] expressions always produce varlena arrays, never fixed-length * arrays. * ---------------- */ typedef struct ArrayExprState { ExprState xprstate; List *elements; /* states for child nodes */ int16 elemlength; /* typlen of the array element type */ bool elembyval; /* is the element type pass-by-value? */ char elemalign; /* typalign of the element type */ } ArrayExprState; /* ---------------- * RowExprState node * ---------------- */ typedef struct RowExprState { ExprState xprstate; List *args; /* the arguments */ TupleDesc tupdesc; /* descriptor for result tuples */ } RowExprState; /* ---------------- * RowCompareExprState node * ---------------- */ typedef struct RowCompareExprState { ExprState xprstate; List *largs; /* the left-hand input arguments */ List *rargs; /* the right-hand input arguments */ FmgrInfo *funcs; /* array of comparison function info */ Oid *collations; /* array of collations to use */ } RowCompareExprState; /* ---------------- * CoalesceExprState node * ---------------- */ typedef struct CoalesceExprState { ExprState xprstate; List *args; /* the arguments */ } CoalesceExprState; /* ---------------- * MinMaxExprState node * ---------------- */ typedef struct MinMaxExprState { ExprState xprstate; List *args; /* the arguments */ FmgrInfo cfunc; /* lookup info for comparison func */ } MinMaxExprState; /* ---------------- * XmlExprState node * ---------------- */ typedef struct XmlExprState { ExprState xprstate; List *named_args; /* ExprStates for named arguments */ List *args; /* ExprStates for other arguments */ } XmlExprState; /* ---------------- * NullTestState node * ---------------- */ typedef struct NullTestState { ExprState xprstate; ExprState *arg; /* input expression */ /* used only if input is of composite type: */ TupleDesc argdesc; /* tupdesc for most recent input */ } NullTestState; /* ---------------- * CoerceToDomainState node * ---------------- */ typedef struct CoerceToDomainState { ExprState xprstate; ExprState *arg; /* input expression */ /* Cached list of constraints that need to be checked */ List *constraints; /* list of DomainConstraintState nodes */ } CoerceToDomainState; /* * DomainConstraintState - one item to check during CoerceToDomain * * Note: this is just a Node, and not an ExprState, because it has no * corresponding Expr to link to. Nonetheless it is part of an ExprState * tree, so we give it a name following the xxxState convention. */ typedef enum DomainConstraintType { DOM_CONSTRAINT_NOTNULL, DOM_CONSTRAINT_CHECK } DomainConstraintType; typedef struct DomainConstraintState { NodeTag type; DomainConstraintType constrainttype; /* constraint type */ char *name; /* name of constraint (for error msgs) */ ExprState *check_expr; /* for CHECK, a boolean expression */ } DomainConstraintState; /* ---------------------------------------------------------------- * Executor State Trees * * An executing query has a PlanState tree paralleling the Plan tree * that describes the plan. * ---------------------------------------------------------------- */ /* ---------------- * PlanState node * * We never actually instantiate any PlanState nodes; this is just the common * abstract superclass for all PlanState-type nodes. * ---------------- */ typedef struct PlanState { NodeTag type; Plan *plan; /* associated Plan node */ EState *state; /* at execution time, states of individual * nodes point to one EState for the whole * top-level plan */ Instrumentation *instrument; /* Optional runtime stats for this node */ /* * Common structural data for all Plan types. These links to subsidiary * state trees parallel links in the associated plan tree (except for the * subPlan list, which does not exist in the plan tree). */ List *targetlist; /* target list to be computed at this node */ List *qual; /* implicitly-ANDed qual conditions */ struct PlanState *lefttree; /* input plan tree(s) */ struct PlanState *righttree; List *initPlan; /* Init SubPlanState nodes (un-correlated expr * subselects) */ List *subPlan; /* SubPlanState nodes in my expressions */ /* * State for management of parameter-change-driven rescanning */ Bitmapset *chgParam; /* set of IDs of changed Params */ /* * Other run-time state needed by most if not all node types. */ TupleTableSlot *ps_ResultTupleSlot; /* slot for my result tuples */ ExprContext *ps_ExprContext; /* node's expression-evaluation context */ ProjectionInfo *ps_ProjInfo; /* info for doing tuple projection */ bool ps_TupFromTlist;/* state flag for processing set-valued * functions in targetlist */ } PlanState; /* ---------------- * these are defined to avoid confusion problems with "left" * and "right" and "inner" and "outer". The convention is that * the "left" plan is the "outer" plan and the "right" plan is * the inner plan, but these make the code more readable. * ---------------- */ #define innerPlanState(node) (((PlanState *)(node))->righttree) #define outerPlanState(node) (((PlanState *)(node))->lefttree) /* Macros for inline access to certain instrumentation counters */ #define InstrCountFiltered1(node, delta) \ do { \ if (((PlanState *)(node))->instrument) \ ((PlanState *)(node))->instrument->nfiltered1 += (delta); \ } while(0) #define InstrCountFiltered2(node, delta) \ do { \ if (((PlanState *)(node))->instrument) \ ((PlanState *)(node))->instrument->nfiltered2 += (delta); \ } while(0) /* * EPQState is state for executing an EvalPlanQual recheck on a candidate * tuple in ModifyTable or LockRows. The estate and planstate fields are * NULL if inactive. */ typedef struct EPQState { EState *estate; /* subsidiary EState */ PlanState *planstate; /* plan state tree ready to be executed */ TupleTableSlot *origslot; /* original output tuple to be rechecked */ Plan *plan; /* plan tree to be executed */ List *arowMarks; /* ExecAuxRowMarks (non-locking only) */ int epqParam; /* ID of Param to force scan node re-eval */ } EPQState; /* ---------------- * ResultState information * ---------------- */ typedef struct ResultState { PlanState ps; /* its first field is NodeTag */ ExprState *resconstantqual; bool rs_done; /* are we done? */ bool rs_checkqual; /* do we need to check the qual? */ } ResultState; /* ---------------- * ModifyTableState information * ---------------- */ typedef struct ModifyTableState { PlanState ps; /* its first field is NodeTag */ CmdType operation; /* INSERT, UPDATE, or DELETE */ bool canSetTag; /* do we set the command tag/es_processed? */ bool mt_done; /* are we done? */ PlanState **mt_plans; /* subplans (one per target rel) */ int mt_nplans; /* number of plans in the array */ int mt_whichplan; /* which one is being executed (0..n-1) */ ResultRelInfo *resultRelInfo; /* per-subplan target relations */ List **mt_arowmarks; /* per-subplan ExecAuxRowMark lists */ EPQState mt_epqstate; /* for evaluating EvalPlanQual rechecks */ bool fireBSTriggers; /* do we need to fire stmt triggers? */ } ModifyTableState; /* ---------------- * AppendState information * * nplans how many plans are in the array * whichplan which plan is being executed (0 .. n-1) * ---------------- */ typedef struct AppendState { PlanState ps; /* its first field is NodeTag */ PlanState **appendplans; /* array of PlanStates for my inputs */ int as_nplans; int as_whichplan; } AppendState; /* ---------------- * MergeAppendState information * * nplans how many plans are in the array * nkeys number of sort key columns * sortkeys sort keys in SortSupport representation * slots current output tuple of each subplan * heap heap of active tuples (represented as array indexes) * heap_size number of active heap entries * initialized true if we have fetched first tuple from each subplan * last_slot last subplan fetched from (which must be re-called) * ---------------- */ typedef struct MergeAppendState { PlanState ps; /* its first field is NodeTag */ PlanState **mergeplans; /* array of PlanStates for my inputs */ int ms_nplans; int ms_nkeys; SortSupport ms_sortkeys; /* array of length ms_nkeys */ TupleTableSlot **ms_slots; /* array of length ms_nplans */ int *ms_heap; /* array of length ms_nplans */ int ms_heap_size; /* current active length of ms_heap[] */ bool ms_initialized; /* are subplans started? */ int ms_last_slot; /* last subplan slot we returned from */ } MergeAppendState; /* ---------------- * RecursiveUnionState information * * RecursiveUnionState is used for performing a recursive union. * * recursing T when we're done scanning the non-recursive term * intermediate_empty T if intermediate_table is currently empty * working_table working table (to be scanned by recursive term) * intermediate_table current recursive output (next generation of WT) * ---------------- */ typedef struct RecursiveUnionState { PlanState ps; /* its first field is NodeTag */ bool recursing; bool intermediate_empty; Tuplestorestate *working_table; Tuplestorestate *intermediate_table; /* Remaining fields are unused in UNION ALL case */ FmgrInfo *eqfunctions; /* per-grouping-field equality fns */ FmgrInfo *hashfunctions; /* per-grouping-field hash fns */ MemoryContext tempContext; /* short-term context for comparisons */ TupleHashTable hashtable; /* hash table for tuples already seen */ MemoryContext tableContext; /* memory context containing hash table */ } RecursiveUnionState; /* ---------------- * BitmapAndState information * ---------------- */ typedef struct BitmapAndState { PlanState ps; /* its first field is NodeTag */ PlanState **bitmapplans; /* array of PlanStates for my inputs */ int nplans; /* number of input plans */ } BitmapAndState; /* ---------------- * BitmapOrState information * ---------------- */ typedef struct BitmapOrState { PlanState ps; /* its first field is NodeTag */ PlanState **bitmapplans; /* array of PlanStates for my inputs */ int nplans; /* number of input plans */ } BitmapOrState; /* ---------------------------------------------------------------- * Scan State Information * ---------------------------------------------------------------- */ /* ---------------- * ScanState information * * ScanState extends PlanState for node types that represent * scans of an underlying relation. It can also be used for nodes * that scan the output of an underlying plan node --- in that case, * only ScanTupleSlot is actually useful, and it refers to the tuple * retrieved from the subplan. * * currentRelation relation being scanned (NULL if none) * currentScanDesc current scan descriptor for scan (NULL if none) * ScanTupleSlot pointer to slot in tuple table holding scan tuple * ---------------- */ typedef struct ScanState { PlanState ps; /* its first field is NodeTag */ Relation ss_currentRelation; HeapScanDesc ss_currentScanDesc; TupleTableSlot *ss_ScanTupleSlot; } ScanState; /* * SeqScan uses a bare ScanState as its state node, since it needs * no additional fields. */ typedef ScanState SeqScanState; /* * These structs store information about index quals that don't have simple * constant right-hand sides. See comments for ExecIndexBuildScanKeys() * for discussion. */ typedef struct { ScanKey scan_key; /* scankey to put value into */ ExprState *key_expr; /* expr to evaluate to get value */ bool key_toastable; /* is expr's result a toastable datatype? */ } IndexRuntimeKeyInfo; typedef struct { ScanKey scan_key; /* scankey to put value into */ ExprState *array_expr; /* expr to evaluate to get array value */ int next_elem; /* next array element to use */ int num_elems; /* number of elems in current array value */ Datum *elem_values; /* array of num_elems Datums */ bool *elem_nulls; /* array of num_elems is-null flags */ } IndexArrayKeyInfo; /* ---------------- * IndexScanState information * * indexqualorig execution state for indexqualorig expressions * ScanKeys Skey structures for index quals * NumScanKeys number of ScanKeys * OrderByKeys Skey structures for index ordering operators * NumOrderByKeys number of OrderByKeys * RuntimeKeys info about Skeys that must be evaluated at runtime * NumRuntimeKeys number of RuntimeKeys * RuntimeKeysReady true if runtime Skeys have been computed * RuntimeContext expr context for evaling runtime Skeys * RelationDesc index relation descriptor * ScanDesc index scan descriptor * ---------------- */ typedef struct IndexScanState { ScanState ss; /* its first field is NodeTag */ List *indexqualorig; ScanKey iss_ScanKeys; int iss_NumScanKeys; ScanKey iss_OrderByKeys; int iss_NumOrderByKeys; IndexRuntimeKeyInfo *iss_RuntimeKeys; int iss_NumRuntimeKeys; bool iss_RuntimeKeysReady; ExprContext *iss_RuntimeContext; Relation iss_RelationDesc; IndexScanDesc iss_ScanDesc; } IndexScanState; /* ---------------- * IndexOnlyScanState information * * indexqual execution state for indexqual expressions * ScanKeys Skey structures for index quals * NumScanKeys number of ScanKeys * OrderByKeys Skey structures for index ordering operators * NumOrderByKeys number of OrderByKeys * RuntimeKeys info about Skeys that must be evaluated at runtime * NumRuntimeKeys number of RuntimeKeys * RuntimeKeysReady true if runtime Skeys have been computed * RuntimeContext expr context for evaling runtime Skeys * RelationDesc index relation descriptor * ScanDesc index scan descriptor * VMBuffer buffer in use for visibility map testing, if any * HeapFetches number of tuples we were forced to fetch from heap * ---------------- */ typedef struct IndexOnlyScanState { ScanState ss; /* its first field is NodeTag */ List *indexqual; ScanKey ioss_ScanKeys; int ioss_NumScanKeys; ScanKey ioss_OrderByKeys; int ioss_NumOrderByKeys; IndexRuntimeKeyInfo *ioss_RuntimeKeys; int ioss_NumRuntimeKeys; bool ioss_RuntimeKeysReady; ExprContext *ioss_RuntimeContext; Relation ioss_RelationDesc; IndexScanDesc ioss_ScanDesc; Buffer ioss_VMBuffer; long ioss_HeapFetches; } IndexOnlyScanState; /* ---------------- * BitmapIndexScanState information * * result bitmap to return output into, or NULL * ScanKeys Skey structures for index quals * NumScanKeys number of ScanKeys * RuntimeKeys info about Skeys that must be evaluated at runtime * NumRuntimeKeys number of RuntimeKeys * ArrayKeys info about Skeys that come from ScalarArrayOpExprs * NumArrayKeys number of ArrayKeys * RuntimeKeysReady true if runtime Skeys have been computed * RuntimeContext expr context for evaling runtime Skeys * RelationDesc index relation descriptor * ScanDesc index scan descriptor * ---------------- */ typedef struct BitmapIndexScanState { ScanState ss; /* its first field is NodeTag */ TIDBitmap *biss_result; ScanKey biss_ScanKeys; int biss_NumScanKeys; IndexRuntimeKeyInfo *biss_RuntimeKeys; int biss_NumRuntimeKeys; IndexArrayKeyInfo *biss_ArrayKeys; int biss_NumArrayKeys; bool biss_RuntimeKeysReady; ExprContext *biss_RuntimeContext; Relation biss_RelationDesc; IndexScanDesc biss_ScanDesc; } BitmapIndexScanState; /* ---------------- * BitmapHeapScanState information * * bitmapqualorig execution state for bitmapqualorig expressions * tbm bitmap obtained from child index scan(s) * tbmiterator iterator for scanning current pages * tbmres current-page data * prefetch_iterator iterator for prefetching ahead of current page * prefetch_pages # pages prefetch iterator is ahead of current * prefetch_target target prefetch distance * ---------------- */ typedef struct BitmapHeapScanState { ScanState ss; /* its first field is NodeTag */ List *bitmapqualorig; TIDBitmap *tbm; TBMIterator *tbmiterator; TBMIterateResult *tbmres; TBMIterator *prefetch_iterator; int prefetch_pages; int prefetch_target; } BitmapHeapScanState; /* ---------------- * TidScanState information * * isCurrentOf scan has a CurrentOfExpr qual * NumTids number of tids in this scan * TidPtr index of currently fetched tid * TidList evaluated item pointers (array of size NumTids) * ---------------- */ typedef struct TidScanState { ScanState ss; /* its first field is NodeTag */ List *tss_tidquals; /* list of ExprState nodes */ bool tss_isCurrentOf; int tss_NumTids; int tss_TidPtr; int tss_MarkTidPtr; ItemPointerData *tss_TidList; HeapTupleData tss_htup; } TidScanState; /* ---------------- * SubqueryScanState information * * SubqueryScanState is used for scanning a sub-query in the range table. * ScanTupleSlot references the current output tuple of the sub-query. * ---------------- */ typedef struct SubqueryScanState { ScanState ss; /* its first field is NodeTag */ PlanState *subplan; } SubqueryScanState; /* ---------------- * FunctionScanState information * * Function nodes are used to scan the results of a * function appearing in FROM (typically a function returning set). * * eflags node's capability flags * tupdesc expected return tuple description * tuplestorestate private state of tuplestore.c * funcexpr state for function expression being evaluated * argcontext memory context to evaluate function arguments in * ---------------- */ typedef struct FunctionScanState { ScanState ss; /* its first field is NodeTag */ int eflags; TupleDesc tupdesc; Tuplestorestate *tuplestorestate; ExprState *funcexpr; MemoryContext argcontext; } FunctionScanState; /* ---------------- * ValuesScanState information * * ValuesScan nodes are used to scan the results of a VALUES list * * rowcontext per-expression-list context * exprlists array of expression lists being evaluated * array_len size of array * curr_idx current array index (0-based) * marked_idx marked position (for mark/restore) * * Note: ss.ps.ps_ExprContext is used to evaluate any qual or projection * expressions attached to the node. We create a second ExprContext, * rowcontext, in which to build the executor expression state for each * Values sublist. Resetting this context lets us get rid of expression * state for each row, avoiding major memory leakage over a long values list. * ---------------- */ typedef struct ValuesScanState { ScanState ss; /* its first field is NodeTag */ ExprContext *rowcontext; List **exprlists; int array_len; int curr_idx; int marked_idx; } ValuesScanState; /* ---------------- * CteScanState information * * CteScan nodes are used to scan a CommonTableExpr query. * * Multiple CteScan nodes can read out from the same CTE query. We use * a tuplestore to hold rows that have been read from the CTE query but * not yet consumed by all readers. * ---------------- */ typedef struct CteScanState { ScanState ss; /* its first field is NodeTag */ int eflags; /* capability flags to pass to tuplestore */ int readptr; /* index of my tuplestore read pointer */ PlanState *cteplanstate; /* PlanState for the CTE query itself */ /* Link to the "leader" CteScanState (possibly this same node) */ struct CteScanState *leader; /* The remaining fields are only valid in the "leader" CteScanState */ Tuplestorestate *cte_table; /* rows already read from the CTE query */ bool eof_cte; /* reached end of CTE query? */ } CteScanState; /* ---------------- * WorkTableScanState information * * WorkTableScan nodes are used to scan the work table created by * a RecursiveUnion node. We locate the RecursiveUnion node * during executor startup. * ---------------- */ typedef struct WorkTableScanState { ScanState ss; /* its first field is NodeTag */ RecursiveUnionState *rustate; } WorkTableScanState; /* ---------------- * ForeignScanState information * * ForeignScan nodes are used to scan foreign-data tables. * ---------------- */ typedef struct ForeignScanState { ScanState ss; /* its first field is NodeTag */ /* use struct pointer to avoid including fdwapi.h here */ struct FdwRoutine *fdwroutine; void *fdw_state; /* foreign-data wrapper can keep state here */ } ForeignScanState; /* ---------------------------------------------------------------- * Join State Information * ---------------------------------------------------------------- */ /* ---------------- * JoinState information * * Superclass for state nodes of join plans. * ---------------- */ typedef struct JoinState { PlanState ps; JoinType jointype; List *joinqual; /* JOIN quals (in addition to ps.qual) */ } JoinState; /* ---------------- * NestLoopState information * * NeedNewOuter true if need new outer tuple on next call * MatchedOuter true if found a join match for current outer tuple * NullInnerTupleSlot prepared null tuple for left outer joins * ---------------- */ typedef struct NestLoopState { JoinState js; /* its first field is NodeTag */ bool nl_NeedNewOuter; bool nl_MatchedOuter; TupleTableSlot *nl_NullInnerTupleSlot; } NestLoopState; /* ---------------- * MergeJoinState information * * NumClauses number of mergejoinable join clauses * Clauses info for each mergejoinable clause * JoinState current state of ExecMergeJoin state machine * ExtraMarks true to issue extra Mark operations on inner scan * ConstFalseJoin true if we have a constant-false joinqual * FillOuter true if should emit unjoined outer tuples anyway * FillInner true if should emit unjoined inner tuples anyway * MatchedOuter true if found a join match for current outer tuple * MatchedInner true if found a join match for current inner tuple * OuterTupleSlot slot in tuple table for cur outer tuple * InnerTupleSlot slot in tuple table for cur inner tuple * MarkedTupleSlot slot in tuple table for marked tuple * NullOuterTupleSlot prepared null tuple for right outer joins * NullInnerTupleSlot prepared null tuple for left outer joins * OuterEContext workspace for computing outer tuple's join values * InnerEContext workspace for computing inner tuple's join values * ---------------- */ /* private in nodeMergejoin.c: */ typedef struct MergeJoinClauseData *MergeJoinClause; typedef struct MergeJoinState { JoinState js; /* its first field is NodeTag */ int mj_NumClauses; MergeJoinClause mj_Clauses; /* array of length mj_NumClauses */ int mj_JoinState; bool mj_ExtraMarks; bool mj_ConstFalseJoin; bool mj_FillOuter; bool mj_FillInner; bool mj_MatchedOuter; bool mj_MatchedInner; TupleTableSlot *mj_OuterTupleSlot; TupleTableSlot *mj_InnerTupleSlot; TupleTableSlot *mj_MarkedTupleSlot; TupleTableSlot *mj_NullOuterTupleSlot; TupleTableSlot *mj_NullInnerTupleSlot; ExprContext *mj_OuterEContext; ExprContext *mj_InnerEContext; } MergeJoinState; /* ---------------- * HashJoinState information * * hashclauses original form of the hashjoin condition * hj_OuterHashKeys the outer hash keys in the hashjoin condition * hj_InnerHashKeys the inner hash keys in the hashjoin condition * hj_HashOperators the join operators in the hashjoin condition * hj_HashTable hash table for the hashjoin * (NULL if table not built yet) * hj_CurHashValue hash value for current outer tuple * hj_CurBucketNo regular bucket# for current outer tuple * hj_CurSkewBucketNo skew bucket# for current outer tuple * hj_CurTuple last inner tuple matched to current outer * tuple, or NULL if starting search * (hj_CurXXX variables are undefined if * OuterTupleSlot is empty!) * hj_OuterTupleSlot tuple slot for outer tuples * hj_HashTupleSlot tuple slot for inner (hashed) tuples * hj_NullOuterTupleSlot prepared null tuple for right/full outer joins * hj_NullInnerTupleSlot prepared null tuple for left/full outer joins * hj_FirstOuterTupleSlot first tuple retrieved from outer plan * hj_JoinState current state of ExecHashJoin state machine * hj_MatchedOuter true if found a join match for current outer * hj_OuterNotEmpty true if outer relation known not empty * ---------------- */ /* these structs are defined in executor/hashjoin.h: */ typedef struct HashJoinTupleData *HashJoinTuple; typedef struct HashJoinTableData *HashJoinTable; typedef struct HashJoinState { JoinState js; /* its first field is NodeTag */ List *hashclauses; /* list of ExprState nodes */ List *hj_OuterHashKeys; /* list of ExprState nodes */ List *hj_InnerHashKeys; /* list of ExprState nodes */ List *hj_HashOperators; /* list of operator OIDs */ HashJoinTable hj_HashTable; uint32 hj_CurHashValue; int hj_CurBucketNo; int hj_CurSkewBucketNo; HashJoinTuple hj_CurTuple; TupleTableSlot *hj_OuterTupleSlot; TupleTableSlot *hj_HashTupleSlot; TupleTableSlot *hj_NullOuterTupleSlot; TupleTableSlot *hj_NullInnerTupleSlot; TupleTableSlot *hj_FirstOuterTupleSlot; int hj_JoinState; bool hj_MatchedOuter; bool hj_OuterNotEmpty; } HashJoinState; /* ---------------------------------------------------------------- * Materialization State Information * ---------------------------------------------------------------- */ /* ---------------- * MaterialState information * * materialize nodes are used to materialize the results * of a subplan into a temporary file. * * ss.ss_ScanTupleSlot refers to output of underlying plan. * ---------------- */ typedef struct MaterialState { ScanState ss; /* its first field is NodeTag */ int eflags; /* capability flags to pass to tuplestore */ bool eof_underlying; /* reached end of underlying plan? */ Tuplestorestate *tuplestorestate; } MaterialState; /* ---------------- * SortState information * ---------------- */ typedef struct SortState { ScanState ss; /* its first field is NodeTag */ bool randomAccess; /* need random access to sort output? */ bool bounded; /* is the result set bounded? */ int64 bound; /* if bounded, how many tuples are needed */ bool sort_Done; /* sort completed yet? */ bool bounded_Done; /* value of bounded we did the sort with */ int64 bound_Done; /* value of bound we did the sort with */ void *tuplesortstate; /* private state of tuplesort.c */ } SortState; /* --------------------- * GroupState information * ------------------------- */ typedef struct GroupState { ScanState ss; /* its first field is NodeTag */ FmgrInfo *eqfunctions; /* per-field lookup data for equality fns */ bool grp_done; /* indicates completion of Group scan */ } GroupState; /* --------------------- * AggState information * * ss.ss_ScanTupleSlot refers to output of underlying plan. * * Note: ss.ps.ps_ExprContext contains ecxt_aggvalues and * ecxt_aggnulls arrays, which hold the computed agg values for the current * input group during evaluation of an Agg node's output tuple(s). We * create a second ExprContext, tmpcontext, in which to evaluate input * expressions and run the aggregate transition functions. * ------------------------- */ /* these structs are private in nodeAgg.c: */ typedef struct AggStatePerAggData *AggStatePerAgg; typedef struct AggStatePerGroupData *AggStatePerGroup; typedef struct AggState { ScanState ss; /* its first field is NodeTag */ List *aggs; /* all Aggref nodes in targetlist & quals */ int numaggs; /* length of list (could be zero!) */ FmgrInfo *eqfunctions; /* per-grouping-field equality fns */ FmgrInfo *hashfunctions; /* per-grouping-field hash fns */ AggStatePerAgg peragg; /* per-Aggref information */ MemoryContext aggcontext; /* memory context for long-lived data */ ExprContext *tmpcontext; /* econtext for input expressions */ bool agg_done; /* indicates completion of Agg scan */ /* these fields are used in AGG_PLAIN and AGG_SORTED modes: */ AggStatePerGroup pergroup; /* per-Aggref-per-group working state */ HeapTuple grp_firstTuple; /* copy of first tuple of current group */ /* these fields are used in AGG_HASHED mode: */ TupleHashTable hashtable; /* hash table with one entry per group */ TupleTableSlot *hashslot; /* slot for loading hash table */ List *hash_needed; /* list of columns needed in hash table */ bool table_filled; /* hash table filled yet? */ TupleHashIterator hashiter; /* for iterating through hash table */ } AggState; /* ---------------- * WindowAggState information * ---------------- */ /* these structs are private in nodeWindowAgg.c: */ typedef struct WindowStatePerFuncData *WindowStatePerFunc; typedef struct WindowStatePerAggData *WindowStatePerAgg; typedef struct WindowAggState { ScanState ss; /* its first field is NodeTag */ /* these fields are filled in by ExecInitExpr: */ List *funcs; /* all WindowFunc nodes in targetlist */ int numfuncs; /* total number of window functions */ int numaggs; /* number that are plain aggregates */ WindowStatePerFunc perfunc; /* per-window-function information */ WindowStatePerAgg peragg; /* per-plain-aggregate information */ FmgrInfo *partEqfunctions; /* equality funcs for partition columns */ FmgrInfo *ordEqfunctions; /* equality funcs for ordering columns */ Tuplestorestate *buffer; /* stores rows of current partition */ int current_ptr; /* read pointer # for current */ int64 spooled_rows; /* total # of rows in buffer */ int64 currentpos; /* position of current row in partition */ int64 frameheadpos; /* current frame head position */ int64 frametailpos; /* current frame tail position */ /* use struct pointer to avoid including windowapi.h here */ struct WindowObjectData *agg_winobj; /* winobj for aggregate * fetches */ int64 aggregatedbase; /* start row for current aggregates */ int64 aggregatedupto; /* rows before this one are aggregated */ int frameOptions; /* frame_clause options, see WindowDef */ ExprState *startOffset; /* expression for starting bound offset */ ExprState *endOffset; /* expression for ending bound offset */ Datum startOffsetValue; /* result of startOffset evaluation */ Datum endOffsetValue; /* result of endOffset evaluation */ MemoryContext partcontext; /* context for partition-lifespan data */ MemoryContext aggcontext; /* context for each aggregate data */ ExprContext *tmpcontext; /* short-term evaluation context */ bool all_first; /* true if the scan is starting */ bool all_done; /* true if the scan is finished */ bool partition_spooled; /* true if all tuples in current * partition have been spooled into * tuplestore */ bool more_partitions;/* true if there's more partitions after this * one */ bool framehead_valid;/* true if frameheadpos is known up to date * for current row */ bool frametail_valid;/* true if frametailpos is known up to date * for current row */ TupleTableSlot *first_part_slot; /* first tuple of current or next * partition */ /* temporary slots for tuples fetched back from tuplestore */ TupleTableSlot *agg_row_slot; TupleTableSlot *temp_slot_1; TupleTableSlot *temp_slot_2; } WindowAggState; /* ---------------- * UniqueState information * * Unique nodes are used "on top of" sort nodes to discard * duplicate tuples returned from the sort phase. Basically * all it does is compare the current tuple from the subplan * with the previously fetched tuple (stored in its result slot). * If the two are identical in all interesting fields, then * we just fetch another tuple from the sort and try again. * ---------------- */ typedef struct UniqueState { PlanState ps; /* its first field is NodeTag */ FmgrInfo *eqfunctions; /* per-field lookup data for equality fns */ MemoryContext tempContext; /* short-term context for comparisons */ } UniqueState; /* ---------------- * HashState information * ---------------- */ typedef struct HashState { PlanState ps; /* its first field is NodeTag */ HashJoinTable hashtable; /* hash table for the hashjoin */ List *hashkeys; /* list of ExprState nodes */ /* hashkeys is same as parent's hj_InnerHashKeys */ } HashState; /* ---------------- * SetOpState information * * Even in "sorted" mode, SetOp nodes are more complex than a simple * Unique, since we have to count how many duplicates to return. But * we also support hashing, so this is really more like a cut-down * form of Agg. * ---------------- */ /* this struct is private in nodeSetOp.c: */ typedef struct SetOpStatePerGroupData *SetOpStatePerGroup; typedef struct SetOpState { PlanState ps; /* its first field is NodeTag */ FmgrInfo *eqfunctions; /* per-grouping-field equality fns */ FmgrInfo *hashfunctions; /* per-grouping-field hash fns */ bool setop_done; /* indicates completion of output scan */ long numOutput; /* number of dups left to output */ MemoryContext tempContext; /* short-term context for comparisons */ /* these fields are used in SETOP_SORTED mode: */ SetOpStatePerGroup pergroup; /* per-group working state */ HeapTuple grp_firstTuple; /* copy of first tuple of current group */ /* these fields are used in SETOP_HASHED mode: */ TupleHashTable hashtable; /* hash table with one entry per group */ MemoryContext tableContext; /* memory context containing hash table */ bool table_filled; /* hash table filled yet? */ TupleHashIterator hashiter; /* for iterating through hash table */ } SetOpState; /* ---------------- * LockRowsState information * * LockRows nodes are used to enforce FOR UPDATE/FOR SHARE locking. * ---------------- */ typedef struct LockRowsState { PlanState ps; /* its first field is NodeTag */ List *lr_arowMarks; /* List of ExecAuxRowMarks */ EPQState lr_epqstate; /* for evaluating EvalPlanQual rechecks */ } LockRowsState; /* ---------------- * LimitState information * * Limit nodes are used to enforce LIMIT/OFFSET clauses. * They just select the desired subrange of their subplan's output. * * offset is the number of initial tuples to skip (0 does nothing). * count is the number of tuples to return after skipping the offset tuples. * If no limit count was specified, count is undefined and noCount is true. * When lstate == LIMIT_INITIAL, offset/count/noCount haven't been set yet. * ---------------- */ typedef enum { LIMIT_INITIAL, /* initial state for LIMIT node */ LIMIT_RESCAN, /* rescan after recomputing parameters */ LIMIT_EMPTY, /* there are no returnable rows */ LIMIT_INWINDOW, /* have returned a row in the window */ LIMIT_SUBPLANEOF, /* at EOF of subplan (within window) */ LIMIT_WINDOWEND, /* stepped off end of window */ LIMIT_WINDOWSTART /* stepped off beginning of window */ } LimitStateCond; typedef struct LimitState { PlanState ps; /* its first field is NodeTag */ ExprState *limitOffset; /* OFFSET parameter, or NULL if none */ ExprState *limitCount; /* COUNT parameter, or NULL if none */ int64 offset; /* current OFFSET value */ int64 count; /* current COUNT, if any */ bool noCount; /* if true, ignore count */ LimitStateCond lstate; /* state machine status, as above */ int64 position; /* 1-based index of last tuple returned */ TupleTableSlot *subSlot; /* tuple last obtained from subplan */ } LimitState; #endif /* EXECNODES_H */ PKBiZz--server/nodes/primnodes.hnu[/*------------------------------------------------------------------------- * * primnodes.h * Definitions for "primitive" node types, those that are used in more * than one of the parse/plan/execute stages of the query pipeline. * Currently, these are mostly nodes for executable expressions * and join trees. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/nodes/primnodes.h * *------------------------------------------------------------------------- */ #ifndef PRIMNODES_H #define PRIMNODES_H #include "access/attnum.h" #include "nodes/pg_list.h" /* ---------------------------------------------------------------- * node definitions * ---------------------------------------------------------------- */ /* * Alias - * specifies an alias for a range variable; the alias might also * specify renaming of columns within the table. * * Note: colnames is a list of Value nodes (always strings). In Alias structs * associated with RTEs, there may be entries corresponding to dropped * columns; these are normally empty strings (""). See parsenodes.h for info. */ typedef struct Alias { NodeTag type; char *aliasname; /* aliased rel name (never qualified) */ List *colnames; /* optional list of column aliases */ } Alias; typedef enum InhOption { INH_NO, /* Do NOT scan child tables */ INH_YES, /* DO scan child tables */ INH_DEFAULT /* Use current SQL_inheritance option */ } InhOption; /* What to do at commit time for temporary relations */ typedef enum OnCommitAction { ONCOMMIT_NOOP, /* No ON COMMIT clause (do nothing) */ ONCOMMIT_PRESERVE_ROWS, /* ON COMMIT PRESERVE ROWS (do nothing) */ ONCOMMIT_DELETE_ROWS, /* ON COMMIT DELETE ROWS */ ONCOMMIT_DROP /* ON COMMIT DROP */ } OnCommitAction; /* * RangeVar - range variable, used in FROM clauses * * Also used to represent table names in utility statements; there, the alias * field is not used, and inhOpt shows whether to apply the operation * recursively to child tables. In some contexts it is also useful to carry * a TEMP table indication here. */ typedef struct RangeVar { NodeTag type; char *catalogname; /* the catalog (database) name, or NULL */ char *schemaname; /* the schema name, or NULL */ char *relname; /* the relation/sequence name */ InhOption inhOpt; /* expand rel by inheritance? recursively act * on children? */ char relpersistence; /* see RELPERSISTENCE_* in pg_class.h */ Alias *alias; /* table alias & optional column aliases */ int location; /* token location, or -1 if unknown */ } RangeVar; /* * IntoClause - target information for SELECT INTO and CREATE TABLE AS */ typedef struct IntoClause { NodeTag type; RangeVar *rel; /* target relation name */ List *colNames; /* column names to assign, or NIL */ List *options; /* options from WITH clause */ OnCommitAction onCommit; /* what do we do at COMMIT? */ char *tableSpaceName; /* table space to use, or NULL */ bool skipData; /* true for WITH NO DATA */ } IntoClause; /* ---------------------------------------------------------------- * node types for executable expressions * ---------------------------------------------------------------- */ /* * Expr - generic superclass for executable-expression nodes * * All node types that are used in executable expression trees should derive * from Expr (that is, have Expr as their first field). Since Expr only * contains NodeTag, this is a formality, but it is an easy form of * documentation. See also the ExprState node types in execnodes.h. */ typedef struct Expr { NodeTag type; } Expr; /* * Var - expression node representing a variable (ie, a table column) * * Note: during parsing/planning, varnoold/varoattno are always just copies * of varno/varattno. At the tail end of planning, Var nodes appearing in * upper-level plan nodes are reassigned to point to the outputs of their * subplans; for example, in a join node varno becomes INNER_VAR or OUTER_VAR * and varattno becomes the index of the proper element of that subplan's * target list. But varnoold/varoattno continue to hold the original values. * The code doesn't really need varnoold/varoattno, but they are very useful * for debugging and interpreting completed plans, so we keep them around. */ #define INNER_VAR 65000 /* reference to inner subplan */ #define OUTER_VAR 65001 /* reference to outer subplan */ #define INDEX_VAR 65002 /* reference to index column */ #define IS_SPECIAL_VARNO(varno) ((varno) >= INNER_VAR) /* Symbols for the indexes of the special RTE entries in rules */ #define PRS2_OLD_VARNO 1 #define PRS2_NEW_VARNO 2 typedef struct Var { Expr xpr; Index varno; /* index of this var's relation in the range * table, or INNER_VAR/OUTER_VAR/INDEX_VAR */ AttrNumber varattno; /* attribute number of this var, or zero for * all */ Oid vartype; /* pg_type OID for the type of this var */ int32 vartypmod; /* pg_attribute typmod value */ Oid varcollid; /* OID of collation, or InvalidOid if none */ Index varlevelsup; /* for subquery variables referencing outer * relations; 0 in a normal var, >0 means N * levels up */ Index varnoold; /* original value of varno, for debugging */ AttrNumber varoattno; /* original value of varattno */ int location; /* token location, or -1 if unknown */ } Var; /* * Const */ typedef struct Const { Expr xpr; Oid consttype; /* pg_type OID of the constant's datatype */ int32 consttypmod; /* typmod value, if any */ Oid constcollid; /* OID of collation, or InvalidOid if none */ int constlen; /* typlen of the constant's datatype */ Datum constvalue; /* the constant's value */ bool constisnull; /* whether the constant is null (if true, * constvalue is undefined) */ bool constbyval; /* whether this datatype is passed by value. * If true, then all the information is stored * in the Datum. If false, then the Datum * contains a pointer to the information. */ int location; /* token location, or -1 if unknown */ } Const; /* ---------------- * Param * paramkind - specifies the kind of parameter. The possible values * for this field are: * * PARAM_EXTERN: The parameter value is supplied from outside the plan. * Such parameters are numbered from 1 to n. * * PARAM_EXEC: The parameter is an internal executor parameter, used * for passing values into and out of sub-queries or from * nestloop joins to their inner scans. * For historical reasons, such parameters are numbered from 0. * These numbers are independent of PARAM_EXTERN numbers. * * PARAM_SUBLINK: The parameter represents an output column of a SubLink * node's sub-select. The column number is contained in the * `paramid' field. (This type of Param is converted to * PARAM_EXEC during planning.) * * Note: currently, paramtypmod is valid for PARAM_SUBLINK Params, and for * PARAM_EXEC Params generated from them; it is always -1 for PARAM_EXTERN * params, since the APIs that supply values for such parameters don't carry * any typmod info. * ---------------- */ typedef enum ParamKind { PARAM_EXTERN, PARAM_EXEC, PARAM_SUBLINK } ParamKind; typedef struct Param { Expr xpr; ParamKind paramkind; /* kind of parameter. See above */ int paramid; /* numeric ID for parameter */ Oid paramtype; /* pg_type OID of parameter's datatype */ int32 paramtypmod; /* typmod value, if known */ Oid paramcollid; /* OID of collation, or InvalidOid if none */ int location; /* token location, or -1 if unknown */ } Param; /* * Aggref * * The aggregate's args list is a targetlist, ie, a list of TargetEntry nodes * (before Postgres 9.0 it was just bare expressions). The non-resjunk TLEs * represent the aggregate's regular arguments (if any) and resjunk TLEs can * be added at the end to represent ORDER BY expressions that are not also * arguments. As in a top-level Query, the TLEs can be marked with * ressortgroupref indexes to let them be referenced by SortGroupClause * entries in the aggorder and/or aggdistinct lists. This represents ORDER BY * and DISTINCT operations to be applied to the aggregate input rows before * they are passed to the transition function. The grammar only allows a * simple "DISTINCT" specifier for the arguments, but we use the full * query-level representation to allow more code sharing. */ typedef struct Aggref { Expr xpr; Oid aggfnoid; /* pg_proc Oid of the aggregate */ Oid aggtype; /* type Oid of result of the aggregate */ Oid aggcollid; /* OID of collation of result */ Oid inputcollid; /* OID of collation that function should use */ List *args; /* arguments and sort expressions */ List *aggorder; /* ORDER BY (list of SortGroupClause) */ List *aggdistinct; /* DISTINCT (list of SortGroupClause) */ bool aggstar; /* TRUE if argument list was really '*' */ Index agglevelsup; /* > 0 if agg belongs to outer query */ int location; /* token location, or -1 if unknown */ } Aggref; /* * WindowFunc */ typedef struct WindowFunc { Expr xpr; Oid winfnoid; /* pg_proc Oid of the function */ Oid wintype; /* type Oid of result of the window function */ Oid wincollid; /* OID of collation of result */ Oid inputcollid; /* OID of collation that function should use */ List *args; /* arguments to the window function */ Index winref; /* index of associated WindowClause */ bool winstar; /* TRUE if argument list was really '*' */ bool winagg; /* is function a simple aggregate? */ int location; /* token location, or -1 if unknown */ } WindowFunc; /* ---------------- * ArrayRef: describes an array subscripting operation * * An ArrayRef can describe fetching a single element from an array, * fetching a subarray (array slice), storing a single element into * an array, or storing a slice. The "store" cases work with an * initial array value and a source value that is inserted into the * appropriate part of the array; the result of the operation is an * entire new modified array value. * * If reflowerindexpr = NIL, then we are fetching or storing a single array * element at the subscripts given by refupperindexpr. Otherwise we are * fetching or storing an array slice, that is a rectangular subarray * with lower and upper bounds given by the index expressions. * reflowerindexpr must be the same length as refupperindexpr when it * is not NIL. * * Note: the result datatype is the element type when fetching a single * element; but it is the array type when doing subarray fetch or either * type of store. * ---------------- */ typedef struct ArrayRef { Expr xpr; Oid refarraytype; /* type of the array proper */ Oid refelemtype; /* type of the array elements */ int32 reftypmod; /* typmod of the array (and elements too) */ Oid refcollid; /* OID of collation, or InvalidOid if none */ List *refupperindexpr;/* expressions that evaluate to upper array * indexes */ List *reflowerindexpr;/* expressions that evaluate to lower array * indexes */ Expr *refexpr; /* the expression that evaluates to an array * value */ Expr *refassgnexpr; /* expression for the source value, or NULL if * fetch */ } ArrayRef; /* * CoercionContext - distinguishes the allowed set of type casts * * NB: ordering of the alternatives is significant; later (larger) values * allow more casts than earlier ones. */ typedef enum CoercionContext { COERCION_IMPLICIT, /* coercion in context of expression */ COERCION_ASSIGNMENT, /* coercion in context of assignment */ COERCION_EXPLICIT /* explicit cast operation */ } CoercionContext; /* * CoercionForm - information showing how to display a function-call node * * NB: equal() ignores CoercionForm fields, therefore this *must* not carry * any semantically significant information. We need that behavior so that * the planner will consider equivalent implicit and explicit casts to be * equivalent. In cases where those actually behave differently, the coercion * function's arguments will be different. */ typedef enum CoercionForm { COERCE_EXPLICIT_CALL, /* display as a function call */ COERCE_EXPLICIT_CAST, /* display as an explicit cast */ COERCE_IMPLICIT_CAST, /* implicit cast, so hide it */ COERCE_DONTCARE /* special case for planner */ } CoercionForm; /* * FuncExpr - expression node for a function call */ typedef struct FuncExpr { Expr xpr; Oid funcid; /* PG_PROC OID of the function */ Oid funcresulttype; /* PG_TYPE OID of result value */ bool funcretset; /* true if function returns set */ CoercionForm funcformat; /* how to display this function call */ Oid funccollid; /* OID of collation of result */ Oid inputcollid; /* OID of collation that function should use */ List *args; /* arguments to the function */ int location; /* token location, or -1 if unknown */ } FuncExpr; /* * NamedArgExpr - a named argument of a function * * This node type can only appear in the args list of a FuncCall or FuncExpr * node. We support pure positional call notation (no named arguments), * named notation (all arguments are named), and mixed notation (unnamed * arguments followed by named ones). * * Parse analysis sets argnumber to the positional index of the argument, * but doesn't rearrange the argument list. * * The planner will convert argument lists to pure positional notation * during expression preprocessing, so execution never sees a NamedArgExpr. */ typedef struct NamedArgExpr { Expr xpr; Expr *arg; /* the argument expression */ char *name; /* the name */ int argnumber; /* argument's number in positional notation */ int location; /* argument name location, or -1 if unknown */ } NamedArgExpr; /* * OpExpr - expression node for an operator invocation * * Semantically, this is essentially the same as a function call. * * Note that opfuncid is not necessarily filled in immediately on creation * of the node. The planner makes sure it is valid before passing the node * tree to the executor, but during parsing/planning opfuncid can be 0. */ typedef struct OpExpr { Expr xpr; Oid opno; /* PG_OPERATOR OID of the operator */ Oid opfuncid; /* PG_PROC OID of underlying function */ Oid opresulttype; /* PG_TYPE OID of result value */ bool opretset; /* true if operator returns set */ Oid opcollid; /* OID of collation of result */ Oid inputcollid; /* OID of collation that operator should use */ List *args; /* arguments to the operator (1 or 2) */ int location; /* token location, or -1 if unknown */ } OpExpr; /* * DistinctExpr - expression node for "x IS DISTINCT FROM y" * * Except for the nodetag, this is represented identically to an OpExpr * referencing the "=" operator for x and y. * We use "=", not the more obvious "<>", because more datatypes have "=" * than "<>". This means the executor must invert the operator result. * Note that the operator function won't be called at all if either input * is NULL, since then the result can be determined directly. */ typedef OpExpr DistinctExpr; /* * NullIfExpr - a NULLIF expression * * Like DistinctExpr, this is represented the same as an OpExpr referencing * the "=" operator for x and y. */ typedef OpExpr NullIfExpr; /* * ScalarArrayOpExpr - expression node for "scalar op ANY/ALL (array)" * * The operator must yield boolean. It is applied to the left operand * and each element of the righthand array, and the results are combined * with OR or AND (for ANY or ALL respectively). The node representation * is almost the same as for the underlying operator, but we need a useOr * flag to remember whether it's ANY or ALL, and we don't have to store * the result type (or the collation) because it must be boolean. */ typedef struct ScalarArrayOpExpr { Expr xpr; Oid opno; /* PG_OPERATOR OID of the operator */ Oid opfuncid; /* PG_PROC OID of underlying function */ bool useOr; /* true for ANY, false for ALL */ Oid inputcollid; /* OID of collation that operator should use */ List *args; /* the scalar and array operands */ int location; /* token location, or -1 if unknown */ } ScalarArrayOpExpr; /* * BoolExpr - expression node for the basic Boolean operators AND, OR, NOT * * Notice the arguments are given as a List. For NOT, of course the list * must always have exactly one element. For AND and OR, the executor can * handle any number of arguments. The parser generally treats AND and OR * as binary and so it typically only produces two-element lists, but the * optimizer will flatten trees of AND and OR nodes to produce longer lists * when possible. There are also a few special cases where more arguments * can appear before optimization. */ typedef enum BoolExprType { AND_EXPR, OR_EXPR, NOT_EXPR } BoolExprType; typedef struct BoolExpr { Expr xpr; BoolExprType boolop; List *args; /* arguments to this expression */ int location; /* token location, or -1 if unknown */ } BoolExpr; /* * SubLink * * A SubLink represents a subselect appearing in an expression, and in some * cases also the combining operator(s) just above it. The subLinkType * indicates the form of the expression represented: * EXISTS_SUBLINK EXISTS(SELECT ...) * ALL_SUBLINK (lefthand) op ALL (SELECT ...) * ANY_SUBLINK (lefthand) op ANY (SELECT ...) * ROWCOMPARE_SUBLINK (lefthand) op (SELECT ...) * EXPR_SUBLINK (SELECT with single targetlist item ...) * ARRAY_SUBLINK ARRAY(SELECT with single targetlist item ...) * CTE_SUBLINK WITH query (never actually part of an expression) * For ALL, ANY, and ROWCOMPARE, the lefthand is a list of expressions of the * same length as the subselect's targetlist. ROWCOMPARE will *always* have * a list with more than one entry; if the subselect has just one target * then the parser will create an EXPR_SUBLINK instead (and any operator * above the subselect will be represented separately). Note that both * ROWCOMPARE and EXPR require the subselect to deliver only one row. * ALL, ANY, and ROWCOMPARE require the combining operators to deliver boolean * results. ALL and ANY combine the per-row results using AND and OR * semantics respectively. * ARRAY requires just one target column, and creates an array of the target * column's type using any number of rows resulting from the subselect. * * SubLink is classed as an Expr node, but it is not actually executable; * it must be replaced in the expression tree by a SubPlan node during * planning. * * NOTE: in the raw output of gram.y, testexpr contains just the raw form * of the lefthand expression (if any), and operName is the String name of * the combining operator. Also, subselect is a raw parsetree. During parse * analysis, the parser transforms testexpr into a complete boolean expression * that compares the lefthand value(s) to PARAM_SUBLINK nodes representing the * output columns of the subselect. And subselect is transformed to a Query. * This is the representation seen in saved rules and in the rewriter. * * In EXISTS, EXPR, and ARRAY SubLinks, testexpr and operName are unused and * are always null. * * The CTE_SUBLINK case never occurs in actual SubLink nodes, but it is used * in SubPlans generated for WITH subqueries. */ typedef enum SubLinkType { EXISTS_SUBLINK, ALL_SUBLINK, ANY_SUBLINK, ROWCOMPARE_SUBLINK, EXPR_SUBLINK, ARRAY_SUBLINK, CTE_SUBLINK /* for SubPlans only */ } SubLinkType; typedef struct SubLink { Expr xpr; SubLinkType subLinkType; /* see above */ Node *testexpr; /* outer-query test for ALL/ANY/ROWCOMPARE */ List *operName; /* originally specified operator name */ Node *subselect; /* subselect as Query* or parsetree */ int location; /* token location, or -1 if unknown */ } SubLink; /* * SubPlan - executable expression node for a subplan (sub-SELECT) * * The planner replaces SubLink nodes in expression trees with SubPlan * nodes after it has finished planning the subquery. SubPlan references * a sub-plantree stored in the subplans list of the toplevel PlannedStmt. * (We avoid a direct link to make it easier to copy expression trees * without causing multiple processing of the subplan.) * * In an ordinary subplan, testexpr points to an executable expression * (OpExpr, an AND/OR tree of OpExprs, or RowCompareExpr) for the combining * operator(s); the left-hand arguments are the original lefthand expressions, * and the right-hand arguments are PARAM_EXEC Param nodes representing the * outputs of the sub-select. (NOTE: runtime coercion functions may be * inserted as well.) This is just the same expression tree as testexpr in * the original SubLink node, but the PARAM_SUBLINK nodes are replaced by * suitably numbered PARAM_EXEC nodes. * * If the sub-select becomes an initplan rather than a subplan, the executable * expression is part of the outer plan's expression tree (and the SubPlan * node itself is not, but rather is found in the outer plan's initPlan * list). In this case testexpr is NULL to avoid duplication. * * The planner also derives lists of the values that need to be passed into * and out of the subplan. Input values are represented as a list "args" of * expressions to be evaluated in the outer-query context (currently these * args are always just Vars, but in principle they could be any expression). * The values are assigned to the global PARAM_EXEC params indexed by parParam * (the parParam and args lists must have the same ordering). setParam is a * list of the PARAM_EXEC params that are computed by the sub-select, if it * is an initplan; they are listed in order by sub-select output column * position. (parParam and setParam are integer Lists, not Bitmapsets, * because their ordering is significant.) * * Also, the planner computes startup and per-call costs for use of the * SubPlan. Note that these include the cost of the subquery proper, * evaluation of the testexpr if any, and any hashtable management overhead. */ typedef struct SubPlan { Expr xpr; /* Fields copied from original SubLink: */ SubLinkType subLinkType; /* see above */ /* The combining operators, transformed to an executable expression: */ Node *testexpr; /* OpExpr or RowCompareExpr expression tree */ List *paramIds; /* IDs of Params embedded in the above */ /* Identification of the Plan tree to use: */ int plan_id; /* Index (from 1) in PlannedStmt.subplans */ /* Identification of the SubPlan for EXPLAIN and debugging purposes: */ char *plan_name; /* A name assigned during planning */ /* Extra data useful for determining subplan's output type: */ Oid firstColType; /* Type of first column of subplan result */ int32 firstColTypmod; /* Typmod of first column of subplan result */ Oid firstColCollation; /* Collation of first column of * subplan result */ /* Information about execution strategy: */ bool useHashTable; /* TRUE to store subselect output in a hash * table (implies we are doing "IN") */ bool unknownEqFalse; /* TRUE if it's okay to return FALSE when the * spec result is UNKNOWN; this allows much * simpler handling of null values */ /* Information for passing params into and out of the subselect: */ /* setParam and parParam are lists of integers (param IDs) */ List *setParam; /* initplan subqueries have to set these * Params for parent plan */ List *parParam; /* indices of input Params from parent plan */ List *args; /* exprs to pass as parParam values */ /* Estimated execution costs: */ Cost startup_cost; /* one-time setup cost */ Cost per_call_cost; /* cost for each subplan evaluation */ } SubPlan; /* * AlternativeSubPlan - expression node for a choice among SubPlans * * The subplans are given as a List so that the node definition need not * change if there's ever more than two alternatives. For the moment, * though, there are always exactly two; and the first one is the fast-start * plan. */ typedef struct AlternativeSubPlan { Expr xpr; List *subplans; /* SubPlan(s) with equivalent results */ } AlternativeSubPlan; /* ---------------- * FieldSelect * * FieldSelect represents the operation of extracting one field from a tuple * value. At runtime, the input expression is expected to yield a rowtype * Datum. The specified field number is extracted and returned as a Datum. * ---------------- */ typedef struct FieldSelect { Expr xpr; Expr *arg; /* input expression */ AttrNumber fieldnum; /* attribute number of field to extract */ Oid resulttype; /* type of the field (result type of this * node) */ int32 resulttypmod; /* output typmod (usually -1) */ Oid resultcollid; /* OID of collation of the field */ } FieldSelect; /* ---------------- * FieldStore * * FieldStore represents the operation of modifying one field in a tuple * value, yielding a new tuple value (the input is not touched!). Like * the assign case of ArrayRef, this is used to implement UPDATE of a * portion of a column. * * A single FieldStore can actually represent updates of several different * fields. The parser only generates FieldStores with single-element lists, * but the planner will collapse multiple updates of the same base column * into one FieldStore. * ---------------- */ typedef struct FieldStore { Expr xpr; Expr *arg; /* input tuple value */ List *newvals; /* new value(s) for field(s) */ List *fieldnums; /* integer list of field attnums */ Oid resulttype; /* type of result (same as type of arg) */ /* Like RowExpr, we deliberately omit a typmod and collation here */ } FieldStore; /* ---------------- * RelabelType * * RelabelType represents a "dummy" type coercion between two binary- * compatible datatypes, such as reinterpreting the result of an OID * expression as an int4. It is a no-op at runtime; we only need it * to provide a place to store the correct type to be attributed to * the expression result during type resolution. (We can't get away * with just overwriting the type field of the input expression node, * so we need a separate node to show the coercion's result type.) * ---------------- */ typedef struct RelabelType { Expr xpr; Expr *arg; /* input expression */ Oid resulttype; /* output type of coercion expression */ int32 resulttypmod; /* output typmod (usually -1) */ Oid resultcollid; /* OID of collation, or InvalidOid if none */ CoercionForm relabelformat; /* how to display this node */ int location; /* token location, or -1 if unknown */ } RelabelType; /* ---------------- * CoerceViaIO * * CoerceViaIO represents a type coercion between two types whose textual * representations are compatible, implemented by invoking the source type's * typoutput function then the destination type's typinput function. * ---------------- */ typedef struct CoerceViaIO { Expr xpr; Expr *arg; /* input expression */ Oid resulttype; /* output type of coercion */ /* output typmod is not stored, but is presumed -1 */ Oid resultcollid; /* OID of collation, or InvalidOid if none */ CoercionForm coerceformat; /* how to display this node */ int location; /* token location, or -1 if unknown */ } CoerceViaIO; /* ---------------- * ArrayCoerceExpr * * ArrayCoerceExpr represents a type coercion from one array type to another, * which is implemented by applying the indicated element-type coercion * function to each element of the source array. If elemfuncid is InvalidOid * then the element types are binary-compatible, but the coercion still * requires some effort (we have to fix the element type ID stored in the * array header). * ---------------- */ typedef struct ArrayCoerceExpr { Expr xpr; Expr *arg; /* input expression (yields an array) */ Oid elemfuncid; /* OID of element coercion function, or 0 */ Oid resulttype; /* output type of coercion (an array type) */ int32 resulttypmod; /* output typmod (also element typmod) */ Oid resultcollid; /* OID of collation, or InvalidOid if none */ bool isExplicit; /* conversion semantics flag to pass to func */ CoercionForm coerceformat; /* how to display this node */ int location; /* token location, or -1 if unknown */ } ArrayCoerceExpr; /* ---------------- * ConvertRowtypeExpr * * ConvertRowtypeExpr represents a type coercion from one composite type * to another, where the source type is guaranteed to contain all the columns * needed for the destination type plus possibly others; the columns need not * be in the same positions, but are matched up by name. This is primarily * used to convert a whole-row value of an inheritance child table into a * valid whole-row value of its parent table's rowtype. * ---------------- */ typedef struct ConvertRowtypeExpr { Expr xpr; Expr *arg; /* input expression */ Oid resulttype; /* output type (always a composite type) */ /* Like RowExpr, we deliberately omit a typmod and collation here */ CoercionForm convertformat; /* how to display this node */ int location; /* token location, or -1 if unknown */ } ConvertRowtypeExpr; /*---------- * CollateExpr - COLLATE * * The planner replaces CollateExpr with RelabelType during expression * preprocessing, so execution never sees a CollateExpr. *---------- */ typedef struct CollateExpr { Expr xpr; Expr *arg; /* input expression */ Oid collOid; /* collation's OID */ int location; /* token location, or -1 if unknown */ } CollateExpr; /*---------- * CaseExpr - a CASE expression * * We support two distinct forms of CASE expression: * CASE WHEN boolexpr THEN expr [ WHEN boolexpr THEN expr ... ] * CASE testexpr WHEN compexpr THEN expr [ WHEN compexpr THEN expr ... ] * These are distinguishable by the "arg" field being NULL in the first case * and the testexpr in the second case. * * In the raw grammar output for the second form, the condition expressions * of the WHEN clauses are just the comparison values. Parse analysis * converts these to valid boolean expressions of the form * CaseTestExpr '=' compexpr * where the CaseTestExpr node is a placeholder that emits the correct * value at runtime. This structure is used so that the testexpr need be * evaluated only once. Note that after parse analysis, the condition * expressions always yield boolean. * * Note: we can test whether a CaseExpr has been through parse analysis * yet by checking whether casetype is InvalidOid or not. *---------- */ typedef struct CaseExpr { Expr xpr; Oid casetype; /* type of expression result */ Oid casecollid; /* OID of collation, or InvalidOid if none */ Expr *arg; /* implicit equality comparison argument */ List *args; /* the arguments (list of WHEN clauses) */ Expr *defresult; /* the default result (ELSE clause) */ int location; /* token location, or -1 if unknown */ } CaseExpr; /* * CaseWhen - one arm of a CASE expression */ typedef struct CaseWhen { Expr xpr; Expr *expr; /* condition expression */ Expr *result; /* substitution result */ int location; /* token location, or -1 if unknown */ } CaseWhen; /* * Placeholder node for the test value to be processed by a CASE expression. * This is effectively like a Param, but can be implemented more simply * since we need only one replacement value at a time. * * We also use this in nested UPDATE expressions. * See transformAssignmentIndirection(). */ typedef struct CaseTestExpr { Expr xpr; Oid typeId; /* type for substituted value */ int32 typeMod; /* typemod for substituted value */ Oid collation; /* collation for the substituted value */ } CaseTestExpr; /* * ArrayExpr - an ARRAY[] expression * * Note: if multidims is false, the constituent expressions all yield the * scalar type identified by element_typeid. If multidims is true, the * constituent expressions all yield arrays of element_typeid (ie, the same * type as array_typeid); at runtime we must check for compatible subscripts. */ typedef struct ArrayExpr { Expr xpr; Oid array_typeid; /* type of expression result */ Oid array_collid; /* OID of collation, or InvalidOid if none */ Oid element_typeid; /* common type of array elements */ List *elements; /* the array elements or sub-arrays */ bool multidims; /* true if elements are sub-arrays */ int location; /* token location, or -1 if unknown */ } ArrayExpr; /* * RowExpr - a ROW() expression * * Note: the list of fields must have a one-for-one correspondence with * physical fields of the associated rowtype, although it is okay for it * to be shorter than the rowtype. That is, the N'th list element must * match up with the N'th physical field. When the N'th physical field * is a dropped column (attisdropped) then the N'th list element can just * be a NULL constant. (This case can only occur for named composite types, * not RECORD types, since those are built from the RowExpr itself rather * than vice versa.) It is important not to assume that length(args) is * the same as the number of columns logically present in the rowtype. * * colnames provides field names in cases where the names can't easily be * obtained otherwise. Names *must* be provided if row_typeid is RECORDOID. * If row_typeid identifies a known composite type, colnames can be NIL to * indicate the type's cataloged field names apply. Note that colnames can * be non-NIL even for a composite type, and typically is when the RowExpr * was created by expanding a whole-row Var. This is so that we can retain * the column alias names of the RTE that the Var referenced (which would * otherwise be very difficult to extract from the parsetree). Like the * args list, colnames is one-for-one with physical fields of the rowtype. */ typedef struct RowExpr { Expr xpr; List *args; /* the fields */ Oid row_typeid; /* RECORDOID or a composite type's ID */ /* * Note: we deliberately do NOT store a typmod. Although a typmod will be * associated with specific RECORD types at runtime, it will differ for * different backends, and so cannot safely be stored in stored * parsetrees. We must assume typmod -1 for a RowExpr node. * * We don't need to store a collation either. The result type is * necessarily composite, and composite types never have a collation. */ CoercionForm row_format; /* how to display this node */ List *colnames; /* list of String, or NIL */ int location; /* token location, or -1 if unknown */ } RowExpr; /* * RowCompareExpr - row-wise comparison, such as (a, b) <= (1, 2) * * We support row comparison for any operator that can be determined to * act like =, <>, <, <=, >, or >= (we determine this by looking for the * operator in btree opfamilies). Note that the same operator name might * map to a different operator for each pair of row elements, since the * element datatypes can vary. * * A RowCompareExpr node is only generated for the < <= > >= cases; * the = and <> cases are translated to simple AND or OR combinations * of the pairwise comparisons. However, we include = and <> in the * RowCompareType enum for the convenience of parser logic. */ typedef enum RowCompareType { /* Values of this enum are chosen to match btree strategy numbers */ ROWCOMPARE_LT = 1, /* BTLessStrategyNumber */ ROWCOMPARE_LE = 2, /* BTLessEqualStrategyNumber */ ROWCOMPARE_EQ = 3, /* BTEqualStrategyNumber */ ROWCOMPARE_GE = 4, /* BTGreaterEqualStrategyNumber */ ROWCOMPARE_GT = 5, /* BTGreaterStrategyNumber */ ROWCOMPARE_NE = 6 /* no such btree strategy */ } RowCompareType; typedef struct RowCompareExpr { Expr xpr; RowCompareType rctype; /* LT LE GE or GT, never EQ or NE */ List *opnos; /* OID list of pairwise comparison ops */ List *opfamilies; /* OID list of containing operator families */ List *inputcollids; /* OID list of collations for comparisons */ List *largs; /* the left-hand input arguments */ List *rargs; /* the right-hand input arguments */ } RowCompareExpr; /* * CoalesceExpr - a COALESCE expression */ typedef struct CoalesceExpr { Expr xpr; Oid coalescetype; /* type of expression result */ Oid coalescecollid; /* OID of collation, or InvalidOid if none */ List *args; /* the arguments */ int location; /* token location, or -1 if unknown */ } CoalesceExpr; /* * MinMaxExpr - a GREATEST or LEAST function */ typedef enum MinMaxOp { IS_GREATEST, IS_LEAST } MinMaxOp; typedef struct MinMaxExpr { Expr xpr; Oid minmaxtype; /* common type of arguments and result */ Oid minmaxcollid; /* OID of collation of result */ Oid inputcollid; /* OID of collation that function should use */ MinMaxOp op; /* function to execute */ List *args; /* the arguments */ int location; /* token location, or -1 if unknown */ } MinMaxExpr; /* * XmlExpr - various SQL/XML functions requiring special grammar productions * * 'name' carries the "NAME foo" argument (already XML-escaped). * 'named_args' and 'arg_names' represent an xml_attribute list. * 'args' carries all other arguments. * * Note: result type/typmod/collation are not stored, but can be deduced * from the XmlExprOp. The type/typmod fields are just used for display * purposes, and are NOT necessarily the true result type of the node. * (We also use type == InvalidOid to mark a not-yet-parse-analyzed XmlExpr.) */ typedef enum XmlExprOp { IS_XMLCONCAT, /* XMLCONCAT(args) */ IS_XMLELEMENT, /* XMLELEMENT(name, xml_attributes, args) */ IS_XMLFOREST, /* XMLFOREST(xml_attributes) */ IS_XMLPARSE, /* XMLPARSE(text, is_doc, preserve_ws) */ IS_XMLPI, /* XMLPI(name [, args]) */ IS_XMLROOT, /* XMLROOT(xml, version, standalone) */ IS_XMLSERIALIZE, /* XMLSERIALIZE(is_document, xmlval) */ IS_DOCUMENT /* xmlval IS DOCUMENT */ } XmlExprOp; typedef enum { XMLOPTION_DOCUMENT, XMLOPTION_CONTENT } XmlOptionType; typedef struct XmlExpr { Expr xpr; XmlExprOp op; /* xml function ID */ char *name; /* name in xml(NAME foo ...) syntaxes */ List *named_args; /* non-XML expressions for xml_attributes */ List *arg_names; /* parallel list of Value strings */ List *args; /* list of expressions */ XmlOptionType xmloption; /* DOCUMENT or CONTENT */ Oid type; /* target type/typmod for XMLSERIALIZE */ int32 typmod; int location; /* token location, or -1 if unknown */ } XmlExpr; /* ---------------- * NullTest * * NullTest represents the operation of testing a value for NULLness. * The appropriate test is performed and returned as a boolean Datum. * * When argisrow is false, this simply represents a test for the null value. * * When argisrow is true, the input expression must yield a rowtype, and * the node implements "row IS [NOT] NULL" per the SQL standard. This * includes checking individual fields for NULLness when the row datum * itself isn't NULL. * * NOTE: the combination of a rowtype input and argisrow==false does NOT * correspond to the SQL notation "row IS [NOT] NULL"; instead, this case * represents the SQL notation "row IS [NOT] DISTINCT FROM NULL". * ---------------- */ typedef enum NullTestType { IS_NULL, IS_NOT_NULL } NullTestType; typedef struct NullTest { Expr xpr; Expr *arg; /* input expression */ NullTestType nulltesttype; /* IS NULL, IS NOT NULL */ bool argisrow; /* T to perform field-by-field null checks */ } NullTest; /* * BooleanTest * * BooleanTest represents the operation of determining whether a boolean * is TRUE, FALSE, or UNKNOWN (ie, NULL). All six meaningful combinations * are supported. Note that a NULL input does *not* cause a NULL result. * The appropriate test is performed and returned as a boolean Datum. */ typedef enum BoolTestType { IS_TRUE, IS_NOT_TRUE, IS_FALSE, IS_NOT_FALSE, IS_UNKNOWN, IS_NOT_UNKNOWN } BoolTestType; typedef struct BooleanTest { Expr xpr; Expr *arg; /* input expression */ BoolTestType booltesttype; /* test type */ } BooleanTest; /* * CoerceToDomain * * CoerceToDomain represents the operation of coercing a value to a domain * type. At runtime (and not before) the precise set of constraints to be * checked will be determined. If the value passes, it is returned as the * result; if not, an error is raised. Note that this is equivalent to * RelabelType in the scenario where no constraints are applied. */ typedef struct CoerceToDomain { Expr xpr; Expr *arg; /* input expression */ Oid resulttype; /* domain type ID (result type) */ int32 resulttypmod; /* output typmod (currently always -1) */ Oid resultcollid; /* OID of collation, or InvalidOid if none */ CoercionForm coercionformat; /* how to display this node */ int location; /* token location, or -1 if unknown */ } CoerceToDomain; /* * Placeholder node for the value to be processed by a domain's check * constraint. This is effectively like a Param, but can be implemented more * simply since we need only one replacement value at a time. * * Note: the typeId/typeMod/collation will be set from the domain's base type, * not the domain itself. This is because we shouldn't consider the value * to be a member of the domain if we haven't yet checked its constraints. */ typedef struct CoerceToDomainValue { Expr xpr; Oid typeId; /* type for substituted value */ int32 typeMod; /* typemod for substituted value */ Oid collation; /* collation for the substituted value */ int location; /* token location, or -1 if unknown */ } CoerceToDomainValue; /* * Placeholder node for a DEFAULT marker in an INSERT or UPDATE command. * * This is not an executable expression: it must be replaced by the actual * column default expression during rewriting. But it is convenient to * treat it as an expression node during parsing and rewriting. */ typedef struct SetToDefault { Expr xpr; Oid typeId; /* type for substituted value */ int32 typeMod; /* typemod for substituted value */ Oid collation; /* collation for the substituted value */ int location; /* token location, or -1 if unknown */ } SetToDefault; /* * Node representing [WHERE] CURRENT OF cursor_name * * CURRENT OF is a bit like a Var, in that it carries the rangetable index * of the target relation being constrained; this aids placing the expression * correctly during planning. We can assume however that its "levelsup" is * always zero, due to the syntactic constraints on where it can appear. * * The referenced cursor can be represented either as a hardwired string * or as a reference to a run-time parameter of type REFCURSOR. The latter * case is for the convenience of plpgsql. */ typedef struct CurrentOfExpr { Expr xpr; Index cvarno; /* RT index of target relation */ char *cursor_name; /* name of referenced cursor, or NULL */ int cursor_param; /* refcursor parameter number, or 0 */ } CurrentOfExpr; /*-------------------- * TargetEntry - * a target entry (used in query target lists) * * Strictly speaking, a TargetEntry isn't an expression node (since it can't * be evaluated by ExecEvalExpr). But we treat it as one anyway, since in * very many places it's convenient to process a whole query targetlist as a * single expression tree. * * In a SELECT's targetlist, resno should always be equal to the item's * ordinal position (counting from 1). However, in an INSERT or UPDATE * targetlist, resno represents the attribute number of the destination * column for the item; so there may be missing or out-of-order resnos. * It is even legal to have duplicated resnos; consider * UPDATE table SET arraycol[1] = ..., arraycol[2] = ..., ... * The two meanings come together in the executor, because the planner * transforms INSERT/UPDATE tlists into a normalized form with exactly * one entry for each column of the destination table. Before that's * happened, however, it is risky to assume that resno == position. * Generally get_tle_by_resno() should be used rather than list_nth() * to fetch tlist entries by resno, and only in SELECT should you assume * that resno is a unique identifier. * * resname is required to represent the correct column name in non-resjunk * entries of top-level SELECT targetlists, since it will be used as the * column title sent to the frontend. In most other contexts it is only * a debugging aid, and may be wrong or even NULL. (In particular, it may * be wrong in a tlist from a stored rule, if the referenced column has been * renamed by ALTER TABLE since the rule was made. Also, the planner tends * to store NULL rather than look up a valid name for tlist entries in * non-toplevel plan nodes.) In resjunk entries, resname should be either * a specific system-generated name (such as "ctid") or NULL; anything else * risks confusing ExecGetJunkAttribute! * * ressortgroupref is used in the representation of ORDER BY, GROUP BY, and * DISTINCT items. Targetlist entries with ressortgroupref=0 are not * sort/group items. If ressortgroupref>0, then this item is an ORDER BY, * GROUP BY, and/or DISTINCT target value. No two entries in a targetlist * may have the same nonzero ressortgroupref --- but there is no particular * meaning to the nonzero values, except as tags. (For example, one must * not assume that lower ressortgroupref means a more significant sort key.) * The order of the associated SortGroupClause lists determine the semantics. * * resorigtbl/resorigcol identify the source of the column, if it is a * simple reference to a column of a base table (or view). If it is not * a simple reference, these fields are zeroes. * * If resjunk is true then the column is a working column (such as a sort key) * that should be removed from the final output of the query. Resjunk columns * must have resnos that cannot duplicate any regular column's resno. Also * note that there are places that assume resjunk columns come after non-junk * columns. *-------------------- */ typedef struct TargetEntry { Expr xpr; Expr *expr; /* expression to evaluate */ AttrNumber resno; /* attribute number (see notes above) */ char *resname; /* name of the column (could be NULL) */ Index ressortgroupref;/* nonzero if referenced by a sort/group * clause */ Oid resorigtbl; /* OID of column's source table */ AttrNumber resorigcol; /* column's number in source table */ bool resjunk; /* set to true to eliminate the attribute from * final target list */ } TargetEntry; /* ---------------------------------------------------------------- * node types for join trees * * The leaves of a join tree structure are RangeTblRef nodes. Above * these, JoinExpr nodes can appear to denote a specific kind of join * or qualified join. Also, FromExpr nodes can appear to denote an * ordinary cross-product join ("FROM foo, bar, baz WHERE ..."). * FromExpr is like a JoinExpr of jointype JOIN_INNER, except that it * may have any number of child nodes, not just two. * * NOTE: the top level of a Query's jointree is always a FromExpr. * Even if the jointree contains no rels, there will be a FromExpr. * * NOTE: the qualification expressions present in JoinExpr nodes are * *in addition to* the query's main WHERE clause, which appears as the * qual of the top-level FromExpr. The reason for associating quals with * specific nodes in the jointree is that the position of a qual is critical * when outer joins are present. (If we enforce a qual too soon or too late, * that may cause the outer join to produce the wrong set of NULL-extended * rows.) If all joins are inner joins then all the qual positions are * semantically interchangeable. * * NOTE: in the raw output of gram.y, a join tree contains RangeVar, * RangeSubselect, and RangeFunction nodes, which are all replaced by * RangeTblRef nodes during the parse analysis phase. Also, the top-level * FromExpr is added during parse analysis; the grammar regards FROM and * WHERE as separate. * ---------------------------------------------------------------- */ /* * RangeTblRef - reference to an entry in the query's rangetable * * We could use direct pointers to the RT entries and skip having these * nodes, but multiple pointers to the same node in a querytree cause * lots of headaches, so it seems better to store an index into the RT. */ typedef struct RangeTblRef { NodeTag type; int rtindex; } RangeTblRef; /*---------- * JoinExpr - for SQL JOIN expressions * * isNatural, usingClause, and quals are interdependent. The user can write * only one of NATURAL, USING(), or ON() (this is enforced by the grammar). * If he writes NATURAL then parse analysis generates the equivalent USING() * list, and from that fills in "quals" with the right equality comparisons. * If he writes USING() then "quals" is filled with equality comparisons. * If he writes ON() then only "quals" is set. Note that NATURAL/USING * are not equivalent to ON() since they also affect the output column list. * * alias is an Alias node representing the AS alias-clause attached to the * join expression, or NULL if no clause. NB: presence or absence of the * alias has a critical impact on semantics, because a join with an alias * restricts visibility of the tables/columns inside it. * * During parse analysis, an RTE is created for the Join, and its index * is filled into rtindex. This RTE is present mainly so that Vars can * be created that refer to the outputs of the join. The planner sometimes * generates JoinExprs internally; these can have rtindex = 0 if there are * no join alias variables referencing such joins. *---------- */ typedef struct JoinExpr { NodeTag type; JoinType jointype; /* type of join */ bool isNatural; /* Natural join? Will need to shape table */ Node *larg; /* left subtree */ Node *rarg; /* right subtree */ List *usingClause; /* USING clause, if any (list of String) */ Node *quals; /* qualifiers on join, if any */ Alias *alias; /* user-written alias clause, if any */ int rtindex; /* RT index assigned for join, or 0 */ } JoinExpr; /*---------- * FromExpr - represents a FROM ... WHERE ... construct * * This is both more flexible than a JoinExpr (it can have any number of * children, including zero) and less so --- we don't need to deal with * aliases and so on. The output column set is implicitly just the union * of the outputs of the children. *---------- */ typedef struct FromExpr { NodeTag type; List *fromlist; /* List of join subtrees */ Node *quals; /* qualifiers on join, if any */ } FromExpr; #endif /* PRIMNODES_H */ PKBiZ server/nodes/readfuncs.hnu[/*------------------------------------------------------------------------- * * readfuncs.h * header file for read.c and readfuncs.c. These functions are internal * to the stringToNode interface and should not be used by anyone else. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/nodes/readfuncs.h * *------------------------------------------------------------------------- */ #ifndef READFUNCS_H #define READFUNCS_H #include "nodes/nodes.h" /* * prototypes for functions in read.c (the lisp token parser) */ extern char *pg_strtok(int *length); extern char *debackslash(char *token, int length); extern void *nodeRead(char *token, int tok_len); /* * prototypes for functions in readfuncs.c */ extern Node *parseNodeString(void); #endif /* READFUNCS_H */ PKBiZcserver/nodes/relation.hnu[/*------------------------------------------------------------------------- * * relation.h * Definitions for planner's internal data structures. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/nodes/relation.h * *------------------------------------------------------------------------- */ #ifndef RELATION_H #define RELATION_H #include "access/sdir.h" #include "nodes/params.h" #include "nodes/parsenodes.h" #include "storage/block.h" /* * Relids * Set of relation identifiers (indexes into the rangetable). */ typedef Bitmapset *Relids; /* * When looking for a "cheapest path", this enum specifies whether we want * cheapest startup cost or cheapest total cost. */ typedef enum CostSelector { STARTUP_COST, TOTAL_COST } CostSelector; /* * The cost estimate produced by cost_qual_eval() includes both a one-time * (startup) cost, and a per-tuple cost. */ typedef struct QualCost { Cost startup; /* one-time cost */ Cost per_tuple; /* per-evaluation cost */ } QualCost; /* * Costing aggregate function execution requires these statistics about * the aggregates to be executed by a given Agg node. Note that transCost * includes the execution costs of the aggregates' input expressions. */ typedef struct AggClauseCosts { int numAggs; /* total number of aggregate functions */ int numOrderedAggs; /* number that use DISTINCT or ORDER BY */ QualCost transCost; /* total per-input-row execution costs */ Cost finalCost; /* total costs of agg final functions */ Size transitionSpace; /* space for pass-by-ref transition data */ } AggClauseCosts; /*---------- * PlannerGlobal * Global information for planning/optimization * * PlannerGlobal holds state for an entire planner invocation; this state * is shared across all levels of sub-Queries that exist in the command being * planned. *---------- */ typedef struct PlannerGlobal { NodeTag type; ParamListInfo boundParams; /* Param values provided to planner() */ List *paramlist; /* unused, will be removed in 9.3 */ List *subplans; /* Plans for SubPlan nodes */ List *subroots; /* PlannerInfos for SubPlan nodes */ Bitmapset *rewindPlanIDs; /* indices of subplans that require REWIND */ List *finalrtable; /* "flat" rangetable for executor */ List *finalrowmarks; /* "flat" list of PlanRowMarks */ List *resultRelations; /* "flat" list of integer RT indexes */ List *relationOids; /* OIDs of relations the plan depends on */ List *invalItems; /* other dependencies, as PlanInvalItems */ Index lastPHId; /* highest PlaceHolderVar ID assigned */ Index lastRowMarkId; /* highest PlanRowMark ID assigned */ bool transientPlan; /* redo plan when TransactionXmin changes? */ /* Added post-release, will be in a saner place in 9.3: */ int nParamExec; /* number of PARAM_EXEC Params used */ } PlannerGlobal; /* macro for fetching the Plan associated with a SubPlan node */ #define planner_subplan_get_plan(root, subplan) \ ((Plan *) list_nth((root)->glob->subplans, (subplan)->plan_id - 1)) /*---------- * PlannerInfo * Per-query information for planning/optimization * * This struct is conventionally called "root" in all the planner routines. * It holds links to all of the planner's working state, in addition to the * original Query. Note that at present the planner extensively modifies * the passed-in Query data structure; someday that should stop. *---------- */ typedef struct PlannerInfo { NodeTag type; Query *parse; /* the Query being planned */ PlannerGlobal *glob; /* global info for current planner run */ Index query_level; /* 1 at the outermost Query */ struct PlannerInfo *parent_root; /* NULL at outermost Query */ /* * simple_rel_array holds pointers to "base rels" and "other rels" (see * comments for RelOptInfo for more info). It is indexed by rangetable * index (so entry 0 is always wasted). Entries can be NULL when an RTE * does not correspond to a base relation, such as a join RTE or an * unreferenced view RTE; or if the RelOptInfo hasn't been made yet. */ struct RelOptInfo **simple_rel_array; /* All 1-rel RelOptInfos */ int simple_rel_array_size; /* allocated size of array */ /* * simple_rte_array is the same length as simple_rel_array and holds * pointers to the associated rangetable entries. This lets us avoid * rt_fetch(), which can be a bit slow once large inheritance sets have * been expanded. */ RangeTblEntry **simple_rte_array; /* rangetable as an array */ /* * all_baserels is a Relids set of all base relids (but not "other" * relids) in the query; that is, the Relids identifier of the final join * we need to form. This is computed in make_one_rel, just before we * start making Paths. */ Relids all_baserels; /* * join_rel_list is a list of all join-relation RelOptInfos we have * considered in this planning run. For small problems we just scan the * list to do lookups, but when there are many join relations we build a * hash table for faster lookups. The hash table is present and valid * when join_rel_hash is not NULL. Note that we still maintain the list * even when using the hash table for lookups; this simplifies life for * GEQO. */ List *join_rel_list; /* list of join-relation RelOptInfos */ struct HTAB *join_rel_hash; /* optional hashtable for join relations */ /* * When doing a dynamic-programming-style join search, join_rel_level[k] * is a list of all join-relation RelOptInfos of level k, and * join_cur_level is the current level. New join-relation RelOptInfos are * automatically added to the join_rel_level[join_cur_level] list. * join_rel_level is NULL if not in use. */ List **join_rel_level; /* lists of join-relation RelOptInfos */ int join_cur_level; /* index of list being extended */ List *init_plans; /* init SubPlans for query */ List *cte_plan_ids; /* per-CTE-item list of subplan IDs */ List *eq_classes; /* list of active EquivalenceClasses */ List *canon_pathkeys; /* list of "canonical" PathKeys */ List *left_join_clauses; /* list of RestrictInfos for * mergejoinable outer join clauses * w/nonnullable var on left */ List *right_join_clauses; /* list of RestrictInfos for * mergejoinable outer join clauses * w/nonnullable var on right */ List *full_join_clauses; /* list of RestrictInfos for * mergejoinable full join clauses */ List *join_info_list; /* list of SpecialJoinInfos */ List *append_rel_list; /* list of AppendRelInfos */ List *rowMarks; /* list of PlanRowMarks */ List *placeholder_list; /* list of PlaceHolderInfos */ List *query_pathkeys; /* desired pathkeys for query_planner(), and * actual pathkeys after planning */ List *group_pathkeys; /* groupClause pathkeys, if any */ List *window_pathkeys; /* pathkeys of bottom window, if any */ List *distinct_pathkeys; /* distinctClause pathkeys, if any */ List *sort_pathkeys; /* sortClause pathkeys, if any */ List *minmax_aggs; /* List of MinMaxAggInfos */ List *initial_rels; /* RelOptInfos we are now trying to join */ MemoryContext planner_cxt; /* context holding PlannerInfo */ double total_table_pages; /* # of pages in all tables of query */ double tuple_fraction; /* tuple_fraction passed to query_planner */ double limit_tuples; /* limit_tuples passed to query_planner */ bool hasInheritedTarget; /* true if parse->resultRelation is an * inheritance child rel */ bool hasJoinRTEs; /* true if any RTEs are RTE_JOIN kind */ bool hasHavingQual; /* true if havingQual was non-null */ bool hasPseudoConstantQuals; /* true if any RestrictInfo has * pseudoconstant = true */ bool hasRecursion; /* true if planning a recursive WITH item */ /* These fields are used only when hasRecursion is true: */ int wt_param_id; /* PARAM_EXEC ID for the work table */ struct Plan *non_recursive_plan; /* plan for non-recursive term */ /* These fields are workspace for createplan.c */ Relids curOuterRels; /* outer rels above current node */ List *curOuterParams; /* not-yet-assigned NestLoopParams */ /* optional private data for join_search_hook, e.g., GEQO */ void *join_search_private; /* Added post-release, will be in a saner place in 9.3: */ List *plan_params; /* list of PlannerParamItems, see below */ /* This will be in a saner place in 9.4: */ Relids nullable_baserels; } PlannerInfo; /* * In places where it's known that simple_rte_array[] must have been prepared * already, we just index into it to fetch RTEs. In code that might be * executed before or after entering query_planner(), use this macro. */ #define planner_rt_fetch(rti, root) \ ((root)->simple_rte_array ? (root)->simple_rte_array[rti] : \ rt_fetch(rti, (root)->parse->rtable)) /*---------- * RelOptInfo * Per-relation information for planning/optimization * * For planning purposes, a "base rel" is either a plain relation (a table) * or the output of a sub-SELECT or function that appears in the range table. * In either case it is uniquely identified by an RT index. A "joinrel" * is the joining of two or more base rels. A joinrel is identified by * the set of RT indexes for its component baserels. We create RelOptInfo * nodes for each baserel and joinrel, and store them in the PlannerInfo's * simple_rel_array and join_rel_list respectively. * * Note that there is only one joinrel for any given set of component * baserels, no matter what order we assemble them in; so an unordered * set is the right datatype to identify it with. * * We also have "other rels", which are like base rels in that they refer to * single RT indexes; but they are not part of the join tree, and are given * a different RelOptKind to identify them. Lastly, there is a RelOptKind * for "dead" relations, which are base rels that we have proven we don't * need to join after all. * * Currently the only kind of otherrels are those made for member relations * of an "append relation", that is an inheritance set or UNION ALL subquery. * An append relation has a parent RTE that is a base rel, which represents * the entire append relation. The member RTEs are otherrels. The parent * is present in the query join tree but the members are not. The member * RTEs and otherrels are used to plan the scans of the individual tables or * subqueries of the append set; then the parent baserel is given Append * and/or MergeAppend paths comprising the best paths for the individual * member rels. (See comments for AppendRelInfo for more information.) * * At one time we also made otherrels to represent join RTEs, for use in * handling join alias Vars. Currently this is not needed because all join * alias Vars are expanded to non-aliased form during preprocess_expression. * * Parts of this data structure are specific to various scan and join * mechanisms. It didn't seem worth creating new node types for them. * * relids - Set of base-relation identifiers; it is a base relation * if there is just one, a join relation if more than one * rows - estimated number of tuples in the relation after restriction * clauses have been applied (ie, output rows of a plan for it) * width - avg. number of bytes per tuple in the relation after the * appropriate projections have been done (ie, output width) * reltargetlist - List of Var and PlaceHolderVar nodes for the values * we need to output from this relation. * List is in no particular order, but all rels of an * appendrel set must use corresponding orders. * NOTE: in a child relation, may contain RowExpr or * ConvertRowtypeExpr representing a whole-row Var. * pathlist - List of Path nodes, one for each potentially useful * method of generating the relation * ppilist - ParamPathInfo nodes for parameterized Paths, if any * cheapest_startup_path - the pathlist member with lowest startup cost * (regardless of its ordering; but must be * unparameterized) * cheapest_total_path - the pathlist member with lowest total cost * (regardless of its ordering; but must be * unparameterized) * cheapest_unique_path - for caching cheapest path to produce unique * (no duplicates) output from relation * cheapest_parameterized_paths - paths with cheapest total costs for * their parameterizations; always includes * cheapest_total_path * * If the relation is a base relation it will have these fields set: * * relid - RTE index (this is redundant with the relids field, but * is provided for convenience of access) * rtekind - distinguishes plain relation, subquery, or function RTE * min_attr, max_attr - range of valid AttrNumbers for rel * attr_needed - array of bitmapsets indicating the highest joinrel * in which each attribute is needed; if bit 0 is set then * the attribute is needed as part of final targetlist * attr_widths - cache space for per-attribute width estimates; * zero means not computed yet * indexlist - list of IndexOptInfo nodes for relation's indexes * (always NIL if it's not a table) * pages - number of disk pages in relation (zero if not a table) * tuples - number of tuples in relation (not considering restrictions) * allvisfrac - fraction of disk pages that are marked all-visible * subplan - plan for subquery (NULL if it's not a subquery) * subroot - PlannerInfo for subquery (NULL if it's not a subquery) * fdwroutine - function hooks for FDW, if foreign table (else NULL) * fdw_private - private state for FDW, if foreign table (else NULL) * * Note: for a subquery, tuples, subplan, subroot are not set immediately * upon creation of the RelOptInfo object; they are filled in when * set_subquery_pathlist processes the object. Likewise, fdwroutine * and fdw_private are filled during initial path creation. * * For otherrels that are appendrel members, these fields are filled * in just as for a baserel. * * The presence of the remaining fields depends on the restrictions * and joins that the relation participates in: * * baserestrictinfo - List of RestrictInfo nodes, containing info about * each non-join qualification clause in which this relation * participates (only used for base rels) * baserestrictcost - Estimated cost of evaluating the baserestrictinfo * clauses at a single tuple (only used for base rels) * joininfo - List of RestrictInfo nodes, containing info about each * join clause in which this relation participates (but * note this excludes clauses that might be derivable from * EquivalenceClasses) * has_eclass_joins - flag that EquivalenceClass joins are possible * * Note: Keeping a restrictinfo list in the RelOptInfo is useful only for * base rels, because for a join rel the set of clauses that are treated as * restrict clauses varies depending on which sub-relations we choose to join. * (For example, in a 3-base-rel join, a clause relating rels 1 and 2 must be * treated as a restrictclause if we join {1} and {2 3} to make {1 2 3}; but * if we join {1 2} and {3} then that clause will be a restrictclause in {1 2} * and should not be processed again at the level of {1 2 3}.) Therefore, * the restrictinfo list in the join case appears in individual JoinPaths * (field joinrestrictinfo), not in the parent relation. But it's OK for * the RelOptInfo to store the joininfo list, because that is the same * for a given rel no matter how we form it. * * We store baserestrictcost in the RelOptInfo (for base relations) because * we know we will need it at least once (to price the sequential scan) * and may need it multiple times to price index scans. *---------- */ typedef enum RelOptKind { RELOPT_BASEREL, RELOPT_JOINREL, RELOPT_OTHER_MEMBER_REL, RELOPT_DEADREL } RelOptKind; typedef struct RelOptInfo { NodeTag type; RelOptKind reloptkind; /* all relations included in this RelOptInfo */ Relids relids; /* set of base relids (rangetable indexes) */ /* size estimates generated by planner */ double rows; /* estimated number of result tuples */ int width; /* estimated avg width of result tuples */ /* materialization information */ List *reltargetlist; /* Vars to be output by scan of relation */ List *pathlist; /* Path structures */ List *ppilist; /* ParamPathInfos used in pathlist */ struct Path *cheapest_startup_path; struct Path *cheapest_total_path; struct Path *cheapest_unique_path; List *cheapest_parameterized_paths; /* information about a base rel (not set for join rels!) */ Index relid; Oid reltablespace; /* containing tablespace */ RTEKind rtekind; /* RELATION, SUBQUERY, or FUNCTION */ AttrNumber min_attr; /* smallest attrno of rel (often <0) */ AttrNumber max_attr; /* largest attrno of rel */ Relids *attr_needed; /* array indexed [min_attr .. max_attr] */ int32 *attr_widths; /* array indexed [min_attr .. max_attr] */ List *indexlist; /* list of IndexOptInfo */ BlockNumber pages; /* size estimates derived from pg_class */ double tuples; double allvisfrac; /* use "struct Plan" to avoid including plannodes.h here */ struct Plan *subplan; /* if subquery */ PlannerInfo *subroot; /* if subquery */ /* use "struct FdwRoutine" to avoid including fdwapi.h here */ struct FdwRoutine *fdwroutine; /* if foreign table */ void *fdw_private; /* if foreign table */ /* used by various scans and joins: */ List *baserestrictinfo; /* RestrictInfo structures (if base * rel) */ QualCost baserestrictcost; /* cost of evaluating the above */ List *joininfo; /* RestrictInfo structures for join clauses * involving this rel */ bool has_eclass_joins; /* T means joininfo is incomplete */ } RelOptInfo; /* * IndexOptInfo * Per-index information for planning/optimization * * indexkeys[], indexcollations[], opfamily[], and opcintype[] * each have ncolumns entries. * * sortopfamily[], reverse_sort[], and nulls_first[] likewise have * ncolumns entries, if the index is ordered; but if it is unordered, * those pointers are NULL. * * Zeroes in the indexkeys[] array indicate index columns that are * expressions; there is one element in indexprs for each such column. * * For an ordered index, reverse_sort[] and nulls_first[] describe the * sort ordering of a forward indexscan; we can also consider a backward * indexscan, which will generate the reverse ordering. * * The indexprs and indpred expressions have been run through * prepqual.c and eval_const_expressions() for ease of matching to * WHERE clauses. indpred is in implicit-AND form. * * indextlist is a TargetEntry list representing the index columns. * It provides an equivalent base-relation Var for each simple column, * and links to the matching indexprs element for each expression column. */ typedef struct IndexOptInfo { NodeTag type; Oid indexoid; /* OID of the index relation */ Oid reltablespace; /* tablespace of index (not table) */ RelOptInfo *rel; /* back-link to index's table */ /* statistics from pg_class */ BlockNumber pages; /* number of disk pages in index */ double tuples; /* number of index tuples in index */ /* index descriptor information */ int ncolumns; /* number of columns in index */ int *indexkeys; /* column numbers of index's keys, or 0 */ Oid *indexcollations; /* OIDs of collations of index columns */ Oid *opfamily; /* OIDs of operator families for columns */ Oid *opcintype; /* OIDs of opclass declared input data types */ Oid *sortopfamily; /* OIDs of btree opfamilies, if orderable */ bool *reverse_sort; /* is sort order descending? */ bool *nulls_first; /* do NULLs come first in the sort order? */ Oid relam; /* OID of the access method (in pg_am) */ RegProcedure amcostestimate; /* OID of the access method's cost fcn */ List *indexprs; /* expressions for non-simple index columns */ List *indpred; /* predicate if a partial index, else NIL */ List *indextlist; /* targetlist representing index columns */ bool predOK; /* true if predicate matches query */ bool unique; /* true if a unique index */ bool immediate; /* is uniqueness enforced immediately? */ bool hypothetical; /* true if index doesn't really exist */ bool canreturn; /* can index return IndexTuples? */ bool amcanorderbyop; /* does AM support order by operator result? */ bool amoptionalkey; /* can query omit key for the first column? */ bool amsearcharray; /* can AM handle ScalarArrayOpExpr quals? */ bool amsearchnulls; /* can AM search for NULL/NOT NULL entries? */ bool amhasgettuple; /* does AM have amgettuple interface? */ bool amhasgetbitmap; /* does AM have amgetbitmap interface? */ } IndexOptInfo; /* * EquivalenceClasses * * Whenever we can determine that a mergejoinable equality clause A = B is * not delayed by any outer join, we create an EquivalenceClass containing * the expressions A and B to record this knowledge. If we later find another * equivalence B = C, we add C to the existing EquivalenceClass; this may * require merging two existing EquivalenceClasses. At the end of the qual * distribution process, we have sets of values that are known all transitively * equal to each other, where "equal" is according to the rules of the btree * operator family(s) shown in ec_opfamilies, as well as the collation shown * by ec_collation. (We restrict an EC to contain only equalities whose * operators belong to the same set of opfamilies. This could probably be * relaxed, but for now it's not worth the trouble, since nearly all equality * operators belong to only one btree opclass anyway. Similarly, we suppose * that all or none of the input datatypes are collatable, so that a single * collation value is sufficient.) * * We also use EquivalenceClasses as the base structure for PathKeys, letting * us represent knowledge about different sort orderings being equivalent. * Since every PathKey must reference an EquivalenceClass, we will end up * with single-member EquivalenceClasses whenever a sort key expression has * not been equivalenced to anything else. It is also possible that such an * EquivalenceClass will contain a volatile expression ("ORDER BY random()"), * which is a case that can't arise otherwise since clauses containing * volatile functions are never considered mergejoinable. We mark such * EquivalenceClasses specially to prevent them from being merged with * ordinary EquivalenceClasses. Also, for volatile expressions we have * to be careful to match the EquivalenceClass to the correct targetlist * entry: consider SELECT random() AS a, random() AS b ... ORDER BY b,a. * So we record the SortGroupRef of the originating sort clause. * * We allow equality clauses appearing below the nullable side of an outer join * to form EquivalenceClasses, but these have a slightly different meaning: * the included values might be all NULL rather than all the same non-null * values. See src/backend/optimizer/README for more on that point. * * NB: if ec_merged isn't NULL, this class has been merged into another, and * should be ignored in favor of using the pointed-to class. */ typedef struct EquivalenceClass { NodeTag type; List *ec_opfamilies; /* btree operator family OIDs */ Oid ec_collation; /* collation, if datatypes are collatable */ List *ec_members; /* list of EquivalenceMembers */ List *ec_sources; /* list of generating RestrictInfos */ List *ec_derives; /* list of derived RestrictInfos */ Relids ec_relids; /* all relids appearing in ec_members */ bool ec_has_const; /* any pseudoconstants in ec_members? */ bool ec_has_volatile; /* the (sole) member is a volatile expr */ bool ec_below_outer_join; /* equivalence applies below an OJ */ bool ec_broken; /* failed to generate needed clauses? */ Index ec_sortref; /* originating sortclause label, or 0 */ struct EquivalenceClass *ec_merged; /* set if merged into another EC */ } EquivalenceClass; /* * If an EC contains a const and isn't below-outer-join, any PathKey depending * on it must be redundant, since there's only one possible value of the key. */ #define EC_MUST_BE_REDUNDANT(eclass) \ ((eclass)->ec_has_const && !(eclass)->ec_below_outer_join) /* * EquivalenceMember - one member expression of an EquivalenceClass * * em_is_child signifies that this element was built by transposing a member * for an appendrel parent relation to represent the corresponding expression * for an appendrel child. These members are used for determining the * pathkeys of scans on the child relation and for explicitly sorting the * child when necessary to build a MergeAppend path for the whole appendrel * tree. An em_is_child member has no impact on the properties of the EC as a * whole; in particular the EC's ec_relids field does NOT include the child * relation. An em_is_child member should never be marked em_is_const nor * cause ec_has_const or ec_has_volatile to be set, either. Thus, em_is_child * members are not really full-fledged members of the EC, but just reflections * or doppelgangers of real members. Most operations on EquivalenceClasses * should ignore em_is_child members, and those that don't should test * em_relids to make sure they only consider relevant members. * * em_datatype is usually the same as exprType(em_expr), but can be * different when dealing with a binary-compatible opfamily; in particular * anyarray_ops would never work without this. Use em_datatype when * looking up a specific btree operator to work with this expression. */ typedef struct EquivalenceMember { NodeTag type; Expr *em_expr; /* the expression represented */ Relids em_relids; /* all relids appearing in em_expr */ Relids em_nullable_relids; /* nullable by lower outer joins */ bool em_is_const; /* expression is pseudoconstant? */ bool em_is_child; /* derived version for a child relation? */ Oid em_datatype; /* the "nominal type" used by the opfamily */ } EquivalenceMember; /* * PathKeys * * The sort ordering of a path is represented by a list of PathKey nodes. * An empty list implies no known ordering. Otherwise the first item * represents the primary sort key, the second the first secondary sort key, * etc. The value being sorted is represented by linking to an * EquivalenceClass containing that value and including pk_opfamily among its * ec_opfamilies. The EquivalenceClass tells which collation to use, too. * This is a convenient method because it makes it trivial to detect * equivalent and closely-related orderings. (See optimizer/README for more * information.) * * Note: pk_strategy is either BTLessStrategyNumber (for ASC) or * BTGreaterStrategyNumber (for DESC). We assume that all ordering-capable * index types will use btree-compatible strategy numbers. */ typedef struct PathKey { NodeTag type; EquivalenceClass *pk_eclass; /* the value that is ordered */ Oid pk_opfamily; /* btree opfamily defining the ordering */ int pk_strategy; /* sort direction (ASC or DESC) */ bool pk_nulls_first; /* do NULLs come before normal values? */ } PathKey; /* * ParamPathInfo * * All parameterized paths for a given relation with given required outer rels * link to a single ParamPathInfo, which stores common information such as * the estimated rowcount for this parameterization. We do this partly to * avoid recalculations, but mostly to ensure that the estimated rowcount * is in fact the same for every such path. * * Note: ppi_clauses is only used in ParamPathInfos for base relation paths; * in join cases it's NIL because the set of relevant clauses varies depending * on how the join is formed. The relevant clauses will appear in each * parameterized join path's joinrestrictinfo list, instead. */ typedef struct ParamPathInfo { NodeTag type; Relids ppi_req_outer; /* rels supplying parameters used by path */ double ppi_rows; /* estimated number of result tuples */ List *ppi_clauses; /* join clauses available from outer rels */ } ParamPathInfo; /* * Type "Path" is used as-is for sequential-scan paths, as well as some other * simple plan types that we don't need any extra information in the path for. * For other path types it is the first component of a larger struct. * * "pathtype" is the NodeTag of the Plan node we could build from this Path. * It is partially redundant with the Path's NodeTag, but allows us to use * the same Path type for multiple Plan types when there is no need to * distinguish the Plan type during path processing. * * "param_info", if not NULL, links to a ParamPathInfo that identifies outer * relation(s) that provide parameter values to each scan of this path. * That means this path can only be joined to those rels by means of nestloop * joins with this path on the inside. Also note that a parameterized path * is responsible for testing all "movable" joinclauses involving this rel * and the specified outer rel(s). * * "rows" is the same as parent->rows in simple paths, but in parameterized * paths and UniquePaths it can be less than parent->rows, reflecting the * fact that we've filtered by extra join conditions or removed duplicates. * * "pathkeys" is a List of PathKey nodes (see above), describing the sort * ordering of the path's output rows. */ typedef struct Path { NodeTag type; NodeTag pathtype; /* tag identifying scan/join method */ RelOptInfo *parent; /* the relation this path can build */ ParamPathInfo *param_info; /* parameterization info, or NULL if none */ /* estimated size/costs for path (see costsize.c for more info) */ double rows; /* estimated number of result tuples */ Cost startup_cost; /* cost expended before fetching any tuples */ Cost total_cost; /* total cost (assuming all tuples fetched) */ List *pathkeys; /* sort ordering of path's output */ /* pathkeys is a List of PathKey nodes; see above */ } Path; /* Macro for extracting a path's parameterization relids; beware double eval */ #define PATH_REQ_OUTER(path) \ ((path)->param_info ? (path)->param_info->ppi_req_outer : (Relids) NULL) /*---------- * IndexPath represents an index scan over a single index. * * This struct is used for both regular indexscans and index-only scans; * path.pathtype is T_IndexScan or T_IndexOnlyScan to show which is meant. * * 'indexinfo' is the index to be scanned. * * 'indexclauses' is a list of index qualification clauses, with implicit * AND semantics across the list. Each clause is a RestrictInfo node from * the query's WHERE or JOIN conditions. An empty list implies a full * index scan. * * 'indexquals' has the same structure as 'indexclauses', but it contains * the actual index qual conditions that can be used with the index. * In simple cases this is identical to 'indexclauses', but when special * indexable operators appear in 'indexclauses', they are replaced by the * derived indexscannable conditions in 'indexquals'. * * 'indexqualcols' is an integer list of index column numbers (zero-based) * of the same length as 'indexquals', showing which index column each qual * is meant to be used with. 'indexquals' is required to be ordered by * index column, so 'indexqualcols' must form a nondecreasing sequence. * (The order of multiple quals for the same index column is unspecified.) * * 'indexorderbys', if not NIL, is a list of ORDER BY expressions that have * been found to be usable as ordering operators for an amcanorderbyop index. * The list must match the path's pathkeys, ie, one expression per pathkey * in the same order. These are not RestrictInfos, just bare expressions, * since they generally won't yield booleans. Also, unlike the case for * quals, it's guaranteed that each expression has the index key on the left * side of the operator. * * 'indexorderbycols' is an integer list of index column numbers (zero-based) * of the same length as 'indexorderbys', showing which index column each * ORDER BY expression is meant to be used with. (There is no restriction * on which index column each ORDER BY can be used with.) * * 'indexscandir' is one of: * ForwardScanDirection: forward scan of an ordered index * BackwardScanDirection: backward scan of an ordered index * NoMovementScanDirection: scan of an unordered index, or don't care * (The executor doesn't care whether it gets ForwardScanDirection or * NoMovementScanDirection for an indexscan, but the planner wants to * distinguish ordered from unordered indexes for building pathkeys.) * * 'indextotalcost' and 'indexselectivity' are saved in the IndexPath so that * we need not recompute them when considering using the same index in a * bitmap index/heap scan (see BitmapHeapPath). The costs of the IndexPath * itself represent the costs of an IndexScan or IndexOnlyScan plan type. *---------- */ typedef struct IndexPath { Path path; IndexOptInfo *indexinfo; List *indexclauses; List *indexquals; List *indexqualcols; List *indexorderbys; List *indexorderbycols; ScanDirection indexscandir; Cost indextotalcost; Selectivity indexselectivity; } IndexPath; /* * BitmapHeapPath represents one or more indexscans that generate TID bitmaps * instead of directly accessing the heap, followed by AND/OR combinations * to produce a single bitmap, followed by a heap scan that uses the bitmap. * Note that the output is always considered unordered, since it will come * out in physical heap order no matter what the underlying indexes did. * * The individual indexscans are represented by IndexPath nodes, and any * logic on top of them is represented by a tree of BitmapAndPath and * BitmapOrPath nodes. Notice that we can use the same IndexPath node both * to represent a regular (or index-only) index scan plan, and as the child * of a BitmapHeapPath that represents scanning the same index using a * BitmapIndexScan. The startup_cost and total_cost figures of an IndexPath * always represent the costs to use it as a regular (or index-only) * IndexScan. The costs of a BitmapIndexScan can be computed using the * IndexPath's indextotalcost and indexselectivity. */ typedef struct BitmapHeapPath { Path path; Path *bitmapqual; /* IndexPath, BitmapAndPath, BitmapOrPath */ } BitmapHeapPath; /* * BitmapAndPath represents a BitmapAnd plan node; it can only appear as * part of the substructure of a BitmapHeapPath. The Path structure is * a bit more heavyweight than we really need for this, but for simplicity * we make it a derivative of Path anyway. */ typedef struct BitmapAndPath { Path path; List *bitmapquals; /* IndexPaths and BitmapOrPaths */ Selectivity bitmapselectivity; } BitmapAndPath; /* * BitmapOrPath represents a BitmapOr plan node; it can only appear as * part of the substructure of a BitmapHeapPath. The Path structure is * a bit more heavyweight than we really need for this, but for simplicity * we make it a derivative of Path anyway. */ typedef struct BitmapOrPath { Path path; List *bitmapquals; /* IndexPaths and BitmapAndPaths */ Selectivity bitmapselectivity; } BitmapOrPath; /* * TidPath represents a scan by TID * * tidquals is an implicitly OR'ed list of qual expressions of the form * "CTID = pseudoconstant" or "CTID = ANY(pseudoconstant_array)". * Note they are bare expressions, not RestrictInfos. */ typedef struct TidPath { Path path; List *tidquals; /* qual(s) involving CTID = something */ } TidPath; /* * ForeignPath represents a potential scan of a foreign table * * fdw_private stores FDW private data about the scan. While fdw_private is * not actually touched by the core code during normal operations, it's * generally a good idea to use a representation that can be dumped by * nodeToString(), so that you can examine the structure during debugging * with tools like pprint(). */ typedef struct ForeignPath { Path path; List *fdw_private; } ForeignPath; /* * AppendPath represents an Append plan, ie, successive execution of * several member plans. * * Note: it is possible for "subpaths" to contain only one, or even no, * elements. These cases are optimized during create_append_plan. * In particular, an AppendPath with no subpaths is a "dummy" path that * is created to represent the case that a relation is provably empty. */ typedef struct AppendPath { Path path; List *subpaths; /* list of component Paths */ } AppendPath; #define IS_DUMMY_PATH(p) \ (IsA((p), AppendPath) && ((AppendPath *) (p))->subpaths == NIL) /* A relation that's been proven empty will have one path that is dummy */ #define IS_DUMMY_REL(r) \ ((r)->cheapest_total_path != NULL && \ IS_DUMMY_PATH((r)->cheapest_total_path)) /* * MergeAppendPath represents a MergeAppend plan, ie, the merging of sorted * results from several member plans to produce similarly-sorted output. */ typedef struct MergeAppendPath { Path path; List *subpaths; /* list of component Paths */ double limit_tuples; /* hard limit on output tuples, or -1 */ } MergeAppendPath; /* * ResultPath represents use of a Result plan node to compute a variable-free * targetlist with no underlying tables (a "SELECT expressions" query). * The query could have a WHERE clause, too, represented by "quals". * * Note that quals is a list of bare clauses, not RestrictInfos. */ typedef struct ResultPath { Path path; List *quals; } ResultPath; /* * MaterialPath represents use of a Material plan node, i.e., caching of * the output of its subpath. This is used when the subpath is expensive * and needs to be scanned repeatedly, or when we need mark/restore ability * and the subpath doesn't have it. */ typedef struct MaterialPath { Path path; Path *subpath; } MaterialPath; /* * UniquePath represents elimination of distinct rows from the output of * its subpath. * * This is unlike the other Path nodes in that it can actually generate * different plans: either hash-based or sort-based implementation, or a * no-op if the input path can be proven distinct already. The decision * is sufficiently localized that it's not worth having separate Path node * types. (Note: in the no-op case, we could eliminate the UniquePath node * entirely and just return the subpath; but it's convenient to have a * UniquePath in the path tree to signal upper-level routines that the input * is known distinct.) */ typedef enum { UNIQUE_PATH_NOOP, /* input is known unique already */ UNIQUE_PATH_HASH, /* use hashing */ UNIQUE_PATH_SORT /* use sorting */ } UniquePathMethod; typedef struct UniquePath { Path path; Path *subpath; UniquePathMethod umethod; List *in_operators; /* equality operators of the IN clause */ List *uniq_exprs; /* expressions to be made unique */ } UniquePath; /* * All join-type paths share these fields. */ typedef struct JoinPath { Path path; JoinType jointype; Path *outerjoinpath; /* path for the outer side of the join */ Path *innerjoinpath; /* path for the inner side of the join */ List *joinrestrictinfo; /* RestrictInfos to apply to join */ /* * See the notes for RelOptInfo and ParamPathInfo to understand why * joinrestrictinfo is needed in JoinPath, and can't be merged into the * parent RelOptInfo. */ } JoinPath; /* * A nested-loop path needs no special fields. */ typedef JoinPath NestPath; /* * A mergejoin path has these fields. * * Unlike other path types, a MergePath node doesn't represent just a single * run-time plan node: it can represent up to four. Aside from the MergeJoin * node itself, there can be a Sort node for the outer input, a Sort node * for the inner input, and/or a Material node for the inner input. We could * represent these nodes by separate path nodes, but considering how many * different merge paths are investigated during a complex join problem, * it seems better to avoid unnecessary palloc overhead. * * path_mergeclauses lists the clauses (in the form of RestrictInfos) * that will be used in the merge. * * Note that the mergeclauses are a subset of the parent relation's * restriction-clause list. Any join clauses that are not mergejoinable * appear only in the parent's restrict list, and must be checked by a * qpqual at execution time. * * outersortkeys (resp. innersortkeys) is NIL if the outer path * (resp. inner path) is already ordered appropriately for the * mergejoin. If it is not NIL then it is a PathKeys list describing * the ordering that must be created by an explicit Sort node. * * materialize_inner is TRUE if a Material node should be placed atop the * inner input. This may appear with or without an inner Sort step. */ typedef struct MergePath { JoinPath jpath; List *path_mergeclauses; /* join clauses to be used for merge */ List *outersortkeys; /* keys for explicit sort, if any */ List *innersortkeys; /* keys for explicit sort, if any */ bool materialize_inner; /* add Materialize to inner? */ } MergePath; /* * A hashjoin path has these fields. * * The remarks above for mergeclauses apply for hashclauses as well. * * Hashjoin does not care what order its inputs appear in, so we have * no need for sortkeys. */ typedef struct HashPath { JoinPath jpath; List *path_hashclauses; /* join clauses used for hashing */ int num_batches; /* number of batches expected */ } HashPath; /* * Restriction clause info. * * We create one of these for each AND sub-clause of a restriction condition * (WHERE or JOIN/ON clause). Since the restriction clauses are logically * ANDed, we can use any one of them or any subset of them to filter out * tuples, without having to evaluate the rest. The RestrictInfo node itself * stores data used by the optimizer while choosing the best query plan. * * If a restriction clause references a single base relation, it will appear * in the baserestrictinfo list of the RelOptInfo for that base rel. * * If a restriction clause references more than one base rel, it will * appear in the joininfo list of every RelOptInfo that describes a strict * subset of the base rels mentioned in the clause. The joininfo lists are * used to drive join tree building by selecting plausible join candidates. * The clause cannot actually be applied until we have built a join rel * containing all the base rels it references, however. * * When we construct a join rel that includes all the base rels referenced * in a multi-relation restriction clause, we place that clause into the * joinrestrictinfo lists of paths for the join rel, if neither left nor * right sub-path includes all base rels referenced in the clause. The clause * will be applied at that join level, and will not propagate any further up * the join tree. (Note: the "predicate migration" code was once intended to * push restriction clauses up and down the plan tree based on evaluation * costs, but it's dead code and is unlikely to be resurrected in the * foreseeable future.) * * Note that in the presence of more than two rels, a multi-rel restriction * might reach different heights in the join tree depending on the join * sequence we use. So, these clauses cannot be associated directly with * the join RelOptInfo, but must be kept track of on a per-join-path basis. * * RestrictInfos that represent equivalence conditions (i.e., mergejoinable * equalities that are not outerjoin-delayed) are handled a bit differently. * Initially we attach them to the EquivalenceClasses that are derived from * them. When we construct a scan or join path, we look through all the * EquivalenceClasses and generate derived RestrictInfos representing the * minimal set of conditions that need to be checked for this particular scan * or join to enforce that all members of each EquivalenceClass are in fact * equal in all rows emitted by the scan or join. * * When dealing with outer joins we have to be very careful about pushing qual * clauses up and down the tree. An outer join's own JOIN/ON conditions must * be evaluated exactly at that join node, unless they are "degenerate" * conditions that reference only Vars from the nullable side of the join. * Quals appearing in WHERE or in a JOIN above the outer join cannot be pushed * down below the outer join, if they reference any nullable Vars. * RestrictInfo nodes contain a flag to indicate whether a qual has been * pushed down to a lower level than its original syntactic placement in the * join tree would suggest. If an outer join prevents us from pushing a qual * down to its "natural" semantic level (the level associated with just the * base rels used in the qual) then we mark the qual with a "required_relids" * value including more than just the base rels it actually uses. By * pretending that the qual references all the rels required to form the outer * join, we prevent it from being evaluated below the outer join's joinrel. * When we do form the outer join's joinrel, we still need to distinguish * those quals that are actually in that join's JOIN/ON condition from those * that appeared elsewhere in the tree and were pushed down to the join rel * because they used no other rels. That's what the is_pushed_down flag is * for; it tells us that a qual is not an OUTER JOIN qual for the set of base * rels listed in required_relids. A clause that originally came from WHERE * or an INNER JOIN condition will *always* have its is_pushed_down flag set. * It's possible for an OUTER JOIN clause to be marked is_pushed_down too, * if we decide that it can be pushed down into the nullable side of the join. * In that case it acts as a plain filter qual for wherever it gets evaluated. * (In short, is_pushed_down is only false for non-degenerate outer join * conditions. Possibly we should rename it to reflect that meaning?) * * RestrictInfo nodes also contain an outerjoin_delayed flag, which is true * if the clause's applicability must be delayed due to any outer joins * appearing below it (ie, it has to be postponed to some join level higher * than the set of relations it actually references). * * There is also an outer_relids field, which is NULL except for outer join * clauses; for those, it is the set of relids on the outer side of the * clause's outer join. (These are rels that the clause cannot be applied to * in parameterized scans, since pushing it into the join's outer side would * lead to wrong answers.) * * There is also a nullable_relids field, which is the set of rels the clause * references that can be forced null by some outer join below the clause. * * outerjoin_delayed = true is subtly different from nullable_relids != NULL: * a clause might reference some nullable rels and yet not be * outerjoin_delayed because it also references all the other rels of the * outer join(s). A clause that is not outerjoin_delayed can be enforced * anywhere it is computable. * * In general, the referenced clause might be arbitrarily complex. The * kinds of clauses we can handle as indexscan quals, mergejoin clauses, * or hashjoin clauses are limited (e.g., no volatile functions). The code * for each kind of path is responsible for identifying the restrict clauses * it can use and ignoring the rest. Clauses not implemented by an indexscan, * mergejoin, or hashjoin will be placed in the plan qual or joinqual field * of the finished Plan node, where they will be enforced by general-purpose * qual-expression-evaluation code. (But we are still entitled to count * their selectivity when estimating the result tuple count, if we * can guess what it is...) * * When the referenced clause is an OR clause, we generate a modified copy * in which additional RestrictInfo nodes are inserted below the top-level * OR/AND structure. This is a convenience for OR indexscan processing: * indexquals taken from either the top level or an OR subclause will have * associated RestrictInfo nodes. * * The can_join flag is set true if the clause looks potentially useful as * a merge or hash join clause, that is if it is a binary opclause with * nonoverlapping sets of relids referenced in the left and right sides. * (Whether the operator is actually merge or hash joinable isn't checked, * however.) * * The pseudoconstant flag is set true if the clause contains no Vars of * the current query level and no volatile functions. Such a clause can be * pulled out and used as a one-time qual in a gating Result node. We keep * pseudoconstant clauses in the same lists as other RestrictInfos so that * the regular clause-pushing machinery can assign them to the correct join * level, but they need to be treated specially for cost and selectivity * estimates. Note that a pseudoconstant clause can never be an indexqual * or merge or hash join clause, so it's of no interest to large parts of * the planner. * * When join clauses are generated from EquivalenceClasses, there may be * several equally valid ways to enforce join equivalence, of which we need * apply only one. We mark clauses of this kind by setting parent_ec to * point to the generating EquivalenceClass. Multiple clauses with the same * parent_ec in the same join are redundant. */ typedef struct RestrictInfo { NodeTag type; Expr *clause; /* the represented clause of WHERE or JOIN */ bool is_pushed_down; /* TRUE if clause was pushed down in level */ bool outerjoin_delayed; /* TRUE if delayed by lower outer join */ bool can_join; /* see comment above */ bool pseudoconstant; /* see comment above */ /* The set of relids (varnos) actually referenced in the clause: */ Relids clause_relids; /* The set of relids required to evaluate the clause: */ Relids required_relids; /* If an outer-join clause, the outer-side relations, else NULL: */ Relids outer_relids; /* The relids used in the clause that are nullable by lower outer joins: */ Relids nullable_relids; /* These fields are set for any binary opclause: */ Relids left_relids; /* relids in left side of clause */ Relids right_relids; /* relids in right side of clause */ /* This field is NULL unless clause is an OR clause: */ Expr *orclause; /* modified clause with RestrictInfos */ /* This field is NULL unless clause is potentially redundant: */ EquivalenceClass *parent_ec; /* generating EquivalenceClass */ /* cache space for cost and selectivity */ QualCost eval_cost; /* eval cost of clause; -1 if not yet set */ Selectivity norm_selec; /* selectivity for "normal" (JOIN_INNER) * semantics; -1 if not yet set; >1 means a * redundant clause */ Selectivity outer_selec; /* selectivity for outer join semantics; -1 if * not yet set */ /* valid if clause is mergejoinable, else NIL */ List *mergeopfamilies; /* opfamilies containing clause operator */ /* cache space for mergeclause processing; NULL if not yet set */ EquivalenceClass *left_ec; /* EquivalenceClass containing lefthand */ EquivalenceClass *right_ec; /* EquivalenceClass containing righthand */ EquivalenceMember *left_em; /* EquivalenceMember for lefthand */ EquivalenceMember *right_em; /* EquivalenceMember for righthand */ List *scansel_cache; /* list of MergeScanSelCache structs */ /* transient workspace for use while considering a specific join path */ bool outer_is_left; /* T = outer var on left, F = on right */ /* valid if clause is hashjoinable, else InvalidOid: */ Oid hashjoinoperator; /* copy of clause operator */ /* cache space for hashclause processing; -1 if not yet set */ Selectivity left_bucketsize; /* avg bucketsize of left side */ Selectivity right_bucketsize; /* avg bucketsize of right side */ } RestrictInfo; /* * Since mergejoinscansel() is a relatively expensive function, and would * otherwise be invoked many times while planning a large join tree, * we go out of our way to cache its results. Each mergejoinable * RestrictInfo carries a list of the specific sort orderings that have * been considered for use with it, and the resulting selectivities. */ typedef struct MergeScanSelCache { /* Ordering details (cache lookup key) */ Oid opfamily; /* btree opfamily defining the ordering */ Oid collation; /* collation for the ordering */ int strategy; /* sort direction (ASC or DESC) */ bool nulls_first; /* do NULLs come before normal values? */ /* Results */ Selectivity leftstartsel; /* first-join fraction for clause left side */ Selectivity leftendsel; /* last-join fraction for clause left side */ Selectivity rightstartsel; /* first-join fraction for clause right side */ Selectivity rightendsel; /* last-join fraction for clause right side */ } MergeScanSelCache; /* * Placeholder node for an expression to be evaluated below the top level * of a plan tree. This is used during planning to represent the contained * expression. At the end of the planning process it is replaced by either * the contained expression or a Var referring to a lower-level evaluation of * the contained expression. Typically the evaluation occurs below an outer * join, and Var references above the outer join might thereby yield NULL * instead of the expression value. * * Although the planner treats this as an expression node type, it is not * recognized by the parser or executor, so we declare it here rather than * in primnodes.h. */ typedef struct PlaceHolderVar { Expr xpr; Expr *phexpr; /* the represented expression */ Relids phrels; /* base relids syntactically within expr src */ Index phid; /* ID for PHV (unique within planner run) */ Index phlevelsup; /* > 0 if PHV belongs to outer query */ } PlaceHolderVar; /* * "Special join" info. * * One-sided outer joins constrain the order of joining partially but not * completely. We flatten such joins into the planner's top-level list of * relations to join, but record information about each outer join in a * SpecialJoinInfo struct. These structs are kept in the PlannerInfo node's * join_info_list. * * Similarly, semijoins and antijoins created by flattening IN (subselect) * and EXISTS(subselect) clauses create partial constraints on join order. * These are likewise recorded in SpecialJoinInfo structs. * * We make SpecialJoinInfos for FULL JOINs even though there is no flexibility * of planning for them, because this simplifies make_join_rel()'s API. * * min_lefthand and min_righthand are the sets of base relids that must be * available on each side when performing the special join. lhs_strict is * true if the special join's condition cannot succeed when the LHS variables * are all NULL (this means that an outer join can commute with upper-level * outer joins even if it appears in their RHS). We don't bother to set * lhs_strict for FULL JOINs, however. * * It is not valid for either min_lefthand or min_righthand to be empty sets; * if they were, this would break the logic that enforces join order. * * syn_lefthand and syn_righthand are the sets of base relids that are * syntactically below this special join. (These are needed to help compute * min_lefthand and min_righthand for higher joins.) * * delay_upper_joins is set TRUE if we detect a pushed-down clause that has * to be evaluated after this join is formed (because it references the RHS). * Any outer joins that have such a clause and this join in their RHS cannot * commute with this join, because that would leave noplace to check the * pushed-down clause. (We don't track this for FULL JOINs, either.) * * join_quals is an implicit-AND list of the quals syntactically associated * with the join (they may or may not end up being applied at the join level). * This is just a side list and does not drive actual application of quals. * For JOIN_SEMI joins, this is cleared to NIL in create_unique_path() if * the join is found not to be suitable for a uniqueify-the-RHS plan. * * jointype is never JOIN_RIGHT; a RIGHT JOIN is handled by switching * the inputs to make it a LEFT JOIN. So the allowed values of jointype * in a join_info_list member are only LEFT, FULL, SEMI, or ANTI. * * For purposes of join selectivity estimation, we create transient * SpecialJoinInfo structures for regular inner joins; so it is possible * to have jointype == JOIN_INNER in such a structure, even though this is * not allowed within join_info_list. We also create transient * SpecialJoinInfos with jointype == JOIN_INNER for outer joins, since for * cost estimation purposes it is sometimes useful to know the join size under * plain innerjoin semantics. Note that lhs_strict, delay_upper_joins, and * join_quals are not set meaningfully within such structs. */ typedef struct SpecialJoinInfo { NodeTag type; Relids min_lefthand; /* base relids in minimum LHS for join */ Relids min_righthand; /* base relids in minimum RHS for join */ Relids syn_lefthand; /* base relids syntactically within LHS */ Relids syn_righthand; /* base relids syntactically within RHS */ JoinType jointype; /* always INNER, LEFT, FULL, SEMI, or ANTI */ bool lhs_strict; /* joinclause is strict for some LHS rel */ bool delay_upper_joins; /* can't commute with upper RHS */ List *join_quals; /* join quals, in implicit-AND list format */ } SpecialJoinInfo; /* * Append-relation info. * * When we expand an inheritable table or a UNION-ALL subselect into an * "append relation" (essentially, a list of child RTEs), we build an * AppendRelInfo for each child RTE. The list of AppendRelInfos indicates * which child RTEs must be included when expanding the parent, and each * node carries information needed to translate Vars referencing the parent * into Vars referencing that child. * * These structs are kept in the PlannerInfo node's append_rel_list. * Note that we just throw all the structs into one list, and scan the * whole list when desiring to expand any one parent. We could have used * a more complex data structure (eg, one list per parent), but this would * be harder to update during operations such as pulling up subqueries, * and not really any easier to scan. Considering that typical queries * will not have many different append parents, it doesn't seem worthwhile * to complicate things. * * Note: after completion of the planner prep phase, any given RTE is an * append parent having entries in append_rel_list if and only if its * "inh" flag is set. We clear "inh" for plain tables that turn out not * to have inheritance children, and (in an abuse of the original meaning * of the flag) we set "inh" for subquery RTEs that turn out to be * flattenable UNION ALL queries. This lets us avoid useless searches * of append_rel_list. * * Note: the data structure assumes that append-rel members are single * baserels. This is OK for inheritance, but it prevents us from pulling * up a UNION ALL member subquery if it contains a join. While that could * be fixed with a more complex data structure, at present there's not much * point because no improvement in the plan could result. */ typedef struct AppendRelInfo { NodeTag type; /* * These fields uniquely identify this append relationship. There can be * (in fact, always should be) multiple AppendRelInfos for the same * parent_relid, but never more than one per child_relid, since a given * RTE cannot be a child of more than one append parent. */ Index parent_relid; /* RT index of append parent rel */ Index child_relid; /* RT index of append child rel */ /* * For an inheritance appendrel, the parent and child are both regular * relations, and we store their rowtype OIDs here for use in translating * whole-row Vars. For a UNION-ALL appendrel, the parent and child are * both subqueries with no named rowtype, and we store InvalidOid here. */ Oid parent_reltype; /* OID of parent's composite type */ Oid child_reltype; /* OID of child's composite type */ /* * The N'th element of this list is a Var or expression representing the * child column corresponding to the N'th column of the parent. This is * used to translate Vars referencing the parent rel into references to * the child. A list element is NULL if it corresponds to a dropped * column of the parent (this is only possible for inheritance cases, not * UNION ALL). The list elements are always simple Vars for inheritance * cases, but can be arbitrary expressions in UNION ALL cases. * * Notice we only store entries for user columns (attno > 0). Whole-row * Vars are special-cased, and system columns (attno < 0) need no special * translation since their attnos are the same for all tables. * * Caution: the Vars have varlevelsup = 0. Be careful to adjust as needed * when copying into a subquery. */ List *translated_vars; /* Expressions in the child's Vars */ /* * We store the parent table's OID here for inheritance, or InvalidOid for * UNION ALL. This is only needed to help in generating error messages if * an attempt is made to reference a dropped parent column. */ Oid parent_reloid; /* OID of parent relation */ } AppendRelInfo; /* * For each distinct placeholder expression generated during planning, we * store a PlaceHolderInfo node in the PlannerInfo node's placeholder_list. * This stores info that is needed centrally rather than in each copy of the * PlaceHolderVar. The phid fields identify which PlaceHolderInfo goes with * each PlaceHolderVar. Note that phid is unique throughout a planner run, * not just within a query level --- this is so that we need not reassign ID's * when pulling a subquery into its parent. * * The idea is to evaluate the expression at (only) the ph_eval_at join level, * then allow it to bubble up like a Var until the ph_needed join level. * ph_needed has the same definition as attr_needed for a regular Var. * * ph_may_need is an initial estimate of ph_needed, formed using the * syntactic locations of references to the PHV. We need this in order to * determine whether the PHV reference forces a join ordering constraint: * if the PHV has to be evaluated below the nullable side of an outer join, * and then used above that outer join, we must constrain join order to ensure * there's a valid place to evaluate the PHV below the join. The final * actual ph_needed level might be lower than ph_may_need, but we can't * determine that until later on. Fortunately this doesn't matter for what * we need ph_may_need for: if there's a PHV reference syntactically * above the outer join, it's not going to be allowed to drop below the outer * join, so we would come to the same conclusions about join order even if * we had the final ph_needed value to compare to. * * We create a PlaceHolderInfo only after determining that the PlaceHolderVar * is actually referenced in the plan tree, so that unreferenced placeholders * don't result in unnecessary constraints on join order. */ typedef struct PlaceHolderInfo { NodeTag type; Index phid; /* ID for PH (unique within planner run) */ PlaceHolderVar *ph_var; /* copy of PlaceHolderVar tree */ Relids ph_eval_at; /* lowest level we can evaluate value at */ Relids ph_needed; /* highest level the value is needed at */ Relids ph_may_need; /* highest level it might be needed at */ int32 ph_width; /* estimated attribute width */ } PlaceHolderInfo; /* * For each potentially index-optimizable MIN/MAX aggregate function, * root->minmax_aggs stores a MinMaxAggInfo describing it. */ typedef struct MinMaxAggInfo { NodeTag type; Oid aggfnoid; /* pg_proc Oid of the aggregate */ Oid aggsortop; /* Oid of its sort operator */ Expr *target; /* expression we are aggregating on */ PlannerInfo *subroot; /* modified "root" for planning the subquery */ Path *path; /* access path for subquery */ Cost pathcost; /* estimated cost to fetch first row */ Param *param; /* param for subplan's output */ } MinMaxAggInfo; /* * At runtime, PARAM_EXEC slots are used to pass values around from one plan * node to another. They can be used to pass values down into subqueries (for * outer references in subqueries), or up out of subqueries (for the results * of a subplan), or from a NestLoop plan node into its inner relation (when * the inner scan is parameterized with values from the outer relation). * The planner is responsible for assigning nonconflicting PARAM_EXEC IDs to * the PARAM_EXEC Params it generates. * * Outer references are managed via root->plan_params, which is a list of * PlannerParamItems. While planning a subquery, each parent query level's * plan_params contains the values required from it by the current subquery. * During create_plan(), we use plan_params to track values that must be * passed from outer to inner sides of NestLoop plan nodes. * * The item a PlannerParamItem represents can be one of three kinds: * * A Var: the slot represents a variable of this level that must be passed * down because subqueries have outer references to it, or must be passed * from a NestLoop node to its inner scan. The varlevelsup value in the Var * will always be zero. * * A PlaceHolderVar: this works much like the Var case, except that the * entry is a PlaceHolderVar node with a contained expression. The PHV * will have phlevelsup = 0, and the contained expression is adjusted * to match in level. * * An Aggref (with an expression tree representing its argument): the slot * represents an aggregate expression that is an outer reference for some * subquery. The Aggref itself has agglevelsup = 0, and its argument tree * is adjusted to match in level. * * Note: we detect duplicate Var and PlaceHolderVar parameters and coalesce * them into one slot, but we do not bother to do that for Aggrefs. * The scope of duplicate-elimination only extends across the set of * parameters passed from one query level into a single subquery, or for * nestloop parameters across the set of nestloop parameters used in a single * query level. So there is no possibility of a PARAM_EXEC slot being used * for conflicting purposes. * * In addition, PARAM_EXEC slots are assigned for Params representing outputs * from subplans (values that are setParam items for those subplans). These * IDs need not be tracked via PlannerParamItems, since we do not need any * duplicate-elimination nor later processing of the represented expressions. * Instead, we just record the assignment of the slot number by incrementing * root->glob->nParamExec. */ typedef struct PlannerParamItem { NodeTag type; Node *item; /* the Var, PlaceHolderVar, or Aggref */ int paramId; /* its assigned PARAM_EXEC slot number */ } PlannerParamItem; /* * When making cost estimates for a SEMI or ANTI join, there are some * correction factors that are needed in both nestloop and hash joins * to account for the fact that the executor can stop scanning inner rows * as soon as it finds a match to the current outer row. These numbers * depend only on the selected outer and inner join relations, not on the * particular paths used for them, so it's worthwhile to calculate them * just once per relation pair not once per considered path. This struct * is filled by compute_semi_anti_join_factors and must be passed along * to the join cost estimation functions. * * outer_match_frac is the fraction of the outer tuples that are * expected to have at least one match. * match_count is the average number of matches expected for * outer tuples that have at least one match. */ typedef struct SemiAntiJoinFactors { Selectivity outer_match_frac; Selectivity match_count; } SemiAntiJoinFactors; /* * For speed reasons, cost estimation for join paths is performed in two * phases: the first phase tries to quickly derive a lower bound for the * join cost, and then we check if that's sufficient to reject the path. * If not, we come back for a more refined cost estimate. The first phase * fills a JoinCostWorkspace struct with its preliminary cost estimates * and possibly additional intermediate values. The second phase takes * these values as inputs to avoid repeating work. * * (Ideally we'd declare this in cost.h, but it's also needed in pathnode.h, * so seems best to put it here.) */ typedef struct JoinCostWorkspace { /* Preliminary cost estimates --- must not be larger than final ones! */ Cost startup_cost; /* cost expended before fetching any tuples */ Cost total_cost; /* total cost (assuming all tuples fetched) */ /* Fields below here should be treated as private to costsize.c */ Cost run_cost; /* non-startup cost components */ /* private for cost_nestloop code */ Cost inner_rescan_run_cost; double outer_matched_rows; Selectivity inner_scan_frac; /* private for cost_mergejoin code */ Cost inner_run_cost; double outer_rows; double inner_rows; double outer_skip_rows; double inner_skip_rows; /* private for cost_hashjoin code */ int numbuckets; int numbatches; } JoinCostWorkspace; #endif /* RELATION_H */ PKBiZ..server/nodes/print.hnu[/*------------------------------------------------------------------------- * * print.h * definitions for nodes/print.c * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/nodes/print.h * *------------------------------------------------------------------------- */ #ifndef PRINT_H #define PRINT_H #include "executor/tuptable.h" #define nodeDisplay(x) pprint(x) extern void print(const void *obj); extern void pprint(const void *obj); extern void elog_node_display(int lev, const char *title, const void *obj, bool pretty); extern char *format_node_dump(const char *dump); extern char *pretty_format_node_dump(const char *dump); extern void print_rt(const List *rtable); extern void print_expr(const Node *expr, const List *rtable); extern void print_pathkeys(const List *pathkeys, const List *rtable); extern void print_tl(const List *tlist, const List *rtable); extern void print_slot(TupleTableSlot *slot); #endif /* PRINT_H */ PKBiZ9Z6 6 server/nodes/memnodes.hnu[/*------------------------------------------------------------------------- * * memnodes.h * POSTGRES memory context node definitions. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/nodes/memnodes.h * *------------------------------------------------------------------------- */ #ifndef MEMNODES_H #define MEMNODES_H #include "nodes/nodes.h" /* * MemoryContext * A logical context in which memory allocations occur. * * MemoryContext itself is an abstract type that can have multiple * implementations, though for now we have only AllocSetContext. * The function pointers in MemoryContextMethods define one specific * implementation of MemoryContext --- they are a virtual function table * in C++ terms. * * Node types that are actual implementations of memory contexts must * begin with the same fields as MemoryContext. * * Note: for largely historical reasons, typedef MemoryContext is a pointer * to the context struct rather than the struct type itself. */ typedef struct MemoryContextMethods { void *(*alloc) (MemoryContext context, Size size); /* call this free_p in case someone #define's free() */ void (*free_p) (MemoryContext context, void *pointer); void *(*realloc) (MemoryContext context, void *pointer, Size size); void (*init) (MemoryContext context); void (*reset) (MemoryContext context); void (*delete_context) (MemoryContext context); Size (*get_chunk_space) (MemoryContext context, void *pointer); bool (*is_empty) (MemoryContext context); void (*stats) (MemoryContext context, int level); #ifdef MEMORY_CONTEXT_CHECKING void (*check) (MemoryContext context); #endif } MemoryContextMethods; typedef struct MemoryContextData { NodeTag type; /* identifies exact kind of context */ MemoryContextMethods *methods; /* virtual function table */ MemoryContext parent; /* NULL if no parent (toplevel context) */ MemoryContext firstchild; /* head of linked list of children */ MemoryContext nextchild; /* next child of same parent */ char *name; /* context name (just for debugging) */ bool isReset; /* T = no space alloced since last reset */ } MemoryContextData; /* utils/palloc.h contains typedef struct MemoryContextData *MemoryContext */ /* * MemoryContextIsValid * True iff memory context is valid. * * Add new context types to the set accepted by this macro. */ #define MemoryContextIsValid(context) \ ((context) != NULL && \ (IsA((context), AllocSetContext))) #endif /* MEMNODES_H */ PKBiZn9Bserver/nodes/replnodes.hnu[/*------------------------------------------------------------------------- * * replnodes.h * definitions for replication grammar parse nodes * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/nodes/replnodes.h * *------------------------------------------------------------------------- */ #ifndef REPLNODES_H #define REPLNODES_H #include "access/xlogdefs.h" #include "nodes/pg_list.h" /* ---------------------- * IDENTIFY_SYSTEM command * ---------------------- */ typedef struct IdentifySystemCmd { NodeTag type; } IdentifySystemCmd; /* ---------------------- * BASE_BACKUP command * ---------------------- */ typedef struct BaseBackupCmd { NodeTag type; List *options; } BaseBackupCmd; /* ---------------------- * START_REPLICATION command * ---------------------- */ typedef struct StartReplicationCmd { NodeTag type; XLogRecPtr startpoint; } StartReplicationCmd; #endif /* REPLNODES_H */ PKBiZ^A"server/executor/nodeSubqueryscan.hnu[/*------------------------------------------------------------------------- * * nodeSubqueryscan.h * * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/nodeSubqueryscan.h * *------------------------------------------------------------------------- */ #ifndef NODESUBQUERYSCAN_H #define NODESUBQUERYSCAN_H #include "nodes/execnodes.h" extern SubqueryScanState *ExecInitSubqueryScan(SubqueryScan *node, EState *estate, int eflags); extern TupleTableSlot *ExecSubqueryScan(SubqueryScanState *node); extern void ExecEndSubqueryScan(SubqueryScanState *node); extern void ExecReScanSubqueryScan(SubqueryScanState *node); #endif /* NODESUBQUERYSCAN_H */ PKBiZkserver/executor/nodeHash.hnu[/*------------------------------------------------------------------------- * * nodeHash.h * prototypes for nodeHash.c * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/nodeHash.h * *------------------------------------------------------------------------- */ #ifndef NODEHASH_H #define NODEHASH_H #include "nodes/execnodes.h" extern HashState *ExecInitHash(Hash *node, EState *estate, int eflags); extern TupleTableSlot *ExecHash(HashState *node); extern Node *MultiExecHash(HashState *node); extern void ExecEndHash(HashState *node); extern void ExecReScanHash(HashState *node); extern HashJoinTable ExecHashTableCreate(Hash *node, List *hashOperators, bool keepNulls); extern void ExecHashTableDestroy(HashJoinTable hashtable); extern void ExecHashTableInsert(HashJoinTable hashtable, TupleTableSlot *slot, uint32 hashvalue); extern bool ExecHashGetHashValue(HashJoinTable hashtable, ExprContext *econtext, List *hashkeys, bool outer_tuple, bool keep_nulls, uint32 *hashvalue); extern void ExecHashGetBucketAndBatch(HashJoinTable hashtable, uint32 hashvalue, int *bucketno, int *batchno); extern bool ExecScanHashBucket(HashJoinState *hjstate, ExprContext *econtext); extern void ExecPrepHashTableForUnmatched(HashJoinState *hjstate); extern bool ExecScanHashTableForUnmatched(HashJoinState *hjstate, ExprContext *econtext); extern void ExecHashTableReset(HashJoinTable hashtable); extern void ExecHashTableResetMatchFlags(HashJoinTable hashtable); extern void ExecChooseHashTableSize(double ntuples, int tupwidth, bool useskew, int *numbuckets, int *numbatches, int *num_skew_mcvs); extern int ExecHashGetSkewBucket(HashJoinTable hashtable, uint32 hashvalue); #endif /* NODEHASH_H */ PKBiZP P server/executor/execdesc.hnu[/*------------------------------------------------------------------------- * * execdesc.h * plan and query descriptor accessor macros used by the executor * and related modules. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/execdesc.h * *------------------------------------------------------------------------- */ #ifndef EXECDESC_H #define EXECDESC_H #include "nodes/execnodes.h" #include "tcop/dest.h" /* ---------------- * query descriptor: * * a QueryDesc encapsulates everything that the executor * needs to execute the query. * * For the convenience of SQL-language functions, we also support QueryDescs * containing utility statements; these must not be passed to the executor * however. * --------------------- */ typedef struct QueryDesc { /* These fields are provided by CreateQueryDesc */ CmdType operation; /* CMD_SELECT, CMD_UPDATE, etc. */ PlannedStmt *plannedstmt; /* planner's output, or null if utility */ Node *utilitystmt; /* utility statement, or null */ const char *sourceText; /* source text of the query */ Snapshot snapshot; /* snapshot to use for query */ Snapshot crosscheck_snapshot; /* crosscheck for RI update/delete */ DestReceiver *dest; /* the destination for tuple output */ ParamListInfo params; /* param values being passed in */ int instrument_options; /* OR of InstrumentOption flags */ /* These fields are set by ExecutorStart */ TupleDesc tupDesc; /* descriptor for result tuples */ EState *estate; /* executor's query-wide state */ PlanState *planstate; /* tree of per-plan-node state */ /* This is always set NULL by the core system, but plugins can change it */ struct Instrumentation *totaltime; /* total time spent in ExecutorRun */ } QueryDesc; /* in pquery.c */ extern QueryDesc *CreateQueryDesc(PlannedStmt *plannedstmt, const char *sourceText, Snapshot snapshot, Snapshot crosscheck_snapshot, DestReceiver *dest, ParamListInfo params, int instrument_options); extern QueryDesc *CreateUtilityQueryDesc(Node *utilitystmt, const char *sourceText, Snapshot snapshot, DestReceiver *dest, ParamListInfo params); extern void FreeQueryDesc(QueryDesc *qdesc); #endif /* EXECDESC_H */ PKBiZ#JJserver/executor/execdebug.hnu[/*------------------------------------------------------------------------- * * execdebug.h * #defines governing debugging behaviour in the executor * * XXX this is all pretty old and crufty. Newer code tends to use elog() * for debug printouts, because that's more flexible than printf(). * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/execdebug.h * *------------------------------------------------------------------------- */ #ifndef EXECDEBUG_H #define EXECDEBUG_H #include "executor/executor.h" #include "nodes/print.h" /* ---------------------------------------------------------------- * debugging defines. * * If you want certain debugging behaviour, then #define * the variable to 1. No need to explicitly #undef by default, * since we can use -D compiler options to enable features. * - thomas 1999-02-20 * ---------------------------------------------------------------- */ /* ---------------- * EXEC_NESTLOOPDEBUG is a flag which turns on debugging of the * nest loop node by NL_printf() and ENL_printf() in nodeNestloop.c * ---------------- #undef EXEC_NESTLOOPDEBUG */ /* ---------------- * EXEC_EVALDEBUG is a flag which turns on debugging of * ExecEval and ExecTargetList() stuff by EV_printf() in execQual.c * ---------------- #undef EXEC_EVALDEBUG */ /* ---------------- * EXEC_SORTDEBUG is a flag which turns on debugging of * the ExecSort() stuff by SO_printf() in nodeSort.c * ---------------- #undef EXEC_SORTDEBUG */ /* ---------------- * EXEC_MERGEJOINDEBUG is a flag which turns on debugging of * the ExecMergeJoin() stuff by MJ_printf() in nodeMergejoin.c * ---------------- #undef EXEC_MERGEJOINDEBUG */ /* ---------------------------------------------------------------- * #defines controlled by above definitions * * Note: most of these are "incomplete" because I didn't * need the ones not defined. More should be added * only as necessary -cim 10/26/89 * ---------------------------------------------------------------- */ #define T_OR_F(b) ((b) ? "true" : "false") #define NULL_OR_TUPLE(slot) (TupIsNull(slot) ? "null" : "a tuple") /* ---------------- * nest loop debugging defines * ---------------- */ #ifdef EXEC_NESTLOOPDEBUG #define NL_nodeDisplay(l) nodeDisplay(l) #define NL_printf(s) printf(s) #define NL1_printf(s, a) printf(s, a) #define ENL1_printf(message) printf("ExecNestLoop: %s\n", message) #else #define NL_nodeDisplay(l) #define NL_printf(s) #define NL1_printf(s, a) #define ENL1_printf(message) #endif /* EXEC_NESTLOOPDEBUG */ /* ---------------- * exec eval / target list debugging defines * ---------------- */ #ifdef EXEC_EVALDEBUG #define EV_nodeDisplay(l) nodeDisplay(l) #define EV_printf(s) printf(s) #define EV1_printf(s, a) printf(s, a) #else #define EV_nodeDisplay(l) #define EV_printf(s) #define EV1_printf(s, a) #endif /* EXEC_EVALDEBUG */ /* ---------------- * sort node debugging defines * ---------------- */ #ifdef EXEC_SORTDEBUG #define SO_nodeDisplay(l) nodeDisplay(l) #define SO_printf(s) printf(s) #define SO1_printf(s, p) printf(s, p) #else #define SO_nodeDisplay(l) #define SO_printf(s) #define SO1_printf(s, p) #endif /* EXEC_SORTDEBUG */ /* ---------------- * merge join debugging defines * ---------------- */ #ifdef EXEC_MERGEJOINDEBUG #define MJ_nodeDisplay(l) nodeDisplay(l) #define MJ_printf(s) printf(s) #define MJ1_printf(s, p) printf(s, p) #define MJ2_printf(s, p1, p2) printf(s, p1, p2) #define MJ_debugtup(slot) debugtup(slot, NULL) #define MJ_dump(state) ExecMergeTupleDump(state) #define MJ_DEBUG_COMPARE(res) \ MJ1_printf(" MJCompare() returns %d\n", (res)) #define MJ_DEBUG_QUAL(clause, res) \ MJ2_printf(" ExecQual(%s, econtext) returns %s\n", \ CppAsString(clause), T_OR_F(res)) #define MJ_DEBUG_PROC_NODE(slot) \ MJ2_printf(" %s = ExecProcNode(...) returns %s\n", \ CppAsString(slot), NULL_OR_TUPLE(slot)) #else #define MJ_nodeDisplay(l) #define MJ_printf(s) #define MJ1_printf(s, p) #define MJ2_printf(s, p1, p2) #define MJ_debugtup(slot) #define MJ_dump(state) #define MJ_DEBUG_COMPARE(res) #define MJ_DEBUG_QUAL(clause, res) #define MJ_DEBUG_PROC_NODE(slot) #endif /* EXEC_MERGEJOINDEBUG */ #endif /* ExecDebugIncluded */ PKBiZػserver/executor/nodeCtescan.hnu[/*------------------------------------------------------------------------- * * nodeCtescan.h * * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/nodeCtescan.h * *------------------------------------------------------------------------- */ #ifndef NODECTESCAN_H #define NODECTESCAN_H #include "nodes/execnodes.h" extern CteScanState *ExecInitCteScan(CteScan *node, EState *estate, int eflags); extern TupleTableSlot *ExecCteScan(CteScanState *node); extern void ExecEndCteScan(CteScanState *node); extern void ExecReScanCteScan(CteScanState *node); #endif /* NODECTESCAN_H */ PKBiZllserver/executor/spi_priv.hnu[/*------------------------------------------------------------------------- * * spi_priv.h * Server Programming Interface private declarations * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/spi_priv.h * *------------------------------------------------------------------------- */ #ifndef SPI_PRIV_H #define SPI_PRIV_H #include "executor/spi.h" #define _SPI_PLAN_MAGIC 569278163 typedef struct { /* current results */ uint32 processed; /* by Executor */ Oid lastoid; SPITupleTable *tuptable; MemoryContext procCxt; /* procedure context */ MemoryContext execCxt; /* executor context */ MemoryContext savedcxt; /* context of SPI_connect's caller */ SubTransactionId connectSubid; /* ID of connecting subtransaction */ } _SPI_connection; /* * SPI plans have three states: saved, unsaved, or temporary. * * Ordinarily, the _SPI_plan struct itself as well as the argtypes array * are in a dedicated memory context identified by plancxt (which can be * really small). All the other subsidiary state is in plancache entries * identified by plancache_list (note: the list cells themselves are in * plancxt). * * In an unsaved plan, the plancxt as well as the plancache entries' contexts * are children of the SPI procedure context, so they'll all disappear at * function exit. plancache.c also knows that the plancache entries are * "unsaved", so it doesn't link them into its global list; hence they do * not respond to inval events. This is OK since we are presumably holding * adequate locks to prevent other backends from messing with the tables. * * For a saved plan, the plancxt is made a child of CacheMemoryContext * since it should persist until explicitly destroyed. Likewise, the * plancache entries will be under CacheMemoryContext since we tell * plancache.c to save them. We rely on plancache.c to keep the cache * entries up-to-date as needed in the face of invalidation events. * * There are also "temporary" SPI plans, in which the _SPI_plan struct is * not even palloc'd but just exists in some function's local variable. * The plancache entries are unsaved and exist under the SPI executor context, * while additional data such as argtypes and list cells is loose in the SPI * executor context. Such plans can be identified by having plancxt == NULL. * * We can also have "one-shot" SPI plans (which are typically temporary, * as described above). These are meant to be executed once and discarded, * and various optimizations are made on the assumption of single use. * Note in particular that the CachedPlanSources within such an SPI plan * are not "complete" until execution. * * Note: if the original query string contained only whitespace and comments, * the plancache_list will be NIL and so there is no place to store the * query string. We don't care about that, but we do care about the * argument type array, which is why it's seemingly-redundantly stored. */ typedef struct _SPI_plan { int magic; /* should equal _SPI_PLAN_MAGIC */ bool saved; /* saved or unsaved plan? */ bool oneshot; /* one-shot plan? */ List *plancache_list; /* one CachedPlanSource per parsetree */ MemoryContext plancxt; /* Context containing _SPI_plan and data */ int cursor_options; /* Cursor options used for planning */ int nargs; /* number of plan arguments */ Oid *argtypes; /* Argument types (NULL if nargs is 0) */ ParserSetupHook parserSetup; /* alternative parameter spec method */ void *parserSetupArg; } _SPI_plan; #endif /* SPI_PRIV_H */ PKBiZʭ:!server/executor/nodeModifyTable.hnu[/*------------------------------------------------------------------------- * * nodeModifyTable.h * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/nodeModifyTable.h * *------------------------------------------------------------------------- */ #ifndef NODEMODIFYTABLE_H #define NODEMODIFYTABLE_H #include "nodes/execnodes.h" extern ModifyTableState *ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags); extern TupleTableSlot *ExecModifyTable(ModifyTableState *node); extern void ExecEndModifyTable(ModifyTableState *node); extern void ExecReScanModifyTable(ModifyTableState *node); #endif /* NODEMODIFYTABLE_H */ PKBiZs?6!server/executor/nodeForeignscan.hnu[/*------------------------------------------------------------------------- * * nodeForeignscan.h * * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/nodeForeignscan.h * *------------------------------------------------------------------------- */ #ifndef NODEFOREIGNSCAN_H #define NODEFOREIGNSCAN_H #include "nodes/execnodes.h" extern ForeignScanState *ExecInitForeignScan(ForeignScan *node, EState *estate, int eflags); extern TupleTableSlot *ExecForeignScan(ForeignScanState *node); extern void ExecEndForeignScan(ForeignScanState *node); extern void ExecReScanForeignScan(ForeignScanState *node); #endif /* NODEFOREIGNSCAN_H */ PKBiZ6server/executor/nodeBitmapAnd.hnu[/*------------------------------------------------------------------------- * * nodeBitmapAnd.h * * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/nodeBitmapAnd.h * *------------------------------------------------------------------------- */ #ifndef NODEBITMAPAND_H #define NODEBITMAPAND_H #include "nodes/execnodes.h" extern BitmapAndState *ExecInitBitmapAnd(BitmapAnd *node, EState *estate, int eflags); extern Node *MultiExecBitmapAnd(BitmapAndState *node); extern void ExecEndBitmapAnd(BitmapAndState *node); extern void ExecReScanBitmapAnd(BitmapAndState *node); #endif /* NODEBITMAPAND_H */ PKBiZPg#server/executor/nodeWorktablescan.hnu[/*------------------------------------------------------------------------- * * nodeWorktablescan.h * * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/nodeWorktablescan.h * *------------------------------------------------------------------------- */ #ifndef NODEWORKTABLESCAN_H #define NODEWORKTABLESCAN_H #include "nodes/execnodes.h" extern WorkTableScanState *ExecInitWorkTableScan(WorkTableScan *node, EState *estate, int eflags); extern TupleTableSlot *ExecWorkTableScan(WorkTableScanState *node); extern void ExecEndWorkTableScan(WorkTableScanState *node); extern void ExecReScanWorkTableScan(WorkTableScanState *node); #endif /* NODEWORKTABLESCAN_H */ PKBiZc"server/executor/nodeFunctionscan.hnu[/*------------------------------------------------------------------------- * * nodeFunctionscan.h * * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/nodeFunctionscan.h * *------------------------------------------------------------------------- */ #ifndef NODEFUNCTIONSCAN_H #define NODEFUNCTIONSCAN_H #include "nodes/execnodes.h" extern FunctionScanState *ExecInitFunctionScan(FunctionScan *node, EState *estate, int eflags); extern TupleTableSlot *ExecFunctionScan(FunctionScanState *node); extern void ExecEndFunctionScan(FunctionScanState *node); extern void ExecReScanFunctionScan(FunctionScanState *node); #endif /* NODEFUNCTIONSCAN_H */ PKBiZ5zzserver/executor/nodeHashjoin.hnu[/*------------------------------------------------------------------------- * * nodeHashjoin.h * prototypes for nodeHashjoin.c * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/nodeHashjoin.h * *------------------------------------------------------------------------- */ #ifndef NODEHASHJOIN_H #define NODEHASHJOIN_H #include "nodes/execnodes.h" #include "storage/buffile.h" extern HashJoinState *ExecInitHashJoin(HashJoin *node, EState *estate, int eflags); extern TupleTableSlot *ExecHashJoin(HashJoinState *node); extern void ExecEndHashJoin(HashJoinState *node); extern void ExecReScanHashJoin(HashJoinState *node); extern void ExecHashJoinSaveTuple(MinimalTuple tuple, uint32 hashvalue, BufFile **fileptr); #endif /* NODEHASHJOIN_H */ PKBiZ server/executor/nodeSetOp.hnu[/*------------------------------------------------------------------------- * * nodeSetOp.h * * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/nodeSetOp.h * *------------------------------------------------------------------------- */ #ifndef NODESETOP_H #define NODESETOP_H #include "nodes/execnodes.h" extern SetOpState *ExecInitSetOp(SetOp *node, EState *estate, int eflags); extern TupleTableSlot *ExecSetOp(SetOpState *node); extern void ExecEndSetOp(SetOpState *node); extern void ExecReScanSetOp(SetOpState *node); #endif /* NODESETOP_H */ PKBiZC bb server/executor/nodeValuesscan.hnu[/*------------------------------------------------------------------------- * * nodeValuesscan.h * * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/nodeValuesscan.h * *------------------------------------------------------------------------- */ #ifndef NODEVALUESSCAN_H #define NODEVALUESSCAN_H #include "nodes/execnodes.h" extern ValuesScanState *ExecInitValuesScan(ValuesScan *node, EState *estate, int eflags); extern TupleTableSlot *ExecValuesScan(ValuesScanState *node); extern void ExecEndValuesScan(ValuesScanState *node); extern void ExecValuesMarkPos(ValuesScanState *node); extern void ExecValuesRestrPos(ValuesScanState *node); extern void ExecReScanValuesScan(ValuesScanState *node); #endif /* NODEVALUESSCAN_H */ PKBiZip3~~server/executor/functions.hnu[/*------------------------------------------------------------------------- * * functions.h * Declarations for execution of SQL-language functions. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/functions.h * *------------------------------------------------------------------------- */ #ifndef FUNCTIONS_H #define FUNCTIONS_H #include "nodes/execnodes.h" #include "tcop/dest.h" /* This struct is known only within executor/functions.c */ typedef struct SQLFunctionParseInfo *SQLFunctionParseInfoPtr; extern Datum fmgr_sql(PG_FUNCTION_ARGS); extern SQLFunctionParseInfoPtr prepare_sql_fn_parse_info(HeapTuple procedureTuple, Node *call_expr, Oid inputCollation); extern void sql_fn_parser_setup(struct ParseState *pstate, SQLFunctionParseInfoPtr pinfo); extern bool check_sql_fn_retval(Oid func_id, Oid rettype, List *queryTreeList, bool *modifyTargetList, JunkFilter **junkFilter); extern DestReceiver *CreateSQLFunctionDestReceiver(void); #endif /* FUNCTIONS_H */ PKBiZ0""server/executor/nodeResult.hnu[/*------------------------------------------------------------------------- * * nodeResult.h * * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/nodeResult.h * *------------------------------------------------------------------------- */ #ifndef NODERESULT_H #define NODERESULT_H #include "nodes/execnodes.h" extern ResultState *ExecInitResult(Result *node, EState *estate, int eflags); extern TupleTableSlot *ExecResult(ResultState *node); extern void ExecEndResult(ResultState *node); extern void ExecResultMarkPos(ResultState *node); extern void ExecResultRestrPos(ResultState *node); extern void ExecReScanResult(ResultState *node); #endif /* NODERESULT_H */ PKBiZZserver/executor/nodeAppend.hnu[/*------------------------------------------------------------------------- * * nodeAppend.h * * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/nodeAppend.h * *------------------------------------------------------------------------- */ #ifndef NODEAPPEND_H #define NODEAPPEND_H #include "nodes/execnodes.h" extern AppendState *ExecInitAppend(Append *node, EState *estate, int eflags); extern TupleTableSlot *ExecAppend(AppendState *node); extern void ExecEndAppend(AppendState *node); extern void ExecReScanAppend(AppendState *node); #endif /* NODEAPPEND_H */ PKBiZ--$server/executor/nodeBitmapHeapscan.hnu[/*------------------------------------------------------------------------- * * nodeBitmapHeapscan.h * * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/nodeBitmapHeapscan.h * *------------------------------------------------------------------------- */ #ifndef NODEBITMAPHEAPSCAN_H #define NODEBITMAPHEAPSCAN_H #include "nodes/execnodes.h" extern BitmapHeapScanState *ExecInitBitmapHeapScan(BitmapHeapScan *node, EState *estate, int eflags); extern TupleTableSlot *ExecBitmapHeapScan(BitmapHeapScanState *node); extern void ExecEndBitmapHeapScan(BitmapHeapScanState *node); extern void ExecReScanBitmapHeapScan(BitmapHeapScanState *node); #endif /* NODEBITMAPHEAPSCAN_H */ PKBiZ;pdserver/executor/nodeNestloop.hnu[/*------------------------------------------------------------------------- * * nodeNestloop.h * * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/nodeNestloop.h * *------------------------------------------------------------------------- */ #ifndef NODENESTLOOP_H #define NODENESTLOOP_H #include "nodes/execnodes.h" extern NestLoopState *ExecInitNestLoop(NestLoop *node, EState *estate, int eflags); extern TupleTableSlot *ExecNestLoop(NestLoopState *node); extern void ExecEndNestLoop(NestLoopState *node); extern void ExecReScanNestLoop(NestLoopState *node); #endif /* NODENESTLOOP_H */ PKBiZ--$server/executor/nodeRecursiveunion.hnu[/*------------------------------------------------------------------------- * * nodeRecursiveunion.h * * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/nodeRecursiveunion.h * *------------------------------------------------------------------------- */ #ifndef NODERECURSIVEUNION_H #define NODERECURSIVEUNION_H #include "nodes/execnodes.h" extern RecursiveUnionState *ExecInitRecursiveUnion(RecursiveUnion *node, EState *estate, int eflags); extern TupleTableSlot *ExecRecursiveUnion(RecursiveUnionState *node); extern void ExecEndRecursiveUnion(RecursiveUnionState *node); extern void ExecReScanRecursiveUnion(RecursiveUnionState *node); #endif /* NODERECURSIVEUNION_H */ PKBiZ@!A,,server/executor/nodeTidscan.hnu[/*------------------------------------------------------------------------- * * nodeTidscan.h * * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/nodeTidscan.h * *------------------------------------------------------------------------- */ #ifndef NODETIDSCAN_H #define NODETIDSCAN_H #include "nodes/execnodes.h" extern TidScanState *ExecInitTidScan(TidScan *node, EState *estate, int eflags); extern TupleTableSlot *ExecTidScan(TidScanState *node); extern void ExecEndTidScan(TidScanState *node); extern void ExecTidMarkPos(TidScanState *node); extern void ExecTidRestrPos(TidScanState *node); extern void ExecReScanTidScan(TidScanState *node); #endif /* NODETIDSCAN_H */ PKBiZ2jserver/executor/nodeAgg.hnu[/*------------------------------------------------------------------------- * * nodeAgg.h * prototypes for nodeAgg.c * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/nodeAgg.h * *------------------------------------------------------------------------- */ #ifndef NODEAGG_H #define NODEAGG_H #include "nodes/execnodes.h" extern AggState *ExecInitAgg(Agg *node, EState *estate, int eflags); extern TupleTableSlot *ExecAgg(AggState *node); extern void ExecEndAgg(AggState *node); extern void ExecReScanAgg(AggState *node); extern Size hash_agg_entry_size(int numAggs); extern Datum aggregate_dummy(PG_FUNCTION_ARGS); #endif /* NODEAGG_H */ PKBiZmFFserver/executor/nodeMaterial.hnu[/*------------------------------------------------------------------------- * * nodeMaterial.h * * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/nodeMaterial.h * *------------------------------------------------------------------------- */ #ifndef NODEMATERIAL_H #define NODEMATERIAL_H #include "nodes/execnodes.h" extern MaterialState *ExecInitMaterial(Material *node, EState *estate, int eflags); extern TupleTableSlot *ExecMaterial(MaterialState *node); extern void ExecEndMaterial(MaterialState *node); extern void ExecMaterialMarkPos(MaterialState *node); extern void ExecMaterialRestrPos(MaterialState *node); extern void ExecReScanMaterial(MaterialState *node); #endif /* NODEMATERIAL_H */ PKBiZS66%server/executor/nodeBitmapIndexscan.hnu[/*------------------------------------------------------------------------- * * nodeBitmapIndexscan.h * * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/nodeBitmapIndexscan.h * *------------------------------------------------------------------------- */ #ifndef NODEBITMAPINDEXSCAN_H #define NODEBITMAPINDEXSCAN_H #include "nodes/execnodes.h" extern BitmapIndexScanState *ExecInitBitmapIndexScan(BitmapIndexScan *node, EState *estate, int eflags); extern Node *MultiExecBitmapIndexScan(BitmapIndexScanState *node); extern void ExecEndBitmapIndexScan(BitmapIndexScanState *node); extern void ExecReScanBitmapIndexScan(BitmapIndexScanState *node); #endif /* NODEBITMAPINDEXSCAN_H */ PKBiZ[E!!server/executor/tuptable.hnu[/*------------------------------------------------------------------------- * * tuptable.h * tuple table support stuff * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/tuptable.h * *------------------------------------------------------------------------- */ #ifndef TUPTABLE_H #define TUPTABLE_H #include "access/htup.h" #include "storage/buf.h" /*---------- * The executor stores tuples in a "tuple table" which is a List of * independent TupleTableSlots. There are several cases we need to handle: * 1. physical tuple in a disk buffer page * 2. physical tuple constructed in palloc'ed memory * 3. "minimal" physical tuple constructed in palloc'ed memory * 4. "virtual" tuple consisting of Datum/isnull arrays * * The first two cases are similar in that they both deal with "materialized" * tuples, but resource management is different. For a tuple in a disk page * we need to hold a pin on the buffer until the TupleTableSlot's reference * to the tuple is dropped; while for a palloc'd tuple we usually want the * tuple pfree'd when the TupleTableSlot's reference is dropped. * * A "minimal" tuple is handled similarly to a palloc'd regular tuple. * At present, minimal tuples never are stored in buffers, so there is no * parallel to case 1. Note that a minimal tuple has no "system columns". * (Actually, it could have an OID, but we have no need to access the OID.) * * A "virtual" tuple is an optimization used to minimize physical data * copying in a nest of plan nodes. Any pass-by-reference Datums in the * tuple point to storage that is not directly associated with the * TupleTableSlot; generally they will point to part of a tuple stored in * a lower plan node's output TupleTableSlot, or to a function result * constructed in a plan node's per-tuple econtext. It is the responsibility * of the generating plan node to be sure these resources are not released * for as long as the virtual tuple needs to be valid. We only use virtual * tuples in the result slots of plan nodes --- tuples to be copied anywhere * else need to be "materialized" into physical tuples. Note also that a * virtual tuple does not have any "system columns". * * It is also possible for a TupleTableSlot to hold both physical and minimal * copies of a tuple. This is done when the slot is requested to provide * the format other than the one it currently holds. (Originally we attempted * to handle such requests by replacing one format with the other, but that * had the fatal defect of invalidating any pass-by-reference Datums pointing * into the existing slot contents.) Both copies must contain identical data * payloads when this is the case. * * The Datum/isnull arrays of a TupleTableSlot serve double duty. When the * slot contains a virtual tuple, they are the authoritative data. When the * slot contains a physical tuple, the arrays contain data extracted from * the tuple. (In this state, any pass-by-reference Datums point into * the physical tuple.) The extracted information is built "lazily", * ie, only as needed. This serves to avoid repeated extraction of data * from the physical tuple. * * A TupleTableSlot can also be "empty", holding no valid data. This is * the only valid state for a freshly-created slot that has not yet had a * tuple descriptor assigned to it. In this state, tts_isempty must be * TRUE, tts_shouldFree FALSE, tts_tuple NULL, tts_buffer InvalidBuffer, * and tts_nvalid zero. * * The tupleDescriptor is simply referenced, not copied, by the TupleTableSlot * code. The caller of ExecSetSlotDescriptor() is responsible for providing * a descriptor that will live as long as the slot does. (Typically, both * slots and descriptors are in per-query memory and are freed by memory * context deallocation at query end; so it's not worth providing any extra * mechanism to do more. However, the slot will increment the tupdesc * reference count if a reference-counted tupdesc is supplied.) * * When tts_shouldFree is true, the physical tuple is "owned" by the slot * and should be freed when the slot's reference to the tuple is dropped. * * If tts_buffer is not InvalidBuffer, then the slot is holding a pin * on the indicated buffer page; drop the pin when we release the * slot's reference to that buffer. (tts_shouldFree should always be * false in such a case, since presumably tts_tuple is pointing at the * buffer page.) * * tts_nvalid indicates the number of valid columns in the tts_values/isnull * arrays. When the slot is holding a "virtual" tuple this must be equal * to the descriptor's natts. When the slot is holding a physical tuple * this is equal to the number of columns we have extracted (we always * extract columns from left to right, so there are no holes). * * tts_values/tts_isnull are allocated when a descriptor is assigned to the * slot; they are of length equal to the descriptor's natts. * * tts_mintuple must always be NULL if the slot does not hold a "minimal" * tuple. When it does, tts_mintuple points to the actual MinimalTupleData * object (the thing to be pfree'd if tts_shouldFreeMin is true). If the slot * has only a minimal and not also a regular physical tuple, then tts_tuple * points at tts_minhdr and the fields of that struct are set correctly * for access to the minimal tuple; in particular, tts_minhdr.t_data points * MINIMAL_TUPLE_OFFSET bytes before tts_mintuple. This allows column * extraction to treat the case identically to regular physical tuples. * * tts_slow/tts_off are saved state for slot_deform_tuple, and should not * be touched by any other code. *---------- */ typedef struct TupleTableSlot { NodeTag type; bool tts_isempty; /* true = slot is empty */ bool tts_shouldFree; /* should pfree tts_tuple? */ bool tts_shouldFreeMin; /* should pfree tts_mintuple? */ bool tts_slow; /* saved state for slot_deform_tuple */ HeapTuple tts_tuple; /* physical tuple, or NULL if virtual */ TupleDesc tts_tupleDescriptor; /* slot's tuple descriptor */ MemoryContext tts_mcxt; /* slot itself is in this context */ Buffer tts_buffer; /* tuple's buffer, or InvalidBuffer */ int tts_nvalid; /* # of valid values in tts_values */ Datum *tts_values; /* current per-attribute values */ bool *tts_isnull; /* current per-attribute isnull flags */ MinimalTuple tts_mintuple; /* minimal tuple, or NULL if none */ HeapTupleData tts_minhdr; /* workspace for minimal-tuple-only case */ long tts_off; /* saved state for slot_deform_tuple */ } TupleTableSlot; #define TTS_HAS_PHYSICAL_TUPLE(slot) \ ((slot)->tts_tuple != NULL && (slot)->tts_tuple != &((slot)->tts_minhdr)) /* * TupIsNull -- is a TupleTableSlot empty? */ #define TupIsNull(slot) \ ((slot) == NULL || (slot)->tts_isempty) /* in executor/execTuples.c */ extern TupleTableSlot *MakeTupleTableSlot(void); extern TupleTableSlot *ExecAllocTableSlot(List **tupleTable); extern void ExecResetTupleTable(List *tupleTable, bool shouldFree); extern TupleTableSlot *MakeSingleTupleTableSlot(TupleDesc tupdesc); extern void ExecDropSingleTupleTableSlot(TupleTableSlot *slot); extern void ExecSetSlotDescriptor(TupleTableSlot *slot, TupleDesc tupdesc); extern TupleTableSlot *ExecStoreTuple(HeapTuple tuple, TupleTableSlot *slot, Buffer buffer, bool shouldFree); extern TupleTableSlot *ExecStoreMinimalTuple(MinimalTuple mtup, TupleTableSlot *slot, bool shouldFree); extern TupleTableSlot *ExecClearTuple(TupleTableSlot *slot); extern TupleTableSlot *ExecStoreVirtualTuple(TupleTableSlot *slot); extern TupleTableSlot *ExecStoreAllNullTuple(TupleTableSlot *slot); extern HeapTuple ExecCopySlotTuple(TupleTableSlot *slot); extern MinimalTuple ExecCopySlotMinimalTuple(TupleTableSlot *slot); extern HeapTuple ExecFetchSlotTuple(TupleTableSlot *slot); extern MinimalTuple ExecFetchSlotMinimalTuple(TupleTableSlot *slot); extern Datum ExecFetchSlotTupleDatum(TupleTableSlot *slot); extern HeapTuple ExecMaterializeSlot(TupleTableSlot *slot); extern TupleTableSlot *ExecCopySlot(TupleTableSlot *dstslot, TupleTableSlot *srcslot); /* in access/common/heaptuple.c */ extern Datum slot_getattr(TupleTableSlot *slot, int attnum, bool *isnull); extern void slot_getallattrs(TupleTableSlot *slot); extern void slot_getsomeattrs(TupleTableSlot *slot, int attnum); extern bool slot_attisnull(TupleTableSlot *slot, int attnum); #endif /* TUPTABLE_H */ PKBiZ] ,,server/executor/nodeSubplan.hnu[/*------------------------------------------------------------------------- * * nodeSubplan.h * * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/nodeSubplan.h * *------------------------------------------------------------------------- */ #ifndef NODESUBPLAN_H #define NODESUBPLAN_H #include "nodes/execnodes.h" extern SubPlanState *ExecInitSubPlan(SubPlan *subplan, PlanState *parent); extern AlternativeSubPlanState *ExecInitAlternativeSubPlan(AlternativeSubPlan *asplan, PlanState *parent); extern void ExecReScanSetParamPlan(SubPlanState *node, PlanState *parent); extern void ExecSetParamPlan(SubPlanState *node, ExprContext *econtext); #endif /* NODESUBPLAN_H */ PKBiZl-server/executor/nodeSort.hnu[/*------------------------------------------------------------------------- * * nodeSort.h * * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/nodeSort.h * *------------------------------------------------------------------------- */ #ifndef NODESORT_H #define NODESORT_H #include "nodes/execnodes.h" extern SortState *ExecInitSort(Sort *node, EState *estate, int eflags); extern TupleTableSlot *ExecSort(SortState *node); extern void ExecEndSort(SortState *node); extern void ExecSortMarkPos(SortState *node); extern void ExecSortRestrPos(SortState *node); extern void ExecReScanSort(SortState *node); #endif /* NODESORT_H */ PKBiZƏ@*server/executor/nodeMergejoin.hnu[/*------------------------------------------------------------------------- * * nodeMergejoin.h * * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/nodeMergejoin.h * *------------------------------------------------------------------------- */ #ifndef NODEMERGEJOIN_H #define NODEMERGEJOIN_H #include "nodes/execnodes.h" extern MergeJoinState *ExecInitMergeJoin(MergeJoin *node, EState *estate, int eflags); extern TupleTableSlot *ExecMergeJoin(MergeJoinState *node); extern void ExecEndMergeJoin(MergeJoinState *node); extern void ExecReScanMergeJoin(MergeJoinState *node); #endif /* NODEMERGEJOIN_H */ PKBiZM( server/executor/tstoreReceiver.hnu[/*------------------------------------------------------------------------- * * tstoreReceiver.h * prototypes for tstoreReceiver.c * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/tstoreReceiver.h * *------------------------------------------------------------------------- */ #ifndef TSTORE_RECEIVER_H #define TSTORE_RECEIVER_H #include "tcop/dest.h" #include "utils/tuplestore.h" extern DestReceiver *CreateTuplestoreDestReceiver(void); extern void SetTuplestoreDestReceiverParams(DestReceiver *self, Tuplestorestate *tStore, MemoryContext tContext, bool detoast); #endif /* TSTORE_RECEIVER_H */ PKBiZ7Zserver/executor/nodeBitmapOr.hnu[/*------------------------------------------------------------------------- * * nodeBitmapOr.h * * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/nodeBitmapOr.h * *------------------------------------------------------------------------- */ #ifndef NODEBITMAPOR_H #define NODEBITMAPOR_H #include "nodes/execnodes.h" extern BitmapOrState *ExecInitBitmapOr(BitmapOr *node, EState *estate, int eflags); extern Node *MultiExecBitmapOr(BitmapOrState *node); extern void ExecEndBitmapOr(BitmapOrState *node); extern void ExecReScanBitmapOr(BitmapOrState *node); #endif /* NODEBITMAPOR_H */ PKBiZT<>!server/executor/nodeMergeAppend.hnu[/*------------------------------------------------------------------------- * * nodeMergeAppend.h * * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/nodeMergeAppend.h * *------------------------------------------------------------------------- */ #ifndef NODEMERGEAPPEND_H #define NODEMERGEAPPEND_H #include "nodes/execnodes.h" extern MergeAppendState *ExecInitMergeAppend(MergeAppend *node, EState *estate, int eflags); extern TupleTableSlot *ExecMergeAppend(MergeAppendState *node); extern void ExecEndMergeAppend(MergeAppendState *node); extern void ExecReScanMergeAppend(MergeAppendState *node); #endif /* NODEMERGEAPPEND_H */ PKBiZ`H#server/executor/nodeIndexonlyscan.hnu[/*------------------------------------------------------------------------- * * nodeIndexonlyscan.h * * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/nodeIndexonlyscan.h * *------------------------------------------------------------------------- */ #ifndef NODEINDEXONLYSCAN_H #define NODEINDEXONLYSCAN_H #include "nodes/execnodes.h" extern IndexOnlyScanState *ExecInitIndexOnlyScan(IndexOnlyScan *node, EState *estate, int eflags); extern TupleTableSlot *ExecIndexOnlyScan(IndexOnlyScanState *node); extern void ExecEndIndexOnlyScan(IndexOnlyScanState *node); extern void ExecIndexOnlyMarkPos(IndexOnlyScanState *node); extern void ExecIndexOnlyRestrPos(IndexOnlyScanState *node); extern void ExecReScanIndexOnlyScan(IndexOnlyScanState *node); #endif /* NODEINDEXONLYSCAN_H */ PKBiZrz︻server/executor/hashjoin.hnu[/*------------------------------------------------------------------------- * * hashjoin.h * internal structures for hash joins * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/hashjoin.h * *------------------------------------------------------------------------- */ #ifndef HASHJOIN_H #define HASHJOIN_H #include "nodes/execnodes.h" #include "storage/buffile.h" /* ---------------------------------------------------------------- * hash-join hash table structures * * Each active hashjoin has a HashJoinTable control block, which is * palloc'd in the executor's per-query context. All other storage needed * for the hashjoin is kept in private memory contexts, two for each hashjoin. * This makes it easy and fast to release the storage when we don't need it * anymore. (Exception: data associated with the temp files lives in the * per-query context too, since we always call buffile.c in that context.) * * The hashtable contexts are made children of the per-query context, ensuring * that they will be discarded at end of statement even if the join is * aborted early by an error. (Likewise, any temporary files we make will * be cleaned up by the virtual file manager in event of an error.) * * Storage that should live through the entire join is allocated from the * "hashCxt", while storage that is only wanted for the current batch is * allocated in the "batchCxt". By resetting the batchCxt at the end of * each batch, we free all the per-batch storage reliably and without tedium. * * During first scan of inner relation, we get its tuples from executor. * If nbatch > 1 then tuples that don't belong in first batch get saved * into inner-batch temp files. The same statements apply for the * first scan of the outer relation, except we write tuples to outer-batch * temp files. After finishing the first scan, we do the following for * each remaining batch: * 1. Read tuples from inner batch file, load into hash buckets. * 2. Read tuples from outer batch file, match to hash buckets and output. * * It is possible to increase nbatch on the fly if the in-memory hash table * gets too big. The hash-value-to-batch computation is arranged so that this * can only cause a tuple to go into a later batch than previously thought, * never into an earlier batch. When we increase nbatch, we rescan the hash * table and dump out any tuples that are now of a later batch to the correct * inner batch file. Subsequently, while reading either inner or outer batch * files, we might find tuples that no longer belong to the current batch; * if so, we just dump them out to the correct batch file. * ---------------------------------------------------------------- */ /* these are in nodes/execnodes.h: */ /* typedef struct HashJoinTupleData *HashJoinTuple; */ /* typedef struct HashJoinTableData *HashJoinTable; */ typedef struct HashJoinTupleData { struct HashJoinTupleData *next; /* link to next tuple in same bucket */ uint32 hashvalue; /* tuple's hash code */ /* Tuple data, in MinimalTuple format, follows on a MAXALIGN boundary */ } HashJoinTupleData; #define HJTUPLE_OVERHEAD MAXALIGN(sizeof(HashJoinTupleData)) #define HJTUPLE_MINTUPLE(hjtup) \ ((MinimalTuple) ((char *) (hjtup) + HJTUPLE_OVERHEAD)) /* * If the outer relation's distribution is sufficiently nonuniform, we attempt * to optimize the join by treating the hash values corresponding to the outer * relation's MCVs specially. Inner relation tuples matching these hash * values go into the "skew" hashtable instead of the main hashtable, and * outer relation tuples with these hash values are matched against that * table instead of the main one. Thus, tuples with these hash values are * effectively handled as part of the first batch and will never go to disk. * The skew hashtable is limited to SKEW_WORK_MEM_PERCENT of the total memory * allowed for the join; while building the hashtables, we decrease the number * of MCVs being specially treated if needed to stay under this limit. * * Note: you might wonder why we look at the outer relation stats for this, * rather than the inner. One reason is that the outer relation is typically * bigger, so we get more I/O savings by optimizing for its most common values. * Also, for similarly-sized relations, the planner prefers to put the more * uniformly distributed relation on the inside, so we're more likely to find * interesting skew in the outer relation. */ typedef struct HashSkewBucket { uint32 hashvalue; /* common hash value */ HashJoinTuple tuples; /* linked list of inner-relation tuples */ } HashSkewBucket; #define SKEW_BUCKET_OVERHEAD MAXALIGN(sizeof(HashSkewBucket)) #define INVALID_SKEW_BUCKET_NO (-1) #define SKEW_WORK_MEM_PERCENT 2 #define SKEW_MIN_OUTER_FRACTION 0.01 typedef struct HashJoinTableData { int nbuckets; /* # buckets in the in-memory hash table */ int log2_nbuckets; /* its log2 (nbuckets must be a power of 2) */ /* buckets[i] is head of list of tuples in i'th in-memory bucket */ struct HashJoinTupleData **buckets; /* buckets array is per-batch storage, as are all the tuples */ bool keepNulls; /* true to store unmatchable NULL tuples */ bool skewEnabled; /* are we using skew optimization? */ HashSkewBucket **skewBucket; /* hashtable of skew buckets */ int skewBucketLen; /* size of skewBucket array (a power of 2!) */ int nSkewBuckets; /* number of active skew buckets */ int *skewBucketNums; /* array indexes of active skew buckets */ int nbatch; /* number of batches */ int curbatch; /* current batch #; 0 during 1st pass */ int nbatch_original; /* nbatch when we started inner scan */ int nbatch_outstart; /* nbatch when we started outer scan */ bool growEnabled; /* flag to shut off nbatch increases */ double totalTuples; /* # tuples obtained from inner plan */ /* * These arrays are allocated for the life of the hash join, but only if * nbatch > 1. A file is opened only when we first write a tuple into it * (otherwise its pointer remains NULL). Note that the zero'th array * elements never get used, since we will process rather than dump out any * tuples of batch zero. */ BufFile **innerBatchFile; /* buffered virtual temp file per batch */ BufFile **outerBatchFile; /* buffered virtual temp file per batch */ /* * Info about the datatype-specific hash functions for the datatypes being * hashed. These are arrays of the same length as the number of hash join * clauses (hash keys). */ FmgrInfo *outer_hashfunctions; /* lookup data for hash functions */ FmgrInfo *inner_hashfunctions; /* lookup data for hash functions */ bool *hashStrict; /* is each hash join operator strict? */ Size spaceUsed; /* memory space currently used by tuples */ Size spaceAllowed; /* upper limit for space used */ Size spacePeak; /* peak space used */ Size spaceUsedSkew; /* skew hash table's current space usage */ Size spaceAllowedSkew; /* upper limit for skew hashtable */ MemoryContext hashCxt; /* context for whole-hash-join storage */ MemoryContext batchCxt; /* context for this-batch-only storage */ } HashJoinTableData; #endif /* HASHJOIN_H */ PKBiZWserver/executor/nodeIndexscan.hnu[/*------------------------------------------------------------------------- * * nodeIndexscan.h * * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/nodeIndexscan.h * *------------------------------------------------------------------------- */ #ifndef NODEINDEXSCAN_H #define NODEINDEXSCAN_H #include "nodes/execnodes.h" extern IndexScanState *ExecInitIndexScan(IndexScan *node, EState *estate, int eflags); extern TupleTableSlot *ExecIndexScan(IndexScanState *node); extern void ExecEndIndexScan(IndexScanState *node); extern void ExecIndexMarkPos(IndexScanState *node); extern void ExecIndexRestrPos(IndexScanState *node); extern void ExecReScanIndexScan(IndexScanState *node); /* * These routines are exported to share code with nodeIndexonlyscan.c and * nodeBitmapIndexscan.c */ extern void ExecIndexBuildScanKeys(PlanState *planstate, Relation index, List *quals, bool isorderby, ScanKey *scanKeys, int *numScanKeys, IndexRuntimeKeyInfo **runtimeKeys, int *numRuntimeKeys, IndexArrayKeyInfo **arrayKeys, int *numArrayKeys); extern void ExecIndexEvalRuntimeKeys(ExprContext *econtext, IndexRuntimeKeyInfo *runtimeKeys, int numRuntimeKeys); extern bool ExecIndexEvalArrayKeys(ExprContext *econtext, IndexArrayKeyInfo *arrayKeys, int numArrayKeys); extern bool ExecIndexAdvanceArrayKeys(IndexArrayKeyInfo *arrayKeys, int numArrayKeys); #endif /* NODEINDEXSCAN_H */ PKBiZs server/executor/nodeLimit.hnu[/*------------------------------------------------------------------------- * * nodeLimit.h * * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/nodeLimit.h * *------------------------------------------------------------------------- */ #ifndef NODELIMIT_H #define NODELIMIT_H #include "nodes/execnodes.h" extern LimitState *ExecInitLimit(Limit *node, EState *estate, int eflags); extern TupleTableSlot *ExecLimit(LimitState *node); extern void ExecEndLimit(LimitState *node); extern void ExecReScanLimit(LimitState *node); #endif /* NODELIMIT_H */ PKBiZ-mserver/executor/nodeLockRows.hnu[/*------------------------------------------------------------------------- * * nodeLockRows.h * * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/nodeLockRows.h * *------------------------------------------------------------------------- */ #ifndef NODELOCKROWS_H #define NODELOCKROWS_H #include "nodes/execnodes.h" extern LockRowsState *ExecInitLockRows(LockRows *node, EState *estate, int eflags); extern TupleTableSlot *ExecLockRows(LockRowsState *node); extern void ExecEndLockRows(LockRowsState *node); extern void ExecReScanLockRows(LockRowsState *node); #endif /* NODELOCKROWS_H */ PKBiZU3gserver/executor/nodeGroup.hnu[/*------------------------------------------------------------------------- * * nodeGroup.h * prototypes for nodeGroup.c * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/nodeGroup.h * *------------------------------------------------------------------------- */ #ifndef NODEGROUP_H #define NODEGROUP_H #include "nodes/execnodes.h" extern GroupState *ExecInitGroup(Group *node, EState *estate, int eflags); extern TupleTableSlot *ExecGroup(GroupState *node); extern void ExecEndGroup(GroupState *node); extern void ExecReScanGroup(GroupState *node); #endif /* NODEGROUP_H */ PKBiZU2server/executor/nodeWindowAgg.hnu[/*------------------------------------------------------------------------- * * nodeWindowAgg.h * prototypes for nodeWindowAgg.c * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/nodeWindowAgg.h * *------------------------------------------------------------------------- */ #ifndef NODEWINDOWAGG_H #define NODEWINDOWAGG_H #include "nodes/execnodes.h" extern WindowAggState *ExecInitWindowAgg(WindowAgg *node, EState *estate, int eflags); extern TupleTableSlot *ExecWindowAgg(WindowAggState *node); extern void ExecEndWindowAgg(WindowAggState *node); extern void ExecReScanWindowAgg(WindowAggState *node); #endif /* NODEWINDOWAGG_H */ PKBiZserver/executor/nodeUnique.hnu[/*------------------------------------------------------------------------- * * nodeUnique.h * * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/nodeUnique.h * *------------------------------------------------------------------------- */ #ifndef NODEUNIQUE_H #define NODEUNIQUE_H #include "nodes/execnodes.h" extern UniqueState *ExecInitUnique(Unique *node, EState *estate, int eflags); extern TupleTableSlot *ExecUnique(UniqueState *node); extern void ExecEndUnique(UniqueState *node); extern void ExecReScanUnique(UniqueState *node); #endif /* NODEUNIQUE_H */ PKBiZ 1,,server/executor/nodeSeqscan.hnu[/*------------------------------------------------------------------------- * * nodeSeqscan.h * * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/nodeSeqscan.h * *------------------------------------------------------------------------- */ #ifndef NODESEQSCAN_H #define NODESEQSCAN_H #include "nodes/execnodes.h" extern SeqScanState *ExecInitSeqScan(SeqScan *node, EState *estate, int eflags); extern TupleTableSlot *ExecSeqScan(SeqScanState *node); extern void ExecEndSeqScan(SeqScanState *node); extern void ExecSeqMarkPos(SeqScanState *node); extern void ExecSeqRestrPos(SeqScanState *node); extern void ExecReScanSeqScan(SeqScanState *node); #endif /* NODESEQSCAN_H */ PKBiẐ]) ) server/executor/instrument.hnu[/*------------------------------------------------------------------------- * * instrument.h * definitions for run-time statistics collection * * * Copyright (c) 2001-2012, PostgreSQL Global Development Group * * src/include/executor/instrument.h * *------------------------------------------------------------------------- */ #ifndef INSTRUMENT_H #define INSTRUMENT_H #include "portability/instr_time.h" typedef struct BufferUsage { long shared_blks_hit; /* # of shared buffer hits */ long shared_blks_read; /* # of shared disk blocks read */ long shared_blks_dirtied; /* # of shared blocks dirtied */ long shared_blks_written; /* # of shared disk blocks written */ long local_blks_hit; /* # of local buffer hits */ long local_blks_read; /* # of local disk blocks read */ long local_blks_dirtied; /* # of shared blocks dirtied */ long local_blks_written; /* # of local disk blocks written */ long temp_blks_read; /* # of temp blocks read */ long temp_blks_written; /* # of temp blocks written */ instr_time blk_read_time; /* time spent reading */ instr_time blk_write_time; /* time spent writing */ } BufferUsage; /* Flag bits included in InstrAlloc's instrument_options bitmask */ typedef enum InstrumentOption { INSTRUMENT_TIMER = 1 << 0, /* needs timer (and row counts) */ INSTRUMENT_BUFFERS = 1 << 1, /* needs buffer usage */ INSTRUMENT_ROWS = 1 << 2, /* needs row count */ INSTRUMENT_ALL = 0x7FFFFFFF } InstrumentOption; typedef struct Instrumentation { /* Parameters set at node creation: */ bool need_timer; /* TRUE if we need timer data */ bool need_bufusage; /* TRUE if we need buffer usage data */ /* Info about current plan cycle: */ bool running; /* TRUE if we've completed first tuple */ instr_time starttime; /* Start time of current iteration of node */ instr_time counter; /* Accumulated runtime for this node */ double firsttuple; /* Time for first tuple of this cycle */ double tuplecount; /* Tuples emitted so far this cycle */ BufferUsage bufusage_start; /* Buffer usage at start */ /* Accumulated statistics across all completed cycles: */ double startup; /* Total startup time (in seconds) */ double total; /* Total total time (in seconds) */ double ntuples; /* Total tuples produced */ double nloops; /* # of run cycles for this node */ double nfiltered1; /* # tuples removed by scanqual or joinqual */ double nfiltered2; /* # tuples removed by "other" quals */ BufferUsage bufusage; /* Total buffer usage */ } Instrumentation; extern PGDLLIMPORT BufferUsage pgBufferUsage; extern Instrumentation *InstrAlloc(int n, int instrument_options); extern void InstrStartNode(Instrumentation *instr); extern void InstrStopNode(Instrumentation *instr, double nTuples); extern void InstrEndLoop(Instrumentation *instr); #endif /* INSTRUMENT_H */ PKBiZ-.server/executor/spi.hnu[/*------------------------------------------------------------------------- * * spi.h * Server Programming Interface public declarations * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/spi.h * *------------------------------------------------------------------------- */ #ifndef SPI_H #define SPI_H #include "nodes/parsenodes.h" #include "utils/portal.h" typedef struct SPITupleTable { MemoryContext tuptabcxt; /* memory context of result table */ uint32 alloced; /* # of alloced vals */ uint32 free; /* # of free vals */ TupleDesc tupdesc; /* tuple descriptor */ HeapTuple *vals; /* tuples */ } SPITupleTable; /* Plans are opaque structs for standard users of SPI */ typedef struct _SPI_plan *SPIPlanPtr; #define SPI_ERROR_CONNECT (-1) #define SPI_ERROR_COPY (-2) #define SPI_ERROR_OPUNKNOWN (-3) #define SPI_ERROR_UNCONNECTED (-4) #define SPI_ERROR_CURSOR (-5) /* not used anymore */ #define SPI_ERROR_ARGUMENT (-6) #define SPI_ERROR_PARAM (-7) #define SPI_ERROR_TRANSACTION (-8) #define SPI_ERROR_NOATTRIBUTE (-9) #define SPI_ERROR_NOOUTFUNC (-10) #define SPI_ERROR_TYPUNKNOWN (-11) #define SPI_OK_CONNECT 1 #define SPI_OK_FINISH 2 #define SPI_OK_FETCH 3 #define SPI_OK_UTILITY 4 #define SPI_OK_SELECT 5 #define SPI_OK_SELINTO 6 #define SPI_OK_INSERT 7 #define SPI_OK_DELETE 8 #define SPI_OK_UPDATE 9 #define SPI_OK_CURSOR 10 #define SPI_OK_INSERT_RETURNING 11 #define SPI_OK_DELETE_RETURNING 12 #define SPI_OK_UPDATE_RETURNING 13 #define SPI_OK_REWRITTEN 14 extern PGDLLIMPORT uint32 SPI_processed; extern PGDLLIMPORT Oid SPI_lastoid; extern PGDLLIMPORT SPITupleTable *SPI_tuptable; extern PGDLLIMPORT int SPI_result; extern int SPI_connect(void); extern int SPI_finish(void); extern void SPI_push(void); extern void SPI_pop(void); extern bool SPI_push_conditional(void); extern void SPI_pop_conditional(bool pushed); extern void SPI_restore_connection(void); extern int SPI_execute(const char *src, bool read_only, long tcount); extern int SPI_execute_plan(SPIPlanPtr plan, Datum *Values, const char *Nulls, bool read_only, long tcount); extern int SPI_execute_plan_with_paramlist(SPIPlanPtr plan, ParamListInfo params, bool read_only, long tcount); extern int SPI_exec(const char *src, long tcount); extern int SPI_execp(SPIPlanPtr plan, Datum *Values, const char *Nulls, long tcount); extern int SPI_execute_snapshot(SPIPlanPtr plan, Datum *Values, const char *Nulls, Snapshot snapshot, Snapshot crosscheck_snapshot, bool read_only, bool fire_triggers, long tcount); extern int SPI_execute_with_args(const char *src, int nargs, Oid *argtypes, Datum *Values, const char *Nulls, bool read_only, long tcount); extern SPIPlanPtr SPI_prepare(const char *src, int nargs, Oid *argtypes); extern SPIPlanPtr SPI_prepare_cursor(const char *src, int nargs, Oid *argtypes, int cursorOptions); extern SPIPlanPtr SPI_prepare_params(const char *src, ParserSetupHook parserSetup, void *parserSetupArg, int cursorOptions); extern int SPI_keepplan(SPIPlanPtr plan); extern SPIPlanPtr SPI_saveplan(SPIPlanPtr plan); extern int SPI_freeplan(SPIPlanPtr plan); extern Oid SPI_getargtypeid(SPIPlanPtr plan, int argIndex); extern int SPI_getargcount(SPIPlanPtr plan); extern bool SPI_is_cursor_plan(SPIPlanPtr plan); extern bool SPI_plan_is_valid(SPIPlanPtr plan); extern const char *SPI_result_code_string(int code); extern List *SPI_plan_get_plan_sources(SPIPlanPtr plan); extern CachedPlan *SPI_plan_get_cached_plan(SPIPlanPtr plan); extern HeapTuple SPI_copytuple(HeapTuple tuple); extern HeapTupleHeader SPI_returntuple(HeapTuple tuple, TupleDesc tupdesc); extern HeapTuple SPI_modifytuple(Relation rel, HeapTuple tuple, int natts, int *attnum, Datum *Values, const char *Nulls); extern int SPI_fnumber(TupleDesc tupdesc, const char *fname); extern char *SPI_fname(TupleDesc tupdesc, int fnumber); extern char *SPI_getvalue(HeapTuple tuple, TupleDesc tupdesc, int fnumber); extern Datum SPI_getbinval(HeapTuple tuple, TupleDesc tupdesc, int fnumber, bool *isnull); extern char *SPI_gettype(TupleDesc tupdesc, int fnumber); extern Oid SPI_gettypeid(TupleDesc tupdesc, int fnumber); extern char *SPI_getrelname(Relation rel); extern char *SPI_getnspname(Relation rel); extern void *SPI_palloc(Size size); extern void *SPI_repalloc(void *pointer, Size size); extern void SPI_pfree(void *pointer); extern void SPI_freetuple(HeapTuple pointer); extern void SPI_freetuptable(SPITupleTable *tuptable); extern Portal SPI_cursor_open(const char *name, SPIPlanPtr plan, Datum *Values, const char *Nulls, bool read_only); extern Portal SPI_cursor_open_with_args(const char *name, const char *src, int nargs, Oid *argtypes, Datum *Values, const char *Nulls, bool read_only, int cursorOptions); extern Portal SPI_cursor_open_with_paramlist(const char *name, SPIPlanPtr plan, ParamListInfo params, bool read_only); extern Portal SPI_cursor_find(const char *name); extern void SPI_cursor_fetch(Portal portal, bool forward, long count); extern void SPI_cursor_move(Portal portal, bool forward, long count); extern void SPI_scroll_cursor_fetch(Portal, FetchDirection direction, long count); extern void SPI_scroll_cursor_move(Portal, FetchDirection direction, long count); extern void SPI_cursor_close(Portal portal); extern void AtEOXact_SPI(bool isCommit); extern void AtEOSubXact_SPI(bool isCommit, SubTransactionId mySubid); #endif /* SPI_H */ PKBiZ' <:<:server/executor/executor.hnu[/*------------------------------------------------------------------------- * * executor.h * support for the POSTGRES executor module * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/executor/executor.h * *------------------------------------------------------------------------- */ #ifndef EXECUTOR_H #define EXECUTOR_H #include "executor/execdesc.h" #include "nodes/parsenodes.h" /* * The "eflags" argument to ExecutorStart and the various ExecInitNode * routines is a bitwise OR of the following flag bits, which tell the * called plan node what to expect. Note that the flags will get modified * as they are passed down the plan tree, since an upper node may require * functionality in its subnode not demanded of the plan as a whole * (example: MergeJoin requires mark/restore capability in its inner input), * or an upper node may shield its input from some functionality requirement * (example: Materialize shields its input from needing to do backward scan). * * EXPLAIN_ONLY indicates that the plan tree is being initialized just so * EXPLAIN can print it out; it will not be run. Hence, no side-effects * of startup should occur. However, error checks (such as permission checks) * should be performed. * * REWIND indicates that the plan node should try to efficiently support * rescans without parameter changes. (Nodes must support ExecReScan calls * in any case, but if this flag was not given, they are at liberty to do it * through complete recalculation. Note that a parameter change forces a * full recalculation in any case.) * * BACKWARD indicates that the plan node must respect the es_direction flag. * When this is not passed, the plan node will only be run forwards. * * MARK indicates that the plan node must support Mark/Restore calls. * When this is not passed, no Mark/Restore will occur. * * SKIP_TRIGGERS tells ExecutorStart/ExecutorFinish to skip calling * AfterTriggerBeginQuery/AfterTriggerEndQuery. This does not necessarily * mean that the plan can't queue any AFTER triggers; just that the caller * is responsible for there being a trigger context for them to be queued in. * * WITH/WITHOUT_OIDS tell the executor to emit tuples with or without space * for OIDs, respectively. These are currently used only for CREATE TABLE AS. * If neither is set, the plan may or may not produce tuples including OIDs. */ #define EXEC_FLAG_EXPLAIN_ONLY 0x0001 /* EXPLAIN, no ANALYZE */ #define EXEC_FLAG_REWIND 0x0002 /* need efficient rescan */ #define EXEC_FLAG_BACKWARD 0x0004 /* need backward scan */ #define EXEC_FLAG_MARK 0x0008 /* need mark/restore */ #define EXEC_FLAG_SKIP_TRIGGERS 0x0010 /* skip AfterTrigger calls */ #define EXEC_FLAG_WITH_OIDS 0x0020 /* force OIDs in returned tuples */ #define EXEC_FLAG_WITHOUT_OIDS 0x0040 /* force no OIDs in returned tuples */ /* * ExecEvalExpr was formerly a function containing a switch statement; * now it's just a macro invoking the function pointed to by an ExprState * node. Beware of double evaluation of the ExprState argument! */ #define ExecEvalExpr(expr, econtext, isNull, isDone) \ ((*(expr)->evalfunc) (expr, econtext, isNull, isDone)) /* Hook for plugins to get control in ExecutorStart() */ typedef void (*ExecutorStart_hook_type) (QueryDesc *queryDesc, int eflags); extern PGDLLIMPORT ExecutorStart_hook_type ExecutorStart_hook; /* Hook for plugins to get control in ExecutorRun() */ typedef void (*ExecutorRun_hook_type) (QueryDesc *queryDesc, ScanDirection direction, long count); extern PGDLLIMPORT ExecutorRun_hook_type ExecutorRun_hook; /* Hook for plugins to get control in ExecutorFinish() */ typedef void (*ExecutorFinish_hook_type) (QueryDesc *queryDesc); extern PGDLLIMPORT ExecutorFinish_hook_type ExecutorFinish_hook; /* Hook for plugins to get control in ExecutorEnd() */ typedef void (*ExecutorEnd_hook_type) (QueryDesc *queryDesc); extern PGDLLIMPORT ExecutorEnd_hook_type ExecutorEnd_hook; /* Hook for plugins to get control in ExecCheckRTPerms() */ typedef bool (*ExecutorCheckPerms_hook_type) (List *, bool); extern PGDLLIMPORT ExecutorCheckPerms_hook_type ExecutorCheckPerms_hook; /* * prototypes from functions in execAmi.c */ extern void ExecReScan(PlanState *node); extern void ExecMarkPos(PlanState *node); extern void ExecRestrPos(PlanState *node); extern bool ExecSupportsMarkRestore(NodeTag plantype); extern bool ExecSupportsBackwardScan(Plan *node); extern bool ExecMaterializesOutput(NodeTag plantype); /* * prototypes from functions in execCurrent.c */ extern bool execCurrentOf(CurrentOfExpr *cexpr, ExprContext *econtext, Oid table_oid, ItemPointer current_tid); /* * prototypes from functions in execGrouping.c */ extern bool execTuplesMatch(TupleTableSlot *slot1, TupleTableSlot *slot2, int numCols, AttrNumber *matchColIdx, FmgrInfo *eqfunctions, MemoryContext evalContext); extern bool execTuplesUnequal(TupleTableSlot *slot1, TupleTableSlot *slot2, int numCols, AttrNumber *matchColIdx, FmgrInfo *eqfunctions, MemoryContext evalContext); extern FmgrInfo *execTuplesMatchPrepare(int numCols, Oid *eqOperators); extern void execTuplesHashPrepare(int numCols, Oid *eqOperators, FmgrInfo **eqFunctions, FmgrInfo **hashFunctions); extern TupleHashTable BuildTupleHashTable(int numCols, AttrNumber *keyColIdx, FmgrInfo *eqfunctions, FmgrInfo *hashfunctions, long nbuckets, Size entrysize, MemoryContext tablecxt, MemoryContext tempcxt); extern TupleHashEntry LookupTupleHashEntry(TupleHashTable hashtable, TupleTableSlot *slot, bool *isnew); extern TupleHashEntry FindTupleHashEntry(TupleHashTable hashtable, TupleTableSlot *slot, FmgrInfo *eqfunctions, FmgrInfo *hashfunctions); /* * prototypes from functions in execJunk.c */ extern JunkFilter *ExecInitJunkFilter(List *targetList, bool hasoid, TupleTableSlot *slot); extern JunkFilter *ExecInitJunkFilterConversion(List *targetList, TupleDesc cleanTupType, TupleTableSlot *slot); extern AttrNumber ExecFindJunkAttribute(JunkFilter *junkfilter, const char *attrName); extern AttrNumber ExecFindJunkAttributeInTlist(List *targetlist, const char *attrName); extern Datum ExecGetJunkAttribute(TupleTableSlot *slot, AttrNumber attno, bool *isNull); extern TupleTableSlot *ExecFilterJunk(JunkFilter *junkfilter, TupleTableSlot *slot); /* * prototypes from functions in execMain.c */ extern void ExecutorStart(QueryDesc *queryDesc, int eflags); extern void standard_ExecutorStart(QueryDesc *queryDesc, int eflags); extern void ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, long count); extern void standard_ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, long count); extern void ExecutorFinish(QueryDesc *queryDesc); extern void standard_ExecutorFinish(QueryDesc *queryDesc); extern void ExecutorEnd(QueryDesc *queryDesc); extern void standard_ExecutorEnd(QueryDesc *queryDesc); extern void ExecutorRewind(QueryDesc *queryDesc); extern bool ExecCheckRTPerms(List *rangeTable, bool ereport_on_violation); extern void CheckValidResultRel(Relation resultRel, CmdType operation); extern void InitResultRelInfo(ResultRelInfo *resultRelInfo, Relation resultRelationDesc, Index resultRelationIndex, int instrument_options); extern ResultRelInfo *ExecGetTriggerResultRel(EState *estate, Oid relid); extern bool ExecContextForcesOids(PlanState *planstate, bool *hasoids); extern void ExecConstraints(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate); extern ExecRowMark *ExecFindRowMark(EState *estate, Index rti); extern ExecAuxRowMark *ExecBuildAuxRowMark(ExecRowMark *erm, List *targetlist); extern TupleTableSlot *EvalPlanQual(EState *estate, EPQState *epqstate, Relation relation, Index rti, ItemPointer tid, TransactionId priorXmax); extern HeapTuple EvalPlanQualFetch(EState *estate, Relation relation, int lockmode, ItemPointer tid, TransactionId priorXmax); extern void EvalPlanQualInit(EPQState *epqstate, EState *estate, Plan *subplan, List *auxrowmarks, int epqParam); extern void EvalPlanQualSetPlan(EPQState *epqstate, Plan *subplan, List *auxrowmarks); extern void EvalPlanQualSetTuple(EPQState *epqstate, Index rti, HeapTuple tuple); extern HeapTuple EvalPlanQualGetTuple(EPQState *epqstate, Index rti); #define EvalPlanQualSetSlot(epqstate, slot) ((epqstate)->origslot = (slot)) extern void EvalPlanQualFetchRowMarks(EPQState *epqstate); extern TupleTableSlot *EvalPlanQualNext(EPQState *epqstate); extern void EvalPlanQualBegin(EPQState *epqstate, EState *parentestate); extern void EvalPlanQualEnd(EPQState *epqstate); /* * prototypes from functions in execProcnode.c */ extern PlanState *ExecInitNode(Plan *node, EState *estate, int eflags); extern TupleTableSlot *ExecProcNode(PlanState *node); extern Node *MultiExecProcNode(PlanState *node); extern void ExecEndNode(PlanState *node); /* * prototypes from functions in execQual.c */ extern Datum GetAttributeByNum(HeapTupleHeader tuple, AttrNumber attrno, bool *isNull); extern Datum GetAttributeByName(HeapTupleHeader tuple, const char *attname, bool *isNull); extern Tuplestorestate *ExecMakeTableFunctionResult(ExprState *funcexpr, ExprContext *econtext, MemoryContext argContext, TupleDesc expectedDesc, bool randomAccess); extern Datum ExecEvalExprSwitchContext(ExprState *expression, ExprContext *econtext, bool *isNull, ExprDoneCond *isDone); extern ExprState *ExecInitExpr(Expr *node, PlanState *parent); extern ExprState *ExecPrepareExpr(Expr *node, EState *estate); extern bool ExecQual(List *qual, ExprContext *econtext, bool resultForNull); extern int ExecTargetListLength(List *targetlist); extern int ExecCleanTargetListLength(List *targetlist); extern TupleTableSlot *ExecProject(ProjectionInfo *projInfo, ExprDoneCond *isDone); /* * prototypes from functions in execScan.c */ typedef TupleTableSlot *(*ExecScanAccessMtd) (ScanState *node); typedef bool (*ExecScanRecheckMtd) (ScanState *node, TupleTableSlot *slot); extern TupleTableSlot *ExecScan(ScanState *node, ExecScanAccessMtd accessMtd, ExecScanRecheckMtd recheckMtd); extern void ExecAssignScanProjectionInfo(ScanState *node); extern void ExecScanReScan(ScanState *node); /* * prototypes from functions in execTuples.c */ extern void ExecInitResultTupleSlot(EState *estate, PlanState *planstate); extern void ExecInitScanTupleSlot(EState *estate, ScanState *scanstate); extern TupleTableSlot *ExecInitExtraTupleSlot(EState *estate); extern TupleTableSlot *ExecInitNullTupleSlot(EState *estate, TupleDesc tupType); extern TupleDesc ExecTypeFromTL(List *targetList, bool hasoid); extern TupleDesc ExecCleanTypeFromTL(List *targetList, bool hasoid); extern TupleDesc ExecTypeFromExprList(List *exprList, List *namesList); extern void ExecTypeSetColNames(TupleDesc typeInfo, List *namesList); extern void UpdateChangedParamSet(PlanState *node, Bitmapset *newchg); typedef struct TupOutputState { TupleTableSlot *slot; DestReceiver *dest; } TupOutputState; extern TupOutputState *begin_tup_output_tupdesc(DestReceiver *dest, TupleDesc tupdesc); extern void do_tup_output(TupOutputState *tstate, Datum *values, bool *isnull); extern void do_text_output_multiline(TupOutputState *tstate, const char *txt); extern void end_tup_output(TupOutputState *tstate); /* * Write a single line of text given as a C string. * * Should only be used with a single-TEXT-attribute tupdesc. */ #define do_text_output_oneline(tstate, str_to_emit) \ do { \ Datum values_[1]; \ bool isnull_[1]; \ values_[0] = PointerGetDatum(cstring_to_text(str_to_emit)); \ isnull_[0] = false; \ do_tup_output(tstate, values_, isnull_); \ pfree(DatumGetPointer(values_[0])); \ } while (0) /* * prototypes from functions in execUtils.c */ extern EState *CreateExecutorState(void); extern void FreeExecutorState(EState *estate); extern ExprContext *CreateExprContext(EState *estate); extern ExprContext *CreateStandaloneExprContext(void); extern void FreeExprContext(ExprContext *econtext, bool isCommit); extern void ReScanExprContext(ExprContext *econtext); #define ResetExprContext(econtext) \ MemoryContextReset((econtext)->ecxt_per_tuple_memory) extern ExprContext *MakePerTupleExprContext(EState *estate); /* Get an EState's per-output-tuple exprcontext, making it if first use */ #define GetPerTupleExprContext(estate) \ ((estate)->es_per_tuple_exprcontext ? \ (estate)->es_per_tuple_exprcontext : \ MakePerTupleExprContext(estate)) #define GetPerTupleMemoryContext(estate) \ (GetPerTupleExprContext(estate)->ecxt_per_tuple_memory) /* Reset an EState's per-output-tuple exprcontext, if one's been created */ #define ResetPerTupleExprContext(estate) \ do { \ if ((estate)->es_per_tuple_exprcontext) \ ResetExprContext((estate)->es_per_tuple_exprcontext); \ } while (0) extern void ExecAssignExprContext(EState *estate, PlanState *planstate); extern void ExecAssignResultType(PlanState *planstate, TupleDesc tupDesc); extern void ExecAssignResultTypeFromTL(PlanState *planstate); extern TupleDesc ExecGetResultType(PlanState *planstate); extern ProjectionInfo *ExecBuildProjectionInfo(List *targetList, ExprContext *econtext, TupleTableSlot *slot, TupleDesc inputDesc); extern void ExecAssignProjectionInfo(PlanState *planstate, TupleDesc inputDesc); extern void ExecFreeExprContext(PlanState *planstate); extern TupleDesc ExecGetScanType(ScanState *scanstate); extern void ExecAssignScanType(ScanState *scanstate, TupleDesc tupDesc); extern void ExecAssignScanTypeFromOuterPlan(ScanState *scanstate); extern bool ExecRelationIsTargetRelation(EState *estate, Index scanrelid); extern Relation ExecOpenScanRelation(EState *estate, Index scanrelid); extern void ExecCloseScanRelation(Relation scanrel); extern void ExecOpenIndices(ResultRelInfo *resultRelInfo); extern void ExecCloseIndices(ResultRelInfo *resultRelInfo); extern List *ExecInsertIndexTuples(TupleTableSlot *slot, ItemPointer tupleid, EState *estate); extern bool check_exclusion_constraint(Relation heap, Relation index, IndexInfo *indexInfo, ItemPointer tupleid, Datum *values, bool *isnull, EState *estate, bool newIndex, bool errorOK); extern void RegisterExprContextCallback(ExprContext *econtext, ExprContextCallbackFunction function, Datum arg); extern void UnregisterExprContextCallback(ExprContext *econtext, ExprContextCallbackFunction function, Datum arg); #endif /* EXECUTOR_H */ PKBiZppS' ' server/replication/walprotocol.hnu[/*------------------------------------------------------------------------- * * walprotocol.h * Definitions relevant to the streaming WAL transmission protocol. * * Portions Copyright (c) 2010-2012, PostgreSQL Global Development Group * * src/include/replication/walprotocol.h * *------------------------------------------------------------------------- */ #ifndef _WALPROTOCOL_H #define _WALPROTOCOL_H #include "access/xlogdefs.h" #include "datatype/timestamp.h" /* * All messages from WalSender must contain these fields to allow us to * correctly calculate the replication delay. */ typedef struct { /* Current end of WAL on the sender */ XLogRecPtr walEnd; /* Sender's system clock at the time of transmission */ TimestampTz sendTime; } WalSndrMessage; /* * Header for a WAL data message (message type 'w'). This is wrapped within * a CopyData message at the FE/BE protocol level. * * The header is followed by actual WAL data. Note that the data length is * not specified in the header --- it's just whatever remains in the message. * * walEnd and sendTime are not essential data, but are provided in case * the receiver wants to adjust its behavior depending on how far behind * it is. */ typedef struct { /* WAL start location of the data included in this message */ XLogRecPtr dataStart; /* Current end of WAL on the sender */ XLogRecPtr walEnd; /* Sender's system clock at the time of transmission */ TimestampTz sendTime; } WalDataMessageHeader; /* * Keepalive message from primary (message type 'k'). (lowercase k) * This is wrapped within a CopyData message at the FE/BE protocol level. * * Note that the data length is not specified here. */ typedef WalSndrMessage PrimaryKeepaliveMessage; /* * Reply message from standby (message type 'r'). This is wrapped within * a CopyData message at the FE/BE protocol level. * * Note that the data length is not specified here. */ typedef struct { /* * The xlog locations that have been written, flushed, and applied by * standby-side. These may be invalid if the standby-side is unable to or * chooses not to report these. */ XLogRecPtr write; XLogRecPtr flush; XLogRecPtr apply; /* Sender's system clock at the time of transmission */ TimestampTz sendTime; } StandbyReplyMessage; /* * Hot Standby feedback from standby (message type 'h'). This is wrapped within * a CopyData message at the FE/BE protocol level. * * Note that the data length is not specified here. */ typedef struct { /* * The current xmin and epoch from the standby, for Hot Standby feedback. * This may be invalid if the standby-side does not support feedback, or * Hot Standby is not yet available. */ TransactionId xmin; uint32 epoch; /* Sender's system clock at the time of transmission */ TimestampTz sendTime; } StandbyHSFeedbackMessage; /* * Maximum data payload in a WAL data message. Must be >= XLOG_BLCKSZ. * * We don't have a good idea of what a good value would be; there's some * overhead per message in both walsender and walreceiver, but on the other * hand sending large batches makes walsender less responsive to signals * because signals are checked only between messages. 128kB (with * default 8k blocks) seems like a reasonable guess for now. */ #define MAX_SEND_SIZE (XLOG_BLCKSZ * 16) #endif /* _WALPROTOCOL_H */ PKBiZ-- server/replication/walreceiver.hnu[/*------------------------------------------------------------------------- * * walreceiver.h * Exports from replication/walreceiverfuncs.c. * * Portions Copyright (c) 2010-2012, PostgreSQL Global Development Group * * src/include/replication/walreceiver.h * *------------------------------------------------------------------------- */ #ifndef _WALRECEIVER_H #define _WALRECEIVER_H #include "access/xlog.h" #include "access/xlogdefs.h" #include "storage/spin.h" #include "pgtime.h" extern int wal_receiver_status_interval; extern bool hot_standby_feedback; /* * MAXCONNINFO: maximum size of a connection string. * * XXX: Should this move to pg_config_manual.h? */ #define MAXCONNINFO 1024 /* Can we allow the standby to accept replication connection from another standby? */ #define AllowCascadeReplication() (EnableHotStandby && max_wal_senders > 0) /* * Values for WalRcv->walRcvState. */ typedef enum { WALRCV_STOPPED, /* stopped and mustn't start up again */ WALRCV_STARTING, /* launched, but the process hasn't * initialized yet */ WALRCV_RUNNING, /* walreceiver is running */ WALRCV_STOPPING /* requested to stop, but still running */ } WalRcvState; /* Shared memory area for management of walreceiver process */ typedef struct { /* * PID of currently active walreceiver process, its current state and * start time (actually, the time at which it was requested to be * started). */ pid_t pid; WalRcvState walRcvState; pg_time_t startTime; /* * receiveStart is the first byte position that will be received. When * startup process starts the walreceiver, it sets receiveStart to the * point where it wants the streaming to begin. */ XLogRecPtr receiveStart; /* * receivedUpto-1 is the last byte position that has already been * received. At the first startup of walreceiver, receivedUpto is set to * receiveStart. After that, walreceiver updates this whenever it flushes * the received WAL to disk. */ XLogRecPtr receivedUpto; /* * latestChunkStart is the starting byte position of the current "batch" * of received WAL. It's actually the same as the previous value of * receivedUpto before the last flush to disk. Startup process can use * this to detect whether it's keeping up or not. */ XLogRecPtr latestChunkStart; /* * Time of send and receive of any message received. */ TimestampTz lastMsgSendTime; TimestampTz lastMsgReceiptTime; /* * Latest reported end of WAL on the sender */ XLogRecPtr latestWalEnd; TimestampTz latestWalEndTime; /* * connection string; is used for walreceiver to connect with the primary. */ char conninfo[MAXCONNINFO]; slock_t mutex; /* locks shared variables shown above */ } WalRcvData; extern WalRcvData *WalRcv; /* libpqwalreceiver hooks */ typedef bool (*walrcv_connect_type) (char *conninfo, XLogRecPtr startpoint); extern PGDLLIMPORT walrcv_connect_type walrcv_connect; typedef bool (*walrcv_receive_type) (int timeout, unsigned char *type, char **buffer, int *len); extern PGDLLIMPORT walrcv_receive_type walrcv_receive; typedef void (*walrcv_send_type) (const char *buffer, int nbytes); extern PGDLLIMPORT walrcv_send_type walrcv_send; typedef void (*walrcv_disconnect_type) (void); extern PGDLLIMPORT walrcv_disconnect_type walrcv_disconnect; /* prototypes for functions in walreceiver.c */ extern void WalReceiverMain(void); /* prototypes for functions in walreceiverfuncs.c */ extern Size WalRcvShmemSize(void); extern void WalRcvShmemInit(void); extern void ShutdownWalRcv(void); extern bool WalRcvInProgress(void); extern void RequestXLogStreaming(XLogRecPtr recptr, const char *conninfo); extern XLogRecPtr GetWalRcvWriteRecPtr(XLogRecPtr *latestChunkStart); extern int GetReplicationApplyDelay(void); extern int GetReplicationTransferLatency(void); #endif /* _WALRECEIVER_H */ PKBiZH6 &server/replication/walsender_private.hnu[/*------------------------------------------------------------------------- * * walsender_private.h * Private definitions from replication/walsender.c. * * Portions Copyright (c) 2010-2012, PostgreSQL Global Development Group * * src/include/replication/walsender_private.h * *------------------------------------------------------------------------- */ #ifndef _WALSENDER_PRIVATE_H #define _WALSENDER_PRIVATE_H #include "access/xlog.h" #include "nodes/nodes.h" #include "replication/syncrep.h" #include "storage/latch.h" #include "storage/shmem.h" #include "storage/spin.h" typedef enum WalSndState { WALSNDSTATE_STARTUP = 0, WALSNDSTATE_BACKUP, WALSNDSTATE_CATCHUP, WALSNDSTATE_STREAMING } WalSndState; /* * Each walsender has a WalSnd struct in shared memory. */ typedef struct WalSnd { pid_t pid; /* this walsender's process id, or 0 */ WalSndState state; /* this walsender's state */ XLogRecPtr sentPtr; /* WAL has been sent up to this point */ bool needreload; /* does currently-open file need to be * reloaded? */ bool sendKeepalive; /* do we send keepalives on this connection? */ /* * The xlog locations that have been written, flushed, and applied by * standby-side. These may be invalid if the standby-side has not offered * values yet. */ XLogRecPtr write; XLogRecPtr flush; XLogRecPtr apply; /* Protects shared variables shown above. */ slock_t mutex; /* * Latch used by backends to wake up this walsender when it has work to * do. */ Latch latch; /* * The priority order of the standby managed by this WALSender, as listed * in synchronous_standby_names, or 0 if not-listed. Protected by * SyncRepLock. */ int sync_standby_priority; } WalSnd; extern WalSnd *MyWalSnd; /* There is one WalSndCtl struct for the whole database cluster */ typedef struct { /* * Synchronous replication queue with one queue per request type. * Protected by SyncRepLock. */ SHM_QUEUE SyncRepQueue[NUM_SYNC_REP_WAIT_MODE]; /* * Current location of the head of the queue. All waiters should have a * waitLSN that follows this value. Protected by SyncRepLock. */ XLogRecPtr lsn[NUM_SYNC_REP_WAIT_MODE]; /* * Are any sync standbys defined? Waiting backends can't reload the * config file safely, so checkpointer updates this value as needed. * Protected by SyncRepLock. */ bool sync_standbys_defined; WalSnd walsnds[1]; /* VARIABLE LENGTH ARRAY */ } WalSndCtlData; extern WalSndCtlData *WalSndCtl; extern void WalSndSetState(WalSndState state); extern void XLogRead(char *buf, XLogRecPtr startptr, Size count); /* * Internal functions for parsing the replication grammar, in repl_gram.y and * repl_scanner.l */ extern int replication_yyparse(void); extern int replication_yylex(void); extern void replication_yyerror(const char *str); extern void replication_scanner_init(const char *query_string); extern void replication_scanner_finish(void); extern Node *replication_parse_result; #endif /* _WALSENDER_PRIVATE_H */ PKBiZ;server/replication/basebackup.hnu[/*------------------------------------------------------------------------- * * basebackup.h * Exports from replication/basebackup.c. * * Portions Copyright (c) 2010-2012, PostgreSQL Global Development Group * * src/include/replication/basebackup.h * *------------------------------------------------------------------------- */ #ifndef _BASEBACKUP_H #define _BASEBACKUP_H #include "nodes/replnodes.h" extern void SendBaseBackup(BaseBackupCmd *cmd); #endif /* _BASEBACKUP_H */ PKBiZ]Πserver/replication/syncrep.hnu[/*------------------------------------------------------------------------- * * syncrep.h * Exports from replication/syncrep.c. * * Portions Copyright (c) 2010-2012, PostgreSQL Global Development Group * * IDENTIFICATION * src/include/replication/syncrep.h * *------------------------------------------------------------------------- */ #ifndef _SYNCREP_H #define _SYNCREP_H #include "access/xlogdefs.h" #include "utils/guc.h" #define SyncRepRequested() \ (max_wal_senders > 0 && synchronous_commit > SYNCHRONOUS_COMMIT_LOCAL_FLUSH) /* SyncRepWaitMode */ #define SYNC_REP_NO_WAIT -1 #define SYNC_REP_WAIT_WRITE 0 #define SYNC_REP_WAIT_FLUSH 1 #define NUM_SYNC_REP_WAIT_MODE 2 /* syncRepState */ #define SYNC_REP_NOT_WAITING 0 #define SYNC_REP_WAITING 1 #define SYNC_REP_WAIT_COMPLETE 2 /* user-settable parameters for synchronous replication */ extern char *SyncRepStandbyNames; /* called by user backend */ extern void SyncRepWaitForLSN(XLogRecPtr XactCommitLSN); /* called at backend exit */ extern void SyncRepCleanupAtProcExit(void); /* called by wal sender */ extern void SyncRepInitConfig(void); extern void SyncRepReleaseWaiters(void); /* called by checkpointer */ extern void SyncRepUpdateSyncStandbysDefined(void); extern bool check_synchronous_standby_names(char **newval, void **extra, GucSource source); extern void assign_synchronous_commit(int newval, void *extra); #endif /* _SYNCREP_H */ PKBiZmserver/replication/walsender.hnu[/*------------------------------------------------------------------------- * * walsender.h * Exports from replication/walsender.c. * * Portions Copyright (c) 2010-2012, PostgreSQL Global Development Group * * src/include/replication/walsender.h * *------------------------------------------------------------------------- */ #ifndef _WALSENDER_H #define _WALSENDER_H #include #include "fmgr.h" /* global state */ extern bool am_walsender; extern bool am_cascading_walsender; extern volatile sig_atomic_t walsender_shutdown_requested; extern volatile sig_atomic_t walsender_ready_to_stop; /* user-settable parameters */ extern int max_wal_senders; extern int replication_timeout; extern int WalSenderMain(void); extern void WalSndSignals(void); extern Size WalSndShmemSize(void); extern void WalSndShmemInit(void); extern void WalSndWakeup(void); extern void WalSndRqstFileReload(void); extern Datum pg_stat_get_wal_senders(PG_FUNCTION_ARGS); #endif /* _WALSENDER_H */ PKBiZɗŵiiserver/pg_config_x86_64.hnu[/* src/include/pg_config.h. Generated from pg_config.h.in by configure. */ /* src/include/pg_config.h.in. Generated from configure.in by autoheader. */ /* Define to the type of arg 1 of 'accept' */ #define ACCEPT_TYPE_ARG1 int /* Define to the type of arg 2 of 'accept' */ #define ACCEPT_TYPE_ARG2 struct sockaddr * /* Define to the type of arg 3 of 'accept' */ #define ACCEPT_TYPE_ARG3 socklen_t /* Define to the return type of 'accept' */ #define ACCEPT_TYPE_RETURN int /* Define if building universal (internal helper macro) */ /* #undef AC_APPLE_UNIVERSAL_BUILD */ /* The normal alignment of `double', in bytes. */ #define ALIGNOF_DOUBLE 8 /* The normal alignment of `int', in bytes. */ #define ALIGNOF_INT 4 /* The normal alignment of `long', in bytes. */ #define ALIGNOF_LONG 8 /* The normal alignment of `long long int', in bytes. */ /* #undef ALIGNOF_LONG_LONG_INT */ /* The normal alignment of `short', in bytes. */ #define ALIGNOF_SHORT 2 /* Size of a disk block --- this also limits the size of a tuple. You can set it bigger if you need bigger tuples (although TOAST should reduce the need to have large tuples, since fields can be spread across multiple tuples). BLCKSZ must be a power of 2. The maximum possible value of BLCKSZ is currently 2^15 (32768). This is determined by the 15-bit widths of the lp_off and lp_len fields in ItemIdData (see include/storage/itemid.h). Changing BLCKSZ requires an initdb. */ #define BLCKSZ 8192 /* Define to the default TCP port number on which the server listens and to which clients will try to connect. This can be overridden at run-time, but it's convenient if your clients have the right default compiled in. (--with-pgport=PORTNUM) */ #define DEF_PGPORT 5432 /* Define to the default TCP port number as a string constant. */ #define DEF_PGPORT_STR "5432" /* Define to build with GSSAPI support. (--with-gssapi) */ #define ENABLE_GSS 1 /* Define to 1 if you want National Language Support. (--enable-nls) */ #define ENABLE_NLS 1 /* Define to 1 to build client libraries as thread-safe code. (--enable-thread-safety) */ #define ENABLE_THREAD_SAFETY 1 /* Define to nothing if C supports flexible array members, and to 1 if it does not. That way, with a declaration like `struct s { int n; double d[FLEXIBLE_ARRAY_MEMBER]; };', the struct hack can be used with pre-C99 compilers. When computing the size of such an object, don't use 'sizeof (struct s)' as it overestimates the size. Use 'offsetof (struct s, d)' instead. Don't use 'offsetof (struct s, d[0])', as this doesn't work with MSVC and with C++ compilers. */ #define FLEXIBLE_ARRAY_MEMBER /**/ /* float4 values are passed by value if 'true', by reference if 'false' */ #define FLOAT4PASSBYVAL true /* float8, int8, and related values are passed by value if 'true', by reference if 'false' */ #define FLOAT8PASSBYVAL true /* Define to 1 if getpwuid_r() takes a 5th argument. */ #define GETPWUID_R_5ARG /**/ /* Define to 1 if gettimeofday() takes only 1 argument. */ /* #undef GETTIMEOFDAY_1ARG */ #ifdef GETTIMEOFDAY_1ARG # define gettimeofday(a,b) gettimeofday(a) #endif /* Define to 1 if you have the `append_history' function. */ #define HAVE_APPEND_HISTORY 1 /* Define to 1 if you have the `ASN1_STRING_get0_data' function. */ /* #undef HAVE_ASN1_STRING_GET0_DATA */ /* Define to 1 if you have the `BIO_meth_new' function. */ /* #undef HAVE_BIO_METH_NEW */ /* Define to 1 if you have the `cbrt' function. */ #define HAVE_CBRT 1 /* Define to 1 if you have the `class' function. */ /* #undef HAVE_CLASS */ /* Define to 1 if you have the header file. */ /* #undef HAVE_CRTDEFS_H */ /* Define to 1 if you have the `crypt' function. */ #define HAVE_CRYPT 1 /* Define to 1 if you have the `CRYPTO_lock' function. */ #define HAVE_CRYPTO_LOCK 1 /* Define to 1 if you have the header file. */ #define HAVE_CRYPT_H 1 /* Define to 1 if you have the declaration of `fdatasync', and to 0 if you don't. */ #define HAVE_DECL_FDATASYNC 1 /* Define to 1 if you have the declaration of `F_FULLFSYNC', and to 0 if you don't. */ #define HAVE_DECL_F_FULLFSYNC 0 /* Define to 1 if you have the declaration of `posix_fadvise', and to 0 if you don't. */ #define HAVE_DECL_POSIX_FADVISE 1 /* Define to 1 if you have the declaration of `snprintf', and to 0 if you don't. */ #define HAVE_DECL_SNPRINTF 1 /* Define to 1 if you have the declaration of `strlcat', and to 0 if you don't. */ #define HAVE_DECL_STRLCAT 0 /* Define to 1 if you have the declaration of `strlcpy', and to 0 if you don't. */ #define HAVE_DECL_STRLCPY 0 /* Define to 1 if you have the declaration of `sys_siglist', and to 0 if you don't. */ #define HAVE_DECL_SYS_SIGLIST 1 /* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you don't. */ #define HAVE_DECL_VSNPRINTF 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_DLD_H */ /* Define to 1 if you have the `dlopen' function. */ #define HAVE_DLOPEN 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_EDITLINE_HISTORY_H */ /* Define to 1 if you have the header file. */ /* #undef HAVE_EDITLINE_READLINE_H */ /* Define to 1 if you have the `fdatasync' function. */ #define HAVE_FDATASYNC 1 /* Define to 1 if you have the `fls' function. */ /* #undef HAVE_FLS */ /* Define to 1 if you have the `fpclass' function. */ /* #undef HAVE_FPCLASS */ /* Define to 1 if you have the `fp_class' function. */ /* #undef HAVE_FP_CLASS */ /* Define to 1 if you have the `fp_class_d' function. */ /* #undef HAVE_FP_CLASS_D */ /* Define to 1 if you have the header file. */ /* #undef HAVE_FP_CLASS_H */ /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ #define HAVE_FSEEKO 1 /* Define to 1 if your compiler understands __func__. */ #define HAVE_FUNCNAME__FUNC 1 /* Define to 1 if your compiler understands __FUNCTION__. */ /* #undef HAVE_FUNCNAME__FUNCTION */ /* Define to 1 if you have __sync_lock_test_and_set(int *) and friends. */ #define HAVE_GCC_INT_ATOMICS 1 /* Define to 1 if you have the `getaddrinfo' function. */ #define HAVE_GETADDRINFO 1 /* Define to 1 if you have the `gethostbyname_r' function. */ #define HAVE_GETHOSTBYNAME_R 1 /* Define to 1 if you have the `getifaddrs' function. */ #define HAVE_GETIFADDRS 1 /* Define to 1 if you have the `getopt' function. */ #define HAVE_GETOPT 1 /* Define to 1 if you have the header file. */ #define HAVE_GETOPT_H 1 /* Define to 1 if you have the `getopt_long' function. */ #define HAVE_GETOPT_LONG 1 /* Define to 1 if you have the `getpeereid' function. */ /* #undef HAVE_GETPEEREID */ /* Define to 1 if you have the `getpeerucred' function. */ /* #undef HAVE_GETPEERUCRED */ /* Define to 1 if you have the `getpwuid_r' function. */ #define HAVE_GETPWUID_R 1 /* Define to 1 if you have the `getrlimit' function. */ #define HAVE_GETRLIMIT 1 /* Define to 1 if you have the `getrusage' function. */ #define HAVE_GETRUSAGE 1 /* Define to 1 if you have the `gettimeofday' function. */ /* #undef HAVE_GETTIMEOFDAY */ /* Define to 1 if you have the header file. */ #define HAVE_GSSAPI_GSSAPI_H 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_GSSAPI_H */ /* Define to 1 if you have the header file. */ /* #undef HAVE_HISTORY_H */ /* Define to 1 if you have the `history_truncate_file' function. */ #define HAVE_HISTORY_TRUNCATE_FILE 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_IEEEFP_H */ /* Define to 1 if you have the header file. */ #define HAVE_IFADDRS_H 1 /* Define to 1 if you have the `inet_aton' function. */ #define HAVE_INET_ATON 1 /* Define to 1 if the system has the type `int64'. */ /* #undef HAVE_INT64 */ /* Define to 1 if the system has the type `int8'. */ /* #undef HAVE_INT8 */ /* Define to 1 if the system has the type `intptr_t'. */ #define HAVE_INTPTR_T 1 /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 /* Define to 1 if you have the global variable 'int opterr'. */ #define HAVE_INT_OPTERR 1 /* Define to 1 if you have the global variable 'int optreset'. */ /* #undef HAVE_INT_OPTRESET */ /* Define to 1 if you have the global variable 'int timezone'. */ #define HAVE_INT_TIMEZONE /**/ /* Define to 1 if you have support for IPv6. */ #define HAVE_IPV6 1 /* Define to 1 if you have isinf(). */ #define HAVE_ISINF 1 /* Define to 1 if `e_data' is member of `krb5_error'. */ /* #undef HAVE_KRB5_ERROR_E_DATA */ /* Define to 1 if `text.data' is member of `krb5_error'. */ #define HAVE_KRB5_ERROR_TEXT_DATA 1 /* Define to 1 if you have krb5_free_unparsed_name. */ #define HAVE_KRB5_FREE_UNPARSED_NAME 1 /* Define to 1 if `client' is member of `krb5_ticket'. */ /* #undef HAVE_KRB5_TICKET_CLIENT */ /* Define to 1 if `enc_part2' is member of `krb5_ticket'. */ #define HAVE_KRB5_TICKET_ENC_PART2 1 /* Define to 1 if you have the header file. */ #define HAVE_LANGINFO_H 1 /* Define to 1 if you have the header file. */ #define HAVE_LDAP_H 1 /* Define to 1 if you have the `crypto' library (-lcrypto). */ #define HAVE_LIBCRYPTO 1 /* Define to 1 if you have the `ldap' library (-lldap). */ #define HAVE_LIBLDAP 1 /* Define to 1 if you have the `ldap_r' library (-lldap_r). */ #define HAVE_LIBLDAP_R 1 /* Define to 1 if you have the `m' library (-lm). */ #define HAVE_LIBM 1 /* Define to 1 if you have the `pam' library (-lpam). */ #define HAVE_LIBPAM 1 /* Define if you have a function readline library */ #define HAVE_LIBREADLINE 1 /* Define to 1 if you have the `selinux' library (-lselinux). */ #define HAVE_LIBSELINUX 1 /* Define to 1 if you have the `ssl' library (-lssl). */ #define HAVE_LIBSSL 1 /* Define to 1 if you have the `wldap32' library (-lwldap32). */ /* #undef HAVE_LIBWLDAP32 */ /* Define to 1 if you have the `xml2' library (-lxml2). */ #define HAVE_LIBXML2 1 /* Define to 1 if you have the `xslt' library (-lxslt). */ #define HAVE_LIBXSLT 1 /* Define to 1 if you have the `z' library (-lz). */ #define HAVE_LIBZ 1 /* Define to 1 if the system has the type `locale_t'. */ #define HAVE_LOCALE_T 1 /* Define to 1 if `long int' works and is 64 bits. */ #define HAVE_LONG_INT_64 1 /* Define to 1 if the system has the type `long long int'. */ #define HAVE_LONG_LONG_INT 1 /* Define to 1 if `long long int' works and is 64 bits. */ /* #undef HAVE_LONG_LONG_INT_64 */ /* Define to 1 if you have the `mbstowcs_l' function. */ /* #undef HAVE_MBSTOWCS_L */ /* Define to 1 if you have the `memmove' function. */ #define HAVE_MEMMOVE 1 /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if the system has the type `MINIDUMP_TYPE'. */ /* #undef HAVE_MINIDUMP_TYPE */ /* Define to 1 if you have the `mkdtemp' function. */ #define HAVE_MKDTEMP 1 /* Define to 1 if you have the header file. */ #define HAVE_NETINET_IN_H 1 /* Define to 1 if you have the header file. */ #define HAVE_NETINET_TCP_H 1 /* Define to 1 if you have the header file. */ #define HAVE_NET_IF_H 1 /* Define to 1 if you have the `OPENSSL_init_ssl' function. */ /* #undef HAVE_OPENSSL_INIT_SSL */ /* Define to 1 if you have the header file. */ /* #undef HAVE_OSSP_UUID_H */ /* Define to 1 if you have the header file. */ /* #undef HAVE_PAM_PAM_APPL_H */ /* Define to 1 if you have the `poll' function. */ #define HAVE_POLL 1 /* Define to 1 if you have the header file. */ #define HAVE_POLL_H 1 /* Define to 1 if you have the `posix_fadvise' function. */ #define HAVE_POSIX_FADVISE 1 /* Define to 1 if you have the POSIX signal interface. */ #define HAVE_POSIX_SIGNALS /**/ /* Define to 1 if the assembler supports PPC's LWARX mutex hint bit. */ /* #undef HAVE_PPC_LWARX_MUTEX_HINT */ /* Define to 1 if you have the `pstat' function. */ /* #undef HAVE_PSTAT */ /* Define to 1 if the PS_STRINGS thing exists. */ /* #undef HAVE_PS_STRINGS */ /* Define if you have POSIX threads libraries and header files. */ /* #undef HAVE_PTHREAD */ /* Define to 1 if you have the `pthread_is_threaded_np' function. */ /* #undef HAVE_PTHREAD_IS_THREADED_NP */ /* Define to 1 if you have the header file. */ #define HAVE_PWD_H 1 /* Define to 1 if you have the `random' function. */ #define HAVE_RANDOM 1 /* Define to 1 if you have the `RAND_OpenSSL' function. */ /* #undef HAVE_RAND_OPENSSL */ /* Define to 1 if you have the header file. */ /* #undef HAVE_READLINE_H */ /* Define to 1 if you have the header file. */ #define HAVE_READLINE_HISTORY_H 1 /* Define to 1 if you have the header file. */ #define HAVE_READLINE_READLINE_H 1 /* Define to 1 if you have the `readlink' function. */ #define HAVE_READLINK 1 /* Define to 1 if you have the `rint' function. */ #define HAVE_RINT 1 /* Define to 1 if you have the global variable 'rl_completion_append_character'. */ #define HAVE_RL_COMPLETION_APPEND_CHARACTER 1 /* Define to 1 if you have the `rl_completion_matches' function. */ #define HAVE_RL_COMPLETION_MATCHES 1 /* Define to 1 if you have the `rl_filename_completion_function' function. */ #define HAVE_RL_FILENAME_COMPLETION_FUNCTION 1 /* Define to 1 if you have the `rl_reset_screen_size' function. */ #define HAVE_RL_RESET_SCREEN_SIZE 1 /* Define to 1 if you have the header file. */ #define HAVE_SECURITY_PAM_APPL_H 1 /* Define to 1 if you have the `setproctitle' function. */ /* #undef HAVE_SETPROCTITLE */ /* Define to 1 if you have the `setsid' function. */ #define HAVE_SETSID 1 /* Define to 1 if you have the `sigprocmask' function. */ #define HAVE_SIGPROCMASK 1 /* Define to 1 if you have sigsetjmp(). */ #define HAVE_SIGSETJMP 1 /* Define to 1 if the system has the type `sig_atomic_t'. */ #define HAVE_SIG_ATOMIC_T 1 /* Define to 1 if you have the `snprintf' function. */ #define HAVE_SNPRINTF 1 /* Define to 1 if you have spinlocks. */ #define HAVE_SPINLOCKS 1 /* Define to 1 if you have the `srandom' function. */ #define HAVE_SRANDOM 1 /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the `strerror' function. */ #define HAVE_STRERROR 1 /* Define to 1 if you have the `strerror_r' function. */ #define HAVE_STRERROR_R 1 /* Define to 1 if cpp supports the ANSI # stringizing operator. */ #define HAVE_STRINGIZE 1 /* Define to 1 if you have the header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the `strlcat' function. */ /* #undef HAVE_STRLCAT */ /* Define to 1 if you have the `strlcpy' function. */ /* #undef HAVE_STRLCPY */ /* Define to 1 if you have the `strtoll' function. */ #define HAVE_STRTOLL 1 /* Define to 1 if you have the `strtoq' function. */ /* #undef HAVE_STRTOQ */ /* Define to 1 if you have the `strtoull' function. */ #define HAVE_STRTOULL 1 /* Define to 1 if you have the `strtouq' function. */ /* #undef HAVE_STRTOUQ */ /* Define to 1 if the system has the type `struct addrinfo'. */ #define HAVE_STRUCT_ADDRINFO 1 /* Define to 1 if the system has the type `struct cmsgcred'. */ /* #undef HAVE_STRUCT_CMSGCRED */ /* Define to 1 if the system has the type `struct option'. */ #define HAVE_STRUCT_OPTION 1 /* Define to 1 if `sa_len' is member of `struct sockaddr'. */ /* #undef HAVE_STRUCT_SOCKADDR_SA_LEN */ /* Define to 1 if the system has the type `struct sockaddr_storage'. */ #define HAVE_STRUCT_SOCKADDR_STORAGE 1 /* Define to 1 if `ss_family' is member of `struct sockaddr_storage'. */ #define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1 /* Define to 1 if `ss_len' is member of `struct sockaddr_storage'. */ /* #undef HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN */ /* Define to 1 if `__ss_family' is member of `struct sockaddr_storage'. */ /* #undef HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY */ /* Define to 1 if `__ss_len' is member of `struct sockaddr_storage'. */ /* #undef HAVE_STRUCT_SOCKADDR_STORAGE___SS_LEN */ /* Define to 1 if `tm_zone' is member of `struct tm'. */ #define HAVE_STRUCT_TM_TM_ZONE 1 /* Define to 1 if you have the `symlink' function. */ #define HAVE_SYMLINK 1 /* Define to 1 if you have the syslog interface. */ #define HAVE_SYSLOG 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_IOCTL_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_IPC_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_POLL_H 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_PSTAT_H */ /* Define to 1 if you have the header file. */ #define HAVE_SYS_RESOURCE_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_SELECT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_SEM_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_SHM_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_SOCKET_H 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_SOCKIO_H */ /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_TAS_H */ /* Define to 1 if you have the header file. */ #define HAVE_SYS_TIME_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_UCRED_H */ /* Define to 1 if you have the header file. */ #define HAVE_SYS_UN_H 1 /* Define to 1 if you have the header file. */ #define HAVE_TERMIOS_H 1 /* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use `HAVE_STRUCT_TM_TM_ZONE' instead. */ #define HAVE_TM_ZONE 1 /* Define to 1 if you have the `towlower' function. */ #define HAVE_TOWLOWER 1 /* Define to 1 if you have the external array `tzname'. */ #define HAVE_TZNAME 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_UCRED_H */ /* Define to 1 if the system has the type `uint64'. */ /* #undef HAVE_UINT64 */ /* Define to 1 if the system has the type `uint8'. */ /* #undef HAVE_UINT8 */ /* Define to 1 if the system has the type `uintptr_t'. */ #define HAVE_UINTPTR_T 1 /* Define to 1 if the system has the type `union semun'. */ /* #undef HAVE_UNION_SEMUN */ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 /* Define to 1 if you have unix sockets. */ #define HAVE_UNIX_SOCKETS 1 /* Define to 1 if you have the `unsetenv' function. */ #define HAVE_UNSETENV 1 /* Define to 1 if you have the `utime' function. */ #define HAVE_UTIME 1 /* Define to 1 if you have the `utimes' function. */ #define HAVE_UTIMES 1 /* Define to 1 if you have the header file. */ #define HAVE_UTIME_H 1 /* Define to 1 if you have the header file. */ #define HAVE_UUID_H 1 /* Define to 1 if you have the `vsnprintf' function. */ #define HAVE_VSNPRINTF 1 /* Define to 1 if you have the `waitpid' function. */ #define HAVE_WAITPID 1 /* Define to 1 if you have the header file. */ #define HAVE_WCHAR_H 1 /* Define to 1 if you have the `wcstombs' function. */ #define HAVE_WCSTOMBS 1 /* Define to 1 if you have the `wcstombs_l' function. */ /* #undef HAVE_WCSTOMBS_L */ /* Define to 1 if you have the header file. */ #define HAVE_WCTYPE_H 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_WINLDAP_H */ /* Define to the appropriate snprintf format for 64-bit ints. */ #define INT64_FORMAT "%ld" /* Define to build with Kerberos 5 support. (--with-krb5) */ #define KRB5 1 /* Define to 1 if `locale_t' requires . */ /* #undef LOCALE_T_IN_XLOCALE */ /* Define as the maximum alignment requirement of any C data type. */ #define MAXIMUM_ALIGNOF 8 /* Define bytes to use libc memset(). */ #define MEMSET_LOOP_LIMIT 1024 /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "pgsql-bugs@postgresql.org" /* Define to the full name of this package. */ #define PACKAGE_NAME "PostgreSQL" /* Define to the full name and version of this package. */ #define PACKAGE_STRING "PostgreSQL 9.2.24" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "postgresql" /* Define to the version of this package. */ #define PACKAGE_VERSION "9.2.24" /* Define to the name of the default PostgreSQL service principal in Kerberos. (--with-krb-srvnam=NAME) */ #define PG_KRB_SRVNAM "postgres" /* PostgreSQL major version as a string */ #define PG_MAJORVERSION "9.2" /* PostgreSQL version as a string */ #define PG_VERSION "9.2.24" /* PostgreSQL version as a number */ #define PG_VERSION_NUM 90224 /* A string containing the version number, platform, and C compiler */ #define PG_VERSION_STR "PostgreSQL 9.2.24 on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit" /* Define to 1 to allow profiling output to be saved separately for each process. */ /* #undef PROFILE_PID_DIR */ /* Define to the necessary symbol if this constant uses a non-standard name on your system. */ /* #undef PTHREAD_CREATE_JOINABLE */ /* RELSEG_SIZE is the maximum number of blocks allowed in one disk file. Thus, the maximum size of a single file is RELSEG_SIZE * BLCKSZ; relations bigger than that are divided into multiple files. RELSEG_SIZE * BLCKSZ must be less than your OS' limit on file size. This is often 2 GB or 4GB in a 32-bit operating system, unless you have large file support enabled. By default, we make the limit 1 GB to avoid any possible integer-overflow problems within the OS. A limit smaller than necessary only means we divide a large relation into more chunks than necessary, so it seems best to err in the direction of a small limit. A power-of-2 value is recommended to save a few cycles in md.c, but is not absolutely required. Changing RELSEG_SIZE requires an initdb. */ #define RELSEG_SIZE 131072 /* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG 8 /* The size of `off_t', as computed by sizeof. */ #define SIZEOF_OFF_T 8 /* The size of `size_t', as computed by sizeof. */ #define SIZEOF_SIZE_T 8 /* The size of `void *', as computed by sizeof. */ #define SIZEOF_VOID_P 8 /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Define to 1 if strerror_r() returns a int. */ /* #undef STRERROR_R_INT */ /* Define to 1 if your declares `struct tm'. */ /* #undef TM_IN_SYS_TIME */ /* Define to the appropriate snprintf format for unsigned 64-bit ints. */ #define UINT64_FORMAT "%lu" /* Define to 1 to build with assertion checks. (--enable-cassert) */ /* #undef USE_ASSERT_CHECKING */ /* Define to 1 to build with Bonjour support. (--with-bonjour) */ /* #undef USE_BONJOUR */ /* Define to 1 if you want float4 values to be passed by value. (--enable-float4-byval) */ #define USE_FLOAT4_BYVAL 1 /* Define to 1 if you want float8, int8, etc values to be passed by value. (--enable-float8-byval) */ #define USE_FLOAT8_BYVAL 1 /* Define to 1 if "static inline" works without unwanted warnings from compilations where static inline functions are defined but not called. */ #define USE_INLINE 1 /* Define to 1 if you want 64-bit integer timestamp and interval support. (--enable-integer-datetimes) */ #define USE_INTEGER_DATETIMES 1 /* Define to 1 to build with LDAP support. (--with-ldap) */ #define USE_LDAP 1 /* Define to 1 to build with XML support. (--with-libxml) */ #define USE_LIBXML 1 /* Define to 1 to use XSLT support when building contrib/xml2. (--with-libxslt) */ #define USE_LIBXSLT 1 /* Define to select named POSIX semaphores. */ /* #undef USE_NAMED_POSIX_SEMAPHORES */ /* Define to 1 to build with PAM support. (--with-pam) */ #define USE_PAM 1 /* Use replacement snprintf() functions. */ /* #undef USE_REPL_SNPRINTF */ /* Define to build with (Open)SSL support. (--with-openssl) */ #define USE_SSL 1 /* Define to select SysV-style semaphores. */ #define USE_SYSV_SEMAPHORES 1 /* Define to select SysV-style shared memory. */ #define USE_SYSV_SHARED_MEMORY 1 /* Define to select unnamed POSIX semaphores. */ /* #undef USE_UNNAMED_POSIX_SEMAPHORES */ /* Define to select Win32-style semaphores. */ /* #undef USE_WIN32_SEMAPHORES */ /* Define to select Win32-style shared memory. */ /* #undef USE_WIN32_SHARED_MEMORY */ /* Define to 1 if `wcstombs_l' requires . */ /* #undef WCSTOMBS_L_IN_XLOCALE */ /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN /* # undef WORDS_BIGENDIAN */ # endif #endif /* Size of a WAL file block. This need have no particular relation to BLCKSZ. XLOG_BLCKSZ must be a power of 2, and if your system supports O_DIRECT I/O, XLOG_BLCKSZ must be a multiple of the alignment requirement for direct-I/O buffers, else direct I/O may fail. Changing XLOG_BLCKSZ requires an initdb. */ #define XLOG_BLCKSZ 8192 /* XLOG_SEG_SIZE is the size of a single WAL file. This must be a power of 2 and larger than XLOG_BLCKSZ (preferably, a great deal larger than XLOG_BLCKSZ). Changing XLOG_SEG_SIZE requires an initdb. */ #define XLOG_SEG_SIZE (16 * 1024 * 1024) /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ /* #undef _LARGEFILE_SOURCE */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus /* #undef inline */ #endif /* Define to the type of a signed integer type wide enough to hold a pointer, if such a type exists, and if the system does not define it. */ /* #undef intptr_t */ /* Define to empty if the C compiler does not understand signed types. */ /* #undef signed */ /* Define to the type of an unsigned integer type wide enough to hold a pointer, if such a type exists, and if the system does not define it. */ /* #undef uintptr_t */ /* Define to empty if the keyword `volatile' does not work. Warning: valid code using `volatile' can become incorrect without. Disable with care. */ /* #undef volatile */ PKBiZAserver/postmaster/bgwriter.hnu[/*------------------------------------------------------------------------- * * bgwriter.h * Exports from postmaster/bgwriter.c and postmaster/checkpointer.c. * * The bgwriter process used to handle checkpointing duties too. Now * there is a separate process, but we did not bother to split this header. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * * src/include/postmaster/bgwriter.h * *------------------------------------------------------------------------- */ #ifndef _BGWRITER_H #define _BGWRITER_H #include "storage/block.h" #include "storage/relfilenode.h" /* GUC options */ extern int BgWriterDelay; extern int CheckPointTimeout; extern int CheckPointWarning; extern double CheckPointCompletionTarget; extern void BackgroundWriterMain(void); extern void CheckpointerMain(void); extern void RequestCheckpoint(int flags); extern void CheckpointWriteDelay(int flags, double progress); extern bool ForwardFsyncRequest(RelFileNode rnode, ForkNumber forknum, BlockNumber segno); extern void AbsorbFsyncRequests(void); extern Size CheckpointerShmemSize(void); extern void CheckpointerShmemInit(void); extern bool FirstCallSinceLastCheckpoint(void); #endif /* _BGWRITER_H */ PKBiZJOserver/postmaster/postmaster.hnu[/*------------------------------------------------------------------------- * * postmaster.h * Exports from postmaster/postmaster.c. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/postmaster/postmaster.h * *------------------------------------------------------------------------- */ #ifndef _POSTMASTER_H #define _POSTMASTER_H /* GUC options */ extern bool EnableSSL; extern int ReservedBackends; extern int PostPortNumber; extern int Unix_socket_permissions; extern char *Unix_socket_group; extern char *Unix_socket_directories; extern char *ListenAddresses; extern bool ClientAuthInProgress; extern int PreAuthDelay; extern int AuthenticationTimeout; extern bool Log_connections; extern bool log_hostname; extern bool enable_bonjour; extern char *bonjour_name; extern bool restart_after_crash; #ifdef WIN32 extern HANDLE PostmasterHandle; #else extern int postmaster_alive_fds[2]; /* * Constants that represent which of postmaster_alive_fds is held by * postmaster, and which is used in children to check for postmaster death. */ #define POSTMASTER_FD_WATCH 0 /* used in children to check for * postmaster death */ #define POSTMASTER_FD_OWN 1 /* kept open by postmaster only */ #endif extern const char *progname; extern int PostmasterMain(int argc, char *argv[]); extern void ClosePostmasterPorts(bool am_syslogger); extern int MaxLivePostmasterChildren(void); #ifdef EXEC_BACKEND extern pid_t postmaster_forkexec(int argc, char *argv[]); extern int SubPostmasterMain(int argc, char *argv[]); extern Size ShmemBackendArraySize(void); extern void ShmemBackendArrayAllocation(void); #endif #endif /* _POSTMASTER_H */ PKBiZ0server/postmaster/pgarch.hnu[/*------------------------------------------------------------------------- * * pgarch.h * Exports from postmaster/pgarch.c. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/postmaster/pgarch.h * *------------------------------------------------------------------------- */ #ifndef _PGARCH_H #define _PGARCH_H /* ---------- * Functions called from postmaster * ---------- */ extern int pgarch_start(void); #ifdef EXEC_BACKEND extern void PgArchiverMain(int argc, char *argv[]); #endif #endif /* _PGARCH_H */ PKBiZ[ server/postmaster/fork_process.hnu[/*------------------------------------------------------------------------- * * fork_process.h * Exports from postmaster/fork_process.c. * * Copyright (c) 1996-2012, PostgreSQL Global Development Group * * src/include/postmaster/fork_process.h * *------------------------------------------------------------------------- */ #ifndef FORK_PROCESS_H #define FORK_PROCESS_H extern pid_t fork_process(void); #endif /* FORK_PROCESS_H */ PKBiZٿ!Xserver/postmaster/autovacuum.hnu[/*------------------------------------------------------------------------- * * autovacuum.h * header file for integrated autovacuum daemon * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/postmaster/autovacuum.h * *------------------------------------------------------------------------- */ #ifndef AUTOVACUUM_H #define AUTOVACUUM_H /* GUC variables */ extern bool autovacuum_start_daemon; extern int autovacuum_max_workers; extern int autovacuum_naptime; extern int autovacuum_vac_thresh; extern double autovacuum_vac_scale; extern int autovacuum_anl_thresh; extern double autovacuum_anl_scale; extern int autovacuum_freeze_max_age; extern int autovacuum_vac_cost_delay; extern int autovacuum_vac_cost_limit; /* autovacuum launcher PID, only valid when worker is shutting down */ extern int AutovacuumLauncherPid; extern int Log_autovacuum_min_duration; /* Status inquiry functions */ extern bool AutoVacuumingActive(void); extern bool IsAutoVacuumLauncherProcess(void); extern bool IsAutoVacuumWorkerProcess(void); #define IsAnyAutoVacuumProcess() \ (IsAutoVacuumLauncherProcess() || IsAutoVacuumWorkerProcess()) /* Functions to start autovacuum process, called from postmaster */ extern void autovac_init(void); extern int StartAutoVacLauncher(void); extern int StartAutoVacWorker(void); /* called from postmaster when a worker could not be forked */ extern void AutoVacWorkerFailed(void); /* autovacuum cost-delay balancer */ extern void AutoVacuumUpdateDelay(void); #ifdef EXEC_BACKEND extern void AutoVacLauncherMain(int argc, char *argv[]); extern void AutoVacWorkerMain(int argc, char *argv[]); extern void AutovacuumWorkerIAm(void); extern void AutovacuumLauncherIAm(void); #endif /* shared memory stuff */ extern Size AutoVacuumShmemSize(void); extern void AutoVacuumShmemInit(void); #endif /* AUTOVACUUM_H */ PKBiZ6server/postmaster/walwriter.hnu[/*------------------------------------------------------------------------- * * walwriter.h * Exports from postmaster/walwriter.c. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * * src/include/postmaster/walwriter.h * *------------------------------------------------------------------------- */ #ifndef _WALWRITER_H #define _WALWRITER_H /* GUC options */ extern int WalWriterDelay; extern void WalWriterMain(void); #endif /* _WALWRITER_H */ PKBiZ{{server/postmaster/startup.hnu[/*------------------------------------------------------------------------- * * startup.h * Exports from postmaster/startup.c. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * * src/include/postmaster/startup.h * *------------------------------------------------------------------------- */ #ifndef _STARTUP_H #define _STARTUP_H extern void HandleStartupProcInterrupts(void); extern void StartupProcessMain(void); extern void PreRestoreCommand(void); extern void PostRestoreCommand(void); extern bool IsPromoteTriggered(void); extern void ResetPromoteTriggered(void); #endif /* _STARTUP_H */ PKBiZ;] server/postmaster/syslogger.hnu[/*------------------------------------------------------------------------- * * syslogger.h * Exports from postmaster/syslogger.c. * * Copyright (c) 2004-2012, PostgreSQL Global Development Group * * src/include/postmaster/syslogger.h * *------------------------------------------------------------------------- */ #ifndef _SYSLOGGER_H #define _SYSLOGGER_H #include /* for PIPE_BUF */ /* * Primitive protocol structure for writing to syslogger pipe(s). The idea * here is to divide long messages into chunks that are not more than * PIPE_BUF bytes long, which according to POSIX spec must be written into * the pipe atomically. The pipe reader then uses the protocol headers to * reassemble the parts of a message into a single string. The reader can * also cope with non-protocol data coming down the pipe, though we cannot * guarantee long strings won't get split apart. * * We use non-nul bytes in is_last to make the protocol a tiny bit * more robust against finding a false double nul byte prologue. But * we still might find it in the len and/or pid bytes unless we're careful. */ #ifdef PIPE_BUF /* Are there any systems with PIPE_BUF > 64K? Unlikely, but ... */ #if PIPE_BUF > 65536 #define PIPE_CHUNK_SIZE 65536 #else #define PIPE_CHUNK_SIZE ((int) PIPE_BUF) #endif #else /* not defined */ /* POSIX says the value of PIPE_BUF must be at least 512, so use that */ #define PIPE_CHUNK_SIZE 512 #endif typedef struct { char nuls[2]; /* always \0\0 */ uint16 len; /* size of this chunk (counts data only) */ int32 pid; /* writer's pid */ char is_last; /* last chunk of message? 't' or 'f' ('T' or * 'F' for CSV case) */ char data[1]; /* data payload starts here */ } PipeProtoHeader; typedef union { PipeProtoHeader proto; char filler[PIPE_CHUNK_SIZE]; } PipeProtoChunk; #define PIPE_HEADER_SIZE offsetof(PipeProtoHeader, data) #define PIPE_MAX_PAYLOAD ((int) (PIPE_CHUNK_SIZE - PIPE_HEADER_SIZE)) /* GUC options */ extern bool Logging_collector; extern int Log_RotationAge; extern int Log_RotationSize; extern PGDLLIMPORT char *Log_directory; extern PGDLLIMPORT char *Log_filename; extern bool Log_truncate_on_rotation; extern int Log_file_mode; extern bool am_syslogger; #ifndef WIN32 extern int syslogPipe[2]; #else extern HANDLE syslogPipe[2]; #endif extern int SysLogger_Start(void); extern void write_syslogger_file(const char *buffer, int count, int dest); #ifdef EXEC_BACKEND extern void SysLoggerMain(int argc, char *argv[]); #endif #endif /* _SYSLOGGER_H */ PKBiZݭ <<server/pg_trace.hnu[/* ---------- * pg_trace.h * * Definitions for the PostgreSQL tracing framework * * Copyright (c) 2006-2012, PostgreSQL Global Development Group * * src/include/pg_trace.h * ---------- */ #ifndef PG_TRACE_H #define PG_TRACE_H #include "utils/probes.h" /* pgrminclude ignore */ #endif /* PG_TRACE_H */ PKBiZserver/pg_config_os.hnu[/* src/include/port/linux.h */ /* * As of July 2007, all known versions of the Linux kernel will sometimes * return EIDRM for a shmctl() operation when EINVAL is correct (it happens * when the low-order 15 bits of the supplied shm ID match the slot number * assigned to a newer shmem segment). We deal with this by assuming that * EIDRM means EINVAL in PGSharedMemoryIsInUse(). This is reasonably safe * since in fact Linux has no excuse for ever returning EIDRM; it doesn't * track removed segments in a way that would allow distinguishing them from * private ones. But someday that code might get upgraded, and we'd have * to have a kernel version test here. */ #define HAVE_LINUX_EIDRM_BUG /* * Set the default wal_sync_method to fdatasync. With recent Linux versions, * xlogdefs.h's normal rules will prefer open_datasync, which (a) doesn't * perform better and (b) causes outright failures on ext4 data=journal * filesystems, because those don't support O_DIRECT. */ #define PLATFORM_DEFAULT_SYNC_METHOD SYNC_METHOD_FDATASYNC PKBiZyߕ7 7 server/lib/dllist.hnu[/*------------------------------------------------------------------------- * * dllist.h * simple doubly linked list primitives * the elements of the list are void* so the lists can contain anything * Dlelem can only be in one list at a time * * * Here's a small example of how to use Dllists: * * Dllist *lst; * Dlelem *elt; * void *in_stuff; -- stuff to stick in the list * void *out_stuff * * lst = DLNewList(); -- make a new dllist * DLAddHead(lst, DLNewElem(in_stuff)); -- add a new element to the list * with in_stuff as the value * ... * elt = DLGetHead(lst); -- retrieve the head element * out_stuff = (void*)DLE_VAL(elt); -- get the stuff out * DLRemove(elt); -- removes the element from its list * DLFreeElem(elt); -- free the element since we don't * use it anymore * * * It is also possible to use Dllist objects that are embedded in larger * structures instead of being separately malloc'd. To do this, use * DLInitElem() to initialize a Dllist field within a larger object. * Don't forget to DLRemove() each field from its list (if any) before * freeing the larger object! * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/lib/dllist.h * *------------------------------------------------------------------------- */ #ifndef DLLIST_H #define DLLIST_H struct Dllist; struct Dlelem; typedef struct Dlelem { struct Dlelem *dle_next; /* next element */ struct Dlelem *dle_prev; /* previous element */ void *dle_val; /* value of the element */ struct Dllist *dle_list; /* what list this element is in */ } Dlelem; typedef struct Dllist { Dlelem *dll_head; Dlelem *dll_tail; } Dllist; extern Dllist *DLNewList(void); /* allocate and initialize a list header */ extern void DLInitList(Dllist *list); /* init a header alloced by caller */ extern void DLFreeList(Dllist *list); /* free up a list and all the nodes in * it */ extern Dlelem *DLNewElem(void *val); extern void DLInitElem(Dlelem *e, void *val); extern void DLFreeElem(Dlelem *e); extern void DLRemove(Dlelem *e); /* removes node from list */ extern void DLAddHead(Dllist *list, Dlelem *node); extern void DLAddTail(Dllist *list, Dlelem *node); extern Dlelem *DLRemHead(Dllist *list); /* remove and return the head */ extern Dlelem *DLRemTail(Dllist *list); extern void DLMoveToFront(Dlelem *e); /* move node to front of its list */ /* These are macros for speed */ #define DLGetHead(list) ((list)->dll_head) #define DLGetTail(list) ((list)->dll_tail) #define DLGetSucc(elem) ((elem)->dle_next) #define DLGetPred(elem) ((elem)->dle_prev) #define DLGetListHdr(elem) ((elem)->dle_list) #define DLE_VAL(elem) ((elem)->dle_val) #endif /* DLLIST_H */ PKBiZY4qssserver/lib/stringinfo.hnu[/*------------------------------------------------------------------------- * * stringinfo.h * Declarations/definitions for "StringInfo" functions. * * StringInfo provides an indefinitely-extensible string data type. * It can be used to buffer either ordinary C strings (null-terminated text) * or arbitrary binary data. All storage is allocated with palloc(). * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/lib/stringinfo.h * *------------------------------------------------------------------------- */ #ifndef STRINGINFO_H #define STRINGINFO_H /*------------------------- * StringInfoData holds information about an extensible string. * data is the current buffer for the string (allocated with palloc). * len is the current string length. There is guaranteed to be * a terminating '\0' at data[len], although this is not very * useful when the string holds binary data rather than text. * maxlen is the allocated size in bytes of 'data', i.e. the maximum * string size (including the terminating '\0' char) that we can * currently store in 'data' without having to reallocate * more space. We must always have maxlen > len. * cursor is initialized to zero by makeStringInfo or initStringInfo, * but is not otherwise touched by the stringinfo.c routines. * Some routines use it to scan through a StringInfo. *------------------------- */ typedef struct StringInfoData { char *data; int len; int maxlen; int cursor; } StringInfoData; typedef StringInfoData *StringInfo; /*------------------------ * There are two ways to create a StringInfo object initially: * * StringInfo stringptr = makeStringInfo(); * Both the StringInfoData and the data buffer are palloc'd. * * StringInfoData string; * initStringInfo(&string); * The data buffer is palloc'd but the StringInfoData is just local. * This is the easiest approach for a StringInfo object that will * only live as long as the current routine. * * To destroy a StringInfo, pfree() the data buffer, and then pfree() the * StringInfoData if it was palloc'd. There's no special support for this. * * NOTE: some routines build up a string using StringInfo, and then * release the StringInfoData but return the data string itself to their * caller. At that point the data string looks like a plain palloc'd * string. *------------------------- */ /*------------------------ * makeStringInfo * Create an empty 'StringInfoData' & return a pointer to it. */ extern StringInfo makeStringInfo(void); /*------------------------ * initStringInfo * Initialize a StringInfoData struct (with previously undefined contents) * to describe an empty string. */ extern void initStringInfo(StringInfo str); /*------------------------ * resetStringInfo * Clears the current content of the StringInfo, if any. The * StringInfo remains valid. */ extern void resetStringInfo(StringInfo str); /*------------------------ * appendStringInfo * Format text data under the control of fmt (an sprintf-style format string) * and append it to whatever is already in str. More space is allocated * to str if necessary. This is sort of like a combination of sprintf and * strcat. */ extern void appendStringInfo(StringInfo str, const char *fmt,...) /* This extension allows gcc to check the format string */ __attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 3))); /*------------------------ * appendStringInfoVA * Attempt to format text data under the control of fmt (an sprintf-style * format string) and append it to whatever is already in str. If successful * return true; if not (because there's not enough space), return false * without modifying str. Typically the caller would enlarge str and retry * on false return --- see appendStringInfo for standard usage pattern. */ extern bool appendStringInfoVA(StringInfo str, const char *fmt, va_list args) __attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 0))); /*------------------------ * appendStringInfoString * Append a null-terminated string to str. * Like appendStringInfo(str, "%s", s) but faster. */ extern void appendStringInfoString(StringInfo str, const char *s); /*------------------------ * appendStringInfoChar * Append a single byte to str. * Like appendStringInfo(str, "%c", ch) but much faster. */ extern void appendStringInfoChar(StringInfo str, char ch); /*------------------------ * appendStringInfoCharMacro * As above, but a macro for even more speed where it matters. * Caution: str argument will be evaluated multiple times. */ #define appendStringInfoCharMacro(str,ch) \ (((str)->len + 1 >= (str)->maxlen) ? \ appendStringInfoChar(str, ch) : \ (void)((str)->data[(str)->len] = (ch), (str)->data[++(str)->len] = '\0')) /*------------------------ * appendStringInfoSpaces * Append a given number of spaces to str. */ extern void appendStringInfoSpaces(StringInfo str, int count); /*------------------------ * appendBinaryStringInfo * Append arbitrary binary data to a StringInfo, allocating more space * if necessary. */ extern void appendBinaryStringInfo(StringInfo str, const char *data, int datalen); /*------------------------ * enlargeStringInfo * Make sure a StringInfo's buffer can hold at least 'needed' more bytes. */ extern void enlargeStringInfo(StringInfo str, int needed); #endif /* STRINGINFO_H */ PKBiZiJyserver/postgres_fe.hnu[/*------------------------------------------------------------------------- * * postgres_fe.h * Primary include file for PostgreSQL client-side .c files * * This should be the first file included by PostgreSQL client libraries and * application programs --- but not by backend modules, which should include * postgres.h. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1995, Regents of the University of California * * src/include/postgres_fe.h * *------------------------------------------------------------------------- */ #ifndef POSTGRES_FE_H #define POSTGRES_FE_H #ifndef FRONTEND #define FRONTEND 1 #endif #include "c.h" #endif /* POSTGRES_FE_H */ PKBiZԧ__server/pgstat.hnu[/* ---------- * pgstat.h * * Definitions for the PostgreSQL statistics collector daemon. * * Copyright (c) 2001-2012, PostgreSQL Global Development Group * * src/include/pgstat.h * ---------- */ #ifndef PGSTAT_H #define PGSTAT_H #include "datatype/timestamp.h" #include "fmgr.h" #include "libpq/pqcomm.h" #include "portability/instr_time.h" #include "utils/hsearch.h" #include "utils/relcache.h" /* Values for track_functions GUC variable --- order is significant! */ typedef enum TrackFunctionsLevel { TRACK_FUNC_OFF, TRACK_FUNC_PL, TRACK_FUNC_ALL } TrackFunctionsLevel; /* ---------- * The types of backend -> collector messages * ---------- */ typedef enum StatMsgType { PGSTAT_MTYPE_DUMMY, PGSTAT_MTYPE_INQUIRY, PGSTAT_MTYPE_TABSTAT, PGSTAT_MTYPE_TABPURGE, PGSTAT_MTYPE_DROPDB, PGSTAT_MTYPE_RESETCOUNTER, PGSTAT_MTYPE_RESETSHAREDCOUNTER, PGSTAT_MTYPE_RESETSINGLECOUNTER, PGSTAT_MTYPE_AUTOVAC_START, PGSTAT_MTYPE_VACUUM, PGSTAT_MTYPE_ANALYZE, PGSTAT_MTYPE_BGWRITER, PGSTAT_MTYPE_FUNCSTAT, PGSTAT_MTYPE_FUNCPURGE, PGSTAT_MTYPE_RECOVERYCONFLICT, PGSTAT_MTYPE_TEMPFILE, PGSTAT_MTYPE_DEADLOCK } StatMsgType; /* ---------- * The data type used for counters. * ---------- */ typedef int64 PgStat_Counter; /* ---------- * PgStat_TableCounts The actual per-table counts kept by a backend * * This struct should contain only actual event counters, because we memcmp * it against zeroes to detect whether there are any counts to transmit. * It is a component of PgStat_TableStatus (within-backend state) and * PgStat_TableEntry (the transmitted message format). * * Note: for a table, tuples_returned is the number of tuples successfully * fetched by heap_getnext, while tuples_fetched is the number of tuples * successfully fetched by heap_fetch under the control of bitmap indexscans. * For an index, tuples_returned is the number of index entries returned by * the index AM, while tuples_fetched is the number of tuples successfully * fetched by heap_fetch under the control of simple indexscans for this index. * * tuples_inserted/updated/deleted/hot_updated count attempted actions, * regardless of whether the transaction committed. delta_live_tuples, * delta_dead_tuples, and changed_tuples are set depending on commit or abort. * Note that delta_live_tuples and delta_dead_tuples can be negative! * ---------- */ typedef struct PgStat_TableCounts { PgStat_Counter t_numscans; PgStat_Counter t_tuples_returned; PgStat_Counter t_tuples_fetched; PgStat_Counter t_tuples_inserted; PgStat_Counter t_tuples_updated; PgStat_Counter t_tuples_deleted; PgStat_Counter t_tuples_hot_updated; PgStat_Counter t_delta_live_tuples; PgStat_Counter t_delta_dead_tuples; PgStat_Counter t_changed_tuples; PgStat_Counter t_blocks_fetched; PgStat_Counter t_blocks_hit; } PgStat_TableCounts; /* Possible targets for resetting cluster-wide shared values */ typedef enum PgStat_Shared_Reset_Target { RESET_BGWRITER } PgStat_Shared_Reset_Target; /* Possible object types for resetting single counters */ typedef enum PgStat_Single_Reset_Type { RESET_TABLE, RESET_FUNCTION } PgStat_Single_Reset_Type; /* ------------------------------------------------------------ * Structures kept in backend local memory while accumulating counts * ------------------------------------------------------------ */ /* ---------- * PgStat_TableStatus Per-table status within a backend * * Many of the event counters are nontransactional, ie, we count events * in committed and aborted transactions alike. For these, we just count * directly in the PgStat_TableStatus. However, delta_live_tuples, * delta_dead_tuples, and changed_tuples must be derived from event counts * with awareness of whether the transaction or subtransaction committed or * aborted. Hence, we also keep a stack of per-(sub)transaction status * records for every table modified in the current transaction. At commit * or abort, we propagate tuples_inserted/updated/deleted up to the * parent subtransaction level, or out to the parent PgStat_TableStatus, * as appropriate. * ---------- */ typedef struct PgStat_TableStatus { Oid t_id; /* table's OID */ bool t_shared; /* is it a shared catalog? */ struct PgStat_TableXactStatus *trans; /* lowest subxact's counts */ PgStat_TableCounts t_counts; /* event counts to be sent */ } PgStat_TableStatus; /* ---------- * PgStat_TableXactStatus Per-table, per-subtransaction status * ---------- */ typedef struct PgStat_TableXactStatus { PgStat_Counter tuples_inserted; /* tuples inserted in (sub)xact */ PgStat_Counter tuples_updated; /* tuples updated in (sub)xact */ PgStat_Counter tuples_deleted; /* tuples deleted in (sub)xact */ int nest_level; /* subtransaction nest level */ /* links to other structs for same relation: */ struct PgStat_TableXactStatus *upper; /* next higher subxact if any */ PgStat_TableStatus *parent; /* per-table status */ /* structs of same subxact level are linked here: */ struct PgStat_TableXactStatus *next; /* next of same subxact */ } PgStat_TableXactStatus; /* ------------------------------------------------------------ * Message formats follow * ------------------------------------------------------------ */ /* ---------- * PgStat_MsgHdr The common message header * ---------- */ typedef struct PgStat_MsgHdr { StatMsgType m_type; int m_size; } PgStat_MsgHdr; /* ---------- * Space available in a message. This will keep the UDP packets below 1K, * which should fit unfragmented into the MTU of the lo interface on most * platforms. Does anybody care for platforms where it doesn't? * ---------- */ #define PGSTAT_MSG_PAYLOAD (1000 - sizeof(PgStat_MsgHdr)) /* ---------- * PgStat_MsgDummy A dummy message, ignored by the collector * ---------- */ typedef struct PgStat_MsgDummy { PgStat_MsgHdr m_hdr; } PgStat_MsgDummy; /* ---------- * PgStat_MsgInquiry Sent by a backend to ask the collector * to write the stats file. * ---------- */ typedef struct PgStat_MsgInquiry { PgStat_MsgHdr m_hdr; TimestampTz inquiry_time; /* minimum acceptable file timestamp */ } PgStat_MsgInquiry; /* ---------- * PgStat_TableEntry Per-table info in a MsgTabstat * ---------- */ typedef struct PgStat_TableEntry { Oid t_id; PgStat_TableCounts t_counts; } PgStat_TableEntry; /* ---------- * PgStat_MsgTabstat Sent by the backend to report table * and buffer access statistics. * ---------- */ #define PGSTAT_NUM_TABENTRIES \ ((PGSTAT_MSG_PAYLOAD - sizeof(Oid) - 3 * sizeof(int)) \ / sizeof(PgStat_TableEntry)) typedef struct PgStat_MsgTabstat { PgStat_MsgHdr m_hdr; Oid m_databaseid; int m_nentries; int m_xact_commit; int m_xact_rollback; PgStat_Counter m_block_read_time; /* times in microseconds */ PgStat_Counter m_block_write_time; PgStat_TableEntry m_entry[PGSTAT_NUM_TABENTRIES]; } PgStat_MsgTabstat; /* ---------- * PgStat_MsgTabpurge Sent by the backend to tell the collector * about dead tables. * ---------- */ #define PGSTAT_NUM_TABPURGE \ ((PGSTAT_MSG_PAYLOAD - sizeof(Oid) - sizeof(int)) \ / sizeof(Oid)) typedef struct PgStat_MsgTabpurge { PgStat_MsgHdr m_hdr; Oid m_databaseid; int m_nentries; Oid m_tableid[PGSTAT_NUM_TABPURGE]; } PgStat_MsgTabpurge; /* ---------- * PgStat_MsgDropdb Sent by the backend to tell the collector * about a dropped database * ---------- */ typedef struct PgStat_MsgDropdb { PgStat_MsgHdr m_hdr; Oid m_databaseid; } PgStat_MsgDropdb; /* ---------- * PgStat_MsgResetcounter Sent by the backend to tell the collector * to reset counters * ---------- */ typedef struct PgStat_MsgResetcounter { PgStat_MsgHdr m_hdr; Oid m_databaseid; } PgStat_MsgResetcounter; /* ---------- * PgStat_MsgResetsharedcounter Sent by the backend to tell the collector * to reset a shared counter * ---------- */ typedef struct PgStat_MsgResetsharedcounter { PgStat_MsgHdr m_hdr; PgStat_Shared_Reset_Target m_resettarget; } PgStat_MsgResetsharedcounter; /* ---------- * PgStat_MsgResetsinglecounter Sent by the backend to tell the collector * to reset a single counter * ---------- */ typedef struct PgStat_MsgResetsinglecounter { PgStat_MsgHdr m_hdr; Oid m_databaseid; PgStat_Single_Reset_Type m_resettype; Oid m_objectid; } PgStat_MsgResetsinglecounter; /* ---------- * PgStat_MsgAutovacStart Sent by the autovacuum daemon to signal * that a database is going to be processed * ---------- */ typedef struct PgStat_MsgAutovacStart { PgStat_MsgHdr m_hdr; Oid m_databaseid; TimestampTz m_start_time; } PgStat_MsgAutovacStart; /* ---------- * PgStat_MsgVacuum Sent by the backend or autovacuum daemon * after VACUUM * ---------- */ typedef struct PgStat_MsgVacuum { PgStat_MsgHdr m_hdr; Oid m_databaseid; Oid m_tableoid; bool m_autovacuum; TimestampTz m_vacuumtime; PgStat_Counter m_tuples; } PgStat_MsgVacuum; /* ---------- * PgStat_MsgAnalyze Sent by the backend or autovacuum daemon * after ANALYZE * ---------- */ typedef struct PgStat_MsgAnalyze { PgStat_MsgHdr m_hdr; Oid m_databaseid; Oid m_tableoid; bool m_autovacuum; bool m_resetcounter; TimestampTz m_analyzetime; PgStat_Counter m_live_tuples; PgStat_Counter m_dead_tuples; } PgStat_MsgAnalyze; /* ---------- * PgStat_MsgBgWriter Sent by the bgwriter to update statistics. * ---------- */ typedef struct PgStat_MsgBgWriter { PgStat_MsgHdr m_hdr; PgStat_Counter m_timed_checkpoints; PgStat_Counter m_requested_checkpoints; PgStat_Counter m_buf_written_checkpoints; PgStat_Counter m_buf_written_clean; PgStat_Counter m_maxwritten_clean; PgStat_Counter m_buf_written_backend; PgStat_Counter m_buf_fsync_backend; PgStat_Counter m_buf_alloc; PgStat_Counter m_checkpoint_write_time; /* times in milliseconds */ PgStat_Counter m_checkpoint_sync_time; } PgStat_MsgBgWriter; /* ---------- * PgStat_MsgRecoveryConflict Sent by the backend upon recovery conflict * ---------- */ typedef struct PgStat_MsgRecoveryConflict { PgStat_MsgHdr m_hdr; Oid m_databaseid; int m_reason; } PgStat_MsgRecoveryConflict; /* ---------- * PgStat_MsgTempFile Sent by the backend upon creating a temp file * ---------- */ typedef struct PgStat_MsgTempFile { PgStat_MsgHdr m_hdr; Oid m_databaseid; size_t m_filesize; } PgStat_MsgTempFile; /* ---------- * PgStat_FunctionCounts The actual per-function counts kept by a backend * * This struct should contain only actual event counters, because we memcmp * it against zeroes to detect whether there are any counts to transmit. * * Note that the time counters are in instr_time format here. We convert to * microseconds in PgStat_Counter format when transmitting to the collector. * ---------- */ typedef struct PgStat_FunctionCounts { PgStat_Counter f_numcalls; instr_time f_total_time; instr_time f_self_time; } PgStat_FunctionCounts; /* ---------- * PgStat_BackendFunctionEntry Entry in backend's per-function hash table * ---------- */ typedef struct PgStat_BackendFunctionEntry { Oid f_id; PgStat_FunctionCounts f_counts; } PgStat_BackendFunctionEntry; /* ---------- * PgStat_FunctionEntry Per-function info in a MsgFuncstat * ---------- */ typedef struct PgStat_FunctionEntry { Oid f_id; PgStat_Counter f_numcalls; PgStat_Counter f_total_time; /* times in microseconds */ PgStat_Counter f_self_time; } PgStat_FunctionEntry; /* ---------- * PgStat_MsgFuncstat Sent by the backend to report function * usage statistics. * ---------- */ #define PGSTAT_NUM_FUNCENTRIES \ ((PGSTAT_MSG_PAYLOAD - sizeof(Oid) - sizeof(int)) \ / sizeof(PgStat_FunctionEntry)) typedef struct PgStat_MsgFuncstat { PgStat_MsgHdr m_hdr; Oid m_databaseid; int m_nentries; PgStat_FunctionEntry m_entry[PGSTAT_NUM_FUNCENTRIES]; } PgStat_MsgFuncstat; /* ---------- * PgStat_MsgFuncpurge Sent by the backend to tell the collector * about dead functions. * ---------- */ #define PGSTAT_NUM_FUNCPURGE \ ((PGSTAT_MSG_PAYLOAD - sizeof(Oid) - sizeof(int)) \ / sizeof(Oid)) typedef struct PgStat_MsgFuncpurge { PgStat_MsgHdr m_hdr; Oid m_databaseid; int m_nentries; Oid m_functionid[PGSTAT_NUM_FUNCPURGE]; } PgStat_MsgFuncpurge; /* ---------- * PgStat_MsgDeadlock Sent by the backend to tell the collector * about a deadlock that occurred. * ---------- */ typedef struct PgStat_MsgDeadlock { PgStat_MsgHdr m_hdr; Oid m_databaseid; } PgStat_MsgDeadlock; /* ---------- * PgStat_Msg Union over all possible messages. * ---------- */ typedef union PgStat_Msg { PgStat_MsgHdr msg_hdr; PgStat_MsgDummy msg_dummy; PgStat_MsgInquiry msg_inquiry; PgStat_MsgTabstat msg_tabstat; PgStat_MsgTabpurge msg_tabpurge; PgStat_MsgDropdb msg_dropdb; PgStat_MsgResetcounter msg_resetcounter; PgStat_MsgResetsharedcounter msg_resetsharedcounter; PgStat_MsgResetsinglecounter msg_resetsinglecounter; PgStat_MsgAutovacStart msg_autovacuum; PgStat_MsgVacuum msg_vacuum; PgStat_MsgAnalyze msg_analyze; PgStat_MsgBgWriter msg_bgwriter; PgStat_MsgFuncstat msg_funcstat; PgStat_MsgFuncpurge msg_funcpurge; PgStat_MsgRecoveryConflict msg_recoveryconflict; PgStat_MsgDeadlock msg_deadlock; } PgStat_Msg; /* ------------------------------------------------------------ * Statistic collector data structures follow * * PGSTAT_FILE_FORMAT_ID should be changed whenever any of these * data structures change. * ------------------------------------------------------------ */ #define PGSTAT_FILE_FORMAT_ID 0x01A5BC9A /* ---------- * PgStat_StatDBEntry The collector's data per database * ---------- */ typedef struct PgStat_StatDBEntry { Oid databaseid; PgStat_Counter n_xact_commit; PgStat_Counter n_xact_rollback; PgStat_Counter n_blocks_fetched; PgStat_Counter n_blocks_hit; PgStat_Counter n_tuples_returned; PgStat_Counter n_tuples_fetched; PgStat_Counter n_tuples_inserted; PgStat_Counter n_tuples_updated; PgStat_Counter n_tuples_deleted; TimestampTz last_autovac_time; PgStat_Counter n_conflict_tablespace; PgStat_Counter n_conflict_lock; PgStat_Counter n_conflict_snapshot; PgStat_Counter n_conflict_bufferpin; PgStat_Counter n_conflict_startup_deadlock; PgStat_Counter n_temp_files; PgStat_Counter n_temp_bytes; PgStat_Counter n_deadlocks; PgStat_Counter n_block_read_time; /* times in microseconds */ PgStat_Counter n_block_write_time; TimestampTz stat_reset_timestamp; /* * tables and functions must be last in the struct, because we don't write * the pointers out to the stats file. */ HTAB *tables; HTAB *functions; } PgStat_StatDBEntry; /* ---------- * PgStat_StatTabEntry The collector's data per table (or index) * ---------- */ typedef struct PgStat_StatTabEntry { Oid tableid; PgStat_Counter numscans; PgStat_Counter tuples_returned; PgStat_Counter tuples_fetched; PgStat_Counter tuples_inserted; PgStat_Counter tuples_updated; PgStat_Counter tuples_deleted; PgStat_Counter tuples_hot_updated; PgStat_Counter n_live_tuples; PgStat_Counter n_dead_tuples; PgStat_Counter changes_since_analyze; PgStat_Counter blocks_fetched; PgStat_Counter blocks_hit; TimestampTz vacuum_timestamp; /* user initiated vacuum */ PgStat_Counter vacuum_count; TimestampTz autovac_vacuum_timestamp; /* autovacuum initiated */ PgStat_Counter autovac_vacuum_count; TimestampTz analyze_timestamp; /* user initiated */ PgStat_Counter analyze_count; TimestampTz autovac_analyze_timestamp; /* autovacuum initiated */ PgStat_Counter autovac_analyze_count; } PgStat_StatTabEntry; /* ---------- * PgStat_StatFuncEntry The collector's data per function * ---------- */ typedef struct PgStat_StatFuncEntry { Oid functionid; PgStat_Counter f_numcalls; PgStat_Counter f_total_time; /* times in microseconds */ PgStat_Counter f_self_time; } PgStat_StatFuncEntry; /* * Global statistics kept in the stats collector */ typedef struct PgStat_GlobalStats { TimestampTz stats_timestamp; /* time of stats file update */ PgStat_Counter timed_checkpoints; PgStat_Counter requested_checkpoints; PgStat_Counter checkpoint_write_time; /* times in milliseconds */ PgStat_Counter checkpoint_sync_time; PgStat_Counter buf_written_checkpoints; PgStat_Counter buf_written_clean; PgStat_Counter maxwritten_clean; PgStat_Counter buf_written_backend; PgStat_Counter buf_fsync_backend; PgStat_Counter buf_alloc; TimestampTz stat_reset_timestamp; } PgStat_GlobalStats; /* ---------- * Backend states * ---------- */ typedef enum BackendState { STATE_UNDEFINED, STATE_IDLE, STATE_RUNNING, STATE_IDLEINTRANSACTION, STATE_FASTPATH, STATE_IDLEINTRANSACTION_ABORTED, STATE_DISABLED } BackendState; /* ---------- * Shared-memory data structures * ---------- */ /* ---------- * PgBackendStatus * * Each live backend maintains a PgBackendStatus struct in shared memory * showing its current activity. (The structs are allocated according to * BackendId, but that is not critical.) Note that the collector process * has no involvement in, or even access to, these structs. * ---------- */ typedef struct PgBackendStatus { /* * To avoid locking overhead, we use the following protocol: a backend * increments st_changecount before modifying its entry, and again after * finishing a modification. A would-be reader should note the value of * st_changecount, copy the entry into private memory, then check * st_changecount again. If the value hasn't changed, and if it's even, * the copy is valid; otherwise start over. This makes updates cheap * while reads are potentially expensive, but that's the tradeoff we want. */ int st_changecount; /* The entry is valid iff st_procpid > 0, unused if st_procpid == 0 */ int st_procpid; /* Times when current backend, transaction, and activity started */ TimestampTz st_proc_start_timestamp; TimestampTz st_xact_start_timestamp; TimestampTz st_activity_start_timestamp; TimestampTz st_state_start_timestamp; /* Database OID, owning user's OID, connection client address */ Oid st_databaseid; Oid st_userid; SockAddr st_clientaddr; char *st_clienthostname; /* MUST be null-terminated */ /* Is backend currently waiting on an lmgr lock? */ bool st_waiting; /* current state */ BackendState st_state; /* application name; MUST be null-terminated */ char *st_appname; /* current command string; MUST be null-terminated */ char *st_activity; } PgBackendStatus; /* * Working state needed to accumulate per-function-call timing statistics. */ typedef struct PgStat_FunctionCallUsage { /* Link to function's hashtable entry (must still be there at exit!) */ /* NULL means we are not tracking the current function call */ PgStat_FunctionCounts *fs; /* Total time previously charged to function, as of function start */ instr_time save_f_total_time; /* Backend-wide total time as of function start */ instr_time save_total; /* system clock as of function start */ instr_time f_start; } PgStat_FunctionCallUsage; /* ---------- * GUC parameters * ---------- */ extern bool pgstat_track_activities; extern bool pgstat_track_counts; extern int pgstat_track_functions; extern PGDLLIMPORT int pgstat_track_activity_query_size; extern char *pgstat_stat_tmpname; extern char *pgstat_stat_filename; /* * BgWriter statistics counters are updated directly by bgwriter and bufmgr */ extern PgStat_MsgBgWriter BgWriterStats; /* * Updated by pgstat_count_buffer_*_time macros */ extern PgStat_Counter pgStatBlockReadTime; extern PgStat_Counter pgStatBlockWriteTime; /* ---------- * Functions called from postmaster * ---------- */ extern Size BackendStatusShmemSize(void); extern void CreateSharedBackendStatus(void); extern void pgstat_init(void); extern int pgstat_start(void); extern void pgstat_reset_all(void); extern void allow_immediate_pgstat_restart(void); #ifdef EXEC_BACKEND extern void PgstatCollectorMain(int argc, char *argv[]); #endif /* ---------- * Functions called from backends * ---------- */ extern void pgstat_ping(void); extern void pgstat_report_stat(bool force); extern void pgstat_vacuum_stat(void); extern void pgstat_drop_database(Oid databaseid); extern void pgstat_clear_snapshot(void); extern void pgstat_reset_counters(void); extern void pgstat_reset_shared_counters(const char *); extern void pgstat_reset_single_counter(Oid objectid, PgStat_Single_Reset_Type type); extern void pgstat_report_autovac(Oid dboid); extern void pgstat_report_vacuum(Oid tableoid, bool shared, PgStat_Counter tuples); extern void pgstat_report_analyze(Relation rel, PgStat_Counter livetuples, PgStat_Counter deadtuples, bool resetcounter); extern void pgstat_report_recovery_conflict(int reason); extern void pgstat_report_deadlock(void); extern void pgstat_initialize(void); extern void pgstat_bestart(void); extern void pgstat_report_activity(BackendState state, const char *cmd_str); extern void pgstat_report_tempfile(size_t filesize); extern void pgstat_report_appname(const char *appname); extern void pgstat_report_xact_timestamp(TimestampTz tstamp); extern void pgstat_report_waiting(bool waiting); extern const char *pgstat_get_backend_current_activity(int pid, bool checkUser); extern const char *pgstat_get_crashed_backend_activity(int pid, char *buffer, int buflen); extern PgStat_TableStatus *find_tabstat_entry(Oid rel_id); extern PgStat_BackendFunctionEntry *find_funcstat_entry(Oid func_id); extern void pgstat_initstats(Relation rel); /* nontransactional event counts are simple enough to inline */ #define pgstat_count_heap_scan(rel) \ do { \ if ((rel)->pgstat_info != NULL) \ (rel)->pgstat_info->t_counts.t_numscans++; \ } while (0) #define pgstat_count_heap_getnext(rel) \ do { \ if ((rel)->pgstat_info != NULL) \ (rel)->pgstat_info->t_counts.t_tuples_returned++; \ } while (0) #define pgstat_count_heap_fetch(rel) \ do { \ if ((rel)->pgstat_info != NULL) \ (rel)->pgstat_info->t_counts.t_tuples_fetched++; \ } while (0) #define pgstat_count_index_scan(rel) \ do { \ if ((rel)->pgstat_info != NULL) \ (rel)->pgstat_info->t_counts.t_numscans++; \ } while (0) #define pgstat_count_index_tuples(rel, n) \ do { \ if ((rel)->pgstat_info != NULL) \ (rel)->pgstat_info->t_counts.t_tuples_returned += (n); \ } while (0) #define pgstat_count_buffer_read(rel) \ do { \ if ((rel)->pgstat_info != NULL) \ (rel)->pgstat_info->t_counts.t_blocks_fetched++; \ } while (0) #define pgstat_count_buffer_hit(rel) \ do { \ if ((rel)->pgstat_info != NULL) \ (rel)->pgstat_info->t_counts.t_blocks_hit++; \ } while (0) #define pgstat_count_buffer_read_time(n) \ (pgStatBlockReadTime += (n)) #define pgstat_count_buffer_write_time(n) \ (pgStatBlockWriteTime += (n)) extern void pgstat_count_heap_insert(Relation rel, int n); extern void pgstat_count_heap_update(Relation rel, bool hot); extern void pgstat_count_heap_delete(Relation rel); extern void pgstat_update_heap_dead_tuples(Relation rel, int delta); extern void pgstat_init_function_usage(FunctionCallInfoData *fcinfo, PgStat_FunctionCallUsage *fcu); extern void pgstat_end_function_usage(PgStat_FunctionCallUsage *fcu, bool finalize); extern void AtEOXact_PgStat(bool isCommit); extern void AtEOSubXact_PgStat(bool isCommit, int nestDepth); extern void AtPrepare_PgStat(void); extern void PostPrepare_PgStat(void); extern void pgstat_twophase_postcommit(TransactionId xid, uint16 info, void *recdata, uint32 len); extern void pgstat_twophase_postabort(TransactionId xid, uint16 info, void *recdata, uint32 len); extern void pgstat_send_bgwriter(void); /* ---------- * Support functions for the SQL-callable functions to * generate the pgstat* views. * ---------- */ extern PgStat_StatDBEntry *pgstat_fetch_stat_dbentry(Oid dbid); extern PgStat_StatTabEntry *pgstat_fetch_stat_tabentry(Oid relid); extern PgBackendStatus *pgstat_fetch_stat_beentry(int beid); extern PgStat_StatFuncEntry *pgstat_fetch_stat_funcentry(Oid funcid); extern int pgstat_fetch_stat_numbackends(void); extern PgStat_GlobalStats *pgstat_fetch_global(void); #endif /* PGSTAT_H */ PKBiZ? server/storage/lmgr.hnu[/*------------------------------------------------------------------------- * * lmgr.h * POSTGRES lock manager definitions. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/lmgr.h * *------------------------------------------------------------------------- */ #ifndef LMGR_H #define LMGR_H #include "lib/stringinfo.h" #include "storage/itemptr.h" #include "storage/lock.h" #include "utils/rel.h" extern void RelationInitLockInfo(Relation relation); /* Lock a relation */ extern void LockRelationOid(Oid relid, LOCKMODE lockmode); extern bool ConditionalLockRelationOid(Oid relid, LOCKMODE lockmode); extern void UnlockRelationId(LockRelId *relid, LOCKMODE lockmode); extern void UnlockRelationOid(Oid relid, LOCKMODE lockmode); extern void LockRelation(Relation relation, LOCKMODE lockmode); extern bool ConditionalLockRelation(Relation relation, LOCKMODE lockmode); extern void UnlockRelation(Relation relation, LOCKMODE lockmode); extern bool LockHasWaitersRelation(Relation relation, LOCKMODE lockmode); extern void LockRelationIdForSession(LockRelId *relid, LOCKMODE lockmode); extern void UnlockRelationIdForSession(LockRelId *relid, LOCKMODE lockmode); /* Lock a relation for extension */ extern void LockRelationForExtension(Relation relation, LOCKMODE lockmode); extern void UnlockRelationForExtension(Relation relation, LOCKMODE lockmode); /* Lock a page (currently only used within indexes) */ extern void LockPage(Relation relation, BlockNumber blkno, LOCKMODE lockmode); extern bool ConditionalLockPage(Relation relation, BlockNumber blkno, LOCKMODE lockmode); extern void UnlockPage(Relation relation, BlockNumber blkno, LOCKMODE lockmode); /* Lock a tuple (see heap_lock_tuple before assuming you understand this) */ extern void LockTuple(Relation relation, ItemPointer tid, LOCKMODE lockmode); extern bool ConditionalLockTuple(Relation relation, ItemPointer tid, LOCKMODE lockmode); extern void UnlockTuple(Relation relation, ItemPointer tid, LOCKMODE lockmode); /* Lock an XID (used to wait for a transaction to finish) */ extern void XactLockTableInsert(TransactionId xid); extern void XactLockTableDelete(TransactionId xid); extern void XactLockTableWait(TransactionId xid); extern bool ConditionalXactLockTableWait(TransactionId xid); /* Lock a general object (other than a relation) of the current database */ extern void LockDatabaseObject(Oid classid, Oid objid, uint16 objsubid, LOCKMODE lockmode); extern void UnlockDatabaseObject(Oid classid, Oid objid, uint16 objsubid, LOCKMODE lockmode); /* Lock a shared-across-databases object (other than a relation) */ extern void LockSharedObject(Oid classid, Oid objid, uint16 objsubid, LOCKMODE lockmode); extern void UnlockSharedObject(Oid classid, Oid objid, uint16 objsubid, LOCKMODE lockmode); extern void LockSharedObjectForSession(Oid classid, Oid objid, uint16 objsubid, LOCKMODE lockmode); extern void UnlockSharedObjectForSession(Oid classid, Oid objid, uint16 objsubid, LOCKMODE lockmode); /* Describe a locktag for error messages */ extern void DescribeLockTag(StringInfo buf, const LOCKTAG *tag); #endif /* LMGR_H */ PKBiZJnTTserver/storage/lock.hnu[/*------------------------------------------------------------------------- * * lock.h * POSTGRES low-level lock mechanism * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/lock.h * *------------------------------------------------------------------------- */ #ifndef LOCK_H_ #define LOCK_H_ #include "storage/backendid.h" #include "storage/lwlock.h" #include "storage/shmem.h" /* struct PGPROC is declared in proc.h, but must forward-reference it */ typedef struct PGPROC PGPROC; typedef struct PROC_QUEUE { SHM_QUEUE links; /* head of list of PGPROC objects */ int size; /* number of entries in list */ } PROC_QUEUE; /* GUC variables */ extern int max_locks_per_xact; #ifdef LOCK_DEBUG extern int Trace_lock_oidmin; extern bool Trace_locks; extern bool Trace_userlocks; extern int Trace_lock_table; extern bool Debug_deadlocks; #endif /* LOCK_DEBUG */ /* * Top-level transactions are identified by VirtualTransactionIDs comprising * the BackendId of the backend running the xact, plus a locally-assigned * LocalTransactionId. These are guaranteed unique over the short term, * but will be reused after a database restart; hence they should never * be stored on disk. * * Note that struct VirtualTransactionId can not be assumed to be atomically * assignable as a whole. However, type LocalTransactionId is assumed to * be atomically assignable, and the backend ID doesn't change often enough * to be a problem, so we can fetch or assign the two fields separately. * We deliberately refrain from using the struct within PGPROC, to prevent * coding errors from trying to use struct assignment with it; instead use * GET_VXID_FROM_PGPROC(). */ typedef struct { BackendId backendId; /* determined at backend startup */ LocalTransactionId localTransactionId; /* backend-local transaction * id */ } VirtualTransactionId; #define InvalidLocalTransactionId 0 #define LocalTransactionIdIsValid(lxid) ((lxid) != InvalidLocalTransactionId) #define VirtualTransactionIdIsValid(vxid) \ (((vxid).backendId != InvalidBackendId) && \ LocalTransactionIdIsValid((vxid).localTransactionId)) #define VirtualTransactionIdEquals(vxid1, vxid2) \ ((vxid1).backendId == (vxid2).backendId && \ (vxid1).localTransactionId == (vxid2).localTransactionId) #define SetInvalidVirtualTransactionId(vxid) \ ((vxid).backendId = InvalidBackendId, \ (vxid).localTransactionId = InvalidLocalTransactionId) #define GET_VXID_FROM_PGPROC(vxid, proc) \ ((vxid).backendId = (proc).backendId, \ (vxid).localTransactionId = (proc).lxid) /* * LOCKMODE is an integer (1..N) indicating a lock type. LOCKMASK is a bit * mask indicating a set of held or requested lock types (the bit 1< 0 then these pointers must either be valid or * NULL, but when nLocks == 0 they should be considered garbage. */ typedef struct LOCALLOCKTAG { LOCKTAG lock; /* identifies the lockable object */ LOCKMODE mode; /* lock mode for this table entry */ } LOCALLOCKTAG; typedef struct LOCALLOCKOWNER { /* * Note: if owner is NULL then the lock is held on behalf of the session; * otherwise it is held on behalf of my current transaction. * * Must use a forward struct reference to avoid circularity. */ struct ResourceOwnerData *owner; int64 nLocks; /* # of times held by this owner */ } LOCALLOCKOWNER; typedef struct LOCALLOCK { /* tag */ LOCALLOCKTAG tag; /* unique identifier of locallock entry */ /* data */ LOCK *lock; /* associated LOCK object, if any */ PROCLOCK *proclock; /* associated PROCLOCK object, if any */ uint32 hashcode; /* copy of LOCKTAG's hash value */ int64 nLocks; /* total number of times lock is held */ int numLockOwners; /* # of relevant ResourceOwners */ int maxLockOwners; /* allocated size of array */ bool holdsStrongLockCount; /* bumped FastPathStrongRelationLocks */ LOCALLOCKOWNER *lockOwners; /* dynamically resizable array */ } LOCALLOCK; #define LOCALLOCK_LOCKMETHOD(llock) ((llock).tag.lock.locktag_lockmethodid) /* * These structures hold information passed from lmgr internals to the lock * listing user-level functions (in lockfuncs.c). */ typedef struct LockInstanceData { LOCKTAG locktag; /* locked object */ LOCKMASK holdMask; /* locks held by this PGPROC */ LOCKMODE waitLockMode; /* lock awaited by this PGPROC, if any */ BackendId backend; /* backend ID of this PGPROC */ LocalTransactionId lxid; /* local transaction ID of this PGPROC */ int pid; /* pid of this PGPROC */ bool fastpath; /* taken via fastpath? */ } LockInstanceData; typedef struct LockData { int nelements; /* The length of the array */ LockInstanceData *locks; } LockData; /* Result codes for LockAcquire() */ typedef enum { LOCKACQUIRE_NOT_AVAIL, /* lock not available, and dontWait=true */ LOCKACQUIRE_OK, /* lock successfully acquired */ LOCKACQUIRE_ALREADY_HELD /* incremented count for lock already held */ } LockAcquireResult; /* Deadlock states identified by DeadLockCheck() */ typedef enum { DS_NOT_YET_CHECKED, /* no deadlock check has run yet */ DS_NO_DEADLOCK, /* no deadlock detected */ DS_SOFT_DEADLOCK, /* deadlock avoided by queue rearrangement */ DS_HARD_DEADLOCK, /* deadlock, no way out but ERROR */ DS_BLOCKED_BY_AUTOVACUUM /* no deadlock; queue blocked by autovacuum * worker */ } DeadLockState; /* * The lockmgr's shared hash tables are partitioned to reduce contention. * To determine which partition a given locktag belongs to, compute the tag's * hash code with LockTagHashCode(), then apply one of these macros. * NB: NUM_LOCK_PARTITIONS must be a power of 2! */ #define LockHashPartition(hashcode) \ ((hashcode) % NUM_LOCK_PARTITIONS) #define LockHashPartitionLock(hashcode) \ ((LWLockId) (FirstLockMgrLock + LockHashPartition(hashcode))) /* * function prototypes */ extern void InitLocks(void); extern LockMethod GetLocksMethodTable(const LOCK *lock); extern uint32 LockTagHashCode(const LOCKTAG *locktag); extern LockAcquireResult LockAcquire(const LOCKTAG *locktag, LOCKMODE lockmode, bool sessionLock, bool dontWait); extern LockAcquireResult LockAcquireExtended(const LOCKTAG *locktag, LOCKMODE lockmode, bool sessionLock, bool dontWait, bool report_memory_error); extern void AbortStrongLockAcquire(void); extern bool LockRelease(const LOCKTAG *locktag, LOCKMODE lockmode, bool sessionLock); extern void LockReleaseAll(LOCKMETHODID lockmethodid, bool allLocks); extern void LockReleaseSession(LOCKMETHODID lockmethodid); extern void LockReleaseCurrentOwner(LOCALLOCK **locallocks, int nlocks); extern void LockReassignCurrentOwner(LOCALLOCK **locallocks, int nlocks); extern bool LockHasWaiters(const LOCKTAG *locktag, LOCKMODE lockmode, bool sessionLock); extern VirtualTransactionId *GetLockConflicts(const LOCKTAG *locktag, LOCKMODE lockmode); extern void AtPrepare_Locks(void); extern void PostPrepare_Locks(TransactionId xid); extern int LockCheckConflicts(LockMethod lockMethodTable, LOCKMODE lockmode, LOCK *lock, PROCLOCK *proclock, PGPROC *proc); extern void GrantLock(LOCK *lock, PROCLOCK *proclock, LOCKMODE lockmode); extern void GrantAwaitedLock(void); extern void RemoveFromWaitQueue(PGPROC *proc, uint32 hashcode); extern Size LockShmemSize(void); extern LockData *GetLockStatusData(void); extern void ReportLockTableError(bool report); typedef struct xl_standby_lock { TransactionId xid; /* xid of holder of AccessExclusiveLock */ Oid dbOid; Oid relOid; } xl_standby_lock; extern xl_standby_lock *GetRunningTransactionLocks(int *nlocks); extern const char *GetLockmodeName(LOCKMETHODID lockmethodid, LOCKMODE mode); extern void lock_twophase_recover(TransactionId xid, uint16 info, void *recdata, uint32 len); extern void lock_twophase_postcommit(TransactionId xid, uint16 info, void *recdata, uint32 len); extern void lock_twophase_postabort(TransactionId xid, uint16 info, void *recdata, uint32 len); extern void lock_twophase_standby_recover(TransactionId xid, uint16 info, void *recdata, uint32 len); extern DeadLockState DeadLockCheck(PGPROC *proc); extern PGPROC *GetBlockingAutoVacuumPgproc(void); extern void DeadLockReport(void); extern void RememberSimpleDeadLock(PGPROC *proc1, LOCKMODE lockmode, LOCK *lock, PGPROC *proc2); extern void InitDeadLockChecking(void); #ifdef LOCK_DEBUG extern void DumpLocks(PGPROC *proc); extern void DumpAllLocks(void); #endif /* Lock a VXID (used to wait for a transaction to finish) */ extern void VirtualXactLockTableInsert(VirtualTransactionId vxid); extern void VirtualXactLockTableCleanup(void); extern bool VirtualXactLock(VirtualTransactionId vxid, bool wait); #endif /* LOCK_H */ PKBiZ_Yߺ server/storage/block.hnu[/*------------------------------------------------------------------------- * * block.h * POSTGRES disk block definitions. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/block.h * *------------------------------------------------------------------------- */ #ifndef BLOCK_H #define BLOCK_H /* * BlockNumber: * * each data file (heap or index) is divided into postgres disk blocks * (which may be thought of as the unit of i/o -- a postgres buffer * contains exactly one disk block). the blocks are numbered * sequentially, 0 to 0xFFFFFFFE. * * InvalidBlockNumber is the same thing as P_NEW in buf.h. * * the access methods, the buffer manager and the storage manager are * more or less the only pieces of code that should be accessing disk * blocks directly. */ typedef uint32 BlockNumber; #define InvalidBlockNumber ((BlockNumber) 0xFFFFFFFF) #define MaxBlockNumber ((BlockNumber) 0xFFFFFFFE) /* * BlockId: * * this is a storage type for BlockNumber. in other words, this type * is used for on-disk structures (e.g., in HeapTupleData) whereas * BlockNumber is the type on which calculations are performed (e.g., * in access method code). * * there doesn't appear to be any reason to have separate types except * for the fact that BlockIds can be SHORTALIGN'd (and therefore any * structures that contains them, such as ItemPointerData, can also be * SHORTALIGN'd). this is an important consideration for reducing the * space requirements of the line pointer (ItemIdData) array on each * page and the header of each heap or index tuple, so it doesn't seem * wise to change this without good reason. */ typedef struct BlockIdData { uint16 bi_hi; uint16 bi_lo; } BlockIdData; typedef BlockIdData *BlockId; /* block identifier */ /* ---------------- * support macros * ---------------- */ /* * BlockNumberIsValid * True iff blockNumber is valid. */ #define BlockNumberIsValid(blockNumber) \ ((bool) ((BlockNumber) (blockNumber) != InvalidBlockNumber)) /* * BlockIdIsValid * True iff the block identifier is valid. */ #define BlockIdIsValid(blockId) \ ((bool) PointerIsValid(blockId)) /* * BlockIdSet * Sets a block identifier to the specified value. */ #define BlockIdSet(blockId, blockNumber) \ ( \ AssertMacro(PointerIsValid(blockId)), \ (blockId)->bi_hi = (blockNumber) >> 16, \ (blockId)->bi_lo = (blockNumber) & 0xffff \ ) /* * BlockIdCopy * Copy a block identifier. */ #define BlockIdCopy(toBlockId, fromBlockId) \ ( \ AssertMacro(PointerIsValid(toBlockId)), \ AssertMacro(PointerIsValid(fromBlockId)), \ (toBlockId)->bi_hi = (fromBlockId)->bi_hi, \ (toBlockId)->bi_lo = (fromBlockId)->bi_lo \ ) /* * BlockIdEquals * Check for block number equality. */ #define BlockIdEquals(blockId1, blockId2) \ ((blockId1)->bi_hi == (blockId2)->bi_hi && \ (blockId1)->bi_lo == (blockId2)->bi_lo) /* * BlockIdGetBlockNumber * Retrieve the block number from a block identifier. */ #define BlockIdGetBlockNumber(blockId) \ ( \ AssertMacro(BlockIdIsValid(blockId)), \ (BlockNumber) (((blockId)->bi_hi << 16) | ((uint16) (blockId)->bi_lo)) \ ) #endif /* BLOCK_H */ PKBiZ server/storage/spin.hnu[/*------------------------------------------------------------------------- * * spin.h * Hardware-independent implementation of spinlocks. * * * The hardware-independent interface to spinlocks is defined by the * typedef "slock_t" and these macros: * * void SpinLockInit(volatile slock_t *lock) * Initialize a spinlock (to the unlocked state). * * void SpinLockAcquire(volatile slock_t *lock) * Acquire a spinlock, waiting if necessary. * Time out and abort() if unable to acquire the lock in a * "reasonable" amount of time --- typically ~ 1 minute. * * void SpinLockRelease(volatile slock_t *lock) * Unlock a previously acquired lock. * * bool SpinLockFree(slock_t *lock) * Tests if the lock is free. Returns TRUE if free, FALSE if locked. * This does *not* change the state of the lock. * * Callers must beware that the macro argument may be evaluated multiple * times! * * CAUTION: Care must be taken to ensure that loads and stores of * shared memory values are not rearranged around spinlock acquire * and release. This is done using the "volatile" qualifier: the C * standard states that loads and stores of volatile objects cannot * be rearranged *with respect to other volatile objects*. The * spinlock is always written through a volatile pointer by the * spinlock macros, but this is not sufficient by itself: code that * protects shared data with a spinlock MUST reference that shared * data through a volatile pointer. * * Keep in mind the coding rule that spinlocks must not be held for more * than a few instructions. In particular, we assume it is not possible * for a CHECK_FOR_INTERRUPTS() to occur while holding a spinlock, and so * it is not necessary to do HOLD/RESUME_INTERRUPTS() in these macros. * * These macros are implemented in terms of hardware-dependent macros * supplied by s_lock.h. There is not currently any extra functionality * added by this header, but there has been in the past and may someday * be again. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/spin.h * *------------------------------------------------------------------------- */ #ifndef SPIN_H #define SPIN_H #include "storage/s_lock.h" #ifndef HAVE_SPINLOCKS #include "storage/pg_sema.h" #endif #define SpinLockInit(lock) S_INIT_LOCK(lock) #define SpinLockAcquire(lock) S_LOCK(lock) #define SpinLockRelease(lock) S_UNLOCK(lock) #define SpinLockFree(lock) S_LOCK_FREE(lock) extern int SpinlockSemas(void); extern Size SpinlockSemaSize(void); #ifndef HAVE_SPINLOCKS extern void SpinlockSemaInit(PGSemaphore); extern PGSemaphore SpinlockSemaArray; #endif #endif /* SPIN_H */ PKBiZYserver/storage/item.hnu[/*------------------------------------------------------------------------- * * item.h * POSTGRES disk item definitions. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/item.h * *------------------------------------------------------------------------- */ #ifndef ITEM_H #define ITEM_H typedef Pointer Item; #endif /* ITEM_H */ PKBiZ*AAserver/storage/fd.hnu[/*------------------------------------------------------------------------- * * fd.h * Virtual file descriptor definitions. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/fd.h * *------------------------------------------------------------------------- */ /* * calls: * * File {Close, Read, Write, Seek, Tell, Sync} * {File Name Open, Allocate, Free} File * * These are NOT JUST RENAMINGS OF THE UNIX ROUTINES. * Use them for all file activity... * * File fd; * fd = FilePathOpenFile("foo", O_RDONLY, 0600); * * AllocateFile(); * FreeFile(); * * Use AllocateFile, not fopen, if you need a stdio file (FILE*); then * use FreeFile, not fclose, to close it. AVOID using stdio for files * that you intend to hold open for any length of time, since there is * no way for them to share kernel file descriptors with other files. * * Likewise, use AllocateDir/FreeDir, not opendir/closedir, to allocate * open directories (DIR*). */ #ifndef FD_H #define FD_H #include /* * FileSeek uses the standard UNIX lseek(2) flags. */ typedef char *FileName; typedef int File; /* GUC parameter */ extern int max_files_per_process; /* * This is private to fd.c, but exported for save/restore_backend_variables() */ extern int max_safe_fds; /* * prototypes for functions in fd.c */ /* Operations on virtual Files --- equivalent to Unix kernel file ops */ extern File PathNameOpenFile(FileName fileName, int fileFlags, int fileMode); extern File OpenTemporaryFile(bool interXact); extern void FileClose(File file); extern int FilePrefetch(File file, off_t offset, int amount); extern int FileRead(File file, char *buffer, int amount); extern int FileWrite(File file, char *buffer, int amount); extern int FileSync(File file); extern off_t FileSeek(File file, off_t offset, int whence); extern int FileTruncate(File file, off_t offset); extern char *FilePathName(File file); /* Operations that allow use of regular stdio --- USE WITH CAUTION */ extern FILE *AllocateFile(const char *name, const char *mode); extern int FreeFile(FILE *file); /* Operations to allow use of the library routines */ extern DIR *AllocateDir(const char *dirname); extern struct dirent *ReadDir(DIR *dir, const char *dirname); extern int FreeDir(DIR *dir); /* If you've really really gotta have a plain kernel FD, use this */ extern int BasicOpenFile(FileName fileName, int fileFlags, int fileMode); /* Miscellaneous support routines */ extern void InitFileAccess(void); extern void set_max_safe_fds(void); extern void closeAllVfds(void); extern void SetTempTablespaces(Oid *tableSpaces, int numSpaces); extern bool TempTablespacesAreSet(void); extern Oid GetNextTempTableSpace(void); extern void AtEOXact_Files(void); extern void AtEOSubXact_Files(bool isCommit, SubTransactionId mySubid, SubTransactionId parentSubid); extern void RemovePgTempFiles(void); extern int pg_fsync(int fd); extern int pg_fsync_no_writethrough(int fd); extern int pg_fsync_writethrough(int fd); extern int pg_fdatasync(int fd); extern int pg_flush_data(int fd, off_t offset, off_t amount); extern void fsync_fname(const char *fname, bool isdir); extern int durable_rename(const char *oldfile, const char *newfile, int loglevel); extern int durable_link_or_rename(const char *oldfile, const char *newfile, int loglevel); extern void SyncDataDirectory(void); /* Filename components for OpenTemporaryFile */ #define PG_TEMP_FILES_DIR "pgsql_tmp" #define PG_TEMP_FILE_PREFIX "pgsql_tmp" #endif /* FD_H */ PKBiZN׮ 99server/storage/pos.hnu[/*------------------------------------------------------------------------- * * pos.h * POSTGRES "position" definitions. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/pos.h * *------------------------------------------------------------------------- */ #ifndef POS_H #define POS_H /* * a 'position' used to be in postgres. this has * been changed to just as the notion of having multiple pages * within a block has been removed. * * the 'offset' abstraction is somewhat confusing. it is NOT a byte * offset within the page; instead, it is an offset into the line * pointer array contained on every page that store (heap or index) * tuples. */ typedef bits16 PositionIdData; typedef PositionIdData *PositionId; /* ---------------- * support macros * ---------------- */ /* * PositionIdIsValid * True iff the position identifier is valid. */ #define PositionIdIsValid(positionId) \ PointerIsValid(positionId) /* * PositionIdSetInvalid * Make an invalid position. */ #define PositionIdSetInvalid(positionId) \ *(positionId) = (bits16) 0 /* * PositionIdSet * Sets a position identifier to the specified value. */ #define PositionIdSet(positionId, offsetNumber) \ *(positionId) = (offsetNumber) /* * PositionIdGetOffsetNumber * Retrieve the offset number from a position identifier. */ #define PositionIdGetOffsetNumber(positionId) \ ((OffsetNumber) *(positionId)) #endif /* POS_H */ PKBiZyKserver/storage/fsm_internals.hnu[/*------------------------------------------------------------------------- * * fsm_internal.h * internal functions for free space map * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/fsm_internals.h * *------------------------------------------------------------------------- */ #ifndef FSM_INTERNALS_H #define FSM_INTERNALS_H #include "storage/buf.h" #include "storage/bufpage.h" /* * Structure of a FSM page. See src/backend/storage/freespace/README for * details. */ typedef struct { /* * fsm_search_avail() tries to spread the load of multiple backends by * returning different pages to different backends in a round-robin * fashion. fp_next_slot points to the next slot to be returned (assuming * there's enough space on it for the request). It's defined as an int, * because it's updated without an exclusive lock. uint16 would be more * appropriate, but int is more likely to be atomically * fetchable/storable. */ int fp_next_slot; /* * fp_nodes contains the binary tree, stored in array. The first * NonLeafNodesPerPage elements are upper nodes, and the following * LeafNodesPerPage elements are leaf nodes. Unused nodes are zero. */ uint8 fp_nodes[1]; } FSMPageData; typedef FSMPageData *FSMPage; /* * Number of non-leaf and leaf nodes, and nodes in total, on an FSM page. * These definitions are internal to fsmpage.c. */ #define NodesPerPage (BLCKSZ - MAXALIGN(SizeOfPageHeaderData) - \ offsetof(FSMPageData, fp_nodes)) #define NonLeafNodesPerPage (BLCKSZ / 2 - 1) #define LeafNodesPerPage (NodesPerPage - NonLeafNodesPerPage) /* * Number of FSM "slots" on a FSM page. This is what should be used * outside fsmpage.c. */ #define SlotsPerFSMPage LeafNodesPerPage /* Prototypes for functions in fsmpage.c */ extern int fsm_search_avail(Buffer buf, uint8 min_cat, bool advancenext, bool exclusive_lock_held); extern uint8 fsm_get_avail(Page page, int slot); extern uint8 fsm_get_max_avail(Page page); extern bool fsm_set_avail(Page page, int slot, uint8 value); extern bool fsm_truncate_avail(Page page, int nslots); extern bool fsm_rebuild_page(Page page); #endif /* FSM_INTERNALS_H */ PKBiZ3>server/storage/buffile.hnu[/*------------------------------------------------------------------------- * * buffile.h * Management of large buffered files, primarily temporary files. * * The BufFile routines provide a partial replacement for stdio atop * virtual file descriptors managed by fd.c. Currently they only support * buffered access to a virtual file, without any of stdio's formatting * features. That's enough for immediate needs, but the set of facilities * could be expanded if necessary. * * BufFile also supports working with temporary files that exceed the OS * file size limit and/or the largest offset representable in an int. * It might be better to split that out as a separately accessible module, * but currently we have no need for oversize temp files without buffered * access. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/buffile.h * *------------------------------------------------------------------------- */ #ifndef BUFFILE_H #define BUFFILE_H /* BufFile is an opaque type whose details are not known outside buffile.c. */ typedef struct BufFile BufFile; /* * prototypes for functions in buffile.c */ extern BufFile *BufFileCreateTemp(bool interXact); extern void BufFileClose(BufFile *file); extern size_t BufFileRead(BufFile *file, void *ptr, size_t size); extern size_t BufFileWrite(BufFile *file, void *ptr, size_t size); extern int BufFileSeek(BufFile *file, int fileno, off_t offset, int whence); extern void BufFileTell(BufFile *file, int *fileno, off_t *offset); extern int BufFileSeekBlock(BufFile *file, long blknum); #endif /* BUFFILE_H */ PKBiZ server/storage/procarray.hnu[/*------------------------------------------------------------------------- * * procarray.h * POSTGRES process array definitions. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/procarray.h * *------------------------------------------------------------------------- */ #ifndef PROCARRAY_H #define PROCARRAY_H #include "storage/standby.h" #include "utils/snapshot.h" extern Size ProcArrayShmemSize(void); extern void CreateSharedProcArray(void); extern void ProcArrayAdd(PGPROC *proc); extern void ProcArrayRemove(PGPROC *proc, TransactionId latestXid); extern void ProcArrayEndTransaction(PGPROC *proc, TransactionId latestXid); extern void ProcArrayClearTransaction(PGPROC *proc); extern void ProcArrayInitRecovery(TransactionId initializedUptoXID); extern void ProcArrayApplyRecoveryInfo(RunningTransactions running); extern void ProcArrayApplyXidAssignment(TransactionId topxid, int nsubxids, TransactionId *subxids); extern void RecordKnownAssignedTransactionIds(TransactionId xid); extern void ExpireTreeKnownAssignedTransactionIds(TransactionId xid, int nsubxids, TransactionId *subxids, TransactionId max_xid); extern void ExpireAllKnownAssignedTransactionIds(void); extern void ExpireOldKnownAssignedTransactionIds(TransactionId xid); extern int GetMaxSnapshotXidCount(void); extern int GetMaxSnapshotSubxidCount(void); extern Snapshot GetSnapshotData(Snapshot snapshot); extern bool ProcArrayInstallImportedXmin(TransactionId xmin, TransactionId sourcexid); extern RunningTransactions GetRunningTransactionData(void); extern bool TransactionIdIsInProgress(TransactionId xid); extern bool TransactionIdIsActive(TransactionId xid); extern TransactionId GetOldestXmin(bool allDbs, bool ignoreVacuum); extern TransactionId GetOldestActiveTransactionId(void); extern int GetTransactionsInCommit(TransactionId **xids_p); extern bool HaveTransactionsInCommit(TransactionId *xids, int nxids); extern PGPROC *BackendPidGetProc(int pid); extern int BackendXidGetPid(TransactionId xid); extern bool IsBackendPid(int pid); extern VirtualTransactionId *GetCurrentVirtualXIDs(TransactionId limitXmin, bool excludeXmin0, bool allDbs, int excludeVacuum, int *nvxids); extern VirtualTransactionId *GetConflictingVirtualXIDs(TransactionId limitXmin, Oid dbOid); extern pid_t CancelVirtualTransaction(VirtualTransactionId vxid, ProcSignalReason sigmode); extern bool MinimumActiveBackends(int min); extern int CountDBBackends(Oid databaseid); extern void CancelDBBackends(Oid databaseid, ProcSignalReason sigmode, bool conflictPending); extern int CountUserBackends(Oid roleid); extern bool CountOtherDBBackends(Oid databaseId, int *nbackends, int *nprepared); extern void XidCacheRemoveRunningXids(TransactionId xid, int nxids, const TransactionId *xids, TransactionId latestXid); #endif /* PROCARRAY_H */ PKBiZeCC$server/storage/predicate_internals.hnu[/*------------------------------------------------------------------------- * * predicate_internals.h * POSTGRES internal predicate locking definitions. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/predicate_internals.h * *------------------------------------------------------------------------- */ #ifndef PREDICATE_INTERNALS_H #define PREDICATE_INTERNALS_H #include "storage/lock.h" /* * Commit number. */ typedef uint64 SerCommitSeqNo; /* * Reserved commit sequence numbers: * - 0 is reserved to indicate a non-existent SLRU entry; it cannot be * used as a SerCommitSeqNo, even an invalid one * - InvalidSerCommitSeqNo is used to indicate a transaction that * hasn't committed yet, so use a number greater than all valid * ones to make comparison do the expected thing * - RecoverySerCommitSeqNo is used to refer to transactions that * happened before a crash/recovery, since we restart the sequence * at that point. It's earlier than all normal sequence numbers, * and is only used by recovered prepared transactions */ #define InvalidSerCommitSeqNo ((SerCommitSeqNo) UINT64CONST(0xFFFFFFFFFFFFFFFF)) #define RecoverySerCommitSeqNo ((SerCommitSeqNo) 1) #define FirstNormalSerCommitSeqNo ((SerCommitSeqNo) 2) /* * The SERIALIZABLEXACT struct contains information needed for each * serializable database transaction to support SSI techniques. * * A home-grown list is maintained in shared memory to manage these. * An entry is used when the serializable transaction acquires a snapshot. * Unless the transaction is rolled back, this entry must generally remain * until all concurrent transactions have completed. (There are special * optimizations for READ ONLY transactions which often allow them to be * cleaned up earlier.) A transaction which is rolled back is cleaned up * as soon as possible. * * Eligibility for cleanup of committed transactions is generally determined * by comparing the transaction's finishedBefore field to * SerializableGlobalXmin. */ typedef struct SERIALIZABLEXACT { VirtualTransactionId vxid; /* The executing process always has one of * these. */ /* * We use two numbers to track the order that transactions commit. Before * commit, a transaction is marked as prepared, and prepareSeqNo is set. * Shortly after commit, it's marked as committed, and commitSeqNo is set. * This doesn't give a strict commit order, but these two values together * are good enough for us, as we can always err on the safe side and * assume that there's a conflict, if we can't be sure of the exact * ordering of two commits. * * Note that a transaction is marked as prepared for a short period during * commit processing, even if two-phase commit is not used. But with * two-phase commit, a transaction can stay in prepared state for some * time. */ SerCommitSeqNo prepareSeqNo; SerCommitSeqNo commitSeqNo; /* these values are not both interesting at the same time */ union { SerCommitSeqNo earliestOutConflictCommit; /* when committed with * conflict out */ SerCommitSeqNo lastCommitBeforeSnapshot; /* when not committed or * no conflict out */ } SeqNo; SHM_QUEUE outConflicts; /* list of write transactions whose data we * couldn't read. */ SHM_QUEUE inConflicts; /* list of read transactions which couldn't * see our write. */ SHM_QUEUE predicateLocks; /* list of associated PREDICATELOCK objects */ SHM_QUEUE finishedLink; /* list link in * FinishedSerializableTransactions */ /* * for r/o transactions: list of concurrent r/w transactions that we could * potentially have conflicts with, and vice versa for r/w transactions */ SHM_QUEUE possibleUnsafeConflicts; TransactionId topXid; /* top level xid for the transaction, if one * exists; else invalid */ TransactionId finishedBefore; /* invalid means still running; else * the struct expires when no * serializable xids are before this. */ TransactionId xmin; /* the transaction's snapshot xmin */ uint32 flags; /* OR'd combination of values defined below */ int pid; /* pid of associated process */ } SERIALIZABLEXACT; #define SXACT_FLAG_COMMITTED 0x00000001 /* already committed */ #define SXACT_FLAG_PREPARED 0x00000002 /* about to commit */ #define SXACT_FLAG_ROLLED_BACK 0x00000004 /* already rolled back */ #define SXACT_FLAG_DOOMED 0x00000008 /* will roll back */ /* * The following flag actually means that the flagged transaction has a * conflict out *to a transaction which committed ahead of it*. It's hard * to get that into a name of a reasonable length. */ #define SXACT_FLAG_CONFLICT_OUT 0x00000010 #define SXACT_FLAG_READ_ONLY 0x00000020 #define SXACT_FLAG_DEFERRABLE_WAITING 0x00000040 #define SXACT_FLAG_RO_SAFE 0x00000080 #define SXACT_FLAG_RO_UNSAFE 0x00000100 #define SXACT_FLAG_SUMMARY_CONFLICT_IN 0x00000200 #define SXACT_FLAG_SUMMARY_CONFLICT_OUT 0x00000400 /* * The following types are used to provide an ad hoc list for holding * SERIALIZABLEXACT objects. An HTAB is overkill, since there is no need to * access these by key -- there are direct pointers to these objects where * needed. If a shared memory list is created, these types can probably be * eliminated in favor of using the general solution. */ typedef struct PredXactListElementData { SHM_QUEUE link; SERIALIZABLEXACT sxact; } PredXactListElementData; typedef struct PredXactListElementData *PredXactListElement; #define PredXactListElementDataSize \ ((Size)MAXALIGN(sizeof(PredXactListElementData))) typedef struct PredXactListData { SHM_QUEUE availableList; SHM_QUEUE activeList; /* * These global variables are maintained when registering and cleaning up * serializable transactions. They must be global across all backends, * but are not needed outside the predicate.c source file. Protected by * SerializableXactHashLock. */ TransactionId SxactGlobalXmin; /* global xmin for active serializable * transactions */ int SxactGlobalXminCount; /* how many active serializable * transactions have this xmin */ int WritableSxactCount; /* how many non-read-only serializable * transactions are active */ SerCommitSeqNo LastSxactCommitSeqNo; /* a strictly monotonically * increasing number for * commits of serializable * transactions */ /* Protected by SerializableXactHashLock. */ SerCommitSeqNo CanPartialClearThrough; /* can clear predicate locks * and inConflicts for * committed transactions * through this seq no */ /* Protected by SerializableFinishedListLock. */ SerCommitSeqNo HavePartialClearedThrough; /* have cleared through this * seq no */ SERIALIZABLEXACT *OldCommittedSxact; /* shared copy of dummy sxact */ PredXactListElement element; } PredXactListData; typedef struct PredXactListData *PredXactList; #define PredXactListDataSize \ ((Size)MAXALIGN(sizeof(PredXactListData))) /* * The following types are used to provide lists of rw-conflicts between * pairs of transactions. Since exactly the same information is needed, * they are also used to record possible unsafe transaction relationships * for purposes of identifying safe snapshots for read-only transactions. * * When a RWConflictData is not in use to record either type of relationship * between a pair of transactions, it is kept on an "available" list. The * outLink field is used for maintaining that list. */ typedef struct RWConflictData { SHM_QUEUE outLink; /* link for list of conflicts out from a sxact */ SHM_QUEUE inLink; /* link for list of conflicts in to a sxact */ SERIALIZABLEXACT *sxactOut; SERIALIZABLEXACT *sxactIn; } RWConflictData; typedef struct RWConflictData *RWConflict; #define RWConflictDataSize \ ((Size)MAXALIGN(sizeof(RWConflictData))) typedef struct RWConflictPoolHeaderData { SHM_QUEUE availableList; RWConflict element; } RWConflictPoolHeaderData; typedef struct RWConflictPoolHeaderData *RWConflictPoolHeader; #define RWConflictPoolHeaderDataSize \ ((Size)MAXALIGN(sizeof(RWConflictPoolHeaderData))) /* * The SERIALIZABLEXIDTAG struct identifies an xid assigned to a serializable * transaction or any of its subtransactions. */ typedef struct SERIALIZABLEXIDTAG { TransactionId xid; } SERIALIZABLEXIDTAG; /* * The SERIALIZABLEXID struct provides a link from a TransactionId for a * serializable transaction to the related SERIALIZABLEXACT record, even if * the transaction has completed and its connection has been closed. * * These are created as new top level transaction IDs are first assigned to * transactions which are participating in predicate locking. This may * never happen for a particular transaction if it doesn't write anything. * They are removed with their related serializable transaction objects. * * The SubTransGetTopmostTransaction method is used where necessary to get * from an XID which might be from a subtransaction to the top level XID. */ typedef struct SERIALIZABLEXID { /* hash key */ SERIALIZABLEXIDTAG tag; /* data */ SERIALIZABLEXACT *myXact; /* pointer to the top level transaction data */ } SERIALIZABLEXID; /* * The PREDICATELOCKTARGETTAG struct identifies a database object which can * be the target of predicate locks. * * Note that the hash function being used doesn't properly respect tag * length -- if the length of the structure isn't a multiple of four bytes it * will go to a four byte boundary past the end of the tag. If you change * this struct, make sure any slack space is initialized, so that any random * bytes in the middle or at the end are not included in the hash. * * TODO SSI: If we always use the same fields for the same type of value, we * should rename these. Holding off until it's clear there are no exceptions. * Since indexes are relations with blocks and tuples, it's looking likely that * the rename will be possible. If not, we may need to divide the last field * and use part of it for a target type, so that we know how to interpret the * data.. */ typedef struct PREDICATELOCKTARGETTAG { uint32 locktag_field1; /* a 32-bit ID field */ uint32 locktag_field2; /* a 32-bit ID field */ uint32 locktag_field3; /* a 32-bit ID field */ uint32 locktag_field4; /* a 32-bit ID field */ } PREDICATELOCKTARGETTAG; /* * The PREDICATELOCKTARGET struct represents a database object on which there * are predicate locks. * * A hash list of these objects is maintained in shared memory. An entry is * added when a predicate lock is requested on an object which doesn't * already have one. An entry is removed when the last lock is removed from * its list. */ typedef struct PREDICATELOCKTARGET { /* hash key */ PREDICATELOCKTARGETTAG tag; /* unique identifier of lockable object */ /* data */ SHM_QUEUE predicateLocks; /* list of PREDICATELOCK objects assoc. with * predicate lock target */ } PREDICATELOCKTARGET; /* * The PREDICATELOCKTAG struct identifies an individual predicate lock. * * It is the combination of predicate lock target (which is a lockable * object) and a serializable transaction which has acquired a lock on that * target. */ typedef struct PREDICATELOCKTAG { PREDICATELOCKTARGET *myTarget; SERIALIZABLEXACT *myXact; } PREDICATELOCKTAG; /* * The PREDICATELOCK struct represents an individual lock. * * An entry can be created here when the related database object is read, or * by promotion of multiple finer-grained targets. All entries related to a * serializable transaction are removed when that serializable transaction is * cleaned up. Entries can also be removed when they are combined into a * single coarser-grained lock entry. */ typedef struct PREDICATELOCK { /* hash key */ PREDICATELOCKTAG tag; /* unique identifier of lock */ /* data */ SHM_QUEUE targetLink; /* list link in PREDICATELOCKTARGET's list of * predicate locks */ SHM_QUEUE xactLink; /* list link in SERIALIZABLEXACT's list of * predicate locks */ SerCommitSeqNo commitSeqNo; /* only used for summarized predicate locks */ } PREDICATELOCK; /* * The LOCALPREDICATELOCK struct represents a local copy of data which is * also present in the PREDICATELOCK table, organized for fast access without * needing to acquire a LWLock. It is strictly for optimization. * * Each serializable transaction creates its own local hash table to hold a * collection of these. This information is used to determine when a number * of fine-grained locks should be promoted to a single coarser-grained lock. * The information is maintained more-or-less in parallel to the * PREDICATELOCK data, but because this data is not protected by locks and is * only used in an optimization heuristic, it is allowed to drift in a few * corner cases where maintaining exact data would be expensive. * * The hash table is created when the serializable transaction acquires its * snapshot, and its memory is released upon completion of the transaction. */ typedef struct LOCALPREDICATELOCK { /* hash key */ PREDICATELOCKTARGETTAG tag; /* unique identifier of lockable object */ /* data */ bool held; /* is lock held, or just its children? */ int childLocks; /* number of child locks currently held */ } LOCALPREDICATELOCK; /* * The types of predicate locks which can be acquired. */ typedef enum PredicateLockTargetType { PREDLOCKTAG_RELATION, PREDLOCKTAG_PAGE, PREDLOCKTAG_TUPLE /* TODO SSI: Other types may be needed for index locking */ } PredicateLockTargetType; /* * This structure is used to quickly capture a copy of all predicate * locks. This is currently used only by the pg_lock_status function, * which in turn is used by the pg_locks view. */ typedef struct PredicateLockData { int nelements; PREDICATELOCKTARGETTAG *locktags; SERIALIZABLEXACT *xacts; } PredicateLockData; /* * These macros define how we map logical IDs of lockable objects into the * physical fields of PREDICATELOCKTARGETTAG. Use these to set up values, * rather than accessing the fields directly. Note multiple eval of target! */ #define SET_PREDICATELOCKTARGETTAG_RELATION(locktag,dboid,reloid) \ ((locktag).locktag_field1 = (dboid), \ (locktag).locktag_field2 = (reloid), \ (locktag).locktag_field3 = InvalidBlockNumber, \ (locktag).locktag_field4 = InvalidOffsetNumber) #define SET_PREDICATELOCKTARGETTAG_PAGE(locktag,dboid,reloid,blocknum) \ ((locktag).locktag_field1 = (dboid), \ (locktag).locktag_field2 = (reloid), \ (locktag).locktag_field3 = (blocknum), \ (locktag).locktag_field4 = InvalidOffsetNumber) #define SET_PREDICATELOCKTARGETTAG_TUPLE(locktag,dboid,reloid,blocknum,offnum) \ ((locktag).locktag_field1 = (dboid), \ (locktag).locktag_field2 = (reloid), \ (locktag).locktag_field3 = (blocknum), \ (locktag).locktag_field4 = (offnum)) #define GET_PREDICATELOCKTARGETTAG_DB(locktag) \ ((Oid) (locktag).locktag_field1) #define GET_PREDICATELOCKTARGETTAG_RELATION(locktag) \ ((Oid) (locktag).locktag_field2) #define GET_PREDICATELOCKTARGETTAG_PAGE(locktag) \ ((BlockNumber) (locktag).locktag_field3) #define GET_PREDICATELOCKTARGETTAG_OFFSET(locktag) \ ((OffsetNumber) (locktag).locktag_field4) #define GET_PREDICATELOCKTARGETTAG_TYPE(locktag) \ (((locktag).locktag_field4 != InvalidOffsetNumber) ? PREDLOCKTAG_TUPLE : \ (((locktag).locktag_field3 != InvalidBlockNumber) ? PREDLOCKTAG_PAGE : \ PREDLOCKTAG_RELATION)) /* * Two-phase commit statefile records. There are two types: for each * transaction, we generate one per-transaction record and a variable * number of per-predicate-lock records. */ typedef enum TwoPhasePredicateRecordType { TWOPHASEPREDICATERECORD_XACT, TWOPHASEPREDICATERECORD_LOCK } TwoPhasePredicateRecordType; /* * Per-transaction information to reconstruct a SERIALIZABLEXACT. Not * much is needed because most of it not meaningful for a recovered * prepared transaction. * * In particular, we do not record the in and out conflict lists for a * prepared transaction because the associated SERIALIZABLEXACTs will * not be available after recovery. Instead, we simply record the * existence of each type of conflict by setting the transaction's * summary conflict in/out flag. */ typedef struct TwoPhasePredicateXactRecord { TransactionId xmin; uint32 flags; } TwoPhasePredicateXactRecord; /* Per-lock state */ typedef struct TwoPhasePredicateLockRecord { PREDICATELOCKTARGETTAG target; uint32 filler; /* to avoid length change in back-patched fix */ } TwoPhasePredicateLockRecord; typedef struct TwoPhasePredicateRecord { TwoPhasePredicateRecordType type; union { TwoPhasePredicateXactRecord xactRecord; TwoPhasePredicateLockRecord lockRecord; } data; } TwoPhasePredicateRecord; /* * Define a macro to use for an "empty" SERIALIZABLEXACT reference. */ #define InvalidSerializableXact ((SERIALIZABLEXACT *) NULL) /* * Function definitions for functions needing awareness of predicate * locking internals. */ extern PredicateLockData *GetPredicateLockStatusData(void); #endif /* PREDICATE_INTERNALS_H */ PKBiZrserver/storage/bufmgr.hnu[/*------------------------------------------------------------------------- * * bufmgr.h * POSTGRES buffer manager definitions. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/bufmgr.h * *------------------------------------------------------------------------- */ #ifndef BUFMGR_H #define BUFMGR_H #include "storage/block.h" #include "storage/buf.h" #include "storage/bufpage.h" #include "storage/relfilenode.h" #include "utils/relcache.h" typedef void *Block; /* Possible arguments for GetAccessStrategy() */ typedef enum BufferAccessStrategyType { BAS_NORMAL, /* Normal random access */ BAS_BULKREAD, /* Large read-only scan (hint bit updates are * ok) */ BAS_BULKWRITE, /* Large multi-block write (e.g. COPY IN) */ BAS_VACUUM /* VACUUM */ } BufferAccessStrategyType; /* Possible modes for ReadBufferExtended() */ typedef enum { RBM_NORMAL, /* Normal read */ RBM_DO_NOT_USE, /* This used to be RBM_ZERO. Only kept for * binary compatibility with 3rd party * extensions. */ RBM_ZERO_ON_ERROR, /* Read, but return an all-zeros page on error */ RBM_NORMAL_NO_LOG, /* Don't log page as invalid during WAL * replay; otherwise same as RBM_NORMAL */ RBM_ZERO_AND_LOCK, /* Don't read from disk, caller will * initialize. Also locks the page. */ RBM_ZERO_AND_CLEANUP_LOCK /* Like RBM_ZERO_AND_LOCK, but locks the page * in "cleanup" mode */ } ReadBufferMode; /* in globals.c ... this duplicates miscadmin.h */ extern PGDLLIMPORT int NBuffers; /* in bufmgr.c */ extern bool zero_damaged_pages; extern int bgwriter_lru_maxpages; extern double bgwriter_lru_multiplier; extern bool track_io_timing; extern int target_prefetch_pages; /* in buf_init.c */ extern PGDLLIMPORT char *BufferBlocks; extern PGDLLIMPORT int32 *PrivateRefCount; /* in localbuf.c */ extern PGDLLIMPORT int NLocBuffer; extern PGDLLIMPORT Block *LocalBufferBlockPointers; extern PGDLLIMPORT int32 *LocalRefCount; /* special block number for ReadBuffer() */ #define P_NEW InvalidBlockNumber /* grow the file to get a new page */ /* * Buffer content lock modes (mode argument for LockBuffer()) */ #define BUFFER_LOCK_UNLOCK 0 #define BUFFER_LOCK_SHARE 1 #define BUFFER_LOCK_EXCLUSIVE 2 /* * These routines are beaten on quite heavily, hence the macroization. */ /* * BufferIsValid * True iff the given buffer number is valid (either as a shared * or local buffer). * * Note: For a long time this was defined the same as BufferIsPinned, * that is it would say False if you didn't hold a pin on the buffer. * I believe this was bogus and served only to mask logic errors. * Code should always know whether it has a buffer reference, * independently of the pin state. * * Note: For a further long time this was not quite the inverse of the * BufferIsInvalid() macro, in that it also did sanity checks to verify * that the buffer number was in range. Most likely, this macro was * originally intended only to be used in assertions, but its use has * since expanded quite a bit, and the overhead of making those checks * even in non-assert-enabled builds can be significant. Thus, we've * now demoted the range checks to assertions within the macro itself. */ #define BufferIsValid(bufnum) \ ( \ AssertMacro((bufnum) <= NBuffers && (bufnum) >= -NLocBuffer), \ (bufnum) != InvalidBuffer \ ) /* * BufferIsPinned * True iff the buffer is pinned (also checks for valid buffer number). * * NOTE: what we check here is that *this* backend holds a pin on * the buffer. We do not care whether some other backend does. */ #define BufferIsPinned(bufnum) \ ( \ !BufferIsValid(bufnum) ? \ false \ : \ BufferIsLocal(bufnum) ? \ (LocalRefCount[-(bufnum) - 1] > 0) \ : \ (PrivateRefCount[(bufnum) - 1] > 0) \ ) /* * BufferGetBlock * Returns a reference to a disk page image associated with a buffer. * * Note: * Assumes buffer is valid. */ #define BufferGetBlock(buffer) \ ( \ AssertMacro(BufferIsValid(buffer)), \ BufferIsLocal(buffer) ? \ LocalBufferBlockPointers[-(buffer) - 1] \ : \ (Block) (BufferBlocks + ((Size) ((buffer) - 1)) * BLCKSZ) \ ) /* * BufferGetPageSize * Returns the page size within a buffer. * * Notes: * Assumes buffer is valid. * * The buffer can be a raw disk block and need not contain a valid * (formatted) disk page. */ /* XXX should dig out of buffer descriptor */ #define BufferGetPageSize(buffer) \ ( \ AssertMacro(BufferIsValid(buffer)), \ (Size)BLCKSZ \ ) /* * BufferGetPage * Returns the page associated with a buffer. */ #define BufferGetPage(buffer) ((Page)BufferGetBlock(buffer)) /* * prototypes for functions in bufmgr.c */ extern void PrefetchBuffer(Relation reln, ForkNumber forkNum, BlockNumber blockNum); extern Buffer ReadBuffer(Relation reln, BlockNumber blockNum); extern Buffer ReadBufferExtended(Relation reln, ForkNumber forkNum, BlockNumber blockNum, ReadBufferMode mode, BufferAccessStrategy strategy); extern Buffer ReadBufferWithoutRelcache(RelFileNode rnode, ForkNumber forkNum, BlockNumber blockNum, ReadBufferMode mode, BufferAccessStrategy strategy); extern void ReleaseBuffer(Buffer buffer); extern void UnlockReleaseBuffer(Buffer buffer); extern void MarkBufferDirty(Buffer buffer); extern void IncrBufferRefCount(Buffer buffer); extern Buffer ReleaseAndReadBuffer(Buffer buffer, Relation relation, BlockNumber blockNum); extern void InitBufferPool(void); extern void InitBufferPoolAccess(void); extern void InitBufferPoolBackend(void); extern void AtEOXact_Buffers(bool isCommit); extern void PrintBufferLeakWarning(Buffer buffer); extern void CheckPointBuffers(int flags); extern BlockNumber BufferGetBlockNumber(Buffer buffer); extern BlockNumber RelationGetNumberOfBlocksInFork(Relation relation, ForkNumber forkNum); extern void FlushOneBuffer(Buffer buffer); extern void FlushRelationBuffers(Relation rel); extern void FlushDatabaseBuffers(Oid dbid); extern void DropRelFileNodeBuffers(RelFileNodeBackend rnode, ForkNumber forkNum, BlockNumber firstDelBlock); extern void DropRelFileNodeAllBuffers(RelFileNodeBackend rnode); extern void DropDatabaseBuffers(Oid dbid); #define RelationGetNumberOfBlocks(reln) \ RelationGetNumberOfBlocksInFork(reln, MAIN_FORKNUM) extern bool BufferIsPermanent(Buffer buffer); #ifdef NOT_USED extern void PrintPinnedBufs(void); #endif extern Size BufferShmemSize(void); extern void BufferGetTag(Buffer buffer, RelFileNode *rnode, ForkNumber *forknum, BlockNumber *blknum); extern void SetBufferCommitInfoNeedsSave(Buffer buffer); extern void UnlockBuffers(void); extern void LockBuffer(Buffer buffer, int mode); extern bool ConditionalLockBuffer(Buffer buffer); extern void LockBufferForCleanup(Buffer buffer); extern bool ConditionalLockBufferForCleanup(Buffer buffer); extern bool HoldingBufferPinThatDelaysRecovery(void); extern void AbortBufferIO(void); extern void BufmgrCommit(void); extern bool BgBufferSync(void); extern void AtProcExit_LocalBuffers(void); /* in freelist.c */ extern BufferAccessStrategy GetAccessStrategy(BufferAccessStrategyType btype); extern void FreeAccessStrategy(BufferAccessStrategy strategy); #endif PKBiZL/,,server/storage/buf_internals.hnu[/*------------------------------------------------------------------------- * * buf_internals.h * Internal definitions for buffer manager and the buffer replacement * strategy. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/buf_internals.h * *------------------------------------------------------------------------- */ #ifndef BUFMGR_INTERNALS_H #define BUFMGR_INTERNALS_H #include "storage/buf.h" #include "storage/latch.h" #include "storage/lwlock.h" #include "storage/shmem.h" #include "storage/smgr.h" #include "storage/spin.h" #include "utils/relcache.h" /* * Flags for buffer descriptors * * Note: TAG_VALID essentially means that there is a buffer hashtable * entry associated with the buffer's tag. */ #define BM_DIRTY (1 << 0) /* data needs writing */ #define BM_VALID (1 << 1) /* data is valid */ #define BM_TAG_VALID (1 << 2) /* tag is assigned */ #define BM_IO_IN_PROGRESS (1 << 3) /* read or write in progress */ #define BM_IO_ERROR (1 << 4) /* previous I/O failed */ #define BM_JUST_DIRTIED (1 << 5) /* dirtied since write started */ #define BM_PIN_COUNT_WAITER (1 << 6) /* have waiter for sole pin */ #define BM_CHECKPOINT_NEEDED (1 << 7) /* must write for checkpoint */ #define BM_PERMANENT (1 << 8) /* permanent relation (not * unlogged, or init fork) */ typedef bits16 BufFlags; /* * The maximum allowed value of usage_count represents a tradeoff between * accuracy and speed of the clock-sweep buffer management algorithm. A * large value (comparable to NBuffers) would approximate LRU semantics. * But it can take as many as BM_MAX_USAGE_COUNT+1 complete cycles of * clock sweeps to find a free buffer, so in practice we don't want the * value to be very large. */ #define BM_MAX_USAGE_COUNT 5 /* * Buffer tag identifies which disk block the buffer contains. * * Note: the BufferTag data must be sufficient to determine where to write the * block, without reference to pg_class or pg_tablespace entries. It's * possible that the backend flushing the buffer doesn't even believe the * relation is visible yet (its xact may have started before the xact that * created the rel). The storage manager must be able to cope anyway. * * Note: if there's any pad bytes in the struct, INIT_BUFFERTAG will have * to be fixed to zero them, since this struct is used as a hash key. */ typedef struct buftag { RelFileNode rnode; /* physical relation identifier */ ForkNumber forkNum; BlockNumber blockNum; /* blknum relative to begin of reln */ } BufferTag; #define CLEAR_BUFFERTAG(a) \ ( \ (a).rnode.spcNode = InvalidOid, \ (a).rnode.dbNode = InvalidOid, \ (a).rnode.relNode = InvalidOid, \ (a).forkNum = InvalidForkNumber, \ (a).blockNum = InvalidBlockNumber \ ) #define INIT_BUFFERTAG(a,xx_rnode,xx_forkNum,xx_blockNum) \ ( \ (a).rnode = (xx_rnode), \ (a).forkNum = (xx_forkNum), \ (a).blockNum = (xx_blockNum) \ ) #define BUFFERTAGS_EQUAL(a,b) \ ( \ RelFileNodeEquals((a).rnode, (b).rnode) && \ (a).blockNum == (b).blockNum && \ (a).forkNum == (b).forkNum \ ) /* * The shared buffer mapping table is partitioned to reduce contention. * To determine which partition lock a given tag requires, compute the tag's * hash code with BufTableHashCode(), then apply BufMappingPartitionLock(). * NB: NUM_BUFFER_PARTITIONS must be a power of 2! */ #define BufTableHashPartition(hashcode) \ ((hashcode) % NUM_BUFFER_PARTITIONS) #define BufMappingPartitionLock(hashcode) \ ((LWLockId) (FirstBufMappingLock + BufTableHashPartition(hashcode))) /* * BufferDesc -- shared descriptor/state data for a single shared buffer. * * Note: buf_hdr_lock must be held to examine or change the tag, flags, * usage_count, refcount, or wait_backend_pid fields. buf_id field never * changes after initialization, so does not need locking. freeNext is * protected by the BufFreelistLock not buf_hdr_lock. The LWLocks can take * care of themselves. The buf_hdr_lock is *not* used to control access to * the data in the buffer! * * An exception is that if we have the buffer pinned, its tag can't change * underneath us, so we can examine the tag without locking the spinlock. * Also, in places we do one-time reads of the flags without bothering to * lock the spinlock; this is generally for situations where we don't expect * the flag bit being tested to be changing. * * We can't physically remove items from a disk page if another backend has * the buffer pinned. Hence, a backend may need to wait for all other pins * to go away. This is signaled by storing its own PID into * wait_backend_pid and setting flag bit BM_PIN_COUNT_WAITER. At present, * there can be only one such waiter per buffer. * * We use this same struct for local buffer headers, but the lock fields * are not used and not all of the flag bits are useful either. */ typedef struct sbufdesc { BufferTag tag; /* ID of page contained in buffer */ BufFlags flags; /* see bit definitions above */ uint16 usage_count; /* usage counter for clock sweep code */ unsigned refcount; /* # of backends holding pins on buffer */ int wait_backend_pid; /* backend PID of pin-count waiter */ slock_t buf_hdr_lock; /* protects the above fields */ int buf_id; /* buffer's index number (from 0) */ int freeNext; /* link in freelist chain */ LWLockId io_in_progress_lock; /* to wait for I/O to complete */ LWLockId content_lock; /* to lock access to buffer contents */ } BufferDesc; #define BufferDescriptorGetBuffer(bdesc) ((bdesc)->buf_id + 1) /* * The freeNext field is either the index of the next freelist entry, * or one of these special values: */ #define FREENEXT_END_OF_LIST (-1) #define FREENEXT_NOT_IN_LIST (-2) /* * Macros for acquiring/releasing a shared buffer header's spinlock. * Do not apply these to local buffers! * * Note: as a general coding rule, if you are using these then you probably * need to be using a volatile-qualified pointer to the buffer header, to * ensure that the compiler doesn't rearrange accesses to the header to * occur before or after the spinlock is acquired/released. */ #define LockBufHdr(bufHdr) SpinLockAcquire(&(bufHdr)->buf_hdr_lock) #define UnlockBufHdr(bufHdr) SpinLockRelease(&(bufHdr)->buf_hdr_lock) /* in buf_init.c */ extern PGDLLIMPORT BufferDesc *BufferDescriptors; /* in localbuf.c */ extern BufferDesc *LocalBufferDescriptors; /* * Internal routines: only called by bufmgr */ /* freelist.c */ extern volatile BufferDesc *StrategyGetBuffer(BufferAccessStrategy strategy, bool *lock_held); extern void StrategyFreeBuffer(volatile BufferDesc *buf); extern bool StrategyRejectBuffer(BufferAccessStrategy strategy, volatile BufferDesc *buf); extern int StrategySyncStart(uint32 *complete_passes, uint32 *num_buf_alloc); extern void StrategyNotifyBgWriter(Latch *bgwriterLatch); extern Size StrategyShmemSize(void); extern void StrategyInitialize(bool init); /* buf_table.c */ extern Size BufTableShmemSize(int size); extern void InitBufTable(int size); extern uint32 BufTableHashCode(BufferTag *tagPtr); extern int BufTableLookup(BufferTag *tagPtr, uint32 hashcode); extern int BufTableInsert(BufferTag *tagPtr, uint32 hashcode, int buf_id); extern void BufTableDelete(BufferTag *tagPtr, uint32 hashcode); /* localbuf.c */ extern void LocalPrefetchBuffer(SMgrRelation smgr, ForkNumber forkNum, BlockNumber blockNum); extern BufferDesc *LocalBufferAlloc(SMgrRelation smgr, ForkNumber forkNum, BlockNumber blockNum, bool *foundPtr); extern void MarkLocalBufferDirty(Buffer buffer); extern void DropRelFileNodeLocalBuffers(RelFileNode rnode, ForkNumber forkNum, BlockNumber firstDelBlock); extern void DropRelFileNodeAllLocalBuffers(RelFileNode rnode); extern void AtEOXact_LocalBuffers(bool isCommit); #endif /* BUFMGR_INTERNALS_H */ PKBiZ+33server/storage/bufpage.hnu[/*------------------------------------------------------------------------- * * bufpage.h * Standard POSTGRES buffer page definitions. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/bufpage.h * *------------------------------------------------------------------------- */ #ifndef BUFPAGE_H #define BUFPAGE_H #include "access/xlogdefs.h" #include "storage/item.h" #include "storage/off.h" /* * A postgres disk page is an abstraction layered on top of a postgres * disk block (which is simply a unit of i/o, see block.h). * * specifically, while a disk block can be unformatted, a postgres * disk page is always a slotted page of the form: * * +----------------+---------------------------------+ * | PageHeaderData | linp1 linp2 linp3 ... | * +-----------+----+---------------------------------+ * | ... linpN | | * +-----------+--------------------------------------+ * | ^ pd_lower | * | | * | v pd_upper | * +-------------+------------------------------------+ * | | tupleN ... | * +-------------+------------------+-----------------+ * | ... tuple3 tuple2 tuple1 | "special space" | * +--------------------------------+-----------------+ * ^ pd_special * * a page is full when nothing can be added between pd_lower and * pd_upper. * * all blocks written out by an access method must be disk pages. * * EXCEPTIONS: * * obviously, a page is not formatted before it is initialized by * a call to PageInit. * * NOTES: * * linp1..N form an ItemId array. ItemPointers point into this array * rather than pointing directly to a tuple. Note that OffsetNumbers * conventionally start at 1, not 0. * * tuple1..N are added "backwards" on the page. because a tuple's * ItemPointer points to its ItemId entry rather than its actual * byte-offset position, tuples can be physically shuffled on a page * whenever the need arises. * * AM-generic per-page information is kept in PageHeaderData. * * AM-specific per-page data (if any) is kept in the area marked "special * space"; each AM has an "opaque" structure defined somewhere that is * stored as the page trailer. an access method should always * initialize its pages with PageInit and then set its own opaque * fields. */ typedef Pointer Page; /* * location (byte offset) within a page. * * note that this is actually limited to 2^15 because we have limited * ItemIdData.lp_off and ItemIdData.lp_len to 15 bits (see itemid.h). */ typedef uint16 LocationIndex; /* * disk page organization * * space management information generic to any page * * pd_lsn - identifies xlog record for last change to this page. * pd_tli - ditto. * pd_flags - flag bits. * pd_lower - offset to start of free space. * pd_upper - offset to end of free space. * pd_special - offset to start of special space. * pd_pagesize_version - size in bytes and page layout version number. * pd_prune_xid - oldest XID among potentially prunable tuples on page. * * The LSN is used by the buffer manager to enforce the basic rule of WAL: * "thou shalt write xlog before data". A dirty buffer cannot be dumped * to disk until xlog has been flushed at least as far as the page's LSN. * We also store the 16 least significant bits of the TLI for identification * purposes (it is not clear that this is actually necessary, but it seems * like a good idea). * * pd_prune_xid is a hint field that helps determine whether pruning will be * useful. It is currently unused in index pages. * * The page version number and page size are packed together into a single * uint16 field. This is for historical reasons: before PostgreSQL 7.3, * there was no concept of a page version number, and doing it this way * lets us pretend that pre-7.3 databases have page version number zero. * We constrain page sizes to be multiples of 256, leaving the low eight * bits available for a version number. * * Minimum possible page size is perhaps 64B to fit page header, opaque space * and a minimal tuple; of course, in reality you want it much bigger, so * the constraint on pagesize mod 256 is not an important restriction. * On the high end, we can only support pages up to 32KB because lp_off/lp_len * are 15 bits. */ typedef struct PageHeaderData { /* XXX LSN is member of *any* block, not only page-organized ones */ XLogRecPtr pd_lsn; /* LSN: next byte after last byte of xlog * record for last change to this page */ uint16 pd_tli; /* least significant bits of the TimeLineID * containing the LSN */ uint16 pd_flags; /* flag bits, see below */ LocationIndex pd_lower; /* offset to start of free space */ LocationIndex pd_upper; /* offset to end of free space */ LocationIndex pd_special; /* offset to start of special space */ uint16 pd_pagesize_version; TransactionId pd_prune_xid; /* oldest prunable XID, or zero if none */ ItemIdData pd_linp[1]; /* beginning of line pointer array */ } PageHeaderData; typedef PageHeaderData *PageHeader; /* * pd_flags contains the following flag bits. Undefined bits are initialized * to zero and may be used in the future. * * PD_HAS_FREE_LINES is set if there are any LP_UNUSED line pointers before * pd_lower. This should be considered a hint rather than the truth, since * changes to it are not WAL-logged. * * PD_PAGE_FULL is set if an UPDATE doesn't find enough free space in the * page for its new tuple version; this suggests that a prune is needed. * Again, this is just a hint. */ #define PD_HAS_FREE_LINES 0x0001 /* are there any unused line pointers? */ #define PD_PAGE_FULL 0x0002 /* not enough free space for new * tuple? */ #define PD_ALL_VISIBLE 0x0004 /* all tuples on page are visible to * everyone */ #define PD_VALID_FLAG_BITS 0x0007 /* OR of all valid pd_flags bits */ /* * Page layout version number 0 is for pre-7.3 Postgres releases. * Releases 7.3 and 7.4 use 1, denoting a new HeapTupleHeader layout. * Release 8.0 uses 2; it changed the HeapTupleHeader layout again. * Release 8.1 uses 3; it redefined HeapTupleHeader infomask bits. * Release 8.3 uses 4; it changed the HeapTupleHeader layout again, and * added the pd_flags field (by stealing some bits from pd_tli), * as well as adding the pd_prune_xid field (which enlarges the header). */ #define PG_PAGE_LAYOUT_VERSION 4 /* ---------------------------------------------------------------- * page support macros * ---------------------------------------------------------------- */ /* * PageIsValid * True iff page is valid. */ #define PageIsValid(page) PointerIsValid(page) /* * line pointer(s) do not count as part of header */ #define SizeOfPageHeaderData (offsetof(PageHeaderData, pd_linp)) /* * PageIsEmpty * returns true iff no itemid has been allocated on the page */ #define PageIsEmpty(page) \ (((PageHeader) (page))->pd_lower <= SizeOfPageHeaderData) /* * PageIsNew * returns true iff page has not been initialized (by PageInit) */ #define PageIsNew(page) (((PageHeader) (page))->pd_upper == 0) /* * PageGetItemId * Returns an item identifier of a page. */ #define PageGetItemId(page, offsetNumber) \ ((ItemId) (&((PageHeader) (page))->pd_linp[(offsetNumber) - 1])) /* * PageGetContents * To be used in case the page does not contain item pointers. * * Note: prior to 8.3 this was not guaranteed to yield a MAXALIGN'd result. * Now it is. Beware of old code that might think the offset to the contents * is just SizeOfPageHeaderData rather than MAXALIGN(SizeOfPageHeaderData). */ #define PageGetContents(page) \ ((char *) (page) + MAXALIGN(SizeOfPageHeaderData)) /* ---------------- * macros to access page size info * ---------------- */ /* * PageSizeIsValid * True iff the page size is valid. */ #define PageSizeIsValid(pageSize) ((pageSize) == BLCKSZ) /* * PageGetPageSize * Returns the page size of a page. * * this can only be called on a formatted page (unlike * BufferGetPageSize, which can be called on an unformatted page). * however, it can be called on a page that is not stored in a buffer. */ #define PageGetPageSize(page) \ ((Size) (((PageHeader) (page))->pd_pagesize_version & (uint16) 0xFF00)) /* * PageGetPageLayoutVersion * Returns the page layout version of a page. */ #define PageGetPageLayoutVersion(page) \ (((PageHeader) (page))->pd_pagesize_version & 0x00FF) /* * PageSetPageSizeAndVersion * Sets the page size and page layout version number of a page. * * We could support setting these two values separately, but there's * no real need for it at the moment. */ #define PageSetPageSizeAndVersion(page, size, version) \ ( \ AssertMacro(((size) & 0xFF00) == (size)), \ AssertMacro(((version) & 0x00FF) == (version)), \ ((PageHeader) (page))->pd_pagesize_version = (size) | (version) \ ) /* ---------------- * page special data macros * ---------------- */ /* * PageGetSpecialSize * Returns size of special space on a page. */ #define PageGetSpecialSize(page) \ ((uint16) (PageGetPageSize(page) - ((PageHeader)(page))->pd_special)) /* * PageGetSpecialPointer * Returns pointer to special space on a page. */ #define PageGetSpecialPointer(page) \ ( \ AssertMacro(PageIsValid(page)), \ (char *) ((char *) (page) + ((PageHeader) (page))->pd_special) \ ) /* * PageGetItem * Retrieves an item on the given page. * * Note: * This does not change the status of any of the resources passed. * The semantics may change in the future. */ #define PageGetItem(page, itemId) \ ( \ AssertMacro(PageIsValid(page)), \ AssertMacro(ItemIdHasStorage(itemId)), \ (Item)(((char *)(page)) + ItemIdGetOffset(itemId)) \ ) /* * PageGetMaxOffsetNumber * Returns the maximum offset number used by the given page. * Since offset numbers are 1-based, this is also the number * of items on the page. * * NOTE: if the page is not initialized (pd_lower == 0), we must * return zero to ensure sane behavior. Accept double evaluation * of the argument so that we can ensure this. */ #define PageGetMaxOffsetNumber(page) \ (((PageHeader) (page))->pd_lower <= SizeOfPageHeaderData ? 0 : \ ((((PageHeader) (page))->pd_lower - SizeOfPageHeaderData) \ / sizeof(ItemIdData))) /* * Additional macros for access to page headers */ #define PageGetLSN(page) \ (((PageHeader) (page))->pd_lsn) #define PageSetLSN(page, lsn) \ (((PageHeader) (page))->pd_lsn = (lsn)) /* NOTE: only the 16 least significant bits are stored */ #define PageGetTLI(page) \ (((PageHeader) (page))->pd_tli) #define PageSetTLI(page, tli) \ (((PageHeader) (page))->pd_tli = (uint16) (tli)) #define PageHasFreeLinePointers(page) \ (((PageHeader) (page))->pd_flags & PD_HAS_FREE_LINES) #define PageSetHasFreeLinePointers(page) \ (((PageHeader) (page))->pd_flags |= PD_HAS_FREE_LINES) #define PageClearHasFreeLinePointers(page) \ (((PageHeader) (page))->pd_flags &= ~PD_HAS_FREE_LINES) #define PageIsFull(page) \ (((PageHeader) (page))->pd_flags & PD_PAGE_FULL) #define PageSetFull(page) \ (((PageHeader) (page))->pd_flags |= PD_PAGE_FULL) #define PageClearFull(page) \ (((PageHeader) (page))->pd_flags &= ~PD_PAGE_FULL) #define PageIsAllVisible(page) \ (((PageHeader) (page))->pd_flags & PD_ALL_VISIBLE) #define PageSetAllVisible(page) \ (((PageHeader) (page))->pd_flags |= PD_ALL_VISIBLE) #define PageClearAllVisible(page) \ (((PageHeader) (page))->pd_flags &= ~PD_ALL_VISIBLE) #define PageIsPrunable(page, oldestxmin) \ ( \ AssertMacro(TransactionIdIsNormal(oldestxmin)), \ TransactionIdIsValid(((PageHeader) (page))->pd_prune_xid) && \ TransactionIdPrecedes(((PageHeader) (page))->pd_prune_xid, oldestxmin) \ ) #define PageSetPrunable(page, xid) \ do { \ Assert(TransactionIdIsNormal(xid)); \ if (!TransactionIdIsValid(((PageHeader) (page))->pd_prune_xid) || \ TransactionIdPrecedes(xid, ((PageHeader) (page))->pd_prune_xid)) \ ((PageHeader) (page))->pd_prune_xid = (xid); \ } while (0) #define PageClearPrunable(page) \ (((PageHeader) (page))->pd_prune_xid = InvalidTransactionId) /* ---------------------------------------------------------------- * extern declarations * ---------------------------------------------------------------- */ extern void PageInit(Page page, Size pageSize, Size specialSize); extern bool PageHeaderIsValid(PageHeader page); extern OffsetNumber PageAddItem(Page page, Item item, Size size, OffsetNumber offsetNumber, bool overwrite, bool is_heap); extern Page PageGetTempPage(Page page); extern Page PageGetTempPageCopy(Page page); extern Page PageGetTempPageCopySpecial(Page page); extern void PageRestoreTempPage(Page tempPage, Page oldPage); extern void PageRepairFragmentation(Page page); extern Size PageGetFreeSpace(Page page); extern Size PageGetExactFreeSpace(Page page); extern Size PageGetHeapFreeSpace(Page page); extern void PageIndexTupleDelete(Page page, OffsetNumber offset); extern void PageIndexMultiDelete(Page page, OffsetNumber *itemnos, int nitems); #endif /* BUFPAGE_H */ PKBiZԺ server/storage/large_object.hnu[/*------------------------------------------------------------------------- * * large_object.h * Declarations for PostgreSQL large objects. POSTGRES 4.2 supported * zillions of large objects (internal, external, jaquith, inversion). * Now we only support inversion. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/large_object.h * *------------------------------------------------------------------------- */ #ifndef LARGE_OBJECT_H #define LARGE_OBJECT_H #include "utils/snapshot.h" /*---------- * Data about a currently-open large object. * * id is the logical OID of the large object * snapshot is the snapshot to use for read/write operations * subid is the subtransaction that opened the desc (or currently owns it) * offset is the current seek offset within the LO * flags contains some flag bits * * NOTE: before 7.1, we also had to store references to the separate table * and index of a specific large object. Now they all live in pg_largeobject * and are accessed via a common relation descriptor. *---------- */ typedef struct LargeObjectDesc { Oid id; /* LO's identifier */ Snapshot snapshot; /* snapshot to use */ SubTransactionId subid; /* owning subtransaction ID */ uint32 offset; /* current seek pointer */ int flags; /* locking info, etc */ /* flag bits: */ #define IFS_RDLOCK (1 << 0) #define IFS_WRLOCK (1 << 1) } LargeObjectDesc; /* * Each "page" (tuple) of a large object can hold this much data * * We could set this as high as BLCKSZ less some overhead, but it seems * better to make it a smaller value, so that not as much space is used * up when a page-tuple is updated. Note that the value is deliberately * chosen large enough to trigger the tuple toaster, so that we will * attempt to compress page tuples in-line. (But they won't be moved off * unless the user creates a toast-table for pg_largeobject...) * * Also, it seems to be a smart move to make the page size be a power of 2, * since clients will often be written to send data in power-of-2 blocks. * This avoids unnecessary tuple updates caused by partial-page writes. */ #define LOBLKSIZE (BLCKSZ / 4) /* * Function definitions... */ /* inversion stuff in inv_api.c */ extern void close_lo_relation(bool isCommit); extern Oid inv_create(Oid lobjId); extern LargeObjectDesc *inv_open(Oid lobjId, int flags, MemoryContext mcxt); extern void inv_close(LargeObjectDesc *obj_desc); extern int inv_drop(Oid lobjId); extern int inv_seek(LargeObjectDesc *obj_desc, int offset, int whence); extern int inv_tell(LargeObjectDesc *obj_desc); extern int inv_read(LargeObjectDesc *obj_desc, char *buf, int nbytes); extern int inv_write(LargeObjectDesc *obj_desc, const char *buf, int nbytes); extern void inv_truncate(LargeObjectDesc *obj_desc, int len); #endif /* LARGE_OBJECT_H */ PKBiZppserver/storage/s_lock.hnu[/*------------------------------------------------------------------------- * * s_lock.h * Hardware-dependent implementation of spinlocks. * * NOTE: none of the macros in this file are intended to be called directly. * Call them through the hardware-independent macros in spin.h. * * The following hardware-dependent macros must be provided for each * supported platform: * * void S_INIT_LOCK(slock_t *lock) * Initialize a spinlock (to the unlocked state). * * void S_LOCK(slock_t *lock) * Acquire a spinlock, waiting if necessary. * Time out and abort() if unable to acquire the lock in a * "reasonable" amount of time --- typically ~ 1 minute. * * void S_UNLOCK(slock_t *lock) * Unlock a previously acquired lock. * * bool S_LOCK_FREE(slock_t *lock) * Tests if the lock is free. Returns TRUE if free, FALSE if locked. * This does *not* change the state of the lock. * * void SPIN_DELAY(void) * Delay operation to occur inside spinlock wait loop. * * Note to implementors: there are default implementations for all these * macros at the bottom of the file. Check if your platform can use * these or needs to override them. * * Usually, S_LOCK() is implemented in terms of even lower-level macros * TAS() and TAS_SPIN(): * * int TAS(slock_t *lock) * Atomic test-and-set instruction. Attempt to acquire the lock, * but do *not* wait. Returns 0 if successful, nonzero if unable * to acquire the lock. * * int TAS_SPIN(slock_t *lock) * Like TAS(), but this version is used when waiting for a lock * previously found to be contended. By default, this is the * same as TAS(), but on some architectures it's better to poll a * contended lock using an unlocked instruction and retry the * atomic test-and-set only when it appears free. * * TAS() and TAS_SPIN() are NOT part of the API, and should never be called * directly. * * CAUTION: on some platforms TAS() and/or TAS_SPIN() may sometimes report * failure to acquire a lock even when the lock is not locked. For example, * on Alpha TAS() will "fail" if interrupted. Therefore a retry loop must * always be used, even if you are certain the lock is free. * * Another caution for users of these macros is that it is the caller's * responsibility to ensure that the compiler doesn't re-order accesses * to shared memory to precede the actual lock acquisition, or follow the * lock release. Typically we handle this by using volatile-qualified * pointers to refer to both the spinlock itself and the shared data * structure being accessed within the spinlocked critical section. * That fixes it because compilers are not allowed to re-order accesses * to volatile objects relative to other such accesses. * * On platforms with weak memory ordering, the TAS(), TAS_SPIN(), and * S_UNLOCK() macros must further include hardware-level memory fence * instructions to prevent similar re-ordering at the hardware level. * TAS() and TAS_SPIN() must guarantee that loads and stores issued after * the macro are not executed until the lock has been obtained. Conversely, * S_UNLOCK() must guarantee that loads and stores issued before the macro * have been executed before the lock is released. * * On most supported platforms, TAS() uses a tas() function written * in assembly language to execute a hardware atomic-test-and-set * instruction. Equivalent OS-supplied mutex routines could be used too. * * If no system-specific TAS() is available (ie, HAVE_SPINLOCKS is not * defined), then we fall back on an emulation that uses SysV semaphores * (see spin.c). This emulation will be MUCH MUCH slower than a proper TAS() * implementation, because of the cost of a kernel call per lock or unlock. * An old report is that Postgres spends around 40% of its time in semop(2) * when using the SysV semaphore code. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/s_lock.h * *------------------------------------------------------------------------- */ #ifndef S_LOCK_H #define S_LOCK_H #ifdef HAVE_SPINLOCKS /* skip spinlocks if requested */ #if defined(__GNUC__) || defined(__INTEL_COMPILER) /************************************************************************* * All the gcc inlines * Gcc consistently defines the CPU as __cpu__. * Other compilers use __cpu or __cpu__ so we test for both in those cases. */ /*---------- * Standard gcc asm format (assuming "volatile slock_t *lock"): __asm__ __volatile__( " instruction \n" " instruction \n" " instruction \n" : "=r"(_res), "+m"(*lock) // return register, in/out lock value : "r"(lock) // lock pointer, in input register : "memory", "cc"); // show clobbered registers here * The output-operands list (after first colon) should always include * "+m"(*lock), whether or not the asm code actually refers to this * operand directly. This ensures that gcc believes the value in the * lock variable is used and set by the asm code. Also, the clobbers * list (after third colon) should always include "memory"; this prevents * gcc from thinking it can cache the values of shared-memory fields * across the asm code. Add "cc" if your asm code changes the condition * code register, and also list any temp registers the code uses. *---------- */ #ifdef __i386__ /* 32-bit i386 */ #define HAS_TEST_AND_SET typedef unsigned char slock_t; #define TAS(lock) tas(lock) static __inline__ int tas(volatile slock_t *lock) { register slock_t _res = 1; /* * Use a non-locking test before asserting the bus lock. Note that the * extra test appears to be a small loss on some x86 platforms and a small * win on others; it's by no means clear that we should keep it. */ __asm__ __volatile__( " cmpb $0,%1 \n" " jne 1f \n" " lock \n" " xchgb %0,%1 \n" "1: \n" : "+q"(_res), "+m"(*lock) : : "memory", "cc"); return (int) _res; } #define SPIN_DELAY() spin_delay() static __inline__ void spin_delay(void) { /* * This sequence is equivalent to the PAUSE instruction ("rep" is * ignored by old IA32 processors if the following instruction is * not a string operation); the IA-32 Architecture Software * Developer's Manual, Vol. 3, Section 7.7.2 describes why using * PAUSE in the inner loop of a spin lock is necessary for good * performance: * * The PAUSE instruction improves the performance of IA-32 * processors supporting Hyper-Threading Technology when * executing spin-wait loops and other routines where one * thread is accessing a shared lock or semaphore in a tight * polling loop. When executing a spin-wait loop, the * processor can suffer a severe performance penalty when * exiting the loop because it detects a possible memory order * violation and flushes the core processor's pipeline. The * PAUSE instruction provides a hint to the processor that the * code sequence is a spin-wait loop. The processor uses this * hint to avoid the memory order violation and prevent the * pipeline flush. In addition, the PAUSE instruction * de-pipelines the spin-wait loop to prevent it from * consuming execution resources excessively. */ __asm__ __volatile__( " rep; nop \n"); } #endif /* __i386__ */ #ifdef __x86_64__ /* AMD Opteron, Intel EM64T */ #define HAS_TEST_AND_SET typedef unsigned char slock_t; #define TAS(lock) tas(lock) static __inline__ int tas(volatile slock_t *lock) { register slock_t _res = 1; /* * On Opteron, using a non-locking test before the locking instruction * is a huge loss. On EM64T, it appears to be a wash or small loss, * so we needn't bother to try to distinguish the sub-architectures. */ __asm__ __volatile__( " lock \n" " xchgb %0,%1 \n" : "+q"(_res), "+m"(*lock) : : "memory", "cc"); return (int) _res; } #define SPIN_DELAY() spin_delay() static __inline__ void spin_delay(void) { /* * Adding a PAUSE in the spin delay loop is demonstrably a no-op on * Opteron, but it may be of some use on EM64T, so we keep it. */ __asm__ __volatile__( " rep; nop \n"); } #endif /* __x86_64__ */ #if defined(__ia64__) || defined(__ia64) /* * Intel Itanium, gcc or Intel's compiler. * * Itanium has weak memory ordering, but we rely on the compiler to enforce * strict ordering of accesses to volatile data. In particular, while the * xchg instruction implicitly acts as a memory barrier with 'acquire' * semantics, we do not have an explicit memory fence instruction in the * S_UNLOCK macro. We use a regular assignment to clear the spinlock, and * trust that the compiler marks the generated store instruction with the * ".rel" opcode. * * Testing shows that assumption to hold on gcc, although I could not find * any explicit statement on that in the gcc manual. In Intel's compiler, * the -m[no-]serialize-volatile option controls that, and testing shows that * it is enabled by default. */ #define HAS_TEST_AND_SET typedef unsigned int slock_t; #define TAS(lock) tas(lock) /* On IA64, it's a win to use a non-locking test before the xchg proper */ #define TAS_SPIN(lock) (*(lock) ? 1 : TAS(lock)) #ifndef __INTEL_COMPILER static __inline__ int tas(volatile slock_t *lock) { long int ret; __asm__ __volatile__( " xchg4 %0=%1,%2 \n" : "=r"(ret), "+m"(*lock) : "r"(1) : "memory"); return (int) ret; } #else /* __INTEL_COMPILER */ static __inline__ int tas(volatile slock_t *lock) { int ret; ret = _InterlockedExchange(lock,1); /* this is a xchg asm macro */ return ret; } #endif /* __INTEL_COMPILER */ #endif /* __ia64__ || __ia64 */ /* * On ARM, we use __sync_lock_test_and_set(int *, int) if available, and if * not fall back on the SWPB instruction. SWPB does not work on ARMv6 or * later, so the compiler builtin is preferred if available. Note also that * the int-width variant of the builtin works on more chips than other widths. */ #if defined(__arm__) || defined(__arm) #define HAS_TEST_AND_SET #define TAS(lock) tas(lock) #ifdef HAVE_GCC_INT_ATOMICS typedef int slock_t; static __inline__ int tas(volatile slock_t *lock) { return __sync_lock_test_and_set(lock, 1); } #define S_UNLOCK(lock) __sync_lock_release(lock) #else /* !HAVE_GCC_INT_ATOMICS */ typedef unsigned char slock_t; static __inline__ int tas(volatile slock_t *lock) { register slock_t _res = 1; __asm__ __volatile__( " swpb %0, %0, [%2] \n" : "+r"(_res), "+m"(*lock) : "r"(lock) : "memory"); return (int) _res; } #endif /* HAVE_GCC_INT_ATOMICS */ #endif /* __arm__ */ /* * On ARM64, we use __sync_lock_test_and_set(int *, int) if available. */ #if defined(__aarch64__) || defined(__aarch64) #ifdef HAVE_GCC_INT_ATOMICS #define HAS_TEST_AND_SET #define TAS(lock) tas(lock) typedef int slock_t; static __inline__ int tas(volatile slock_t *lock) { return __sync_lock_test_and_set(lock, 1); } #define S_UNLOCK(lock) __sync_lock_release(lock) #endif /* HAVE_GCC_INT_ATOMICS */ #endif /* __aarch64__ */ /* S/390 and S/390x Linux (32- and 64-bit zSeries) */ #if defined(__s390__) || defined(__s390x__) #define HAS_TEST_AND_SET typedef unsigned int slock_t; #define TAS(lock) tas(lock) static __inline__ int tas(volatile slock_t *lock) { int _res = 0; __asm__ __volatile__( " cs %0,%3,0(%2) \n" : "+d"(_res), "+m"(*lock) : "a"(lock), "d"(1) : "memory", "cc"); return _res; } #endif /* __s390__ || __s390x__ */ #if defined(__sparc__) /* Sparc */ /* * Solaris has always run sparc processors in TSO (total store) mode, but * linux didn't use to and the *BSDs still don't. So, be careful about * acquire/release semantics. The CPU will treat superflous membars as NOPs, * so it's just code space. */ #define HAS_TEST_AND_SET typedef unsigned char slock_t; #define TAS(lock) tas(lock) static __inline__ int tas(volatile slock_t *lock) { register slock_t _res; /* * See comment in /pg/backend/port/tas/solaris_sparc.s for why this * uses "ldstub", and that file uses "cas". gcc currently generates * sparcv7-targeted binaries, so "cas" use isn't possible. */ __asm__ __volatile__( " ldstub [%2], %0 \n" : "=r"(_res), "+m"(*lock) : "r"(lock) : "memory"); #if defined(__sparcv7) || defined(__sparc_v7__) /* * No stbar or membar available, luckily no actually produced hardware * requires a barrier. */ #elif defined(__sparcv8) || defined(__sparc_v8__) /* stbar is available (and required for both PSO, RMO), membar isn't */ __asm__ __volatile__ ("stbar \n":::"memory"); #else /* * #LoadStore (RMO) | #LoadLoad (RMO) together are the appropriate acquire * barrier for sparcv8+ upwards. */ __asm__ __volatile__ ("membar #LoadStore | #LoadLoad \n":::"memory"); #endif return (int) _res; } #if defined(__sparcv7) || defined(__sparc_v7__) /* * No stbar or membar available, luckily no actually produced hardware * requires a barrier. */ #define S_UNLOCK(lock) (*((volatile slock_t *) (lock)) = 0) #elif defined(__sparcv8) || defined(__sparc_v8__) /* stbar is available (and required for both PSO, RMO), membar isn't */ #define S_UNLOCK(lock) \ do \ { \ __asm__ __volatile__ ("stbar \n":::"memory"); \ *((volatile slock_t *) (lock)) = 0; \ } while (0) #else /* * #LoadStore (RMO) | #StoreStore (RMO, PSO) together are the appropriate * release barrier for sparcv8+ upwards. */ #define S_UNLOCK(lock) \ do \ { \ __asm__ __volatile__ ("membar #LoadStore | #StoreStore \n":::"memory"); \ *((volatile slock_t *) (lock)) = 0; \ } while (0) #endif #endif /* __sparc__ */ /* PowerPC */ #if defined(__ppc__) || defined(__powerpc__) || defined(__ppc64__) || defined(__powerpc64__) #define HAS_TEST_AND_SET typedef unsigned int slock_t; #define TAS(lock) tas(lock) /* On PPC, it's a win to use a non-locking test before the lwarx */ #define TAS_SPIN(lock) (*(lock) ? 1 : TAS(lock)) /* * NOTE: per the Enhanced PowerPC Architecture manual, v1.0 dated 7-May-2002, * an isync is a sufficient synchronization barrier after a lwarx/stwcx loop. * On newer machines, we can use lwsync instead for better performance. * * Ordinarily, we'd code the branches here using GNU-style local symbols, that * is "1f" referencing "1:" and so on. But some people run gcc on AIX with * IBM's assembler as backend, and IBM's assembler doesn't do local symbols. * So hand-code the branch offsets; fortunately, all PPC instructions are * exactly 4 bytes each, so it's not too hard to count. */ static __inline__ int tas(volatile slock_t *lock) { slock_t _t; int _res; __asm__ __volatile__( #ifdef USE_PPC_LWARX_MUTEX_HINT " lwarx %0,0,%3,1 \n" #else " lwarx %0,0,%3 \n" #endif " cmpwi %0,0 \n" " bne $+16 \n" /* branch to li %1,1 */ " addi %0,%0,1 \n" " stwcx. %0,0,%3 \n" " beq $+12 \n" /* branch to lwsync/isync */ " li %1,1 \n" " b $+12 \n" /* branch to end of asm sequence */ #ifdef USE_PPC_LWSYNC " lwsync \n" #else " isync \n" #endif " li %1,0 \n" : "=&r"(_t), "=r"(_res), "+m"(*lock) : "r"(lock) : "memory", "cc"); return _res; } /* * PowerPC S_UNLOCK is almost standard but requires a "sync" instruction. * On newer machines, we can use lwsync instead for better performance. */ #ifdef USE_PPC_LWSYNC #define S_UNLOCK(lock) \ do \ { \ __asm__ __volatile__ (" lwsync \n"); \ *((volatile slock_t *) (lock)) = 0; \ } while (0) #else #define S_UNLOCK(lock) \ do \ { \ __asm__ __volatile__ (" sync \n"); \ *((volatile slock_t *) (lock)) = 0; \ } while (0) #endif /* USE_PPC_LWSYNC */ #endif /* powerpc */ /* Linux Motorola 68k */ #if (defined(__mc68000__) || defined(__m68k__)) && defined(__linux__) #define HAS_TEST_AND_SET typedef unsigned char slock_t; #define TAS(lock) tas(lock) static __inline__ int tas(volatile slock_t *lock) { register int rv; __asm__ __volatile__( " clrl %0 \n" " tas %1 \n" " sne %0 \n" : "=d"(rv), "+m"(*lock) : : "memory", "cc"); return rv; } #endif /* (__mc68000__ || __m68k__) && __linux__ */ /* * VAXen -- even multiprocessor ones * (thanks to Tom Ivar Helbekkmo) */ #if defined(__vax__) #define HAS_TEST_AND_SET typedef unsigned char slock_t; #define TAS(lock) tas(lock) static __inline__ int tas(volatile slock_t *lock) { register int _res; __asm__ __volatile__( " movl $1, %0 \n" " bbssi $0, (%2), 1f \n" " clrl %0 \n" "1: \n" : "=&r"(_res), "+m"(*lock) : "r"(lock) : "memory"); return _res; } #endif /* __vax__ */ #if defined(__ns32k__) /* National Semiconductor 32K */ #define HAS_TEST_AND_SET typedef unsigned char slock_t; #define TAS(lock) tas(lock) static __inline__ int tas(volatile slock_t *lock) { register int _res; __asm__ __volatile__( " sbitb 0, %1 \n" " sfsd %0 \n" : "=r"(_res), "+m"(*lock) : : "memory"); return _res; } #endif /* __ns32k__ */ #if defined(__alpha) || defined(__alpha__) /* Alpha */ /* * Correct multi-processor locking methods are explained in section 5.5.3 * of the Alpha AXP Architecture Handbook, which at this writing can be * found at ftp://ftp.netbsd.org/pub/NetBSD/misc/dec-docs/index.html. * For gcc we implement the handbook's code directly with inline assembler. */ #define HAS_TEST_AND_SET typedef unsigned long slock_t; #define TAS(lock) tas(lock) static __inline__ int tas(volatile slock_t *lock) { register slock_t _res; __asm__ __volatile__( " ldq $0, %1 \n" " bne $0, 2f \n" " ldq_l %0, %1 \n" " bne %0, 2f \n" " mov 1, $0 \n" " stq_c $0, %1 \n" " beq $0, 2f \n" " mb \n" " br 3f \n" "2: mov 1, %0 \n" "3: \n" : "=&r"(_res), "+m"(*lock) : : "memory", "0"); return (int) _res; } #define S_UNLOCK(lock) \ do \ {\ __asm__ __volatile__ (" mb \n"); \ *((volatile slock_t *) (lock)) = 0; \ } while (0) #endif /* __alpha || __alpha__ */ #if defined(__mips__) && !defined(__sgi) /* non-SGI MIPS */ /* Note: on SGI we use the OS' mutex ABI, see below */ /* Note: R10000 processors require a separate SYNC */ #define HAS_TEST_AND_SET typedef unsigned int slock_t; #define TAS(lock) tas(lock) static __inline__ int tas(volatile slock_t *lock) { register volatile slock_t *_l = lock; register int _res; register int _tmp; __asm__ __volatile__( " .set push \n" " .set mips2 \n" " .set noreorder \n" " .set nomacro \n" " ll %0, %2 \n" " or %1, %0, 1 \n" " sc %1, %2 \n" " xori %1, 1 \n" " or %0, %0, %1 \n" " sync \n" " .set pop " : "=&r" (_res), "=&r" (_tmp), "+R" (*_l) : : "memory"); return _res; } /* MIPS S_UNLOCK is almost standard but requires a "sync" instruction */ #define S_UNLOCK(lock) \ do \ { \ __asm__ __volatile__( \ " .set push \n" \ " .set mips2 \n" \ " .set noreorder \n" \ " .set nomacro \n" \ " sync \n" \ " .set pop "); \ *((volatile slock_t *) (lock)) = 0; \ } while (0) #endif /* __mips__ && !__sgi */ #if defined(__m32r__) && defined(HAVE_SYS_TAS_H) /* Renesas' M32R */ #define HAS_TEST_AND_SET #include typedef int slock_t; #define TAS(lock) tas(lock) #endif /* __m32r__ */ #if defined(__sh__) /* Renesas' SuperH */ #define HAS_TEST_AND_SET typedef unsigned char slock_t; #define TAS(lock) tas(lock) static __inline__ int tas(volatile slock_t *lock) { register int _res; /* * This asm is coded as if %0 could be any register, but actually SuperH * restricts the target of xor-immediate to be R0. That's handled by * the "z" constraint on _res. */ __asm__ __volatile__( " tas.b @%2 \n" " movt %0 \n" " xor #1,%0 \n" : "=z"(_res), "+m"(*lock) : "r"(lock) : "memory", "t"); return _res; } #endif /* __sh__ */ /* These live in s_lock.c, but only for gcc */ #if defined(__m68k__) && !defined(__linux__) /* non-Linux Motorola 68k */ #define HAS_TEST_AND_SET typedef unsigned char slock_t; #endif #endif /* defined(__GNUC__) || defined(__INTEL_COMPILER) */ /* * --------------------------------------------------------------------- * Platforms that use non-gcc inline assembly: * --------------------------------------------------------------------- */ #if !defined(HAS_TEST_AND_SET) /* We didn't trigger above, let's try here */ #if defined(USE_UNIVEL_CC) /* Unixware compiler */ #define HAS_TEST_AND_SET typedef unsigned char slock_t; #define TAS(lock) tas(lock) asm int tas(volatile slock_t *s_lock) { /* UNIVEL wants %mem in column 1, so we don't pg_indent this file */ %mem s_lock pushl %ebx movl s_lock, %ebx movl $255, %eax lock xchgb %al, (%ebx) popl %ebx } #endif /* defined(USE_UNIVEL_CC) */ #if defined(__alpha) || defined(__alpha__) /* Tru64 Unix Alpha compiler */ /* * The Tru64 compiler doesn't support gcc-style inline asm, but it does * have some builtin functions that accomplish much the same results. * For simplicity, slock_t is defined as long (ie, quadword) on Alpha * regardless of the compiler in use. LOCK_LONG and UNLOCK_LONG only * operate on an int (ie, longword), but that's OK as long as we define * S_INIT_LOCK to zero out the whole quadword. */ #define HAS_TEST_AND_SET typedef unsigned long slock_t; #include #define S_INIT_LOCK(lock) (*(lock) = 0) #define TAS(lock) (__LOCK_LONG_RETRY((lock), 1) == 0) #define S_UNLOCK(lock) __UNLOCK_LONG(lock) #endif /* __alpha || __alpha__ */ #if defined(__hppa) || defined(__hppa__) /* HP PA-RISC, GCC and HP compilers */ /* * HP's PA-RISC * * See src/backend/port/hpux/tas.c.template for details about LDCWX. Because * LDCWX requires a 16-byte-aligned address, we declare slock_t as a 16-byte * struct. The active word in the struct is whichever has the aligned address; * the other three words just sit at -1. * * When using gcc, we can inline the required assembly code. */ #define HAS_TEST_AND_SET typedef struct { int sema[4]; } slock_t; #define TAS_ACTIVE_WORD(lock) ((volatile int *) (((uintptr_t) (lock) + 15) & ~15)) #if defined(__GNUC__) static __inline__ int tas(volatile slock_t *lock) { volatile int *lockword = TAS_ACTIVE_WORD(lock); register int lockval; __asm__ __volatile__( " ldcwx 0(0,%2),%0 \n" : "=r"(lockval), "+m"(*lockword) : "r"(lockword) : "memory"); return (lockval == 0); } #endif /* __GNUC__ */ #define S_UNLOCK(lock) (*TAS_ACTIVE_WORD(lock) = -1) #define S_INIT_LOCK(lock) \ do { \ volatile slock_t *lock_ = (lock); \ lock_->sema[0] = -1; \ lock_->sema[1] = -1; \ lock_->sema[2] = -1; \ lock_->sema[3] = -1; \ } while (0) #define S_LOCK_FREE(lock) (*TAS_ACTIVE_WORD(lock) != 0) #endif /* __hppa || __hppa__ */ #if defined(__hpux) && defined(__ia64) && !defined(__GNUC__) /* * HP-UX on Itanium, non-gcc compiler * * We assume that the compiler enforces strict ordering of loads/stores on * volatile data (see comments on the gcc-version earlier in this file). * Note that this assumption does *not* hold if you use the * +Ovolatile=__unordered option on the HP-UX compiler, so don't do that. * * See also Implementing Spinlocks on the Intel Itanium Architecture and * PA-RISC, by Tor Ekqvist and David Graves, for more information. As of * this writing, version 1.0 of the manual is available at: * http://h21007.www2.hp.com/portal/download/files/unprot/itanium/spinlocks.pdf */ #define HAS_TEST_AND_SET typedef unsigned int slock_t; #include #define TAS(lock) _Asm_xchg(_SZ_W, lock, 1, _LDHINT_NONE) /* On IA64, it's a win to use a non-locking test before the xchg proper */ #define TAS_SPIN(lock) (*(lock) ? 1 : TAS(lock)) #endif /* HPUX on IA64, non gcc */ #if defined(__sgi) /* SGI compiler */ /* * SGI IRIX 5 * slock_t is defined as a unsigned long. We use the standard SGI * mutex API. * * The following comment is left for historical reasons, but is probably * not a good idea since the mutex ABI is supported. * * This stuff may be supplemented in the future with Masato Kataoka's MIPS-II * assembly from his NECEWS SVR4 port, but we probably ought to retain this * for the R3000 chips out there. */ #define HAS_TEST_AND_SET typedef unsigned long slock_t; #include "mutex.h" #define TAS(lock) (test_and_set(lock,1)) #define S_UNLOCK(lock) (test_then_and(lock,0)) #define S_INIT_LOCK(lock) (test_then_and(lock,0)) #define S_LOCK_FREE(lock) (test_then_add(lock,0) == 0) #endif /* __sgi */ #if defined(sinix) /* Sinix */ /* * SINIX / Reliant UNIX * slock_t is defined as a struct abilock_t, which has a single unsigned long * member. (Basically same as SGI) */ #define HAS_TEST_AND_SET #include "abi_mutex.h" typedef abilock_t slock_t; #define TAS(lock) (!acquire_lock(lock)) #define S_UNLOCK(lock) release_lock(lock) #define S_INIT_LOCK(lock) init_lock(lock) #define S_LOCK_FREE(lock) (stat_lock(lock) == UNLOCKED) #endif /* sinix */ #if defined(_AIX) /* AIX */ /* * AIX (POWER) */ #define HAS_TEST_AND_SET #include typedef int slock_t; #define TAS(lock) _check_lock((slock_t *) (lock), 0, 1) #define S_UNLOCK(lock) _clear_lock((slock_t *) (lock), 0) #endif /* _AIX */ /* These are in sunstudio_(sparc|x86).s */ #if defined(sun3) /* Sun3 */ #define HAS_TEST_AND_SET typedef unsigned char slock_t; #endif #if defined(__SUNPRO_C) && (defined(__i386) || defined(__x86_64__) || defined(__sparc__) || defined(__sparc)) #define HAS_TEST_AND_SET #if defined(__i386) || defined(__x86_64__) || defined(__sparcv9) || defined(__sparcv8plus) typedef unsigned int slock_t; #else typedef unsigned char slock_t; #endif extern slock_t pg_atomic_cas(volatile slock_t *lock, slock_t with, slock_t cmp); #define TAS(a) (pg_atomic_cas((a), 1, 0) != 0) #endif #ifdef WIN32_ONLY_COMPILER typedef LONG slock_t; #define HAS_TEST_AND_SET #define TAS(lock) (InterlockedCompareExchange(lock, 1, 0)) #define SPIN_DELAY() spin_delay() /* If using Visual C++ on Win64, inline assembly is unavailable. * Use a _mm_pause intrinsic instead of rep nop. */ #if defined(_WIN64) static __forceinline void spin_delay(void) { _mm_pause(); } #else static __forceinline void spin_delay(void) { /* See comment for gcc code. Same code, MASM syntax */ __asm rep nop; } #endif #endif #endif /* !defined(HAS_TEST_AND_SET) */ /* Blow up if we didn't have any way to do spinlocks */ #ifndef HAS_TEST_AND_SET #error PostgreSQL does not have native spinlock support on this platform. To continue the compilation, rerun configure using --disable-spinlocks. However, performance will be poor. Please report this to pgsql-bugs@postgresql.org. #endif #else /* !HAVE_SPINLOCKS */ /* * Fake spinlock implementation using semaphores --- slow and prone * to fall foul of kernel limits on number of semaphores, so don't use this * unless you must! The subroutines appear in spin.c. */ typedef int slock_t; extern bool s_lock_free_sema(volatile slock_t *lock); extern void s_unlock_sema(volatile slock_t *lock); extern void s_init_lock_sema(volatile slock_t *lock); extern int tas_sema(volatile slock_t *lock); #define S_LOCK_FREE(lock) s_lock_free_sema(lock) #define S_UNLOCK(lock) s_unlock_sema(lock) #define S_INIT_LOCK(lock) s_init_lock_sema(lock) #define TAS(lock) tas_sema(lock) #endif /* HAVE_SPINLOCKS */ /* * Default Definitions - override these above as needed. */ #if !defined(S_LOCK) #define S_LOCK(lock) \ do { \ if (TAS(lock)) \ s_lock((lock), __FILE__, __LINE__); \ } while (0) #endif /* S_LOCK */ #if !defined(S_LOCK_FREE) #define S_LOCK_FREE(lock) (*(lock) == 0) #endif /* S_LOCK_FREE */ #if !defined(S_UNLOCK) #define S_UNLOCK(lock) (*((volatile slock_t *) (lock)) = 0) #endif /* S_UNLOCK */ #if !defined(S_INIT_LOCK) #define S_INIT_LOCK(lock) S_UNLOCK(lock) #endif /* S_INIT_LOCK */ #if !defined(SPIN_DELAY) #define SPIN_DELAY() ((void) 0) #endif /* SPIN_DELAY */ #if !defined(TAS) extern int tas(volatile slock_t *lock); /* in port/.../tas.s, or * s_lock.c */ #define TAS(lock) tas(lock) #endif /* TAS */ #if !defined(TAS_SPIN) #define TAS_SPIN(lock) TAS(lock) #endif /* TAS_SPIN */ /* * Platform-independent out-of-line support routines */ extern void s_lock(volatile slock_t *lock, const char *file, int line); /* Support for dynamic adjustment of spins_per_delay */ #define DEFAULT_SPINS_PER_DELAY 100 extern void set_spins_per_delay(int shared_spins_per_delay); extern int update_spins_per_delay(int shared_spins_per_delay); #endif /* S_LOCK_H */ PKBiZX{server/storage/standby.hnu[/*------------------------------------------------------------------------- * * standby.h * Definitions for hot standby mode. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/standby.h * *------------------------------------------------------------------------- */ #ifndef STANDBY_H #define STANDBY_H #include "access/xlog.h" #include "storage/lock.h" #include "storage/procsignal.h" #include "storage/relfilenode.h" /* User-settable GUC parameters */ extern int vacuum_defer_cleanup_age; extern int max_standby_archive_delay; extern int max_standby_streaming_delay; extern void InitRecoveryTransactionEnvironment(void); extern void ShutdownRecoveryTransactionEnvironment(void); extern void ResolveRecoveryConflictWithSnapshot(TransactionId latestRemovedXid, RelFileNode node); extern void ResolveRecoveryConflictWithTablespace(Oid tsid); extern void ResolveRecoveryConflictWithDatabase(Oid dbid); extern void ResolveRecoveryConflictWithBufferPin(void); extern void SendRecoveryConflictWithBufferPin(ProcSignalReason reason); extern void CheckRecoveryConflictDeadlock(void); /* * Standby Rmgr (RM_STANDBY_ID) * * Standby recovery manager exists to perform actions that are required * to make hot standby work. That includes logging AccessExclusiveLocks taken * by transactions and running-xacts snapshots. */ extern void StandbyAcquireAccessExclusiveLock(TransactionId xid, Oid dbOid, Oid relOid); extern void StandbyReleaseLockTree(TransactionId xid, int nsubxids, TransactionId *subxids); extern void StandbyReleaseAllLocks(void); extern void StandbyReleaseOldLocks(int nxids, TransactionId *xids); /* * XLOG message types */ #define XLOG_STANDBY_LOCK 0x00 #define XLOG_RUNNING_XACTS 0x10 typedef struct xl_standby_locks { int nlocks; /* number of entries in locks array */ xl_standby_lock locks[1]; /* VARIABLE LENGTH ARRAY */ } xl_standby_locks; /* * When we write running xact data to WAL, we use this structure. */ typedef struct xl_running_xacts { int xcnt; /* # of xact ids in xids[] */ bool subxid_overflow; /* snapshot overflowed, subxids missing */ TransactionId nextXid; /* copy of ShmemVariableCache->nextXid */ TransactionId oldestRunningXid; /* *not* oldestXmin */ TransactionId latestCompletedXid; /* so we can set xmax */ TransactionId xids[1]; /* VARIABLE LENGTH ARRAY */ } xl_running_xacts; #define MinSizeOfXactRunningXacts offsetof(xl_running_xacts, xids) /* Recovery handlers for the Standby Rmgr (RM_STANDBY_ID) */ extern void standby_redo(XLogRecPtr lsn, XLogRecord *record); extern void standby_desc(StringInfo buf, uint8 xl_info, char *rec); /* * Declarations for GetRunningTransactionData(). Similar to Snapshots, but * not quite. This has nothing at all to do with visibility on this server, * so this is completely separate from snapmgr.c and snapmgr.h. * This data is important for creating the initial snapshot state on a * standby server. We need lots more information than a normal snapshot, * hence we use a specific data structure for our needs. This data * is written to WAL as a separate record immediately after each * checkpoint. That means that wherever we start a standby from we will * almost immediately see the data we need to begin executing queries. */ typedef struct RunningTransactionsData { int xcnt; /* # of xact ids in xids[] */ bool subxid_overflow; /* snapshot overflowed, subxids missing */ TransactionId nextXid; /* copy of ShmemVariableCache->nextXid */ TransactionId oldestRunningXid; /* *not* oldestXmin */ TransactionId latestCompletedXid; /* so we can set xmax */ TransactionId *xids; /* array of (sub)xids still running */ } RunningTransactionsData; typedef RunningTransactionsData *RunningTransactions; extern void LogAccessExclusiveLock(Oid dbOid, Oid relOid); extern void LogAccessExclusiveLockPrepare(void); extern void LogStandbySnapshot(void); #endif /* STANDBY_H */ PKBiZiserver/storage/latch.hnu[/*------------------------------------------------------------------------- * * latch.h * Routines for interprocess latches * * A latch is a boolean variable, with operations that let processes sleep * until it is set. A latch can be set from another process, or a signal * handler within the same process. * * The latch interface is a reliable replacement for the common pattern of * using pg_usleep() or select() to wait until a signal arrives, where the * signal handler sets a flag variable. Because on some platforms an * incoming signal doesn't interrupt sleep, and even on platforms where it * does there is a race condition if the signal arrives just before * entering the sleep, the common pattern must periodically wake up and * poll the flag variable. The pselect() system call was invented to solve * this problem, but it is not portable enough. Latches are designed to * overcome these limitations, allowing you to sleep without polling and * ensuring quick response to signals from other processes. * * There are two kinds of latches: local and shared. A local latch is * initialized by InitLatch, and can only be set from the same process. * A local latch can be used to wait for a signal to arrive, by calling * SetLatch in the signal handler. A shared latch resides in shared memory, * and must be initialized at postmaster startup by InitSharedLatch. Before * a shared latch can be waited on, it must be associated with a process * with OwnLatch. Only the process owning the latch can wait on it, but any * process can set it. * * There are three basic operations on a latch: * * SetLatch - Sets the latch * ResetLatch - Clears the latch, allowing it to be set again * WaitLatch - Waits for the latch to become set * * WaitLatch includes a provision for timeouts (which should be avoided * when possible, as they incur extra overhead) and a provision for * postmaster child processes to wake up immediately on postmaster death. * See unix_latch.c for detailed specifications for the exported functions. * * The correct pattern to wait for event(s) is: * * for (;;) * { * ResetLatch(); * if (work to do) * Do Stuff(); * WaitLatch(); * } * * It's important to reset the latch *before* checking if there's work to * do. Otherwise, if someone sets the latch between the check and the * ResetLatch call, you will miss it and Wait will incorrectly block. * * To wake up the waiter, you must first set a global flag or something * else that the wait loop tests in the "if (work to do)" part, and call * SetLatch *after* that. SetLatch is designed to return quickly if the * latch is already set. * * Presently, when using a shared latch for interprocess signalling, the * flag variable(s) set by senders and inspected by the wait loop must * be protected by spinlocks or LWLocks, else it is possible to miss events * on machines with weak memory ordering (such as PPC). This restriction * will be lifted in future by inserting suitable memory barriers into * SetLatch and ResetLatch. * * On some platforms, signals will not interrupt the latch wait primitive * by themselves. Therefore, it is critical that any signal handler that * is meant to terminate a WaitLatch wait calls SetLatch. * * Note that use of the process latch (PGPROC.procLatch) is generally better * than an ad-hoc shared latch for signaling auxiliary processes. This is * because generic signal handlers will call SetLatch on the process latch * only, so using any latch other than the process latch effectively precludes * use of any generic handler. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/latch.h * *------------------------------------------------------------------------- */ #ifndef LATCH_H #define LATCH_H #include /* * Latch structure should be treated as opaque and only accessed through * the public functions. It is defined here to allow embedding Latches as * part of bigger structs. */ typedef struct { sig_atomic_t is_set; bool is_shared; int owner_pid; #ifdef WIN32 HANDLE event; #endif } Latch; /* Bitmasks for events that may wake-up WaitLatch() clients */ #define WL_LATCH_SET (1 << 0) #define WL_SOCKET_READABLE (1 << 1) #define WL_SOCKET_WRITEABLE (1 << 2) #define WL_TIMEOUT (1 << 3) #define WL_POSTMASTER_DEATH (1 << 4) /* * prototypes for functions in latch.c */ extern void InitializeLatchSupport(void); extern void InitLatch(volatile Latch *latch); extern void InitSharedLatch(volatile Latch *latch); extern void OwnLatch(volatile Latch *latch); extern void DisownLatch(volatile Latch *latch); extern int WaitLatch(volatile Latch *latch, int wakeEvents, long timeout); extern int WaitLatchOrSocket(volatile Latch *latch, int wakeEvents, pgsocket sock, long timeout); extern void SetLatch(volatile Latch *latch); extern void ResetLatch(volatile Latch *latch); /* beware of memory ordering issues if you use this macro! */ #define TestLatch(latch) (((volatile Latch *) (latch))->is_set) /* * Unix implementation uses SIGUSR1 for inter-process signaling. * Win32 doesn't need this. */ #ifndef WIN32 extern void latch_sigusr1_handler(void); #else #define latch_sigusr1_handler() ((void) 0) #endif #endif /* LATCH_H */ PKBiZi:server/storage/sinval.hnu[/*------------------------------------------------------------------------- * * sinval.h * POSTGRES shared cache invalidation communication definitions. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/sinval.h * *------------------------------------------------------------------------- */ #ifndef SINVAL_H #define SINVAL_H #include "storage/relfilenode.h" /* * We support several types of shared-invalidation messages: * * invalidate a specific tuple in a specific catcache * * invalidate all catcache entries from a given system catalog * * invalidate a relcache entry for a specific logical relation * * invalidate an smgr cache entry for a specific physical relation * * invalidate the mapped-relation mapping for a given database * More types could be added if needed. The message type is identified by * the first "int8" field of the message struct. Zero or positive means a * specific-catcache inval message (and also serves as the catcache ID field). * Negative values identify the other message types, as per codes below. * * Catcache inval events are initially driven by detecting tuple inserts, * updates and deletions in system catalogs (see CacheInvalidateHeapTuple). * An update can generate two inval events, one for the old tuple and one for * the new, but this is reduced to one event if the tuple's hash key doesn't * change. Note that the inval events themselves don't actually say whether * the tuple is being inserted or deleted. Also, since we transmit only a * hash key, there is a small risk of unnecessary invalidations due to chance * matches of hash keys. * * Note that some system catalogs have multiple caches on them (with different * indexes). On detecting a tuple invalidation in such a catalog, separate * catcache inval messages must be generated for each of its caches, since * the hash keys will generally be different. * * Catcache and relcache invalidations are transactional, and so are sent * to other backends upon commit. Internally to the generating backend, * they are also processed at CommandCounterIncrement so that later commands * in the same transaction see the new state. The generating backend also * has to process them at abort, to flush out any cache state it's loaded * from no-longer-valid entries. * * smgr and relation mapping invalidations are non-transactional: they are * sent immediately when the underlying file change is made. */ typedef struct { int8 id; /* cache ID --- must be first */ Oid dbId; /* database ID, or 0 if a shared relation */ uint32 hashValue; /* hash value of key for this catcache */ } SharedInvalCatcacheMsg; #define SHAREDINVALCATALOG_ID (-1) typedef struct { int8 id; /* type field --- must be first */ Oid dbId; /* database ID, or 0 if a shared catalog */ Oid catId; /* ID of catalog whose contents are invalid */ } SharedInvalCatalogMsg; #define SHAREDINVALRELCACHE_ID (-2) typedef struct { int8 id; /* type field --- must be first */ Oid dbId; /* database ID, or 0 if a shared relation */ Oid relId; /* relation ID */ } SharedInvalRelcacheMsg; #define SHAREDINVALSMGR_ID (-3) typedef struct { /* note: field layout chosen to pack into 16 bytes */ int8 id; /* type field --- must be first */ int8 backend_hi; /* high bits of backend ID, if temprel */ uint16 backend_lo; /* low bits of backend ID, if temprel */ RelFileNode rnode; /* spcNode, dbNode, relNode */ } SharedInvalSmgrMsg; #define SHAREDINVALRELMAP_ID (-4) typedef struct { int8 id; /* type field --- must be first */ Oid dbId; /* database ID, or 0 for shared catalogs */ } SharedInvalRelmapMsg; typedef union { int8 id; /* type field --- must be first */ SharedInvalCatcacheMsg cc; SharedInvalCatalogMsg cat; SharedInvalRelcacheMsg rc; SharedInvalSmgrMsg sm; SharedInvalRelmapMsg rm; } SharedInvalidationMessage; /* Counter of messages processed; don't worry about overflow. */ extern uint64 SharedInvalidMessageCounter; extern void SendSharedInvalidMessages(const SharedInvalidationMessage *msgs, int n); extern void ReceiveSharedInvalidMessages( void (*invalFunction) (SharedInvalidationMessage *msg), void (*resetFunction) (void)); /* signal handler for catchup events (PROCSIG_CATCHUP_INTERRUPT) */ extern void HandleCatchupInterrupt(void); /* * enable/disable processing of catchup events directly from signal handler. * The enable routine first performs processing of any catchup events that * have occurred since the last disable. */ extern void EnableCatchupInterrupt(void); extern bool DisableCatchupInterrupt(void); extern int xactGetCommittedInvalidationMessages(SharedInvalidationMessage **msgs, bool *RelcacheInitFileInval); extern void ProcessCommittedInvalidationMessages(SharedInvalidationMessage *msgs, int nmsgs, bool RelcacheInitFileInval, Oid dbid, Oid tsid); #endif /* SINVAL_H */ PKBiZYserver/storage/itemptr.hnu[/*------------------------------------------------------------------------- * * itemptr.h * POSTGRES disk item pointer definitions. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/itemptr.h * *------------------------------------------------------------------------- */ #ifndef ITEMPTR_H #define ITEMPTR_H #include "storage/block.h" #include "storage/off.h" /* * ItemPointer: * * This is a pointer to an item within a disk page of a known file * (for example, a cross-link from an index to its parent table). * blkid tells us which block, posid tells us which entry in the linp * (ItemIdData) array we want. * * Note: because there is an item pointer in each tuple header and index * tuple header on disk, it's very important not to waste space with * structure padding bytes. The struct is designed to be six bytes long * (it contains three int16 fields) but a few compilers will pad it to * eight bytes unless coerced. We apply appropriate persuasion where * possible, and to cope with unpersuadable compilers, we try to use * "SizeOfIptrData" rather than "sizeof(ItemPointerData)" when computing * on-disk sizes. */ typedef struct ItemPointerData { BlockIdData ip_blkid; OffsetNumber ip_posid; } #ifdef __arm__ __attribute__((packed)) /* Appropriate whack upside the head for ARM */ #endif ItemPointerData; #define SizeOfIptrData \ (offsetof(ItemPointerData, ip_posid) + sizeof(OffsetNumber)) typedef ItemPointerData *ItemPointer; /* ---------------- * support macros * ---------------- */ /* * ItemPointerIsValid * True iff the disk item pointer is not NULL. */ #define ItemPointerIsValid(pointer) \ ((bool) (PointerIsValid(pointer) && ((pointer)->ip_posid != 0))) /* * ItemPointerGetBlockNumber * Returns the block number of a disk item pointer. */ #define ItemPointerGetBlockNumber(pointer) \ ( \ AssertMacro(ItemPointerIsValid(pointer)), \ BlockIdGetBlockNumber(&(pointer)->ip_blkid) \ ) /* * ItemPointerGetOffsetNumber * Returns the offset number of a disk item pointer. */ #define ItemPointerGetOffsetNumber(pointer) \ ( \ AssertMacro(ItemPointerIsValid(pointer)), \ (pointer)->ip_posid \ ) /* * ItemPointerSet * Sets a disk item pointer to the specified block and offset. */ #define ItemPointerSet(pointer, blockNumber, offNum) \ ( \ AssertMacro(PointerIsValid(pointer)), \ BlockIdSet(&((pointer)->ip_blkid), blockNumber), \ (pointer)->ip_posid = offNum \ ) /* * ItemPointerSetBlockNumber * Sets a disk item pointer to the specified block. */ #define ItemPointerSetBlockNumber(pointer, blockNumber) \ ( \ AssertMacro(PointerIsValid(pointer)), \ BlockIdSet(&((pointer)->ip_blkid), blockNumber) \ ) /* * ItemPointerSetOffsetNumber * Sets a disk item pointer to the specified offset. */ #define ItemPointerSetOffsetNumber(pointer, offsetNumber) \ ( \ AssertMacro(PointerIsValid(pointer)), \ (pointer)->ip_posid = (offsetNumber) \ ) /* * ItemPointerCopy * Copies the contents of one disk item pointer to another. */ #define ItemPointerCopy(fromPointer, toPointer) \ ( \ AssertMacro(PointerIsValid(toPointer)), \ AssertMacro(PointerIsValid(fromPointer)), \ *(toPointer) = *(fromPointer) \ ) /* * ItemPointerSetInvalid * Sets a disk item pointer to be invalid. */ #define ItemPointerSetInvalid(pointer) \ ( \ AssertMacro(PointerIsValid(pointer)), \ BlockIdSet(&((pointer)->ip_blkid), InvalidBlockNumber), \ (pointer)->ip_posid = InvalidOffsetNumber \ ) /* ---------------- * externs * ---------------- */ extern bool ItemPointerEquals(ItemPointer pointer1, ItemPointer pointer2); extern int32 ItemPointerCompare(ItemPointer arg1, ItemPointer arg2); #endif /* ITEMPTR_H */ PKBiZMserver/storage/smgr.hnu[/*------------------------------------------------------------------------- * * smgr.h * storage manager switch public interface declarations. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/smgr.h * *------------------------------------------------------------------------- */ #ifndef SMGR_H #define SMGR_H #include "fmgr.h" #include "storage/block.h" #include "storage/relfilenode.h" /* * smgr.c maintains a table of SMgrRelation objects, which are essentially * cached file handles. An SMgrRelation is created (if not already present) * by smgropen(), and destroyed by smgrclose(). Note that neither of these * operations imply I/O, they just create or destroy a hashtable entry. * (But smgrclose() may release associated resources, such as OS-level file * descriptors.) * * An SMgrRelation may have an "owner", which is just a pointer to it from * somewhere else; smgr.c will clear this pointer if the SMgrRelation is * closed. We use this to avoid dangling pointers from relcache to smgr * without having to make the smgr explicitly aware of relcache. There * can't be more than one "owner" pointer per SMgrRelation, but that's * all we need. * * SMgrRelations that do not have an "owner" are considered to be transient, * and are deleted at end of transaction. */ typedef struct SMgrRelationData { /* rnode is the hashtable lookup key, so it must be first! */ RelFileNodeBackend smgr_rnode; /* relation physical identifier */ /* pointer to owning pointer, or NULL if none */ struct SMgrRelationData **smgr_owner; /* * These next three fields are not actually used or manipulated by smgr, * except that they are reset to InvalidBlockNumber upon a cache flush * event (in particular, upon truncation of the relation). Higher levels * store cached state here so that it will be reset when truncation * happens. In all three cases, InvalidBlockNumber means "unknown". */ BlockNumber smgr_targblock; /* current insertion target block */ BlockNumber smgr_fsm_nblocks; /* last known size of fsm fork */ BlockNumber smgr_vm_nblocks; /* last known size of vm fork */ /* additional public fields may someday exist here */ /* * Fields below here are intended to be private to smgr.c and its * submodules. Do not touch them from elsewhere. */ int smgr_which; /* storage manager selector */ /* for md.c; NULL for forks that are not open */ struct _MdfdVec *md_fd[MAX_FORKNUM + 1]; /* if unowned, list link in list of all unowned SMgrRelations */ struct SMgrRelationData *next_unowned_reln; } SMgrRelationData; typedef SMgrRelationData *SMgrRelation; #define SmgrIsTemp(smgr) \ RelFileNodeBackendIsTemp((smgr)->smgr_rnode) extern void smgrinit(void); extern SMgrRelation smgropen(RelFileNode rnode, BackendId backend); extern bool smgrexists(SMgrRelation reln, ForkNumber forknum); extern void smgrsetowner(SMgrRelation *owner, SMgrRelation reln); extern void smgrclearowner(SMgrRelation *owner, SMgrRelation reln); extern void smgrclose(SMgrRelation reln); extern void smgrcloseall(void); extern void smgrclosenode(RelFileNodeBackend rnode); extern void smgrcreate(SMgrRelation reln, ForkNumber forknum, bool isRedo); extern void smgrdounlink(SMgrRelation reln, bool isRedo); extern void smgrdounlinkfork(SMgrRelation reln, ForkNumber forknum, bool isRedo); extern void smgrextend(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, char *buffer, bool skipFsync); extern void smgrprefetch(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum); extern void smgrread(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, char *buffer); extern void smgrwrite(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, char *buffer, bool skipFsync); extern BlockNumber smgrnblocks(SMgrRelation reln, ForkNumber forknum); extern void smgrtruncate(SMgrRelation reln, ForkNumber forknum, BlockNumber nblocks); extern void smgrimmedsync(SMgrRelation reln, ForkNumber forknum); extern void smgrpreckpt(void); extern void smgrsync(void); extern void smgrpostckpt(void); extern void AtEOXact_SMgr(void); /* internals: move me elsewhere -- ay 7/94 */ /* in md.c */ extern void mdinit(void); extern void mdclose(SMgrRelation reln, ForkNumber forknum); extern void mdcreate(SMgrRelation reln, ForkNumber forknum, bool isRedo); extern bool mdexists(SMgrRelation reln, ForkNumber forknum); extern void mdunlink(RelFileNodeBackend rnode, ForkNumber forknum, bool isRedo); extern void mdextend(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, char *buffer, bool skipFsync); extern void mdprefetch(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum); extern void mdread(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, char *buffer); extern void mdwrite(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, char *buffer, bool skipFsync); extern BlockNumber mdnblocks(SMgrRelation reln, ForkNumber forknum); extern void mdtruncate(SMgrRelation reln, ForkNumber forknum, BlockNumber nblocks); extern void mdimmedsync(SMgrRelation reln, ForkNumber forknum); extern void mdpreckpt(void); extern void mdsync(void); extern void mdpostckpt(void); extern void SetForwardFsyncRequests(void); extern void RememberFsyncRequest(RelFileNode rnode, ForkNumber forknum, BlockNumber segno); extern void ForgetRelationFsyncRequests(RelFileNode rnode, ForkNumber forknum); extern void ForgetDatabaseFsyncRequests(Oid dbid); /* smgrtype.c */ extern Datum smgrout(PG_FUNCTION_ARGS); extern Datum smgrin(PG_FUNCTION_ARGS); extern Datum smgreq(PG_FUNCTION_ARGS); extern Datum smgrne(PG_FUNCTION_ARGS); #endif /* SMGR_H */ PKBiZoAAserver/storage/relfilenode.hnu[/*------------------------------------------------------------------------- * * relfilenode.h * Physical access information for relations. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/relfilenode.h * *------------------------------------------------------------------------- */ #ifndef RELFILENODE_H #define RELFILENODE_H #include "storage/backendid.h" /* * The physical storage of a relation consists of one or more forks. The * main fork is always created, but in addition to that there can be * additional forks for storing various metadata. ForkNumber is used when * we need to refer to a specific fork in a relation. */ typedef enum ForkNumber { InvalidForkNumber = -1, MAIN_FORKNUM = 0, FSM_FORKNUM, VISIBILITYMAP_FORKNUM, INIT_FORKNUM /* * NOTE: if you add a new fork, change MAX_FORKNUM below and update the * forkNames array in catalog.c */ } ForkNumber; #define MAX_FORKNUM INIT_FORKNUM /* * RelFileNode must provide all that we need to know to physically access * a relation, with the exception of the backend ID, which can be provided * separately. Note, however, that a "physical" relation is comprised of * multiple files on the filesystem, as each fork is stored as a separate * file, and each fork can be divided into multiple segments. See md.c. * * spcNode identifies the tablespace of the relation. It corresponds to * pg_tablespace.oid. * * dbNode identifies the database of the relation. It is zero for * "shared" relations (those common to all databases of a cluster). * Nonzero dbNode values correspond to pg_database.oid. * * relNode identifies the specific relation. relNode corresponds to * pg_class.relfilenode (NOT pg_class.oid, because we need to be able * to assign new physical files to relations in some situations). * Notice that relNode is only unique within a particular database. * * Note: spcNode must be GLOBALTABLESPACE_OID if and only if dbNode is * zero. We support shared relations only in the "global" tablespace. * * Note: in pg_class we allow reltablespace == 0 to denote that the * relation is stored in its database's "default" tablespace (as * identified by pg_database.dattablespace). However this shorthand * is NOT allowed in RelFileNode structs --- the real tablespace ID * must be supplied when setting spcNode. * * Note: in pg_class, relfilenode can be zero to denote that the relation * is a "mapped" relation, whose current true filenode number is available * from relmapper.c. Again, this case is NOT allowed in RelFileNodes. * * Note: various places use RelFileNode in hashtable keys. Therefore, * there *must not* be any unused padding bytes in this struct. That * should be safe as long as all the fields are of type Oid. */ typedef struct RelFileNode { Oid spcNode; /* tablespace */ Oid dbNode; /* database */ Oid relNode; /* relation */ } RelFileNode; /* * Augmenting a relfilenode with the backend ID provides all the information * we need to locate the physical storage. The backend ID is InvalidBackendId * for regular relations (those accessible to more than one backend), or the * owning backend's ID for backend-local relations. Backend-local relations * are always transient and removed in case of a database crash; they are * never WAL-logged or fsync'd. */ typedef struct RelFileNodeBackend { RelFileNode node; BackendId backend; } RelFileNodeBackend; #define RelFileNodeBackendIsTemp(rnode) \ ((rnode).backend != InvalidBackendId) /* * Note: RelFileNodeEquals and RelFileNodeBackendEquals compare relNode first * since that is most likely to be different in two unequal RelFileNodes. It * is probably redundant to compare spcNode if the other fields are found equal, * but do it anyway to be sure. Likewise for checking the backend ID in * RelFileNodeBackendEquals. */ #define RelFileNodeEquals(node1, node2) \ ((node1).relNode == (node2).relNode && \ (node1).dbNode == (node2).dbNode && \ (node1).spcNode == (node2).spcNode) #define RelFileNodeBackendEquals(node1, node2) \ ((node1).node.relNode == (node2).node.relNode && \ (node1).node.dbNode == (node2).node.dbNode && \ (node1).backend == (node2).backend && \ (node1).node.spcNode == (node2).node.spcNode) #endif /* RELFILENODE_H */ PKBiZ-4UJ11server/storage/copydir.hnu[/*------------------------------------------------------------------------- * * copydir.h * Copy a directory. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/copydir.h * *------------------------------------------------------------------------- */ #ifndef COPYDIR_H #define COPYDIR_H extern void copydir(char *fromdir, char *todir, bool recurse); extern void copy_file(char *fromfile, char *tofile); #endif /* COPYDIR_H */ PKBiZ L server/storage/shmem.hnu[/*------------------------------------------------------------------------- * * shmem.h * shared memory management structures * * Historical note: * A long time ago, Postgres' shared memory region was allowed to be mapped * at a different address in each process, and shared memory "pointers" were * passed around as offsets relative to the start of the shared memory region. * That is no longer the case: each process must map the shared memory region * at the same address. This means shared memory pointers can be passed * around directly between different processes. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/shmem.h * *------------------------------------------------------------------------- */ #ifndef SHMEM_H #define SHMEM_H #include "utils/hsearch.h" /* shmqueue.c */ typedef struct SHM_QUEUE { struct SHM_QUEUE *prev; struct SHM_QUEUE *next; } SHM_QUEUE; /* shmem.c */ extern void InitShmemAccess(void *seghdr); extern void InitShmemAllocation(void); extern void *ShmemAlloc(Size size); extern bool ShmemAddrIsValid(const void *addr); extern void InitShmemIndex(void); extern HTAB *ShmemInitHash(const char *name, long init_size, long max_size, HASHCTL *infoP, int hash_flags); extern void *ShmemInitStruct(const char *name, Size size, bool *foundPtr); extern Size add_size(Size s1, Size s2); extern Size mul_size(Size s1, Size s2); /* ipci.c */ extern void RequestAddinShmemSpace(Size size); /* size constants for the shmem index table */ /* max size of data structure string name */ #define SHMEM_INDEX_KEYSIZE (48) /* estimated size of the shmem index table (not a hard limit) */ #define SHMEM_INDEX_SIZE (64) /* this is a hash bucket in the shmem index table */ typedef struct { char key[SHMEM_INDEX_KEYSIZE]; /* string name */ void *location; /* location in shared mem */ Size size; /* # bytes allocated for the structure */ } ShmemIndexEnt; /* * prototypes for functions in shmqueue.c */ extern void SHMQueueInit(SHM_QUEUE *queue); extern void SHMQueueElemInit(SHM_QUEUE *queue); extern void SHMQueueDelete(SHM_QUEUE *queue); extern void SHMQueueInsertBefore(SHM_QUEUE *queue, SHM_QUEUE *elem); extern void SHMQueueInsertAfter(SHM_QUEUE *queue, SHM_QUEUE *elem); extern Pointer SHMQueueNext(const SHM_QUEUE *queue, const SHM_QUEUE *curElem, Size linkOffset); extern Pointer SHMQueuePrev(const SHM_QUEUE *queue, const SHM_QUEUE *curElem, Size linkOffset); extern bool SHMQueueEmpty(const SHM_QUEUE *queue); extern bool SHMQueueIsDetached(const SHM_QUEUE *queue); #endif /* SHMEM_H */ PKBiZFQQserver/storage/lwlock.hnu[/*------------------------------------------------------------------------- * * lwlock.h * Lightweight lock manager * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/lwlock.h * *------------------------------------------------------------------------- */ #ifndef LWLOCK_H #define LWLOCK_H /* * It's a bit odd to declare NUM_BUFFER_PARTITIONS and NUM_LOCK_PARTITIONS * here, but we need them to set up enum LWLockId correctly, and having * this file include lock.h or bufmgr.h would be backwards. */ /* Number of partitions of the shared buffer mapping hashtable */ #define NUM_BUFFER_PARTITIONS 16 /* Number of partitions the shared lock tables are divided into */ #define LOG2_NUM_LOCK_PARTITIONS 4 #define NUM_LOCK_PARTITIONS (1 << LOG2_NUM_LOCK_PARTITIONS) /* Number of partitions the shared predicate lock tables are divided into */ #define LOG2_NUM_PREDICATELOCK_PARTITIONS 4 #define NUM_PREDICATELOCK_PARTITIONS (1 << LOG2_NUM_PREDICATELOCK_PARTITIONS) /* * We have a number of predefined LWLocks, plus a bunch of LWLocks that are * dynamically assigned (e.g., for shared buffers). The LWLock structures * live in shared memory (since they contain shared data) and are identified * by values of this enumerated type. We abuse the notion of an enum somewhat * by allowing values not listed in the enum declaration to be assigned. * The extra value MaxDynamicLWLock is there to keep the compiler from * deciding that the enum can be represented as char or short ... * * If you remove a lock, please replace it with a placeholder. This retains * the lock numbering, which is helpful for DTrace and other external * debugging scripts. */ typedef enum LWLockId { BufFreelistLock, ShmemIndexLock, OidGenLock, XidGenLock, ProcArrayLock, SInvalReadLock, SInvalWriteLock, WALInsertLock, WALWriteLock, ControlFileLock, CheckpointLock, CLogControlLock, SubtransControlLock, MultiXactGenLock, MultiXactOffsetControlLock, MultiXactMemberControlLock, RelCacheInitLock, CheckpointerCommLock, TwoPhaseStateLock, TablespaceCreateLock, BtreeVacuumLock, AddinShmemInitLock, AutovacuumLock, AutovacuumScheduleLock, SyncScanLock, RelationMappingLock, AsyncCtlLock, AsyncQueueLock, SerializableXactHashLock, SerializableFinishedListLock, SerializablePredicateLockListLock, OldSerXidLock, SyncRepLock, /* Individual lock IDs end here */ FirstBufMappingLock, FirstLockMgrLock = FirstBufMappingLock + NUM_BUFFER_PARTITIONS, FirstPredicateLockMgrLock = FirstLockMgrLock + NUM_LOCK_PARTITIONS, /* must be last except for MaxDynamicLWLock: */ NumFixedLWLocks = FirstPredicateLockMgrLock + NUM_PREDICATELOCK_PARTITIONS, MaxDynamicLWLock = 1000000000 } LWLockId; typedef enum LWLockMode { LW_EXCLUSIVE, LW_SHARED, LW_WAIT_UNTIL_FREE /* A special mode used in PGPROC->lwlockMode, * when waiting for lock to become free. Not * to be used as LWLockAcquire argument */ } LWLockMode; #ifdef LOCK_DEBUG extern bool Trace_lwlocks; #endif extern LWLockId LWLockAssign(void); extern void LWLockAcquire(LWLockId lockid, LWLockMode mode); extern bool LWLockConditionalAcquire(LWLockId lockid, LWLockMode mode); extern bool LWLockAcquireOrWait(LWLockId lockid, LWLockMode mode); extern void LWLockRelease(LWLockId lockid); extern void LWLockReleaseAll(void); extern bool LWLockHeldByMe(LWLockId lockid); extern int NumLWLocks(void); extern Size LWLockShmemSize(void); extern void CreateLWLocks(void); extern void RequestAddinLWLocks(int n); #endif /* LWLOCK_H */ PKBiZ'server/storage/backendid.hnu[/*------------------------------------------------------------------------- * * backendid.h * POSTGRES backend id communication definitions * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/backendid.h * *------------------------------------------------------------------------- */ #ifndef BACKENDID_H #define BACKENDID_H /* ---------------- * -cim 8/17/90 * ---------------- */ typedef int BackendId; /* unique currently active backend identifier */ #define InvalidBackendId (-1) extern PGDLLIMPORT BackendId MyBackendId; /* backend id of this backend */ #endif /* BACKENDID_H */ PKBiZb0::server/storage/buf.hnu[/*------------------------------------------------------------------------- * * buf.h * Basic buffer manager data types. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/buf.h * *------------------------------------------------------------------------- */ #ifndef BUF_H #define BUF_H /* * Buffer identifiers. * * Zero is invalid, positive is the index of a shared buffer (1..NBuffers), * negative is the index of a local buffer (-1 .. -NLocBuffer). */ typedef int Buffer; #define InvalidBuffer 0 /* * BufferIsInvalid * True iff the buffer is invalid. */ #define BufferIsInvalid(buffer) ((buffer) == InvalidBuffer) /* * BufferIsLocal * True iff the buffer is local (not visible to other backends). */ #define BufferIsLocal(buffer) ((buffer) < 0) /* * Buffer access strategy objects. * * BufferAccessStrategyData is private to freelist.c */ typedef struct BufferAccessStrategyData *BufferAccessStrategy; #endif /* BUF_H */ PKBiZ2ccserver/storage/barrier.hnu[/*------------------------------------------------------------------------- * * barrier.h * Memory barrier operations. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/barrier.h * *------------------------------------------------------------------------- */ #ifndef BARRIER_H #define BARRIER_H #include "storage/s_lock.h" extern slock_t dummy_spinlock; /* * A compiler barrier need not (and preferably should not) emit any actual * machine code, but must act as an optimization fence: the compiler must not * reorder loads or stores to main memory around the barrier. However, the * CPU may still reorder loads or stores at runtime, if the architecture's * memory model permits this. * * A memory barrier must act as a compiler barrier, and in addition must * guarantee that all loads and stores issued prior to the barrier are * completed before any loads or stores issued after the barrier. Unless * loads and stores are totally ordered (which is not the case on most * architectures) this requires issuing some sort of memory fencing * instruction. * * A read barrier must act as a compiler barrier, and in addition must * guarantee that any loads issued prior to the barrier are completed before * any loads issued after the barrier. Similarly, a write barrier acts * as a compiler barrier, and also orders stores. Read and write barriers * are thus weaker than a full memory barrier, but stronger than a compiler * barrier. In practice, on machines with strong memory ordering, read and * write barriers may require nothing more than a compiler barrier. * * For an introduction to using memory barriers within the PostgreSQL backend, * see src/backend/storage/lmgr/README.barrier */ #if defined(DISABLE_BARRIERS) /* * Fall through to the spinlock-based implementation. */ #elif defined(__INTEL_COMPILER) /* * icc defines __GNUC__, but doesn't support gcc's inline asm syntax */ #if defined(__ia64__) || defined(__ia64) #define pg_memory_barrier() __mf() #elif defined(__i386__) || defined(__x86_64__) #define pg_memory_barrier() _mm_mfence() #endif #define pg_compiler_barrier() __memory_barrier() #elif defined(__GNUC__) /* This works on any architecture, since it's only talking to GCC itself. */ #define pg_compiler_barrier() __asm__ __volatile__("" : : : "memory") #if defined(__i386__) /* * i386 does not allow loads to be reordered with other loads, or stores to be * reordered with other stores, but a load can be performed before a subsequent * store. * * "lock; addl" has worked for longer than "mfence". */ #define pg_memory_barrier() \ __asm__ __volatile__ ("lock; addl $0,0(%%esp)" : : : "memory", "cc") #define pg_read_barrier() pg_compiler_barrier() #define pg_write_barrier() pg_compiler_barrier() #elif defined(__x86_64__) /* 64 bit x86 */ /* * x86_64 has similar ordering characteristics to i386. * * Technically, some x86-ish chips support uncached memory access and/or * special instructions that are weakly ordered. In those cases we'd need * the read and write barriers to be lfence and sfence. But since we don't * do those things, a compiler barrier should be enough. */ #define pg_memory_barrier() \ __asm__ __volatile__ ("lock; addl $0,0(%%rsp)" : : : "memory", "cc") #define pg_read_barrier() pg_compiler_barrier() #define pg_write_barrier() pg_compiler_barrier() #elif defined(__ia64__) || defined(__ia64) /* * Itanium is weakly ordered, so read and write barriers require a full * fence. */ #define pg_memory_barrier() __asm__ __volatile__ ("mf" : : : "memory") #elif defined(__ppc__) || defined(__powerpc__) || defined(__ppc64__) || defined(__powerpc64__) /* * lwsync orders loads with respect to each other, and similarly with stores. * But a load can be performed before a subsequent store, so sync must be used * for a full memory barrier. */ #define pg_memory_barrier() __asm__ __volatile__ ("sync" : : : "memory") #define pg_read_barrier() __asm__ __volatile__ ("lwsync" : : : "memory") #define pg_write_barrier() __asm__ __volatile__ ("lwsync" : : : "memory") #elif defined(__alpha) || defined(__alpha__) /* Alpha */ /* * Unlike all other known architectures, Alpha allows dependent reads to be * reordered, but we don't currently find it necessary to provide a conditional * read barrier to cover that case. We might need to add that later. */ #define pg_memory_barrier() __asm__ __volatile__ ("mb" : : : "memory") #define pg_read_barrier() __asm__ __volatile__ ("mb" : : : "memory") #define pg_write_barrier() __asm__ __volatile__ ("wmb" : : : "memory") #elif defined(__hppa) || defined(__hppa__) /* HP PA-RISC */ /* HPPA doesn't do either read or write reordering */ #define pg_memory_barrier() pg_compiler_barrier() #elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) /* * If we're on GCC 4.1.0 or higher, we should be able to get a memory * barrier out of this compiler built-in. But we prefer to rely on our * own definitions where possible, and use this only as a fallback. */ #define pg_memory_barrier() __sync_synchronize() #endif #elif defined(__ia64__) || defined(__ia64) #define pg_compiler_barrier() _Asm_sched_fence() #define pg_memory_barrier() _Asm_mf() #elif defined(WIN32_ONLY_COMPILER) /* Should work on both MSVC and Borland. */ #include #pragma intrinsic(_ReadWriteBarrier) #define pg_compiler_barrier() _ReadWriteBarrier() #define pg_memory_barrier() MemoryBarrier() #endif /* * If we have no memory barrier implementation for this architecture, we * fall back to acquiring and releasing a spinlock. This might, in turn, * fall back to the semaphore-based spinlock implementation, which will be * amazingly slow. * * It's not self-evident that every possible legal implementation of a * spinlock acquire-and-release would be equivalent to a full memory barrier. * For example, I'm not sure that Itanium's acq and rel add up to a full * fence. But all of our actual implementations seem OK in this regard. */ #if !defined(pg_memory_barrier) #define pg_memory_barrier() \ do { S_LOCK(&dummy_spinlock); S_UNLOCK(&dummy_spinlock); } while (0) #endif /* * If read or write barriers are undefined, we upgrade them to full memory * barriers. * * If a compiler barrier is unavailable, you probably don't want a full * memory barrier instead, so if you have a use case for a compiler barrier, * you'd better use #ifdef. */ #if !defined(pg_read_barrier) #define pg_read_barrier() pg_memory_barrier() #endif #if !defined(pg_write_barrier) #define pg_write_barrier() pg_memory_barrier() #endif #endif /* BARRIER_H */ PKBiZ$server/storage/sinvaladt.hnu[/*------------------------------------------------------------------------- * * sinvaladt.h * POSTGRES shared cache invalidation data manager. * * The shared cache invalidation manager is responsible for transmitting * invalidation messages between backends. Any message sent by any backend * must be delivered to all already-running backends before it can be * forgotten. (If we run out of space, we instead deliver a "RESET" * message to backends that have fallen too far behind.) * * The struct type SharedInvalidationMessage, defining the contents of * a single message, is defined in sinval.h. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/sinvaladt.h * *------------------------------------------------------------------------- */ #ifndef SINVALADT_H #define SINVALADT_H #include "storage/proc.h" #include "storage/sinval.h" /* * prototypes for functions in sinvaladt.c */ extern Size SInvalShmemSize(void); extern void CreateSharedInvalidationState(void); extern void SharedInvalBackendInit(bool sendOnly); extern PGPROC *BackendIdGetProc(int backendID); extern void SIInsertDataEntries(const SharedInvalidationMessage *data, int n); extern int SIGetDataEntries(SharedInvalidationMessage *data, int datasize); extern void SICleanupQueue(bool callerHasWriteLock, int minFree); extern LocalTransactionId GetNextLocalTransactionId(void); #endif /* SINVALADT_H */ PKBiZ|4server/storage/itemid.hnu[/*------------------------------------------------------------------------- * * itemid.h * Standard POSTGRES buffer page item identifier definitions. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/itemid.h * *------------------------------------------------------------------------- */ #ifndef ITEMID_H #define ITEMID_H /* * An item pointer (also called line pointer) on a buffer page * * In some cases an item pointer is "in use" but does not have any associated * storage on the page. By convention, lp_len == 0 in every item pointer * that does not have storage, independently of its lp_flags state. */ typedef struct ItemIdData { unsigned lp_off:15, /* offset to tuple (from start of page) */ lp_flags:2, /* state of item pointer, see below */ lp_len:15; /* byte length of tuple */ } ItemIdData; typedef ItemIdData *ItemId; /* * lp_flags has these possible states. An UNUSED line pointer is available * for immediate re-use, the other states are not. */ #define LP_UNUSED 0 /* unused (should always have lp_len=0) */ #define LP_NORMAL 1 /* used (should always have lp_len>0) */ #define LP_REDIRECT 2 /* HOT redirect (should have lp_len=0) */ #define LP_DEAD 3 /* dead, may or may not have storage */ /* * Item offsets and lengths are represented by these types when * they're not actually stored in an ItemIdData. */ typedef uint16 ItemOffset; typedef uint16 ItemLength; /* ---------------- * support macros * ---------------- */ /* * ItemIdGetLength */ #define ItemIdGetLength(itemId) \ ((itemId)->lp_len) /* * ItemIdGetOffset */ #define ItemIdGetOffset(itemId) \ ((itemId)->lp_off) /* * ItemIdGetFlags */ #define ItemIdGetFlags(itemId) \ ((itemId)->lp_flags) /* * ItemIdGetRedirect * In a REDIRECT pointer, lp_off holds the link to the next item pointer */ #define ItemIdGetRedirect(itemId) \ ((itemId)->lp_off) /* * ItemIdIsValid * True iff item identifier is valid. * This is a pretty weak test, probably useful only in Asserts. */ #define ItemIdIsValid(itemId) PointerIsValid(itemId) /* * ItemIdIsUsed * True iff item identifier is in use. */ #define ItemIdIsUsed(itemId) \ ((itemId)->lp_flags != LP_UNUSED) /* * ItemIdIsNormal * True iff item identifier is in state NORMAL. */ #define ItemIdIsNormal(itemId) \ ((itemId)->lp_flags == LP_NORMAL) /* * ItemIdIsRedirected * True iff item identifier is in state REDIRECT. */ #define ItemIdIsRedirected(itemId) \ ((itemId)->lp_flags == LP_REDIRECT) /* * ItemIdIsDead * True iff item identifier is in state DEAD. */ #define ItemIdIsDead(itemId) \ ((itemId)->lp_flags == LP_DEAD) /* * ItemIdHasStorage * True iff item identifier has associated storage. */ #define ItemIdHasStorage(itemId) \ ((itemId)->lp_len != 0) /* * ItemIdSetUnused * Set the item identifier to be UNUSED, with no storage. * Beware of multiple evaluations of itemId! */ #define ItemIdSetUnused(itemId) \ ( \ (itemId)->lp_flags = LP_UNUSED, \ (itemId)->lp_off = 0, \ (itemId)->lp_len = 0 \ ) /* * ItemIdSetNormal * Set the item identifier to be NORMAL, with the specified storage. * Beware of multiple evaluations of itemId! */ #define ItemIdSetNormal(itemId, off, len) \ ( \ (itemId)->lp_flags = LP_NORMAL, \ (itemId)->lp_off = (off), \ (itemId)->lp_len = (len) \ ) /* * ItemIdSetRedirect * Set the item identifier to be REDIRECT, with the specified link. * Beware of multiple evaluations of itemId! */ #define ItemIdSetRedirect(itemId, link) \ ( \ (itemId)->lp_flags = LP_REDIRECT, \ (itemId)->lp_off = (link), \ (itemId)->lp_len = 0 \ ) /* * ItemIdSetDead * Set the item identifier to be DEAD, with no storage. * Beware of multiple evaluations of itemId! */ #define ItemIdSetDead(itemId) \ ( \ (itemId)->lp_flags = LP_DEAD, \ (itemId)->lp_off = 0, \ (itemId)->lp_len = 0 \ ) /* * ItemIdMarkDead * Set the item identifier to be DEAD, keeping its existing storage. * * Note: in indexes, this is used as if it were a hint-bit mechanism; * we trust that multiple processors can do this in parallel and get * the same result. */ #define ItemIdMarkDead(itemId) \ ( \ (itemId)->lp_flags = LP_DEAD \ ) #endif /* ITEMID_H */ PKBiZ( server/storage/pg_sema.hnu[/*------------------------------------------------------------------------- * * pg_sema.h * Platform-independent API for semaphores. * * PostgreSQL requires counting semaphores (the kind that keep track of * multiple unlock operations, and will allow an equal number of subsequent * lock operations before blocking). The underlying implementation is * not the same on every platform. This file defines the API that must * be provided by each port. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/pg_sema.h * *------------------------------------------------------------------------- */ #ifndef PG_SEMA_H #define PG_SEMA_H /* * PGSemaphoreData and pointer type PGSemaphore are the data structure * representing an individual semaphore. The contents of PGSemaphoreData * vary across implementations and must never be touched by platform- * independent code. PGSemaphoreData structures are always allocated * in shared memory (to support implementations where the data changes during * lock/unlock). * * pg_config.h must define exactly one of the USE_xxx_SEMAPHORES symbols. */ #ifdef USE_NAMED_POSIX_SEMAPHORES #include typedef sem_t *PGSemaphoreData; #endif #ifdef USE_UNNAMED_POSIX_SEMAPHORES #include typedef sem_t PGSemaphoreData; #endif #ifdef USE_SYSV_SEMAPHORES typedef struct PGSemaphoreData { int semId; /* semaphore set identifier */ int semNum; /* semaphore number within set */ } PGSemaphoreData; #endif #ifdef USE_WIN32_SEMAPHORES typedef HANDLE PGSemaphoreData; #endif typedef PGSemaphoreData *PGSemaphore; /* Module initialization (called during postmaster start or shmem reinit) */ extern void PGReserveSemaphores(int maxSemas, int port); /* Initialize a PGSemaphore structure to represent a sema with count 1 */ extern void PGSemaphoreCreate(PGSemaphore sema); /* Reset a previously-initialized PGSemaphore to have count 0 */ extern void PGSemaphoreReset(PGSemaphore sema); /* Lock a semaphore (decrement count), blocking if count would be < 0 */ extern void PGSemaphoreLock(PGSemaphore sema, bool interruptOK); /* Unlock a semaphore (increment count) */ extern void PGSemaphoreUnlock(PGSemaphore sema); /* Lock a semaphore only if able to do so without blocking */ extern bool PGSemaphoreTryLock(PGSemaphore sema); #endif /* PG_SEMA_H */ PKBiZWserver/storage/indexfsm.hnu[/*------------------------------------------------------------------------- * * indexfsm.h * POSTGRES free space map for quickly finding an unused page in index * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/indexfsm.h * *------------------------------------------------------------------------- */ #ifndef INDEXFSM_H_ #define INDEXFSM_H_ #include "storage/block.h" #include "utils/relcache.h" extern BlockNumber GetFreeIndexPage(Relation rel); extern void RecordFreeIndexPage(Relation rel, BlockNumber page); extern void RecordUsedIndexPage(Relation rel, BlockNumber page); extern void IndexFreeSpaceMapVacuum(Relation rel); #endif /* INDEXFSM_H_ */ PKBiZ٘"RRserver/storage/off.hnu[/*------------------------------------------------------------------------- * * off.h * POSTGRES disk "offset" definitions. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/off.h * *------------------------------------------------------------------------- */ #ifndef OFF_H #define OFF_H #include "storage/itemid.h" /* * OffsetNumber: * * this is a 1-based index into the linp (ItemIdData) array in the * header of each disk page. */ typedef uint16 OffsetNumber; #define InvalidOffsetNumber ((OffsetNumber) 0) #define FirstOffsetNumber ((OffsetNumber) 1) #define MaxOffsetNumber ((OffsetNumber) (BLCKSZ / sizeof(ItemIdData))) #define OffsetNumberMask (0xffff) /* valid uint16 bits */ /* ---------------- * support macros * ---------------- */ /* * OffsetNumberIsValid * True iff the offset number is valid. */ #define OffsetNumberIsValid(offsetNumber) \ ((bool) ((offsetNumber != InvalidOffsetNumber) && \ (offsetNumber <= MaxOffsetNumber))) /* * OffsetNumberNext * OffsetNumberPrev * Increments/decrements the argument. These macros look pointless * but they help us disambiguate the different manipulations on * OffsetNumbers (e.g., sometimes we subtract one from an * OffsetNumber to move back, and sometimes we do so to form a * real C array index). */ #define OffsetNumberNext(offsetNumber) \ ((OffsetNumber) (1 + (offsetNumber))) #define OffsetNumberPrev(offsetNumber) \ ((OffsetNumber) (-1 + (offsetNumber))) #endif /* OFF_H */ PKBiZTjLLserver/storage/reinit.hnu[/*------------------------------------------------------------------------- * * reinit.h * Reinitialization of unlogged relations * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/fd.h * *------------------------------------------------------------------------- */ #ifndef REINIT_H #define REINIT_H extern void ResetUnloggedRelations(int op); #define UNLOGGED_RELATION_CLEANUP 0x0001 #define UNLOGGED_RELATION_INIT 0x0002 #endif /* REINIT_H */ PKBiZserver/storage/freespace.hnu[/*------------------------------------------------------------------------- * * freespace.h * POSTGRES free space map for quickly finding free space in relations * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/freespace.h * *------------------------------------------------------------------------- */ #ifndef FREESPACE_H_ #define FREESPACE_H_ #include "storage/block.h" #include "storage/relfilenode.h" #include "utils/relcache.h" /* prototypes for public functions in freespace.c */ extern Size GetRecordedFreeSpace(Relation rel, BlockNumber heapBlk); extern BlockNumber GetPageWithFreeSpace(Relation rel, Size spaceNeeded); extern BlockNumber RecordAndGetPageWithFreeSpace(Relation rel, BlockNumber oldPage, Size oldSpaceAvail, Size spaceNeeded); extern void RecordPageWithFreeSpace(Relation rel, BlockNumber heapBlk, Size spaceAvail); extern void XLogRecordPageWithFreeSpace(RelFileNode rnode, BlockNumber heapBlk, Size spaceAvail); extern void FreeSpaceMapTruncateRel(Relation rel, BlockNumber nblocks); extern void FreeSpaceMapVacuum(Relation rel); #endif /* FREESPACE_H_ */ PKBiZ-PM&M&server/storage/proc.hnu[/*------------------------------------------------------------------------- * * proc.h * per-process shared memory data structures * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/proc.h * *------------------------------------------------------------------------- */ #ifndef _PROC_H_ #define _PROC_H_ #include "access/xlog.h" #include "datatype/timestamp.h" #include "storage/latch.h" #include "storage/lock.h" #include "storage/pg_sema.h" /* * Each backend advertises up to PGPROC_MAX_CACHED_SUBXIDS TransactionIds * for non-aborted subtransactions of its current top transaction. These * have to be treated as running XIDs by other backends. * * We also keep track of whether the cache overflowed (ie, the transaction has * generated at least one subtransaction that didn't fit in the cache). * If none of the caches have overflowed, we can assume that an XID that's not * listed anywhere in the PGPROC array is not a running transaction. Else we * have to look at pg_subtrans. */ #define PGPROC_MAX_CACHED_SUBXIDS 64 /* XXX guessed-at value */ struct XidCache { TransactionId xids[PGPROC_MAX_CACHED_SUBXIDS]; }; /* Flags for PGXACT->vacuumFlags */ #define PROC_IS_AUTOVACUUM 0x01 /* is it an autovac worker? */ #define PROC_IN_VACUUM 0x02 /* currently running lazy vacuum */ #define PROC_IN_ANALYZE 0x04 /* currently running analyze */ #define PROC_VACUUM_FOR_WRAPAROUND 0x08 /* set by autovac only */ /* flags reset at EOXact */ #define PROC_VACUUM_STATE_MASK (0x0E) /* * We allow a small number of "weak" relation locks (AccesShareLock, * RowShareLock, RowExclusiveLock) to be recorded in the PGPROC structure * rather than the main lock table. This eases contention on the lock * manager LWLocks. See storage/lmgr/README for additional details. */ #define FP_LOCK_SLOTS_PER_BACKEND 16 /* * Each backend has a PGPROC struct in shared memory. There is also a list of * currently-unused PGPROC structs that will be reallocated to new backends. * * links: list link for any list the PGPROC is in. When waiting for a lock, * the PGPROC is linked into that lock's waitProcs queue. A recycled PGPROC * is linked into ProcGlobal's freeProcs list. * * Note: twophase.c also sets up a dummy PGPROC struct for each currently * prepared transaction. These PGPROCs appear in the ProcArray data structure * so that the prepared transactions appear to be still running and are * correctly shown as holding locks. A prepared transaction PGPROC can be * distinguished from a real one at need by the fact that it has pid == 0. * The semaphore and lock-activity fields in a prepared-xact PGPROC are unused, * but its myProcLocks[] lists are valid. */ struct PGPROC { /* proc->links MUST BE FIRST IN STRUCT (see ProcSleep,ProcWakeup,etc) */ SHM_QUEUE links; /* list link if process is in a list */ PGSemaphoreData sem; /* ONE semaphore to sleep on */ int waitStatus; /* STATUS_WAITING, STATUS_OK or STATUS_ERROR */ Latch procLatch; /* generic latch for process */ LocalTransactionId lxid; /* local id of top-level transaction currently * being executed by this proc, if running; * else InvalidLocalTransactionId */ int pid; /* Backend's process ID; 0 if prepared xact */ int pgprocno; /* These fields are zero while a backend is still starting up: */ BackendId backendId; /* This backend's backend ID (if assigned) */ Oid databaseId; /* OID of database this backend is using */ Oid roleId; /* OID of role using this backend */ /* * While in hot standby mode, shows that a conflict signal has been sent * for the current transaction. Set/cleared while holding ProcArrayLock, * though not required. Accessed without lock, if needed. */ bool recoveryConflictPending; /* Info about LWLock the process is currently waiting for, if any. */ bool lwWaiting; /* true if waiting for an LW lock */ uint8 lwWaitMode; /* lwlock mode being waited for */ struct PGPROC *lwWaitLink; /* next waiter for same LW lock */ /* Info about lock the process is currently waiting for, if any. */ /* waitLock and waitProcLock are NULL if not currently waiting. */ LOCK *waitLock; /* Lock object we're sleeping on ... */ PROCLOCK *waitProcLock; /* Per-holder info for awaited lock */ LOCKMODE waitLockMode; /* type of lock we're waiting for */ LOCKMASK heldLocks; /* bitmask for lock types already held on this * lock object by this backend */ /* * Info to allow us to wait for synchronous replication, if needed. * waitLSN is InvalidXLogRecPtr if not waiting; set only by user backend. * syncRepState must not be touched except by owning process or WALSender. * syncRepLinks used only while holding SyncRepLock. */ XLogRecPtr waitLSN; /* waiting for this LSN or higher */ int syncRepState; /* wait state for sync rep */ SHM_QUEUE syncRepLinks; /* list link if process is in syncrep queue */ /* * All PROCLOCK objects for locks held or awaited by this backend are * linked into one of these lists, according to the partition number of * their lock. */ SHM_QUEUE myProcLocks[NUM_LOCK_PARTITIONS]; struct XidCache subxids; /* cache for subtransaction XIDs */ /* Per-backend LWLock. Protects fields below. */ LWLockId backendLock; /* protects the fields below */ /* Lock manager data, recording fast-path locks taken by this backend. */ uint64 fpLockBits; /* lock modes held for each fast-path slot */ Oid fpRelId[FP_LOCK_SLOTS_PER_BACKEND]; /* slots for rel oids */ bool fpVXIDLock; /* are we holding a fast-path VXID lock? */ LocalTransactionId fpLocalTransactionId; /* lxid for fast-path VXID * lock */ }; /* NOTE: "typedef struct PGPROC PGPROC" appears in storage/lock.h. */ extern PGDLLIMPORT PGPROC *MyProc; extern PGDLLIMPORT struct PGXACT *MyPgXact; /* * Prior to PostgreSQL 9.2, the fields below were stored as part of the * PGPROC. However, benchmarking revealed that packing these particular * members into a separate array as tightly as possible sped up GetSnapshotData * considerably on systems with many CPU cores, by reducing the number of * cache lines needing to be fetched. Thus, think very carefully before adding * anything else here. */ typedef struct PGXACT { TransactionId xid; /* id of top-level transaction currently being * executed by this proc, if running and XID * is assigned; else InvalidTransactionId */ TransactionId xmin; /* minimal running XID as it was when we were * starting our xact, excluding LAZY VACUUM: * vacuum must not remove tuples deleted by * xid >= xmin ! */ uint8 vacuumFlags; /* vacuum-related flags, see above */ bool overflowed; bool inCommit; /* true if within commit critical section */ uint8 nxids; } PGXACT; /* * There is one ProcGlobal struct for the whole database cluster. */ typedef struct PROC_HDR { /* Array of PGPROC structures (not including dummies for prepared txns) */ PGPROC *allProcs; /* Array of PGXACT structures (not including dummies for prepared txns) */ PGXACT *allPgXact; /* Length of allProcs array */ uint32 allProcCount; /* Head of list of free PGPROC structures */ PGPROC *freeProcs; /* Head of list of autovacuum's free PGPROC structures */ PGPROC *autovacFreeProcs; /* WALWriter process's latch */ Latch *walwriterLatch; /* Checkpointer process's latch */ Latch *checkpointerLatch; /* Current shared estimate of appropriate spins_per_delay value */ int spins_per_delay; /* The proc of the Startup process, since not in ProcArray */ PGPROC *startupProc; int startupProcPid; /* Buffer id of the buffer that Startup process waits for pin on, or -1 */ int startupBufferPinWaitBufId; } PROC_HDR; extern PROC_HDR *ProcGlobal; extern PGPROC *PreparedXactProcs; /* * We set aside some extra PGPROC structures for auxiliary processes, * ie things that aren't full-fledged backends but need shmem access. * * Background writer, checkpointer and WAL writer run during normal operation. * Startup process and WAL receiver also consume 2 slots, but WAL writer is * launched only after startup has exited, so we only need 4 slots. */ #define NUM_AUXILIARY_PROCS 4 /* configurable options */ extern int DeadlockTimeout; extern int StatementTimeout; extern bool log_lock_waits; extern volatile bool cancel_from_timeout; /* * Function Prototypes */ extern int ProcGlobalSemas(void); extern Size ProcGlobalShmemSize(void); extern void InitProcGlobal(void); extern void InitProcess(void); extern void InitProcessPhase2(void); extern void InitAuxiliaryProcess(void); extern void PublishStartupProcessInformation(void); extern void SetStartupBufferPinWaitBufId(int bufid); extern int GetStartupBufferPinWaitBufId(void); extern bool HaveNFreeProcs(int n); extern void ProcReleaseLocks(bool isCommit); extern void ProcQueueInit(PROC_QUEUE *queue); extern int ProcSleep(LOCALLOCK *locallock, LockMethod lockMethodTable); extern PGPROC *ProcWakeup(PGPROC *proc, int waitStatus); extern void ProcLockWakeup(LockMethod lockMethodTable, LOCK *lock); extern bool IsWaitingForLock(void); extern void LockErrorCleanup(void); extern void ProcWaitForSignal(void); extern void ProcSendSignal(int pid); extern bool enable_sig_alarm(int delayms, bool is_statement_timeout); extern bool disable_sig_alarm(bool is_statement_timeout); extern void handle_sig_alarm(SIGNAL_ARGS); extern bool enable_standby_sig_alarm(TimestampTz now, TimestampTz fin_time, bool deadlock_only); extern bool disable_standby_sig_alarm(void); extern void handle_standby_sig_alarm(SIGNAL_ARGS); #endif /* PROC_H */ PKBiZ8  server/storage/pmsignal.hnu[/*------------------------------------------------------------------------- * * pmsignal.h * routines for signaling the postmaster from its child processes * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/pmsignal.h * *------------------------------------------------------------------------- */ #ifndef PMSIGNAL_H #define PMSIGNAL_H /* * Reasons for signaling the postmaster. We can cope with simultaneous * signals for different reasons. If the same reason is signaled multiple * times in quick succession, however, the postmaster is likely to observe * only one notification of it. This is okay for the present uses. */ typedef enum { PMSIGNAL_RECOVERY_STARTED, /* recovery has started */ PMSIGNAL_BEGIN_HOT_STANDBY, /* begin Hot Standby */ PMSIGNAL_WAKEN_ARCHIVER, /* send a NOTIFY signal to xlog archiver */ PMSIGNAL_ROTATE_LOGFILE, /* send SIGUSR1 to syslogger to rotate logfile */ PMSIGNAL_START_AUTOVAC_LAUNCHER, /* start an autovacuum launcher */ PMSIGNAL_START_AUTOVAC_WORKER, /* start an autovacuum worker */ PMSIGNAL_START_WALRECEIVER, /* start a walreceiver */ PMSIGNAL_ADVANCE_STATE_MACHINE, /* advance postmaster's state machine */ NUM_PMSIGNALS /* Must be last value of enum! */ } PMSignalReason; /* PMSignalData is an opaque struct, details known only within pmsignal.c */ typedef struct PMSignalData PMSignalData; /* * prototypes for functions in pmsignal.c */ extern Size PMSignalShmemSize(void); extern void PMSignalShmemInit(void); extern void SendPostmasterSignal(PMSignalReason reason); extern bool CheckPostmasterSignal(PMSignalReason reason); extern int AssignPostmasterChildSlot(void); extern bool ReleasePostmasterChildSlot(int slot); extern bool IsPostmasterChildWalSender(int slot); extern void MarkPostmasterChildActive(void); extern void MarkPostmasterChildInactive(void); extern void MarkPostmasterChildWalSender(void); extern bool PostmasterIsAlive(void); #endif /* PMSIGNAL_H */ PKBiZ9\server/storage/pg_shmem.hnu[/*------------------------------------------------------------------------- * * pg_shmem.h * Platform-independent API for shared memory support. * * Every port is expected to support shared memory with approximately * SysV-ish semantics; in particular, a memory block is not anonymous * but has an ID, and we must be able to tell whether there are any * remaining processes attached to a block of a specified ID. * * To simplify life for the SysV implementation, the ID is assumed to * consist of two unsigned long values (these are key and ID in SysV * terms). Other platforms may ignore the second value if they need * only one ID number. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/pg_shmem.h * *------------------------------------------------------------------------- */ #ifndef PG_SHMEM_H #define PG_SHMEM_H typedef struct PGShmemHeader /* standard header for all Postgres shmem */ { int32 magic; /* magic # to identify Postgres segments */ #define PGShmemMagic 679834894 pid_t creatorPID; /* PID of creating process */ Size totalsize; /* total size of segment */ Size freeoffset; /* offset to first free space */ void *index; /* pointer to ShmemIndex table */ #ifndef WIN32 /* Windows doesn't have useful inode#s */ dev_t device; /* device data directory is on */ ino_t inode; /* inode number of data directory */ #endif } PGShmemHeader; #ifdef EXEC_BACKEND #ifndef WIN32 extern unsigned long UsedShmemSegID; #else extern HANDLE UsedShmemSegID; #endif extern void *UsedShmemSegAddr; extern void PGSharedMemoryReAttach(void); extern void PGSharedMemoryNoReAttach(void); #endif extern PGShmemHeader *PGSharedMemoryCreate(Size size, bool makePrivate, int port); extern bool PGSharedMemoryIsInUse(unsigned long id1, unsigned long id2); extern void PGSharedMemoryDetach(void); #endif /* PG_SHMEM_H */ PKBiZv\server/storage/procsignal.hnu[/*------------------------------------------------------------------------- * * procsignal.h * Routines for interprocess signalling * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/procsignal.h * *------------------------------------------------------------------------- */ #ifndef PROCSIGNAL_H #define PROCSIGNAL_H #include "storage/backendid.h" /* * Reasons for signalling a Postgres child process (a backend or an auxiliary * process, like checkpointer). We can cope with concurrent signals for different * reasons. However, if the same reason is signaled multiple times in quick * succession, the process is likely to observe only one notification of it. * This is okay for the present uses. * * Also, because of race conditions, it's important that all the signals be * defined so that no harm is done if a process mistakenly receives one. */ typedef enum { PROCSIG_CATCHUP_INTERRUPT, /* sinval catchup interrupt */ PROCSIG_NOTIFY_INTERRUPT, /* listen/notify interrupt */ /* Recovery conflict reasons */ PROCSIG_RECOVERY_CONFLICT_DATABASE, PROCSIG_RECOVERY_CONFLICT_TABLESPACE, PROCSIG_RECOVERY_CONFLICT_LOCK, PROCSIG_RECOVERY_CONFLICT_SNAPSHOT, PROCSIG_RECOVERY_CONFLICT_BUFFERPIN, PROCSIG_RECOVERY_CONFLICT_STARTUP_DEADLOCK, NUM_PROCSIGNALS /* Must be last! */ } ProcSignalReason; /* * prototypes for functions in procsignal.c */ extern Size ProcSignalShmemSize(void); extern void ProcSignalShmemInit(void); extern void ProcSignalInit(int pss_idx); extern int SendProcSignal(pid_t pid, ProcSignalReason reason, BackendId backendId); extern void procsignal_sigusr1_handler(SIGNAL_ARGS); #endif /* PROCSIGNAL_H */ PKBiZ0? ? server/storage/predicate.hnu[/*------------------------------------------------------------------------- * * predicate.h * POSTGRES public predicate locking definitions. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/predicate.h * *------------------------------------------------------------------------- */ #ifndef PREDICATE_H #define PREDICATE_H #include "utils/relcache.h" #include "utils/snapshot.h" /* * GUC variables */ extern int max_predicate_locks_per_xact; /* Number of SLRU buffers to use for predicate locking */ #define NUM_OLDSERXID_BUFFERS 16 /* * function prototypes */ /* housekeeping for shared memory predicate lock structures */ extern void InitPredicateLocks(void); extern Size PredicateLockShmemSize(void); extern void CheckPointPredicate(void); /* predicate lock reporting */ extern bool PageIsPredicateLocked(Relation relation, BlockNumber blkno); /* predicate lock maintenance */ extern Snapshot GetSerializableTransactionSnapshot(Snapshot snapshot); extern void SetSerializableTransactionSnapshot(Snapshot snapshot, TransactionId sourcexid); extern void RegisterPredicateLockingXid(TransactionId xid); extern void PredicateLockRelation(Relation relation, Snapshot snapshot); extern void PredicateLockPage(Relation relation, BlockNumber blkno, Snapshot snapshot); extern void PredicateLockTuple(Relation relation, HeapTuple tuple, Snapshot snapshot); extern void PredicateLockPageSplit(Relation relation, BlockNumber oldblkno, BlockNumber newblkno); extern void PredicateLockPageCombine(Relation relation, BlockNumber oldblkno, BlockNumber newblkno); extern void TransferPredicateLocksToHeapRelation(Relation relation); extern void ReleasePredicateLocks(bool isCommit); /* conflict detection (may also trigger rollback) */ extern void CheckForSerializableConflictOut(bool valid, Relation relation, HeapTuple tuple, Buffer buffer, Snapshot snapshot); extern void CheckForSerializableConflictIn(Relation relation, HeapTuple tuple, Buffer buffer); extern void CheckTableForSerializableConflictIn(Relation relation); /* final rollback checking */ extern void PreCommit_CheckForSerializationFailure(void); /* two-phase commit support */ extern void AtPrepare_PredicateLocks(void); extern void PostPrepare_PredicateLocks(TransactionId xid); extern void PredicateLockTwoPhaseFinish(TransactionId xid, bool isCommit); extern void predicatelock_twophase_recover(TransactionId xid, uint16 info, void *recdata, uint32 len); #endif /* PREDICATE_H */ PKBiZp) ) server/storage/ipc.hnu[/*------------------------------------------------------------------------- * * ipc.h * POSTGRES inter-process communication definitions. * * This file is misnamed, as it no longer has much of anything directly * to do with IPC. The functionality here is concerned with managing * exit-time cleanup for either a postmaster or a backend. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/ipc.h * *------------------------------------------------------------------------- */ #ifndef IPC_H #define IPC_H typedef void (*pg_on_exit_callback) (int code, Datum arg); typedef void (*shmem_startup_hook_type) (void); /*---------- * API for handling cleanup that must occur during either ereport(ERROR) * or ereport(FATAL) exits from a block of code. (Typical examples are * undoing transient changes to shared-memory state.) * * PG_ENSURE_ERROR_CLEANUP(cleanup_function, arg); * { * ... code that might throw ereport(ERROR) or ereport(FATAL) ... * } * PG_END_ENSURE_ERROR_CLEANUP(cleanup_function, arg); * * where the cleanup code is in a function declared per pg_on_exit_callback. * The Datum value "arg" can carry any information the cleanup function * needs. * * This construct ensures that cleanup_function() will be called during * either ERROR or FATAL exits. It will not be called on successful * exit from the controlled code. (If you want it to happen then too, * call the function yourself from just after the construct.) * * Note: the macro arguments are multiply evaluated, so avoid side-effects. *---------- */ #define PG_ENSURE_ERROR_CLEANUP(cleanup_function, arg) \ do { \ on_shmem_exit(cleanup_function, arg); \ PG_TRY() #define PG_END_ENSURE_ERROR_CLEANUP(cleanup_function, arg) \ cancel_shmem_exit(cleanup_function, arg); \ PG_CATCH(); \ { \ cancel_shmem_exit(cleanup_function, arg); \ cleanup_function (0, arg); \ PG_RE_THROW(); \ } \ PG_END_TRY(); \ } while (0) /* ipc.c */ extern bool proc_exit_inprogress; extern void proc_exit(int code); extern void shmem_exit(int code); extern void on_proc_exit(pg_on_exit_callback function, Datum arg); extern void on_shmem_exit(pg_on_exit_callback function, Datum arg); extern void cancel_shmem_exit(pg_on_exit_callback function, Datum arg); extern void on_exit_reset(void); /* ipci.c */ extern PGDLLIMPORT shmem_startup_hook_type shmem_startup_hook; extern void CreateSharedMemoryAndSemaphores(bool makePrivate, int port); #endif /* IPC_H */ PKBiZJdK K server/windowapi.hnu[/*------------------------------------------------------------------------- * * windowapi.h * API for window functions to extract data from their window * * A window function does not receive its arguments in the normal way * (and therefore the concept of strictness is irrelevant). Instead it * receives a "WindowObject", which it can fetch with PG_WINDOW_OBJECT() * (note V1 calling convention must be used). Correct call context can * be tested with WindowObjectIsValid(). Although argument values are * not passed, the call is correctly set up so that PG_NARGS() can be * used and argument type information can be obtained with * get_fn_expr_argtype(), get_fn_expr_arg_stable(), etc. * * Operations on the WindowObject allow the window function to find out * the current row number, total number of rows in the partition, etc * and to evaluate its argument expression(s) at various rows in the * window partition. See the header comments for each WindowObject API * function in nodeWindowAgg.c for details. * * * Portions Copyright (c) 2000-2012, PostgreSQL Global Development Group * * src/include/windowapi.h * *------------------------------------------------------------------------- */ #ifndef WINDOWAPI_H #define WINDOWAPI_H /* values of "seektype" */ #define WINDOW_SEEK_CURRENT 0 #define WINDOW_SEEK_HEAD 1 #define WINDOW_SEEK_TAIL 2 /* this struct is private in nodeWindowAgg.c */ typedef struct WindowObjectData *WindowObject; #define PG_WINDOW_OBJECT() ((WindowObject) fcinfo->context) #define WindowObjectIsValid(winobj) \ ((winobj) != NULL && IsA(winobj, WindowObjectData)) extern void *WinGetPartitionLocalMemory(WindowObject winobj, Size sz); extern int64 WinGetCurrentPosition(WindowObject winobj); extern int64 WinGetPartitionRowCount(WindowObject winobj); extern void WinSetMarkPosition(WindowObject winobj, int64 markpos); extern bool WinRowsArePeers(WindowObject winobj, int64 pos1, int64 pos2); extern Datum WinGetFuncArgInPartition(WindowObject winobj, int argno, int relpos, int seektype, bool set_mark, bool *isnull, bool *isout); extern Datum WinGetFuncArgInFrame(WindowObject winobj, int argno, int relpos, int seektype, bool set_mark, bool *isnull, bool *isout); extern Datum WinGetFuncArgCurrent(WindowObject winobj, int argno, bool *isnull); #endif /* WINDOWAPI_H */ PKBiZ%@server/parser/keywords.hnu[/*------------------------------------------------------------------------- * * keywords.h * lexical token lookup for key words in PostgreSQL * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/parser/keywords.h * *------------------------------------------------------------------------- */ #ifndef KEYWORDS_H #define KEYWORDS_H /* Keyword categories --- should match lists in gram.y */ #define UNRESERVED_KEYWORD 0 #define COL_NAME_KEYWORD 1 #define TYPE_FUNC_NAME_KEYWORD 2 #define RESERVED_KEYWORD 3 typedef struct ScanKeyword { const char *name; /* in lower case */ int16 value; /* grammar's token code */ int16 category; /* see codes above */ } ScanKeyword; extern PGDLLIMPORT const ScanKeyword ScanKeywords[]; extern PGDLLIMPORT const int NumScanKeywords; extern const ScanKeyword *ScanKeywordLookup(const char *text, const ScanKeyword *keywords, int num_keywords); #endif /* KEYWORDS_H */ PKBiZ] Q Qserver/parser/kwlist.hnu[/*------------------------------------------------------------------------- * * kwlist.h * * The keyword list is kept in its own source file for possible use by * automatic tools. The exact representation of a keyword is determined * by the PG_KEYWORD macro, which is not defined in this file; it can * be defined by the caller for special purposes. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION * src/include/parser/kwlist.h * *------------------------------------------------------------------------- */ /* there is deliberately not an #ifndef KWLIST_H here */ /* * List of keyword (name, token-value, category) entries. * * !!WARNING!!: This list must be sorted by ASCII name, because binary * search is used to locate entries. */ /* name, value, category */ PG_KEYWORD("abort", ABORT_P, UNRESERVED_KEYWORD) PG_KEYWORD("absolute", ABSOLUTE_P, UNRESERVED_KEYWORD) PG_KEYWORD("access", ACCESS, UNRESERVED_KEYWORD) PG_KEYWORD("action", ACTION, UNRESERVED_KEYWORD) PG_KEYWORD("add", ADD_P, UNRESERVED_KEYWORD) PG_KEYWORD("admin", ADMIN, UNRESERVED_KEYWORD) PG_KEYWORD("after", AFTER, UNRESERVED_KEYWORD) PG_KEYWORD("aggregate", AGGREGATE, UNRESERVED_KEYWORD) PG_KEYWORD("all", ALL, RESERVED_KEYWORD) PG_KEYWORD("also", ALSO, UNRESERVED_KEYWORD) PG_KEYWORD("alter", ALTER, UNRESERVED_KEYWORD) PG_KEYWORD("always", ALWAYS, UNRESERVED_KEYWORD) PG_KEYWORD("analyse", ANALYSE, RESERVED_KEYWORD) /* British spelling */ PG_KEYWORD("analyze", ANALYZE, RESERVED_KEYWORD) PG_KEYWORD("and", AND, RESERVED_KEYWORD) PG_KEYWORD("any", ANY, RESERVED_KEYWORD) PG_KEYWORD("array", ARRAY, RESERVED_KEYWORD) PG_KEYWORD("as", AS, RESERVED_KEYWORD) PG_KEYWORD("asc", ASC, RESERVED_KEYWORD) PG_KEYWORD("assertion", ASSERTION, UNRESERVED_KEYWORD) PG_KEYWORD("assignment", ASSIGNMENT, UNRESERVED_KEYWORD) PG_KEYWORD("asymmetric", ASYMMETRIC, RESERVED_KEYWORD) PG_KEYWORD("at", AT, UNRESERVED_KEYWORD) PG_KEYWORD("attribute", ATTRIBUTE, UNRESERVED_KEYWORD) PG_KEYWORD("authorization", AUTHORIZATION, TYPE_FUNC_NAME_KEYWORD) PG_KEYWORD("backward", BACKWARD, UNRESERVED_KEYWORD) PG_KEYWORD("before", BEFORE, UNRESERVED_KEYWORD) PG_KEYWORD("begin", BEGIN_P, UNRESERVED_KEYWORD) PG_KEYWORD("between", BETWEEN, COL_NAME_KEYWORD) PG_KEYWORD("bigint", BIGINT, COL_NAME_KEYWORD) PG_KEYWORD("binary", BINARY, TYPE_FUNC_NAME_KEYWORD) PG_KEYWORD("bit", BIT, COL_NAME_KEYWORD) PG_KEYWORD("boolean", BOOLEAN_P, COL_NAME_KEYWORD) PG_KEYWORD("both", BOTH, RESERVED_KEYWORD) PG_KEYWORD("by", BY, UNRESERVED_KEYWORD) PG_KEYWORD("cache", CACHE, UNRESERVED_KEYWORD) PG_KEYWORD("called", CALLED, UNRESERVED_KEYWORD) PG_KEYWORD("cascade", CASCADE, UNRESERVED_KEYWORD) PG_KEYWORD("cascaded", CASCADED, UNRESERVED_KEYWORD) PG_KEYWORD("case", CASE, RESERVED_KEYWORD) PG_KEYWORD("cast", CAST, RESERVED_KEYWORD) PG_KEYWORD("catalog", CATALOG_P, UNRESERVED_KEYWORD) PG_KEYWORD("chain", CHAIN, UNRESERVED_KEYWORD) PG_KEYWORD("char", CHAR_P, COL_NAME_KEYWORD) PG_KEYWORD("character", CHARACTER, COL_NAME_KEYWORD) PG_KEYWORD("characteristics", CHARACTERISTICS, UNRESERVED_KEYWORD) PG_KEYWORD("check", CHECK, RESERVED_KEYWORD) PG_KEYWORD("checkpoint", CHECKPOINT, UNRESERVED_KEYWORD) PG_KEYWORD("class", CLASS, UNRESERVED_KEYWORD) PG_KEYWORD("close", CLOSE, UNRESERVED_KEYWORD) PG_KEYWORD("cluster", CLUSTER, UNRESERVED_KEYWORD) PG_KEYWORD("coalesce", COALESCE, COL_NAME_KEYWORD) PG_KEYWORD("collate", COLLATE, RESERVED_KEYWORD) PG_KEYWORD("collation", COLLATION, TYPE_FUNC_NAME_KEYWORD) PG_KEYWORD("column", COLUMN, RESERVED_KEYWORD) PG_KEYWORD("comment", COMMENT, UNRESERVED_KEYWORD) PG_KEYWORD("comments", COMMENTS, UNRESERVED_KEYWORD) PG_KEYWORD("commit", COMMIT, UNRESERVED_KEYWORD) PG_KEYWORD("committed", COMMITTED, UNRESERVED_KEYWORD) PG_KEYWORD("concurrently", CONCURRENTLY, TYPE_FUNC_NAME_KEYWORD) PG_KEYWORD("configuration", CONFIGURATION, UNRESERVED_KEYWORD) PG_KEYWORD("connection", CONNECTION, UNRESERVED_KEYWORD) PG_KEYWORD("constraint", CONSTRAINT, RESERVED_KEYWORD) PG_KEYWORD("constraints", CONSTRAINTS, UNRESERVED_KEYWORD) PG_KEYWORD("content", CONTENT_P, UNRESERVED_KEYWORD) PG_KEYWORD("continue", CONTINUE_P, UNRESERVED_KEYWORD) PG_KEYWORD("conversion", CONVERSION_P, UNRESERVED_KEYWORD) PG_KEYWORD("copy", COPY, UNRESERVED_KEYWORD) PG_KEYWORD("cost", COST, UNRESERVED_KEYWORD) PG_KEYWORD("create", CREATE, RESERVED_KEYWORD) PG_KEYWORD("cross", CROSS, TYPE_FUNC_NAME_KEYWORD) PG_KEYWORD("csv", CSV, UNRESERVED_KEYWORD) PG_KEYWORD("current", CURRENT_P, UNRESERVED_KEYWORD) PG_KEYWORD("current_catalog", CURRENT_CATALOG, RESERVED_KEYWORD) PG_KEYWORD("current_date", CURRENT_DATE, RESERVED_KEYWORD) PG_KEYWORD("current_role", CURRENT_ROLE, RESERVED_KEYWORD) PG_KEYWORD("current_schema", CURRENT_SCHEMA, TYPE_FUNC_NAME_KEYWORD) PG_KEYWORD("current_time", CURRENT_TIME, RESERVED_KEYWORD) PG_KEYWORD("current_timestamp", CURRENT_TIMESTAMP, RESERVED_KEYWORD) PG_KEYWORD("current_user", CURRENT_USER, RESERVED_KEYWORD) PG_KEYWORD("cursor", CURSOR, UNRESERVED_KEYWORD) PG_KEYWORD("cycle", CYCLE, UNRESERVED_KEYWORD) PG_KEYWORD("data", DATA_P, UNRESERVED_KEYWORD) PG_KEYWORD("database", DATABASE, UNRESERVED_KEYWORD) PG_KEYWORD("day", DAY_P, UNRESERVED_KEYWORD) PG_KEYWORD("deallocate", DEALLOCATE, UNRESERVED_KEYWORD) PG_KEYWORD("dec", DEC, COL_NAME_KEYWORD) PG_KEYWORD("decimal", DECIMAL_P, COL_NAME_KEYWORD) PG_KEYWORD("declare", DECLARE, UNRESERVED_KEYWORD) PG_KEYWORD("default", DEFAULT, RESERVED_KEYWORD) PG_KEYWORD("defaults", DEFAULTS, UNRESERVED_KEYWORD) PG_KEYWORD("deferrable", DEFERRABLE, RESERVED_KEYWORD) PG_KEYWORD("deferred", DEFERRED, UNRESERVED_KEYWORD) PG_KEYWORD("definer", DEFINER, UNRESERVED_KEYWORD) PG_KEYWORD("delete", DELETE_P, UNRESERVED_KEYWORD) PG_KEYWORD("delimiter", DELIMITER, UNRESERVED_KEYWORD) PG_KEYWORD("delimiters", DELIMITERS, UNRESERVED_KEYWORD) PG_KEYWORD("desc", DESC, RESERVED_KEYWORD) PG_KEYWORD("dictionary", DICTIONARY, UNRESERVED_KEYWORD) PG_KEYWORD("disable", DISABLE_P, UNRESERVED_KEYWORD) PG_KEYWORD("discard", DISCARD, UNRESERVED_KEYWORD) PG_KEYWORD("distinct", DISTINCT, RESERVED_KEYWORD) PG_KEYWORD("do", DO, RESERVED_KEYWORD) PG_KEYWORD("document", DOCUMENT_P, UNRESERVED_KEYWORD) PG_KEYWORD("domain", DOMAIN_P, UNRESERVED_KEYWORD) PG_KEYWORD("double", DOUBLE_P, UNRESERVED_KEYWORD) PG_KEYWORD("drop", DROP, UNRESERVED_KEYWORD) PG_KEYWORD("each", EACH, UNRESERVED_KEYWORD) PG_KEYWORD("else", ELSE, RESERVED_KEYWORD) PG_KEYWORD("enable", ENABLE_P, UNRESERVED_KEYWORD) PG_KEYWORD("encoding", ENCODING, UNRESERVED_KEYWORD) PG_KEYWORD("encrypted", ENCRYPTED, UNRESERVED_KEYWORD) PG_KEYWORD("end", END_P, RESERVED_KEYWORD) PG_KEYWORD("enum", ENUM_P, UNRESERVED_KEYWORD) PG_KEYWORD("escape", ESCAPE, UNRESERVED_KEYWORD) PG_KEYWORD("except", EXCEPT, RESERVED_KEYWORD) PG_KEYWORD("exclude", EXCLUDE, UNRESERVED_KEYWORD) PG_KEYWORD("excluding", EXCLUDING, UNRESERVED_KEYWORD) PG_KEYWORD("exclusive", EXCLUSIVE, UNRESERVED_KEYWORD) PG_KEYWORD("execute", EXECUTE, UNRESERVED_KEYWORD) PG_KEYWORD("exists", EXISTS, COL_NAME_KEYWORD) PG_KEYWORD("explain", EXPLAIN, UNRESERVED_KEYWORD) PG_KEYWORD("extension", EXTENSION, UNRESERVED_KEYWORD) PG_KEYWORD("external", EXTERNAL, UNRESERVED_KEYWORD) PG_KEYWORD("extract", EXTRACT, COL_NAME_KEYWORD) PG_KEYWORD("false", FALSE_P, RESERVED_KEYWORD) PG_KEYWORD("family", FAMILY, UNRESERVED_KEYWORD) PG_KEYWORD("fetch", FETCH, RESERVED_KEYWORD) PG_KEYWORD("first", FIRST_P, UNRESERVED_KEYWORD) PG_KEYWORD("float", FLOAT_P, COL_NAME_KEYWORD) PG_KEYWORD("following", FOLLOWING, UNRESERVED_KEYWORD) PG_KEYWORD("for", FOR, RESERVED_KEYWORD) PG_KEYWORD("force", FORCE, UNRESERVED_KEYWORD) PG_KEYWORD("foreign", FOREIGN, RESERVED_KEYWORD) PG_KEYWORD("forward", FORWARD, UNRESERVED_KEYWORD) PG_KEYWORD("freeze", FREEZE, TYPE_FUNC_NAME_KEYWORD) PG_KEYWORD("from", FROM, RESERVED_KEYWORD) PG_KEYWORD("full", FULL, TYPE_FUNC_NAME_KEYWORD) PG_KEYWORD("function", FUNCTION, UNRESERVED_KEYWORD) PG_KEYWORD("functions", FUNCTIONS, UNRESERVED_KEYWORD) PG_KEYWORD("global", GLOBAL, UNRESERVED_KEYWORD) PG_KEYWORD("grant", GRANT, RESERVED_KEYWORD) PG_KEYWORD("granted", GRANTED, UNRESERVED_KEYWORD) PG_KEYWORD("greatest", GREATEST, COL_NAME_KEYWORD) PG_KEYWORD("group", GROUP_P, RESERVED_KEYWORD) PG_KEYWORD("handler", HANDLER, UNRESERVED_KEYWORD) PG_KEYWORD("having", HAVING, RESERVED_KEYWORD) PG_KEYWORD("header", HEADER_P, UNRESERVED_KEYWORD) PG_KEYWORD("hold", HOLD, UNRESERVED_KEYWORD) PG_KEYWORD("hour", HOUR_P, UNRESERVED_KEYWORD) PG_KEYWORD("identity", IDENTITY_P, UNRESERVED_KEYWORD) PG_KEYWORD("if", IF_P, UNRESERVED_KEYWORD) PG_KEYWORD("ilike", ILIKE, TYPE_FUNC_NAME_KEYWORD) PG_KEYWORD("immediate", IMMEDIATE, UNRESERVED_KEYWORD) PG_KEYWORD("immutable", IMMUTABLE, UNRESERVED_KEYWORD) PG_KEYWORD("implicit", IMPLICIT_P, UNRESERVED_KEYWORD) PG_KEYWORD("in", IN_P, RESERVED_KEYWORD) PG_KEYWORD("including", INCLUDING, UNRESERVED_KEYWORD) PG_KEYWORD("increment", INCREMENT, UNRESERVED_KEYWORD) PG_KEYWORD("index", INDEX, UNRESERVED_KEYWORD) PG_KEYWORD("indexes", INDEXES, UNRESERVED_KEYWORD) PG_KEYWORD("inherit", INHERIT, UNRESERVED_KEYWORD) PG_KEYWORD("inherits", INHERITS, UNRESERVED_KEYWORD) PG_KEYWORD("initially", INITIALLY, RESERVED_KEYWORD) PG_KEYWORD("inline", INLINE_P, UNRESERVED_KEYWORD) PG_KEYWORD("inner", INNER_P, TYPE_FUNC_NAME_KEYWORD) PG_KEYWORD("inout", INOUT, COL_NAME_KEYWORD) PG_KEYWORD("input", INPUT_P, UNRESERVED_KEYWORD) PG_KEYWORD("insensitive", INSENSITIVE, UNRESERVED_KEYWORD) PG_KEYWORD("insert", INSERT, UNRESERVED_KEYWORD) PG_KEYWORD("instead", INSTEAD, UNRESERVED_KEYWORD) PG_KEYWORD("int", INT_P, COL_NAME_KEYWORD) PG_KEYWORD("integer", INTEGER, COL_NAME_KEYWORD) PG_KEYWORD("intersect", INTERSECT, RESERVED_KEYWORD) PG_KEYWORD("interval", INTERVAL, COL_NAME_KEYWORD) PG_KEYWORD("into", INTO, RESERVED_KEYWORD) PG_KEYWORD("invoker", INVOKER, UNRESERVED_KEYWORD) PG_KEYWORD("is", IS, TYPE_FUNC_NAME_KEYWORD) PG_KEYWORD("isnull", ISNULL, TYPE_FUNC_NAME_KEYWORD) PG_KEYWORD("isolation", ISOLATION, UNRESERVED_KEYWORD) PG_KEYWORD("join", JOIN, TYPE_FUNC_NAME_KEYWORD) PG_KEYWORD("key", KEY, UNRESERVED_KEYWORD) PG_KEYWORD("label", LABEL, UNRESERVED_KEYWORD) PG_KEYWORD("language", LANGUAGE, UNRESERVED_KEYWORD) PG_KEYWORD("large", LARGE_P, UNRESERVED_KEYWORD) PG_KEYWORD("last", LAST_P, UNRESERVED_KEYWORD) PG_KEYWORD("lc_collate", LC_COLLATE_P, UNRESERVED_KEYWORD) PG_KEYWORD("lc_ctype", LC_CTYPE_P, UNRESERVED_KEYWORD) PG_KEYWORD("leading", LEADING, RESERVED_KEYWORD) PG_KEYWORD("leakproof", LEAKPROOF, UNRESERVED_KEYWORD) PG_KEYWORD("least", LEAST, COL_NAME_KEYWORD) PG_KEYWORD("left", LEFT, TYPE_FUNC_NAME_KEYWORD) PG_KEYWORD("level", LEVEL, UNRESERVED_KEYWORD) PG_KEYWORD("like", LIKE, TYPE_FUNC_NAME_KEYWORD) PG_KEYWORD("limit", LIMIT, RESERVED_KEYWORD) PG_KEYWORD("listen", LISTEN, UNRESERVED_KEYWORD) PG_KEYWORD("load", LOAD, UNRESERVED_KEYWORD) PG_KEYWORD("local", LOCAL, UNRESERVED_KEYWORD) PG_KEYWORD("localtime", LOCALTIME, RESERVED_KEYWORD) PG_KEYWORD("localtimestamp", LOCALTIMESTAMP, RESERVED_KEYWORD) PG_KEYWORD("location", LOCATION, UNRESERVED_KEYWORD) PG_KEYWORD("lock", LOCK_P, UNRESERVED_KEYWORD) PG_KEYWORD("mapping", MAPPING, UNRESERVED_KEYWORD) PG_KEYWORD("match", MATCH, UNRESERVED_KEYWORD) PG_KEYWORD("maxvalue", MAXVALUE, UNRESERVED_KEYWORD) PG_KEYWORD("minute", MINUTE_P, UNRESERVED_KEYWORD) PG_KEYWORD("minvalue", MINVALUE, UNRESERVED_KEYWORD) PG_KEYWORD("mode", MODE, UNRESERVED_KEYWORD) PG_KEYWORD("month", MONTH_P, UNRESERVED_KEYWORD) PG_KEYWORD("move", MOVE, UNRESERVED_KEYWORD) PG_KEYWORD("name", NAME_P, UNRESERVED_KEYWORD) PG_KEYWORD("names", NAMES, UNRESERVED_KEYWORD) PG_KEYWORD("national", NATIONAL, COL_NAME_KEYWORD) PG_KEYWORD("natural", NATURAL, TYPE_FUNC_NAME_KEYWORD) PG_KEYWORD("nchar", NCHAR, COL_NAME_KEYWORD) PG_KEYWORD("next", NEXT, UNRESERVED_KEYWORD) PG_KEYWORD("no", NO, UNRESERVED_KEYWORD) PG_KEYWORD("none", NONE, COL_NAME_KEYWORD) PG_KEYWORD("not", NOT, RESERVED_KEYWORD) PG_KEYWORD("nothing", NOTHING, UNRESERVED_KEYWORD) PG_KEYWORD("notify", NOTIFY, UNRESERVED_KEYWORD) PG_KEYWORD("notnull", NOTNULL, TYPE_FUNC_NAME_KEYWORD) PG_KEYWORD("nowait", NOWAIT, UNRESERVED_KEYWORD) PG_KEYWORD("null", NULL_P, RESERVED_KEYWORD) PG_KEYWORD("nullif", NULLIF, COL_NAME_KEYWORD) PG_KEYWORD("nulls", NULLS_P, UNRESERVED_KEYWORD) PG_KEYWORD("numeric", NUMERIC, COL_NAME_KEYWORD) PG_KEYWORD("object", OBJECT_P, UNRESERVED_KEYWORD) PG_KEYWORD("of", OF, UNRESERVED_KEYWORD) PG_KEYWORD("off", OFF, UNRESERVED_KEYWORD) PG_KEYWORD("offset", OFFSET, RESERVED_KEYWORD) PG_KEYWORD("oids", OIDS, UNRESERVED_KEYWORD) PG_KEYWORD("on", ON, RESERVED_KEYWORD) PG_KEYWORD("only", ONLY, RESERVED_KEYWORD) PG_KEYWORD("operator", OPERATOR, UNRESERVED_KEYWORD) PG_KEYWORD("option", OPTION, UNRESERVED_KEYWORD) PG_KEYWORD("options", OPTIONS, UNRESERVED_KEYWORD) PG_KEYWORD("or", OR, RESERVED_KEYWORD) PG_KEYWORD("order", ORDER, RESERVED_KEYWORD) PG_KEYWORD("out", OUT_P, COL_NAME_KEYWORD) PG_KEYWORD("outer", OUTER_P, TYPE_FUNC_NAME_KEYWORD) PG_KEYWORD("over", OVER, TYPE_FUNC_NAME_KEYWORD) PG_KEYWORD("overlaps", OVERLAPS, TYPE_FUNC_NAME_KEYWORD) PG_KEYWORD("overlay", OVERLAY, COL_NAME_KEYWORD) PG_KEYWORD("owned", OWNED, UNRESERVED_KEYWORD) PG_KEYWORD("owner", OWNER, UNRESERVED_KEYWORD) PG_KEYWORD("parser", PARSER, UNRESERVED_KEYWORD) PG_KEYWORD("partial", PARTIAL, UNRESERVED_KEYWORD) PG_KEYWORD("partition", PARTITION, UNRESERVED_KEYWORD) PG_KEYWORD("passing", PASSING, UNRESERVED_KEYWORD) PG_KEYWORD("password", PASSWORD, UNRESERVED_KEYWORD) PG_KEYWORD("placing", PLACING, RESERVED_KEYWORD) PG_KEYWORD("plans", PLANS, UNRESERVED_KEYWORD) PG_KEYWORD("position", POSITION, COL_NAME_KEYWORD) PG_KEYWORD("preceding", PRECEDING, UNRESERVED_KEYWORD) PG_KEYWORD("precision", PRECISION, COL_NAME_KEYWORD) PG_KEYWORD("prepare", PREPARE, UNRESERVED_KEYWORD) PG_KEYWORD("prepared", PREPARED, UNRESERVED_KEYWORD) PG_KEYWORD("preserve", PRESERVE, UNRESERVED_KEYWORD) PG_KEYWORD("primary", PRIMARY, RESERVED_KEYWORD) PG_KEYWORD("prior", PRIOR, UNRESERVED_KEYWORD) PG_KEYWORD("privileges", PRIVILEGES, UNRESERVED_KEYWORD) PG_KEYWORD("procedural", PROCEDURAL, UNRESERVED_KEYWORD) PG_KEYWORD("procedure", PROCEDURE, UNRESERVED_KEYWORD) PG_KEYWORD("quote", QUOTE, UNRESERVED_KEYWORD) PG_KEYWORD("range", RANGE, UNRESERVED_KEYWORD) PG_KEYWORD("read", READ, UNRESERVED_KEYWORD) PG_KEYWORD("real", REAL, COL_NAME_KEYWORD) PG_KEYWORD("reassign", REASSIGN, UNRESERVED_KEYWORD) PG_KEYWORD("recheck", RECHECK, UNRESERVED_KEYWORD) PG_KEYWORD("recursive", RECURSIVE, UNRESERVED_KEYWORD) PG_KEYWORD("ref", REF, UNRESERVED_KEYWORD) PG_KEYWORD("references", REFERENCES, RESERVED_KEYWORD) PG_KEYWORD("reindex", REINDEX, UNRESERVED_KEYWORD) PG_KEYWORD("relative", RELATIVE_P, UNRESERVED_KEYWORD) PG_KEYWORD("release", RELEASE, UNRESERVED_KEYWORD) PG_KEYWORD("rename", RENAME, UNRESERVED_KEYWORD) PG_KEYWORD("repeatable", REPEATABLE, UNRESERVED_KEYWORD) PG_KEYWORD("replace", REPLACE, UNRESERVED_KEYWORD) PG_KEYWORD("replica", REPLICA, UNRESERVED_KEYWORD) PG_KEYWORD("reset", RESET, UNRESERVED_KEYWORD) PG_KEYWORD("restart", RESTART, UNRESERVED_KEYWORD) PG_KEYWORD("restrict", RESTRICT, UNRESERVED_KEYWORD) PG_KEYWORD("returning", RETURNING, RESERVED_KEYWORD) PG_KEYWORD("returns", RETURNS, UNRESERVED_KEYWORD) PG_KEYWORD("revoke", REVOKE, UNRESERVED_KEYWORD) PG_KEYWORD("right", RIGHT, TYPE_FUNC_NAME_KEYWORD) PG_KEYWORD("role", ROLE, UNRESERVED_KEYWORD) PG_KEYWORD("rollback", ROLLBACK, UNRESERVED_KEYWORD) PG_KEYWORD("row", ROW, COL_NAME_KEYWORD) PG_KEYWORD("rows", ROWS, UNRESERVED_KEYWORD) PG_KEYWORD("rule", RULE, UNRESERVED_KEYWORD) PG_KEYWORD("savepoint", SAVEPOINT, UNRESERVED_KEYWORD) PG_KEYWORD("schema", SCHEMA, UNRESERVED_KEYWORD) PG_KEYWORD("scroll", SCROLL, UNRESERVED_KEYWORD) PG_KEYWORD("search", SEARCH, UNRESERVED_KEYWORD) PG_KEYWORD("second", SECOND_P, UNRESERVED_KEYWORD) PG_KEYWORD("security", SECURITY, UNRESERVED_KEYWORD) PG_KEYWORD("select", SELECT, RESERVED_KEYWORD) PG_KEYWORD("sequence", SEQUENCE, UNRESERVED_KEYWORD) PG_KEYWORD("sequences", SEQUENCES, UNRESERVED_KEYWORD) PG_KEYWORD("serializable", SERIALIZABLE, UNRESERVED_KEYWORD) PG_KEYWORD("server", SERVER, UNRESERVED_KEYWORD) PG_KEYWORD("session", SESSION, UNRESERVED_KEYWORD) PG_KEYWORD("session_user", SESSION_USER, RESERVED_KEYWORD) PG_KEYWORD("set", SET, UNRESERVED_KEYWORD) PG_KEYWORD("setof", SETOF, COL_NAME_KEYWORD) PG_KEYWORD("share", SHARE, UNRESERVED_KEYWORD) PG_KEYWORD("show", SHOW, UNRESERVED_KEYWORD) PG_KEYWORD("similar", SIMILAR, TYPE_FUNC_NAME_KEYWORD) PG_KEYWORD("simple", SIMPLE, UNRESERVED_KEYWORD) PG_KEYWORD("smallint", SMALLINT, COL_NAME_KEYWORD) PG_KEYWORD("snapshot", SNAPSHOT, UNRESERVED_KEYWORD) PG_KEYWORD("some", SOME, RESERVED_KEYWORD) PG_KEYWORD("stable", STABLE, UNRESERVED_KEYWORD) PG_KEYWORD("standalone", STANDALONE_P, UNRESERVED_KEYWORD) PG_KEYWORD("start", START, UNRESERVED_KEYWORD) PG_KEYWORD("statement", STATEMENT, UNRESERVED_KEYWORD) PG_KEYWORD("statistics", STATISTICS, UNRESERVED_KEYWORD) PG_KEYWORD("stdin", STDIN, UNRESERVED_KEYWORD) PG_KEYWORD("stdout", STDOUT, UNRESERVED_KEYWORD) PG_KEYWORD("storage", STORAGE, UNRESERVED_KEYWORD) PG_KEYWORD("strict", STRICT_P, UNRESERVED_KEYWORD) PG_KEYWORD("strip", STRIP_P, UNRESERVED_KEYWORD) PG_KEYWORD("substring", SUBSTRING, COL_NAME_KEYWORD) PG_KEYWORD("symmetric", SYMMETRIC, RESERVED_KEYWORD) PG_KEYWORD("sysid", SYSID, UNRESERVED_KEYWORD) PG_KEYWORD("system", SYSTEM_P, UNRESERVED_KEYWORD) PG_KEYWORD("table", TABLE, RESERVED_KEYWORD) PG_KEYWORD("tables", TABLES, UNRESERVED_KEYWORD) PG_KEYWORD("tablespace", TABLESPACE, UNRESERVED_KEYWORD) PG_KEYWORD("temp", TEMP, UNRESERVED_KEYWORD) PG_KEYWORD("template", TEMPLATE, UNRESERVED_KEYWORD) PG_KEYWORD("temporary", TEMPORARY, UNRESERVED_KEYWORD) PG_KEYWORD("text", TEXT_P, UNRESERVED_KEYWORD) PG_KEYWORD("then", THEN, RESERVED_KEYWORD) PG_KEYWORD("time", TIME, COL_NAME_KEYWORD) PG_KEYWORD("timestamp", TIMESTAMP, COL_NAME_KEYWORD) PG_KEYWORD("to", TO, RESERVED_KEYWORD) PG_KEYWORD("trailing", TRAILING, RESERVED_KEYWORD) PG_KEYWORD("transaction", TRANSACTION, UNRESERVED_KEYWORD) PG_KEYWORD("treat", TREAT, COL_NAME_KEYWORD) PG_KEYWORD("trigger", TRIGGER, UNRESERVED_KEYWORD) PG_KEYWORD("trim", TRIM, COL_NAME_KEYWORD) PG_KEYWORD("true", TRUE_P, RESERVED_KEYWORD) PG_KEYWORD("truncate", TRUNCATE, UNRESERVED_KEYWORD) PG_KEYWORD("trusted", TRUSTED, UNRESERVED_KEYWORD) PG_KEYWORD("type", TYPE_P, UNRESERVED_KEYWORD) PG_KEYWORD("types", TYPES_P, UNRESERVED_KEYWORD) PG_KEYWORD("unbounded", UNBOUNDED, UNRESERVED_KEYWORD) PG_KEYWORD("uncommitted", UNCOMMITTED, UNRESERVED_KEYWORD) PG_KEYWORD("unencrypted", UNENCRYPTED, UNRESERVED_KEYWORD) PG_KEYWORD("union", UNION, RESERVED_KEYWORD) PG_KEYWORD("unique", UNIQUE, RESERVED_KEYWORD) PG_KEYWORD("unknown", UNKNOWN, UNRESERVED_KEYWORD) PG_KEYWORD("unlisten", UNLISTEN, UNRESERVED_KEYWORD) PG_KEYWORD("unlogged", UNLOGGED, UNRESERVED_KEYWORD) PG_KEYWORD("until", UNTIL, UNRESERVED_KEYWORD) PG_KEYWORD("update", UPDATE, UNRESERVED_KEYWORD) PG_KEYWORD("user", USER, RESERVED_KEYWORD) PG_KEYWORD("using", USING, RESERVED_KEYWORD) PG_KEYWORD("vacuum", VACUUM, UNRESERVED_KEYWORD) PG_KEYWORD("valid", VALID, UNRESERVED_KEYWORD) PG_KEYWORD("validate", VALIDATE, UNRESERVED_KEYWORD) PG_KEYWORD("validator", VALIDATOR, UNRESERVED_KEYWORD) PG_KEYWORD("value", VALUE_P, UNRESERVED_KEYWORD) PG_KEYWORD("values", VALUES, COL_NAME_KEYWORD) PG_KEYWORD("varchar", VARCHAR, COL_NAME_KEYWORD) PG_KEYWORD("variadic", VARIADIC, RESERVED_KEYWORD) PG_KEYWORD("varying", VARYING, UNRESERVED_KEYWORD) PG_KEYWORD("verbose", VERBOSE, TYPE_FUNC_NAME_KEYWORD) PG_KEYWORD("version", VERSION_P, UNRESERVED_KEYWORD) PG_KEYWORD("view", VIEW, UNRESERVED_KEYWORD) PG_KEYWORD("volatile", VOLATILE, UNRESERVED_KEYWORD) PG_KEYWORD("when", WHEN, RESERVED_KEYWORD) PG_KEYWORD("where", WHERE, RESERVED_KEYWORD) PG_KEYWORD("whitespace", WHITESPACE_P, UNRESERVED_KEYWORD) PG_KEYWORD("window", WINDOW, RESERVED_KEYWORD) PG_KEYWORD("with", WITH, RESERVED_KEYWORD) PG_KEYWORD("without", WITHOUT, UNRESERVED_KEYWORD) PG_KEYWORD("work", WORK, UNRESERVED_KEYWORD) PG_KEYWORD("wrapper", WRAPPER, UNRESERVED_KEYWORD) PG_KEYWORD("write", WRITE, UNRESERVED_KEYWORD) PG_KEYWORD("xml", XML_P, UNRESERVED_KEYWORD) PG_KEYWORD("xmlattributes", XMLATTRIBUTES, COL_NAME_KEYWORD) PG_KEYWORD("xmlconcat", XMLCONCAT, COL_NAME_KEYWORD) PG_KEYWORD("xmlelement", XMLELEMENT, COL_NAME_KEYWORD) PG_KEYWORD("xmlexists", XMLEXISTS, COL_NAME_KEYWORD) PG_KEYWORD("xmlforest", XMLFOREST, COL_NAME_KEYWORD) PG_KEYWORD("xmlparse", XMLPARSE, COL_NAME_KEYWORD) PG_KEYWORD("xmlpi", XMLPI, COL_NAME_KEYWORD) PG_KEYWORD("xmlroot", XMLROOT, COL_NAME_KEYWORD) PG_KEYWORD("xmlserialize", XMLSERIALIZE, COL_NAME_KEYWORD) PG_KEYWORD("year", YEAR_P, UNRESERVED_KEYWORD) PG_KEYWORD("yes", YES_P, UNRESERVED_KEYWORD) PG_KEYWORD("zone", ZONE, UNRESERVED_KEYWORD) PKBiZvffserver/parser/gramparse.hnu[/*------------------------------------------------------------------------- * * gramparse.h * Shared definitions for the "raw" parser (flex and bison phases only) * * NOTE: this file is only meant to be included in the core parsing files, * ie, parser.c, gram.y, scan.l, and keywords.c. Definitions that are needed * outside the core parser should be in parser.h. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/parser/gramparse.h * *------------------------------------------------------------------------- */ #ifndef GRAMPARSE_H #define GRAMPARSE_H #include "nodes/parsenodes.h" #include "parser/scanner.h" /* * NB: include gram.h only AFTER including scanner.h, because scanner.h * is what #defines YYLTYPE. */ #include "parser/gram.h" /* * The YY_EXTRA data that a flex scanner allows us to pass around. Private * state needed for raw parsing/lexing goes here. */ typedef struct base_yy_extra_type { /* * Fields used by the core scanner. */ core_yy_extra_type core_yy_extra; /* * State variables for base_yylex(). */ bool have_lookahead; /* is lookahead info valid? */ int lookahead_token; /* one-token lookahead */ core_YYSTYPE lookahead_yylval; /* yylval for lookahead token */ YYLTYPE lookahead_yylloc; /* yylloc for lookahead token */ /* * State variables that belong to the grammar. */ List *parsetree; /* final parse result is delivered here */ } base_yy_extra_type; /* * In principle we should use yyget_extra() to fetch the yyextra field * from a yyscanner struct. However, flex always puts that field first, * and this is sufficiently performance-critical to make it seem worth * cheating a bit to use an inline macro. */ #define pg_yyget_extra(yyscanner) (*((base_yy_extra_type **) (yyscanner))) /* from parser.c */ extern int base_yylex(YYSTYPE *lvalp, YYLTYPE *llocp, core_yyscan_t yyscanner); /* from gram.y */ extern void parser_init(base_yy_extra_type *yyext); extern int base_yyparse(core_yyscan_t yyscanner); #endif /* GRAMPARSE_H */ PKBiZL}dserver/parser/parse_param.hnu[/*------------------------------------------------------------------------- * * parse_param.h * handle parameters in parser * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/parser/parse_param.h * *------------------------------------------------------------------------- */ #ifndef PARSE_PARAM_H #define PARSE_PARAM_H #include "parser/parse_node.h" extern void parse_fixed_parameters(ParseState *pstate, Oid *paramTypes, int numParams); extern void parse_variable_parameters(ParseState *pstate, Oid **paramTypes, int *numParams); extern void check_variable_parameters(ParseState *pstate, Query *query); #endif /* PARSE_PARAM_H */ PKBiZ7T?server/parser/parse_agg.hnu[/*------------------------------------------------------------------------- * * parse_agg.h * handle aggregates and window functions in parser * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/parser/parse_agg.h * *------------------------------------------------------------------------- */ #ifndef PARSE_AGG_H #define PARSE_AGG_H #include "parser/parse_node.h" extern void transformAggregateCall(ParseState *pstate, Aggref *agg, List *args, List *aggorder, bool agg_distinct); extern void transformWindowFuncCall(ParseState *pstate, WindowFunc *wfunc, WindowDef *windef); extern void parseCheckAggregates(ParseState *pstate, Query *qry); extern void parseCheckWindowFuncs(ParseState *pstate, Query *qry); extern void build_aggregate_fnexprs(Oid *agg_input_types, int agg_num_inputs, Oid agg_state_type, Oid agg_result_type, Oid agg_input_collation, Oid transfn_oid, Oid finalfn_oid, Expr **transfnexpr, Expr **finalfnexpr); #endif /* PARSE_AGG_H */ PKBiZyuserver/parser/parse_cte.hnu[/*------------------------------------------------------------------------- * * parse_cte.h * handle CTEs (common table expressions) in parser * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/parser/parse_cte.h * *------------------------------------------------------------------------- */ #ifndef PARSE_CTE_H #define PARSE_CTE_H #include "parser/parse_node.h" extern List *transformWithClause(ParseState *pstate, WithClause *withClause); extern void analyzeCTETargetList(ParseState *pstate, CommonTableExpr *cte, List *tlist); #endif /* PARSE_CTE_H */ PKBiZ;iiserver/parser/scanner.hnu[/*------------------------------------------------------------------------- * * scanner.h * API for the core scanner (flex machine) * * The core scanner is also used by PL/pgsql, so we provide a public API * for it. However, the rest of the backend is only expected to use the * higher-level API provided by parser.h. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/parser/scanner.h * *------------------------------------------------------------------------- */ #ifndef SCANNER_H #define SCANNER_H #include "parser/keywords.h" /* * The scanner returns extra data about scanned tokens in this union type. * Note that this is a subset of the fields used in YYSTYPE of the bison * parsers built atop the scanner. */ typedef union core_YYSTYPE { int ival; /* for integer literals */ char *str; /* for identifiers and non-integer literals */ const char *keyword; /* canonical spelling of keywords */ } core_YYSTYPE; /* * We track token locations in terms of byte offsets from the start of the * source string, not the column number/line number representation that * bison uses by default. Also, to minimize overhead we track only one * location (usually the first token location) for each construct, not * the beginning and ending locations as bison does by default. It's * therefore sufficient to make YYLTYPE an int. */ #define YYLTYPE int /* * Another important component of the scanner's API is the token code numbers. * However, those are not defined in this file, because bison insists on * defining them for itself. The token codes used by the core scanner are * the ASCII characters plus these: * %token IDENT FCONST SCONST BCONST XCONST Op * %token ICONST PARAM * %token TYPECAST DOT_DOT COLON_EQUALS * The above token definitions *must* be the first ones declared in any * bison parser built atop this scanner, so that they will have consistent * numbers assigned to them (specifically, IDENT = 258 and so on). */ /* * The YY_EXTRA data that a flex scanner allows us to pass around. * Private state needed by the core scanner goes here. Note that the actual * yy_extra struct may be larger and have this as its first component, thus * allowing the calling parser to keep some fields of its own in YY_EXTRA. */ typedef struct core_yy_extra_type { /* * The string the scanner is physically scanning. We keep this mainly so * that we can cheaply compute the offset of the current token (yytext). */ char *scanbuf; Size scanbuflen; /* * The keyword list to use. */ const ScanKeyword *keywords; int num_keywords; /* * literalbuf is used to accumulate literal values when multiple rules are * needed to parse a single literal. Call startlit() to reset buffer to * empty, addlit() to add text. NOTE: the string in literalbuf is NOT * necessarily null-terminated, but there always IS room to add a trailing * null at offset literallen. We store a null only when we need it. */ char *literalbuf; /* palloc'd expandable buffer */ int literallen; /* actual current string length */ int literalalloc; /* current allocated buffer size */ int xcdepth; /* depth of nesting in slash-star comments */ char *dolqstart; /* current $foo$ quote start string */ /* first part of UTF16 surrogate pair for Unicode escapes */ int32 utf16_first_part; /* state variables for literal-lexing warnings */ bool warn_on_first_escape; bool saw_non_ascii; } core_yy_extra_type; /* * The type of yyscanner is opaque outside scan.l. */ typedef void *core_yyscan_t; /* Entry points in parser/scan.l */ extern core_yyscan_t scanner_init(const char *str, core_yy_extra_type *yyext, const ScanKeyword *keywords, int num_keywords); extern void scanner_finish(core_yyscan_t yyscanner); extern int core_yylex(core_YYSTYPE *lvalp, YYLTYPE *llocp, core_yyscan_t yyscanner); extern int scanner_errposition(int location, core_yyscan_t yyscanner); extern void scanner_yyerror(const char *message, core_yyscan_t yyscanner); #endif /* SCANNER_H */ PKBiZ~ FFserver/parser/parse_type.hnu[/*------------------------------------------------------------------------- * * parse_type.h * handle type operations for parser * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/parser/parse_type.h * *------------------------------------------------------------------------- */ #ifndef PARSE_TYPE_H #define PARSE_TYPE_H #include "access/htup.h" #include "parser/parse_node.h" typedef HeapTuple Type; extern Type LookupTypeName(ParseState *pstate, const TypeName *typeName, int32 *typmod_p); extern Type LookupTypeNameExtended(ParseState *pstate, const TypeName *typeName, int32 *typmod_p, bool temp_ok, bool missing_ok); extern Type typenameType(ParseState *pstate, const TypeName *typeName, int32 *typmod_p); extern Oid typenameTypeId(ParseState *pstate, const TypeName *typeName); extern void typenameTypeIdAndMod(ParseState *pstate, const TypeName *typeName, Oid *typeid_p, int32 *typmod_p); extern char *TypeNameToString(const TypeName *typeName); extern char *TypeNameListToString(List *typenames); extern Oid LookupCollation(ParseState *pstate, List *collnames, int location); extern Oid GetColumnDefCollation(ParseState *pstate, ColumnDef *coldef, Oid typeOid); extern Type typeidType(Oid id); extern Oid typeTypeId(Type tp); extern int16 typeLen(Type t); extern bool typeByVal(Type t); extern char *typeTypeName(Type t); extern Oid typeTypeRelid(Type typ); extern Oid typeTypeCollation(Type typ); extern Datum stringTypeDatum(Type tp, char *string, int32 atttypmod); extern Oid typeidTypeRelid(Oid type_id); extern void parseTypeString(const char *str, Oid *typeid_p, int32 *typmod_p); #define ISCOMPLEX(typeid) (typeidTypeRelid(typeid) != InvalidOid) #endif /* PARSE_TYPE_H */ PKBiZqaM**server/parser/gram.hnu[/* A Bison parser, made by GNU Bison 3.0.2. */ /* Bison interface for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ #ifndef YY_BASE_YY_GRAM_H_INCLUDED # define YY_BASE_YY_GRAM_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif #if YYDEBUG extern int base_yydebug; #endif /* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { IDENT = 258, FCONST = 259, SCONST = 260, BCONST = 261, XCONST = 262, Op = 263, ICONST = 264, PARAM = 265, TYPECAST = 266, DOT_DOT = 267, COLON_EQUALS = 268, ABORT_P = 269, ABSOLUTE_P = 270, ACCESS = 271, ACTION = 272, ADD_P = 273, ADMIN = 274, AFTER = 275, AGGREGATE = 276, ALL = 277, ALSO = 278, ALTER = 279, ALWAYS = 280, ANALYSE = 281, ANALYZE = 282, AND = 283, ANY = 284, ARRAY = 285, AS = 286, ASC = 287, ASSERTION = 288, ASSIGNMENT = 289, ASYMMETRIC = 290, AT = 291, ATTRIBUTE = 292, AUTHORIZATION = 293, BACKWARD = 294, BEFORE = 295, BEGIN_P = 296, BETWEEN = 297, BIGINT = 298, BINARY = 299, BIT = 300, BOOLEAN_P = 301, BOTH = 302, BY = 303, CACHE = 304, CALLED = 305, CASCADE = 306, CASCADED = 307, CASE = 308, CAST = 309, CATALOG_P = 310, CHAIN = 311, CHAR_P = 312, CHARACTER = 313, CHARACTERISTICS = 314, CHECK = 315, CHECKPOINT = 316, CLASS = 317, CLOSE = 318, CLUSTER = 319, COALESCE = 320, COLLATE = 321, COLLATION = 322, COLUMN = 323, COMMENT = 324, COMMENTS = 325, COMMIT = 326, COMMITTED = 327, CONCURRENTLY = 328, CONFIGURATION = 329, CONNECTION = 330, CONSTRAINT = 331, CONSTRAINTS = 332, CONTENT_P = 333, CONTINUE_P = 334, CONVERSION_P = 335, COPY = 336, COST = 337, CREATE = 338, CROSS = 339, CSV = 340, CURRENT_P = 341, CURRENT_CATALOG = 342, CURRENT_DATE = 343, CURRENT_ROLE = 344, CURRENT_SCHEMA = 345, CURRENT_TIME = 346, CURRENT_TIMESTAMP = 347, CURRENT_USER = 348, CURSOR = 349, CYCLE = 350, DATA_P = 351, DATABASE = 352, DAY_P = 353, DEALLOCATE = 354, DEC = 355, DECIMAL_P = 356, DECLARE = 357, DEFAULT = 358, DEFAULTS = 359, DEFERRABLE = 360, DEFERRED = 361, DEFINER = 362, DELETE_P = 363, DELIMITER = 364, DELIMITERS = 365, DESC = 366, DICTIONARY = 367, DISABLE_P = 368, DISCARD = 369, DISTINCT = 370, DO = 371, DOCUMENT_P = 372, DOMAIN_P = 373, DOUBLE_P = 374, DROP = 375, EACH = 376, ELSE = 377, ENABLE_P = 378, ENCODING = 379, ENCRYPTED = 380, END_P = 381, ENUM_P = 382, ESCAPE = 383, EXCEPT = 384, EXCLUDE = 385, EXCLUDING = 386, EXCLUSIVE = 387, EXECUTE = 388, EXISTS = 389, EXPLAIN = 390, EXTENSION = 391, EXTERNAL = 392, EXTRACT = 393, FALSE_P = 394, FAMILY = 395, FETCH = 396, FIRST_P = 397, FLOAT_P = 398, FOLLOWING = 399, FOR = 400, FORCE = 401, FOREIGN = 402, FORWARD = 403, FREEZE = 404, FROM = 405, FULL = 406, FUNCTION = 407, FUNCTIONS = 408, GLOBAL = 409, GRANT = 410, GRANTED = 411, GREATEST = 412, GROUP_P = 413, HANDLER = 414, HAVING = 415, HEADER_P = 416, HOLD = 417, HOUR_P = 418, IDENTITY_P = 419, IF_P = 420, ILIKE = 421, IMMEDIATE = 422, IMMUTABLE = 423, IMPLICIT_P = 424, IN_P = 425, INCLUDING = 426, INCREMENT = 427, INDEX = 428, INDEXES = 429, INHERIT = 430, INHERITS = 431, INITIALLY = 432, INLINE_P = 433, INNER_P = 434, INOUT = 435, INPUT_P = 436, INSENSITIVE = 437, INSERT = 438, INSTEAD = 439, INT_P = 440, INTEGER = 441, INTERSECT = 442, INTERVAL = 443, INTO = 444, INVOKER = 445, IS = 446, ISNULL = 447, ISOLATION = 448, JOIN = 449, KEY = 450, LABEL = 451, LANGUAGE = 452, LARGE_P = 453, LAST_P = 454, LC_COLLATE_P = 455, LC_CTYPE_P = 456, LEADING = 457, LEAKPROOF = 458, LEAST = 459, LEFT = 460, LEVEL = 461, LIKE = 462, LIMIT = 463, LISTEN = 464, LOAD = 465, LOCAL = 466, LOCALTIME = 467, LOCALTIMESTAMP = 468, LOCATION = 469, LOCK_P = 470, MAPPING = 471, MATCH = 472, MAXVALUE = 473, MINUTE_P = 474, MINVALUE = 475, MODE = 476, MONTH_P = 477, MOVE = 478, NAME_P = 479, NAMES = 480, NATIONAL = 481, NATURAL = 482, NCHAR = 483, NEXT = 484, NO = 485, NONE = 486, NOT = 487, NOTHING = 488, NOTIFY = 489, NOTNULL = 490, NOWAIT = 491, NULL_P = 492, NULLIF = 493, NULLS_P = 494, NUMERIC = 495, OBJECT_P = 496, OF = 497, OFF = 498, OFFSET = 499, OIDS = 500, ON = 501, ONLY = 502, OPERATOR = 503, OPTION = 504, OPTIONS = 505, OR = 506, ORDER = 507, OUT_P = 508, OUTER_P = 509, OVER = 510, OVERLAPS = 511, OVERLAY = 512, OWNED = 513, OWNER = 514, PARSER = 515, PARTIAL = 516, PARTITION = 517, PASSING = 518, PASSWORD = 519, PLACING = 520, PLANS = 521, POSITION = 522, PRECEDING = 523, PRECISION = 524, PRESERVE = 525, PREPARE = 526, PREPARED = 527, PRIMARY = 528, PRIOR = 529, PRIVILEGES = 530, PROCEDURAL = 531, PROCEDURE = 532, QUOTE = 533, RANGE = 534, READ = 535, REAL = 536, REASSIGN = 537, RECHECK = 538, RECURSIVE = 539, REF = 540, REFERENCES = 541, REINDEX = 542, RELATIVE_P = 543, RELEASE = 544, RENAME = 545, REPEATABLE = 546, REPLACE = 547, REPLICA = 548, RESET = 549, RESTART = 550, RESTRICT = 551, RETURNING = 552, RETURNS = 553, REVOKE = 554, RIGHT = 555, ROLE = 556, ROLLBACK = 557, ROW = 558, ROWS = 559, RULE = 560, SAVEPOINT = 561, SCHEMA = 562, SCROLL = 563, SEARCH = 564, SECOND_P = 565, SECURITY = 566, SELECT = 567, SEQUENCE = 568, SEQUENCES = 569, SERIALIZABLE = 570, SERVER = 571, SESSION = 572, SESSION_USER = 573, SET = 574, SETOF = 575, SHARE = 576, SHOW = 577, SIMILAR = 578, SIMPLE = 579, SMALLINT = 580, SNAPSHOT = 581, SOME = 582, STABLE = 583, STANDALONE_P = 584, START = 585, STATEMENT = 586, STATISTICS = 587, STDIN = 588, STDOUT = 589, STORAGE = 590, STRICT_P = 591, STRIP_P = 592, SUBSTRING = 593, SYMMETRIC = 594, SYSID = 595, SYSTEM_P = 596, TABLE = 597, TABLES = 598, TABLESPACE = 599, TEMP = 600, TEMPLATE = 601, TEMPORARY = 602, TEXT_P = 603, THEN = 604, TIME = 605, TIMESTAMP = 606, TO = 607, TRAILING = 608, TRANSACTION = 609, TREAT = 610, TRIGGER = 611, TRIM = 612, TRUE_P = 613, TRUNCATE = 614, TRUSTED = 615, TYPE_P = 616, TYPES_P = 617, UNBOUNDED = 618, UNCOMMITTED = 619, UNENCRYPTED = 620, UNION = 621, UNIQUE = 622, UNKNOWN = 623, UNLISTEN = 624, UNLOGGED = 625, UNTIL = 626, UPDATE = 627, USER = 628, USING = 629, VACUUM = 630, VALID = 631, VALIDATE = 632, VALIDATOR = 633, VALUE_P = 634, VALUES = 635, VARCHAR = 636, VARIADIC = 637, VARYING = 638, VERBOSE = 639, VERSION_P = 640, VIEW = 641, VOLATILE = 642, WHEN = 643, WHERE = 644, WHITESPACE_P = 645, WINDOW = 646, WITH = 647, WITHOUT = 648, WORK = 649, WRAPPER = 650, WRITE = 651, XML_P = 652, XMLATTRIBUTES = 653, XMLCONCAT = 654, XMLELEMENT = 655, XMLEXISTS = 656, XMLFOREST = 657, XMLPARSE = 658, XMLPI = 659, XMLROOT = 660, XMLSERIALIZE = 661, YEAR_P = 662, YES_P = 663, ZONE = 664, NULLS_FIRST = 665, NULLS_LAST = 666, WITH_TIME = 667, POSTFIXOP = 668, UMINUS = 669 }; #endif /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE YYSTYPE; union YYSTYPE { #line 158 "gram.y" /* yacc.c:1909 */ core_YYSTYPE core_yystype; /* these fields must match core_YYSTYPE: */ int ival; char *str; const char *keyword; char chr; bool boolean; JoinType jtype; DropBehavior dbehavior; OnCommitAction oncommit; List *list; Node *node; Value *value; ObjectType objtype; TypeName *typnam; FunctionParameter *fun_param; FunctionParameterMode fun_param_mode; FuncWithArgs *funwithargs; DefElem *defelt; SortBy *sortby; WindowDef *windef; JoinExpr *jexpr; IndexElem *ielem; Alias *alias; RangeVar *range; IntoClause *into; WithClause *with; A_Indices *aind; ResTarget *target; struct PrivTarget *privtarget; AccessPriv *accesspriv; InsertStmt *istmt; VariableSetStmt *vsetstmt; #line 506 "gram.h" /* yacc.c:1909 */ }; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif /* Location type. */ #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED typedef struct YYLTYPE YYLTYPE; struct YYLTYPE { int first_line; int first_column; int last_line; int last_column; }; # define YYLTYPE_IS_DECLARED 1 # define YYLTYPE_IS_TRIVIAL 1 #endif int base_yyparse (core_yyscan_t yyscanner); #endif /* !YY_BASE_YY_GRAM_H_INCLUDED */ PKBiZTVkkserver/parser/parse_expr.hnu[/*------------------------------------------------------------------------- * * parse_expr.h * handle expressions in parser * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/parser/parse_expr.h * *------------------------------------------------------------------------- */ #ifndef PARSE_EXPR_H #define PARSE_EXPR_H #include "parser/parse_node.h" /* GUC parameters */ extern bool Transform_null_equals; extern Node *transformExpr(ParseState *pstate, Node *expr); #endif /* PARSE_EXPR_H */ PKBiZ zzserver/parser/parser.hnu[/*------------------------------------------------------------------------- * * parser.h * Definitions for the "raw" parser (flex and bison phases only) * * This is the external API for the raw lexing/parsing functions. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/parser/parser.h * *------------------------------------------------------------------------- */ #ifndef PARSER_H #define PARSER_H #include "nodes/parsenodes.h" typedef enum { BACKSLASH_QUOTE_OFF, BACKSLASH_QUOTE_ON, BACKSLASH_QUOTE_SAFE_ENCODING } BackslashQuoteType; /* GUC variables in scan.l (every one of these is a bad idea :-() */ extern int backslash_quote; extern bool escape_string_warning; extern PGDLLIMPORT bool standard_conforming_strings; /* Primary entry point for the raw parsing functions */ extern List *raw_parser(const char *str); /* Utility functions exported by gram.y (perhaps these should be elsewhere) */ extern List *SystemFuncName(char *name); extern TypeName *SystemTypeName(char *name); #endif /* PARSER_H */ PKBiZ|&==server/parser/parse_collate.hnu[/*------------------------------------------------------------------------- * * parse_collate.h * Routines for assigning collation information. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/parser/parse_collate.h * *------------------------------------------------------------------------- */ #ifndef PARSE_COLLATE_H #define PARSE_COLLATE_H #include "parser/parse_node.h" extern void assign_query_collations(ParseState *pstate, Query *query); extern void assign_list_collations(ParseState *pstate, List *exprs); extern void assign_expr_collations(ParseState *pstate, Node *expr); extern Oid select_common_collation(ParseState *pstate, List *exprs, bool none_ok); #endif /* PARSE_COLLATE_H */ PKBiZK^, , server/parser/parse_coerce.hnu[/*------------------------------------------------------------------------- * * parse_coerce.h * Routines for type coercion. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/parser/parse_coerce.h * *------------------------------------------------------------------------- */ #ifndef PARSE_COERCE_H #define PARSE_COERCE_H #include "parser/parse_node.h" /* Type categories (see TYPCATEGORY_xxx symbols in catalog/pg_type.h) */ typedef char TYPCATEGORY; /* Result codes for find_coercion_pathway */ typedef enum CoercionPathType { COERCION_PATH_NONE, /* failed to find any coercion pathway */ COERCION_PATH_FUNC, /* apply the specified coercion function */ COERCION_PATH_RELABELTYPE, /* binary-compatible cast, no function */ COERCION_PATH_ARRAYCOERCE, /* need an ArrayCoerceExpr node */ COERCION_PATH_COERCEVIAIO /* need a CoerceViaIO node */ } CoercionPathType; extern bool IsBinaryCoercible(Oid srctype, Oid targettype); extern bool IsPreferredType(TYPCATEGORY category, Oid type); extern TYPCATEGORY TypeCategory(Oid type); extern Node *coerce_to_target_type(ParseState *pstate, Node *expr, Oid exprtype, Oid targettype, int32 targettypmod, CoercionContext ccontext, CoercionForm cformat, int location); extern bool can_coerce_type(int nargs, Oid *input_typeids, Oid *target_typeids, CoercionContext ccontext); extern Node *coerce_type(ParseState *pstate, Node *node, Oid inputTypeId, Oid targetTypeId, int32 targetTypeMod, CoercionContext ccontext, CoercionForm cformat, int location); extern Node *coerce_to_domain(Node *arg, Oid baseTypeId, int32 baseTypeMod, Oid typeId, CoercionForm cformat, int location, bool hideInputCoercion, bool lengthCoercionDone); extern Node *coerce_to_boolean(ParseState *pstate, Node *node, const char *constructName); extern Node *coerce_to_specific_type(ParseState *pstate, Node *node, Oid targetTypeId, const char *constructName); extern int parser_coercion_errposition(ParseState *pstate, int coerce_location, Node *input_expr); extern Oid select_common_type(ParseState *pstate, List *exprs, const char *context, Node **which_expr); extern Node *coerce_to_common_type(ParseState *pstate, Node *node, Oid targetTypeId, const char *context); extern bool check_generic_type_consistency(Oid *actual_arg_types, Oid *declared_arg_types, int nargs); extern Oid enforce_generic_type_consistency(Oid *actual_arg_types, Oid *declared_arg_types, int nargs, Oid rettype, bool allow_poly); extern Oid resolve_generic_type(Oid declared_type, Oid context_actual_type, Oid context_declared_type); extern CoercionPathType find_coercion_pathway(Oid targetTypeId, Oid sourceTypeId, CoercionContext ccontext, Oid *funcid); extern CoercionPathType find_typmod_coercion_function(Oid typeId, Oid *funcid); #endif /* PARSE_COERCE_H */ PKBiZl҉"server/parser/analyze.hnu[/*------------------------------------------------------------------------- * * analyze.h * parse analysis for optimizable statements * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/parser/analyze.h * *------------------------------------------------------------------------- */ #ifndef ANALYZE_H #define ANALYZE_H #include "parser/parse_node.h" /* Hook for plugins to get control at end of parse analysis */ typedef void (*post_parse_analyze_hook_type) (ParseState *pstate, Query *query); extern PGDLLIMPORT post_parse_analyze_hook_type post_parse_analyze_hook; extern Query *parse_analyze(Node *parseTree, const char *sourceText, Oid *paramTypes, int numParams); extern Query *parse_analyze_varparams(Node *parseTree, const char *sourceText, Oid **paramTypes, int *numParams); extern Query *parse_sub_analyze(Node *parseTree, ParseState *parentParseState, CommonTableExpr *parentCTE, bool locked_from_parent); extern Query *transformTopLevelStmt(ParseState *pstate, Node *parseTree); extern Query *transformStmt(ParseState *pstate, Node *parseTree); extern bool analyze_requires_snapshot(Node *parseTree); extern void CheckSelectLocking(Query *qry); extern void applyLockingClause(Query *qry, Index rtindex, bool forUpdate, bool noWait, bool pushedDown); #endif /* ANALYZE_H */ PKBiZxM.server/parser/parse_target.hnu[/*------------------------------------------------------------------------- * * parse_target.h * handle target lists * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/parser/parse_target.h * *------------------------------------------------------------------------- */ #ifndef PARSE_TARGET_H #define PARSE_TARGET_H #include "parser/parse_node.h" extern List *transformTargetList(ParseState *pstate, List *targetlist); extern List *transformExpressionList(ParseState *pstate, List *exprlist); extern void markTargetListOrigins(ParseState *pstate, List *targetlist); extern TargetEntry *transformTargetEntry(ParseState *pstate, Node *node, Node *expr, char *colname, bool resjunk); extern Expr *transformAssignedExpr(ParseState *pstate, Expr *expr, char *colname, int attrno, List *indirection, int location); extern void updateTargetListEntry(ParseState *pstate, TargetEntry *tle, char *colname, int attrno, List *indirection, int location); extern List *checkInsertTargets(ParseState *pstate, List *cols, List **attrnos); extern TupleDesc expandRecordVariable(ParseState *pstate, Var *var, int levelsup); extern char *FigureColname(Node *node); extern char *FigureIndexColname(Node *node); #endif /* PARSE_TARGET_H */ PKBiZ{ffserver/parser/parse_node.hnu[/*------------------------------------------------------------------------- * * parse_node.h * Internal definitions for parser * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/parser/parse_node.h * *------------------------------------------------------------------------- */ #ifndef PARSE_NODE_H #define PARSE_NODE_H #include "nodes/parsenodes.h" #include "utils/relcache.h" /* * Function signatures for parser hooks */ typedef struct ParseState ParseState; typedef Node *(*PreParseColumnRefHook) (ParseState *pstate, ColumnRef *cref); typedef Node *(*PostParseColumnRefHook) (ParseState *pstate, ColumnRef *cref, Node *var); typedef Node *(*ParseParamRefHook) (ParseState *pstate, ParamRef *pref); typedef Node *(*CoerceParamHook) (ParseState *pstate, Param *param, Oid targetTypeId, int32 targetTypeMod, int location); /* * State information used during parse analysis * * parentParseState: NULL in a top-level ParseState. When parsing a subquery, * links to current parse state of outer query. * * p_sourcetext: source string that generated the raw parsetree being * analyzed, or NULL if not available. (The string is used only to * generate cursor positions in error messages: we need it to convert * byte-wise locations in parse structures to character-wise cursor * positions.) * * p_rtable: list of RTEs that will become the rangetable of the query. * Note that neither relname nor refname of these entries are necessarily * unique; searching the rtable by name is a bad idea. * * p_joinexprs: list of JoinExpr nodes associated with p_rtable entries. * This is one-for-one with p_rtable, but contains NULLs for non-join * RTEs, and may be shorter than p_rtable if the last RTE(s) aren't joins. * * p_joinlist: list of join items (RangeTblRef and JoinExpr nodes) that * will become the fromlist of the query's top-level FromExpr node. * * p_relnamespace: list of RTEs that represents the current namespace for * table lookup, ie, those RTEs that are accessible by qualified names. * This may be just a subset of the rtable + joinlist, and/or may contain * entries that are not yet added to the main joinlist. * * p_varnamespace: list of RTEs that represents the current namespace for * column lookup, ie, those RTEs that are accessible by unqualified names. * This is different from p_relnamespace because a JOIN without an alias does * not hide the contained tables (so they must still be in p_relnamespace) * but it does hide their columns (unqualified references to the columns must * refer to the JOIN, not the member tables). Other special RTEs such as * NEW/OLD for rules may also appear in just one of these lists. * * p_ctenamespace: list of CommonTableExprs (WITH items) that are visible * at the moment. This is different from p_relnamespace because you have * to make an RTE before you can access a CTE. * * p_future_ctes: list of CommonTableExprs (WITH items) that are not yet * visible due to scope rules. This is used to help improve error messages. * * p_parent_cte: CommonTableExpr that immediately contains the current query, * if any. * * p_windowdefs: list of WindowDefs representing WINDOW and OVER clauses. * We collect these while transforming expressions and then transform them * afterwards (so that any resjunk tlist items needed for the sort/group * clauses end up at the end of the query tlist). A WindowDef's location in * this list, counting from 1, is the winref number to use to reference it. */ struct ParseState { struct ParseState *parentParseState; /* stack link */ const char *p_sourcetext; /* source text, or NULL if not available */ List *p_rtable; /* range table so far */ List *p_joinexprs; /* JoinExprs for RTE_JOIN p_rtable entries */ List *p_joinlist; /* join items so far (will become FromExpr * node's fromlist) */ List *p_relnamespace; /* current namespace for relations */ List *p_varnamespace; /* current namespace for columns */ List *p_ctenamespace; /* current namespace for common table exprs */ List *p_future_ctes; /* common table exprs not yet in namespace */ CommonTableExpr *p_parent_cte; /* this query's containing CTE */ List *p_windowdefs; /* raw representations of window clauses */ int p_next_resno; /* next targetlist resno to assign */ List *p_locking_clause; /* raw FOR UPDATE/FOR SHARE info */ Node *p_value_substitute; /* what to replace VALUE with, if any */ bool p_hasAggs; bool p_hasWindowFuncs; bool p_hasSubLinks; bool p_hasModifyingCTE; bool p_is_insert; bool p_is_update; bool p_locked_from_parent; Relation p_target_relation; RangeTblEntry *p_target_rangetblentry; /* * Optional hook functions for parser callbacks. These are null unless * set up by the caller of make_parsestate. */ PreParseColumnRefHook p_pre_columnref_hook; PostParseColumnRefHook p_post_columnref_hook; ParseParamRefHook p_paramref_hook; CoerceParamHook p_coerce_param_hook; void *p_ref_hook_state; /* common passthrough link for above */ }; /* Support for parser_errposition_callback function */ typedef struct ParseCallbackState { ParseState *pstate; int location; ErrorContextCallback errcontext; } ParseCallbackState; extern ParseState *make_parsestate(ParseState *parentParseState); extern void free_parsestate(ParseState *pstate); extern int parser_errposition(ParseState *pstate, int location); extern void setup_parser_errposition_callback(ParseCallbackState *pcbstate, ParseState *pstate, int location); extern void cancel_parser_errposition_callback(ParseCallbackState *pcbstate); extern Var *make_var(ParseState *pstate, RangeTblEntry *rte, int attrno, int location); extern Oid transformArrayType(Oid *arrayType, int32 *arrayTypmod); extern ArrayRef *transformArraySubscripts(ParseState *pstate, Node *arrayBase, Oid arrayType, Oid elementType, int32 arrayTypMod, List *indirection, Node *assignFrom); extern Const *make_const(ParseState *pstate, Value *value, int location); #endif /* PARSE_NODE_H */ PKBiZJ\server/parser/scansup.hnu[/*------------------------------------------------------------------------- * * scansup.h * scanner support routines. used by both the bootstrap lexer * as well as the normal lexer * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/parser/scansup.h * *------------------------------------------------------------------------- */ #ifndef SCANSUP_H #define SCANSUP_H extern char *scanstr(const char *s); extern char *downcase_truncate_identifier(const char *ident, int len, bool warn); extern void truncate_identifier(char *ident, int len, bool warn); extern bool scanner_isspace(char ch); #endif /* SCANSUP_H */ PKBiZ,'server/parser/parsetree.hnu[/*------------------------------------------------------------------------- * * parsetree.h * Routines to access various components and subcomponents of * parse trees. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/parser/parsetree.h * *------------------------------------------------------------------------- */ #ifndef PARSETREE_H #define PARSETREE_H #include "nodes/parsenodes.h" /* ---------------- * range table operations * ---------------- */ /* * rt_fetch * * NB: this will crash and burn if handed an out-of-range RT index */ #define rt_fetch(rangetable_index, rangetable) \ ((RangeTblEntry *) list_nth(rangetable, (rangetable_index)-1)) /* * getrelid * * Given the range index of a relation, return the corresponding * relation OID. Note that InvalidOid will be returned if the * RTE is for a non-relation-type RTE. */ #define getrelid(rangeindex,rangetable) \ (rt_fetch(rangeindex, rangetable)->relid) /* * Given an RTE and an attribute number, return the appropriate * variable name or alias for that attribute of that RTE. */ extern char *get_rte_attribute_name(RangeTblEntry *rte, AttrNumber attnum); /* * Given an RTE and an attribute number, return the appropriate * type and typemod info for that attribute of that RTE. */ extern void get_rte_attribute_type(RangeTblEntry *rte, AttrNumber attnum, Oid *vartype, int32 *vartypmod, Oid *varcollid); /* * Check whether an attribute of an RTE has been dropped (note that * get_rte_attribute_type will fail on such an attr) */ extern bool get_rte_attribute_is_dropped(RangeTblEntry *rte, AttrNumber attnum); /* ---------------- * target list operations * ---------------- */ extern TargetEntry *get_tle_by_resno(List *tlist, AttrNumber resno); /* ---------------- * FOR UPDATE/SHARE info * ---------------- */ extern RowMarkClause *get_parse_rowmark(Query *qry, Index rtindex); #endif /* PARSETREE_H */ PKBiZh@p p server/parser/parse_func.hnu[/*------------------------------------------------------------------------- * * parse_func.h * * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/parser/parse_func.h * *------------------------------------------------------------------------- */ #ifndef PARSER_FUNC_H #define PARSER_FUNC_H #include "catalog/namespace.h" #include "parser/parse_node.h" /* * This structure is used to explore the inheritance hierarchy above * nodes in the type tree in order to disambiguate among polymorphic * functions. */ typedef struct _InhPaths { int nsupers; /* number of superclasses */ Oid self; /* this class */ Oid *supervec; /* vector of superclasses */ } InhPaths; /* Result codes for func_get_detail */ typedef enum { FUNCDETAIL_NOTFOUND, /* no matching function */ FUNCDETAIL_MULTIPLE, /* too many matching functions */ FUNCDETAIL_NORMAL, /* found a matching regular function */ FUNCDETAIL_AGGREGATE, /* found a matching aggregate function */ FUNCDETAIL_WINDOWFUNC, /* found a matching window function */ FUNCDETAIL_COERCION /* it's a type coercion request */ } FuncDetailCode; extern Node *ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs, List *agg_order, bool agg_star, bool agg_distinct, bool func_variadic, WindowDef *over, bool is_column, int location); extern FuncDetailCode func_get_detail(List *funcname, List *fargs, List *fargnames, int nargs, Oid *argtypes, bool expand_variadic, bool expand_defaults, Oid *funcid, Oid *rettype, bool *retset, int *nvargs, Oid **true_typeids, List **argdefaults); extern int func_match_argtypes(int nargs, Oid *input_typeids, FuncCandidateList raw_candidates, FuncCandidateList *candidates); extern FuncCandidateList func_select_candidate(int nargs, Oid *input_typeids, FuncCandidateList candidates); extern void make_fn_arguments(ParseState *pstate, List *fargs, Oid *actual_arg_types, Oid *declared_arg_types); extern const char *funcname_signature_string(const char *funcname, int nargs, List *argnames, const Oid *argtypes); extern const char *func_signature_string(List *funcname, int nargs, List *argnames, const Oid *argtypes); extern Oid LookupFuncName(List *funcname, int nargs, const Oid *argtypes, bool noError); extern Oid LookupFuncNameTypeNames(List *funcname, List *argtypes, bool noError); extern Oid LookupAggNameTypeNames(List *aggname, List *argtypes, bool noError); #endif /* PARSE_FUNC_H */ PKBiZucserver/parser/parse_clause.hnu[/*------------------------------------------------------------------------- * * parse_clause.h * handle clauses in parser * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/parser/parse_clause.h * *------------------------------------------------------------------------- */ #ifndef PARSE_CLAUSE_H #define PARSE_CLAUSE_H #include "parser/parse_node.h" extern void transformFromClause(ParseState *pstate, List *frmList); extern int setTargetTable(ParseState *pstate, RangeVar *relation, bool inh, bool alsoSource, AclMode requiredPerms); extern bool interpretInhOption(InhOption inhOpt); extern bool interpretOidsOption(List *defList); extern Node *transformWhereClause(ParseState *pstate, Node *clause, const char *constructName); extern Node *transformLimitClause(ParseState *pstate, Node *clause, const char *constructName); extern List *transformGroupClause(ParseState *pstate, List *grouplist, List **targetlist, List *sortClause, bool useSQL99); extern List *transformSortClause(ParseState *pstate, List *orderlist, List **targetlist, bool resolveUnknown, bool useSQL99); extern List *transformWindowDefinitions(ParseState *pstate, List *windowdefs, List **targetlist); extern List *transformDistinctClause(ParseState *pstate, List **targetlist, List *sortClause, bool is_agg); extern List *transformDistinctOnClause(ParseState *pstate, List *distinctlist, List **targetlist, List *sortClause); extern Index assignSortGroupRef(TargetEntry *tle, List *tlist); extern bool targetIsInSortList(TargetEntry *tle, Oid sortop, List *sortList); #endif /* PARSE_CLAUSE_H */ PKBiZ͛d server/parser/parse_relation.hnu[/*------------------------------------------------------------------------- * * parse_relation.h * prototypes for parse_relation.c. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/parser/parse_relation.h * *------------------------------------------------------------------------- */ #ifndef PARSE_RELATION_H #define PARSE_RELATION_H #include "parser/parse_node.h" extern RangeTblEntry *refnameRangeTblEntry(ParseState *pstate, const char *schemaname, const char *refname, int location, int *sublevels_up); extern CommonTableExpr *scanNameSpaceForCTE(ParseState *pstate, const char *refname, Index *ctelevelsup); extern void checkNameSpaceConflicts(ParseState *pstate, List *namespace1, List *namespace2); extern int RTERangeTablePosn(ParseState *pstate, RangeTblEntry *rte, int *sublevels_up); extern RangeTblEntry *GetRTEByRangeTablePosn(ParseState *pstate, int varno, int sublevels_up); extern CommonTableExpr *GetCTEForRTE(ParseState *pstate, RangeTblEntry *rte, int rtelevelsup); extern Node *scanRTEForColumn(ParseState *pstate, RangeTblEntry *rte, char *colname, int location); extern Node *colNameToVar(ParseState *pstate, char *colname, bool localonly, int location); extern void markVarForSelectPriv(ParseState *pstate, Var *var, RangeTblEntry *rte); extern Relation parserOpenTable(ParseState *pstate, const RangeVar *relation, int lockmode); extern RangeTblEntry *addRangeTableEntry(ParseState *pstate, RangeVar *relation, Alias *alias, bool inh, bool inFromCl); extern RangeTblEntry *addRangeTableEntryForRelation(ParseState *pstate, Relation rel, Alias *alias, bool inh, bool inFromCl); extern RangeTblEntry *addRangeTableEntryForSubquery(ParseState *pstate, Query *subquery, Alias *alias, bool inFromCl); extern RangeTblEntry *addRangeTableEntryForFunction(ParseState *pstate, char *funcname, Node *funcexpr, RangeFunction *rangefunc, bool inFromCl); extern RangeTblEntry *addRangeTableEntryForValues(ParseState *pstate, List *exprs, List *collations, Alias *alias, bool inFromCl); extern RangeTblEntry *addRangeTableEntryForJoin(ParseState *pstate, List *colnames, JoinType jointype, List *aliasvars, Alias *alias, bool inFromCl); extern RangeTblEntry *addRangeTableEntryForCTE(ParseState *pstate, CommonTableExpr *cte, Index levelsup, RangeVar *rv, bool inFromCl); extern bool isLockedRefname(ParseState *pstate, const char *refname); extern void addRTEtoQuery(ParseState *pstate, RangeTblEntry *rte, bool addToJoinList, bool addToRelNameSpace, bool addToVarNameSpace); extern void errorMissingRTE(ParseState *pstate, RangeVar *relation); extern void expandRTE(RangeTblEntry *rte, int rtindex, int sublevels_up, int location, bool include_dropped, List **colnames, List **colvars); extern List *expandRelAttrs(ParseState *pstate, RangeTblEntry *rte, int rtindex, int sublevels_up, int location); extern int attnameAttNum(Relation rd, const char *attname, bool sysColOK); extern Name attnumAttName(Relation rd, int attid); extern Oid attnumTypeId(Relation rd, int attid); extern Oid attnumCollationId(Relation rd, int attid); #endif /* PARSE_RELATION_H */ PKBiZ:server/parser/parse_utilcmd.hnu[/*------------------------------------------------------------------------- * * parse_utilcmd.h * parse analysis for utility commands * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/parser/parse_utilcmd.h * *------------------------------------------------------------------------- */ #ifndef PARSE_UTILCMD_H #define PARSE_UTILCMD_H #include "parser/parse_node.h" extern List *transformCreateStmt(CreateStmt *stmt, const char *queryString); extern List *transformAlterTableStmt(Oid relid, AlterTableStmt *stmt, const char *queryString); extern IndexStmt *transformIndexStmt(Oid relid, IndexStmt *stmt, const char *queryString); extern void transformRuleStmt(RuleStmt *stmt, const char *queryString, List **actions, Node **whereClause); extern List *transformCreateSchemaStmt(CreateSchemaStmt *stmt); #endif /* PARSE_UTILCMD_H */ PKBiZ^Zv server/parser/parse_oper.hnu[/*------------------------------------------------------------------------- * * parse_oper.h * handle operator things for parser * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/parser/parse_oper.h * *------------------------------------------------------------------------- */ #ifndef PARSE_OPER_H #define PARSE_OPER_H #include "access/htup.h" #include "parser/parse_node.h" typedef HeapTuple Operator; /* Routines to look up an operator given name and exact input type(s) */ extern Oid LookupOperName(ParseState *pstate, List *opername, Oid oprleft, Oid oprright, bool noError, int location); extern Oid LookupOperNameTypeNames(ParseState *pstate, List *opername, TypeName *oprleft, TypeName *oprright, bool noError, int location); /* Routines to find operators matching a name and given input types */ /* NB: the selected operator may require coercion of the input types! */ extern Operator oper(ParseState *pstate, List *op, Oid arg1, Oid arg2, bool noError, int location); extern Operator right_oper(ParseState *pstate, List *op, Oid arg, bool noError, int location); extern Operator left_oper(ParseState *pstate, List *op, Oid arg, bool noError, int location); /* Routines to find operators that DO NOT require coercion --- ie, their */ /* input types are either exactly as given, or binary-compatible */ extern Operator compatible_oper(ParseState *pstate, List *op, Oid arg1, Oid arg2, bool noError, int location); /* currently no need for compatible_left_oper/compatible_right_oper */ /* Routines for identifying "<", "=", ">" operators for a type */ extern void get_sort_group_operators(Oid argtype, bool needLT, bool needEQ, bool needGT, Oid *ltOpr, Oid *eqOpr, Oid *gtOpr, bool *isHashable); /* Convenience routines for common calls on the above */ extern Oid compatible_oper_opid(List *op, Oid arg1, Oid arg2, bool noError); /* Extract operator OID or underlying-function OID from an Operator tuple */ extern Oid oprid(Operator op); extern Oid oprfuncid(Operator op); /* Build expression tree for an operator invocation */ extern Expr *make_op(ParseState *pstate, List *opname, Node *ltree, Node *rtree, int location); extern Expr *make_scalar_array_op(ParseState *pstate, List *opname, bool useOr, Node *ltree, Node *rtree, int location); #endif /* PARSE_OPER_H */ PKBiZserver/libpq/ip.hnu[/*------------------------------------------------------------------------- * * ip.h * Definitions for IPv6-aware network access. * * These definitions are used by both frontend and backend code. Be careful * what you include here! * * Copyright (c) 2003-2012, PostgreSQL Global Development Group * * src/include/libpq/ip.h * *------------------------------------------------------------------------- */ #ifndef IP_H #define IP_H #include "getaddrinfo.h" /* pgrminclude ignore */ #include "libpq/pqcomm.h" /* pgrminclude ignore */ #ifdef HAVE_UNIX_SOCKETS #define IS_AF_UNIX(fam) ((fam) == AF_UNIX) #else #define IS_AF_UNIX(fam) (0) #endif typedef void (*PgIfAddrCallback) (struct sockaddr * addr, struct sockaddr * netmask, void *cb_data); extern int pg_getaddrinfo_all(const char *hostname, const char *servname, const struct addrinfo * hintp, struct addrinfo ** result); extern void pg_freeaddrinfo_all(int hint_ai_family, struct addrinfo * ai); extern int pg_getnameinfo_all(const struct sockaddr_storage * addr, int salen, char *node, int nodelen, char *service, int servicelen, int flags); extern int pg_range_sockaddr(const struct sockaddr_storage * addr, const struct sockaddr_storage * netaddr, const struct sockaddr_storage * netmask); extern int pg_sockaddr_cidr_mask(struct sockaddr_storage * mask, char *numbits, int family); extern int pg_foreach_ifaddr(PgIfAddrCallback callback, void *cb_data); #endif /* IP_H */ PKBiZ'JJserver/libpq/be-fsstubs.hnu[/*------------------------------------------------------------------------- * * be-fsstubs.h * * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/libpq/be-fsstubs.h * *------------------------------------------------------------------------- */ #ifndef BE_FSSTUBS_H #define BE_FSSTUBS_H #include "fmgr.h" /* * LO functions available via pg_proc entries */ extern Datum lo_import(PG_FUNCTION_ARGS); extern Datum lo_import_with_oid(PG_FUNCTION_ARGS); extern Datum lo_export(PG_FUNCTION_ARGS); extern Datum lo_creat(PG_FUNCTION_ARGS); extern Datum lo_create(PG_FUNCTION_ARGS); extern Datum lo_open(PG_FUNCTION_ARGS); extern Datum lo_close(PG_FUNCTION_ARGS); extern Datum loread(PG_FUNCTION_ARGS); extern Datum lowrite(PG_FUNCTION_ARGS); extern Datum lo_lseek(PG_FUNCTION_ARGS); extern Datum lo_tell(PG_FUNCTION_ARGS); extern Datum lo_unlink(PG_FUNCTION_ARGS); extern Datum lo_truncate(PG_FUNCTION_ARGS); /* * compatibility option for access control */ extern bool lo_compat_privileges; /* * These are not fmgr-callable, but are available to C code. * Probably these should have had the underscore-free names, * but too late now... */ extern int lo_read(int fd, char *buf, int len); extern int lo_write(int fd, const char *buf, int len); /* * Cleanup LOs at xact commit/abort */ extern void AtEOXact_LargeObject(bool isCommit); extern void AtEOSubXact_LargeObject(bool isCommit, SubTransactionId mySubid, SubTransactionId parentSubid); #endif /* BE_FSSTUBS_H */ PKBiZyyserver/libpq/libpq-fs.hnu[/*------------------------------------------------------------------------- * * libpq-fs.h * definitions for using Inversion file system routines (ie, large objects) * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/libpq/libpq-fs.h * *------------------------------------------------------------------------- */ #ifndef LIBPQ_FS_H #define LIBPQ_FS_H /* * Read/write mode flags for inversion (large object) calls */ #define INV_WRITE 0x00020000 #define INV_READ 0x00040000 #endif /* LIBPQ_FS_H */ PKBiZ{server/libpq/auth.hnu[/*------------------------------------------------------------------------- * * auth.h * Definitions for network authentication routines * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/libpq/auth.h * *------------------------------------------------------------------------- */ #ifndef AUTH_H #define AUTH_H #include "libpq/libpq-be.h" extern char *pg_krb_server_keyfile; extern char *pg_krb_srvnam; extern bool pg_krb_caseins_users; extern char *pg_krb_server_hostname; extern char *pg_krb_realm; extern void ClientAuthentication(Port *port); /* Hook for plugins to get control in ClientAuthentication() */ typedef void (*ClientAuthentication_hook_type) (Port *, int); extern PGDLLIMPORT ClientAuthentication_hook_type ClientAuthentication_hook; #endif /* AUTH_H */ PKBiZ%server/libpq/hba.hnu[/*------------------------------------------------------------------------- * * hba.h * Interface to hba.c * * * src/include/libpq/hba.h * *------------------------------------------------------------------------- */ #ifndef HBA_H #define HBA_H #include "libpq/pqcomm.h" /* pgrminclude ignore */ /* needed for NetBSD */ #include "nodes/pg_list.h" typedef enum UserAuth { uaReject, uaImplicitReject, uaKrb5, uaTrust, uaIdent, uaPassword, uaMD5, uaGSS, uaSSPI, uaPAM, uaLDAP, uaCert, uaRADIUS, uaPeer } UserAuth; typedef enum IPCompareMethod { ipCmpMask, ipCmpSameHost, ipCmpSameNet, ipCmpAll } IPCompareMethod; typedef enum ConnType { ctLocal, ctHost, ctHostSSL, ctHostNoSSL } ConnType; typedef struct HbaLine { int linenumber; ConnType conntype; List *databases; List *roles; struct sockaddr_storage addr; struct sockaddr_storage mask; IPCompareMethod ip_cmp_method; char *hostname; UserAuth auth_method; char *usermap; char *pamservice; bool ldaptls; char *ldapserver; int ldapport; char *ldapbinddn; char *ldapbindpasswd; char *ldapsearchattribute; char *ldapbasedn; char *ldapprefix; char *ldapsuffix; bool clientcert; char *krb_server_hostname; char *krb_realm; bool include_realm; char *radiusserver; char *radiussecret; char *radiusidentifier; int radiusport; } HbaLine; /* kluge to avoid including libpq/libpq-be.h here */ typedef struct Port hbaPort; extern bool load_hba(void); extern void load_ident(void); extern void hba_getauthmethod(hbaPort *port); extern int check_usermap(const char *usermap_name, const char *pg_role, const char *auth_user, bool case_sensitive); extern bool pg_isblank(const char c); #endif /* HBA_H */ PKBiZG+( ( server/libpq/libpq.hnu[/*------------------------------------------------------------------------- * * libpq.h * POSTGRES LIBPQ buffer structure definitions. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/libpq/libpq.h * *------------------------------------------------------------------------- */ #ifndef LIBPQ_H #define LIBPQ_H #include #include #include "lib/stringinfo.h" #include "libpq/libpq-be.h" /* ---------------- * PQArgBlock * Information (pointer to array of this structure) required * for the PQfn() call. (This probably ought to go somewhere else...) * ---------------- */ typedef struct { int len; int isint; union { int *ptr; /* can't use void (dec compiler barfs) */ int integer; } u; } PQArgBlock; /* * External functions. */ /* * prototypes for functions in pqcomm.c */ extern int StreamServerPort(int family, char *hostName, unsigned short portNumber, char *unixSocketDir, pgsocket ListenSocket[], int MaxListen); extern int StreamConnection(pgsocket server_fd, Port *port); extern void StreamClose(pgsocket sock); extern void TouchSocketFiles(void); extern void pq_init(void); extern void pq_comm_reset(void); extern int pq_getbytes(char *s, size_t len); extern int pq_getstring(StringInfo s); extern void pq_startmsgread(void); extern void pq_endmsgread(void); extern bool pq_is_reading_msg(void); extern int pq_getmessage(StringInfo s, int maxlen); extern int pq_getbyte(void); extern int pq_peekbyte(void); extern int pq_getbyte_if_available(unsigned char *c); extern bool pq_buffer_has_data(void); extern int pq_putbytes(const char *s, size_t len); extern int pq_flush(void); extern int pq_flush_if_writable(void); extern bool pq_is_send_pending(void); extern int pq_putmessage(char msgtype, const char *s, size_t len); extern void pq_putmessage_noblock(char msgtype, const char *s, size_t len); extern void pq_startcopyout(void); extern void pq_endcopyout(bool errorAbort); /* * prototypes for functions in be-secure.c */ extern char *ssl_cert_file; extern char *ssl_key_file; extern char *ssl_ca_file; extern char *ssl_crl_file; extern int secure_initialize(void); extern bool secure_loaded_verify_locations(void); extern void secure_destroy(void); extern int secure_open_server(Port *port); extern void secure_close(Port *port); extern ssize_t secure_read(Port *port, void *ptr, size_t len); extern ssize_t secure_write(Port *port, void *ptr, size_t len); #endif /* LIBPQ_H */ PKBiZ{server/libpq/md5.hnu[/*------------------------------------------------------------------------- * * md5.h * Interface to libpq/md5.c * * These definitions are needed by both frontend and backend code to work * with MD5-encrypted passwords. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/libpq/md5.h * *------------------------------------------------------------------------- */ #ifndef PG_MD5_H #define PG_MD5_H #define MD5_PASSWD_LEN 35 #define isMD5(passwd) (strncmp(passwd, "md5", 3) == 0 && \ strlen(passwd) == MD5_PASSWD_LEN) extern bool pg_md5_hash(const void *buff, size_t len, char *hexsum); extern bool pg_md5_binary(const void *buff, size_t len, void *outbuf); extern bool pg_md5_encrypt(const char *passwd, const char *salt, size_t salt_len, char *buf); #endif PKBiZ server/libpq/pqsignal.hnu[/*------------------------------------------------------------------------- * * pqsignal.h * prototypes for the reliable BSD-style signal(2) routine. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/libpq/pqsignal.h * * NOTES * This shouldn't be in libpq, but the monitor and some other * things need it... * *------------------------------------------------------------------------- */ #ifndef PQSIGNAL_H #define PQSIGNAL_H #include #ifdef HAVE_SIGPROCMASK extern sigset_t UnBlockSig, BlockSig, StartupBlockSig; #define PG_SETMASK(mask) sigprocmask(SIG_SETMASK, mask, NULL) #else /* not HAVE_SIGPROCMASK */ extern int UnBlockSig, BlockSig, StartupBlockSig; #ifndef WIN32 #define PG_SETMASK(mask) sigsetmask(*((int*)(mask))) #else #define PG_SETMASK(mask) pqsigsetmask(*((int*)(mask))) int pqsigsetmask(int mask); #endif #define sigaddset(set, signum) (*(set) |= (sigmask(signum))) #define sigdelset(set, signum) (*(set) &= ~(sigmask(signum))) #endif /* not HAVE_SIGPROCMASK */ typedef void (*pqsigfunc) (int); extern void pqinitmask(void); extern pqsigfunc pqsignal(int signo, pqsigfunc func); #endif /* PQSIGNAL_H */ PKBiZhserver/libpq/pqformat.hnu[/*------------------------------------------------------------------------- * * pqformat.h * Definitions for formatting and parsing frontend/backend messages * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/libpq/pqformat.h * *------------------------------------------------------------------------- */ #ifndef PQFORMAT_H #define PQFORMAT_H #include "lib/stringinfo.h" extern void pq_beginmessage(StringInfo buf, char msgtype); extern void pq_sendbyte(StringInfo buf, int byt); extern void pq_sendbytes(StringInfo buf, const char *data, int datalen); extern void pq_sendcountedtext(StringInfo buf, const char *str, int slen, bool countincludesself); extern void pq_sendtext(StringInfo buf, const char *str, int slen); extern void pq_sendstring(StringInfo buf, const char *str); extern void pq_send_ascii_string(StringInfo buf, const char *str); extern void pq_sendint(StringInfo buf, int i, int b); extern void pq_sendint64(StringInfo buf, int64 i); extern void pq_sendfloat4(StringInfo buf, float4 f); extern void pq_sendfloat8(StringInfo buf, float8 f); extern void pq_endmessage(StringInfo buf); extern void pq_begintypsend(StringInfo buf); extern bytea *pq_endtypsend(StringInfo buf); extern void pq_puttextmessage(char msgtype, const char *str); extern void pq_putemptymessage(char msgtype); extern int pq_getmsgbyte(StringInfo msg); extern unsigned int pq_getmsgint(StringInfo msg, int b); extern int64 pq_getmsgint64(StringInfo msg); extern float4 pq_getmsgfloat4(StringInfo msg); extern float8 pq_getmsgfloat8(StringInfo msg); extern const char *pq_getmsgbytes(StringInfo msg, int datalen); extern void pq_copymsgbytes(StringInfo msg, char *buf, int datalen); extern char *pq_getmsgtext(StringInfo msg, int rawbytes, int *nbytes); extern const char *pq_getmsgstring(StringInfo msg); extern void pq_getmsgend(StringInfo msg); #endif /* PQFORMAT_H */ PKBiZserver/libpq/libpq-be.hnu[/*------------------------------------------------------------------------- * * libpq_be.h * This file contains definitions for structures and externs used * by the postmaster during client authentication. * * Note that this is backend-internal and is NOT exported to clients. * Structs that need to be client-visible are in pqcomm.h. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/libpq/libpq-be.h * *------------------------------------------------------------------------- */ #ifndef LIBPQ_BE_H #define LIBPQ_BE_H #ifdef HAVE_SYS_TIME_H #include #endif #ifdef USE_SSL #include #include #endif #ifdef HAVE_NETINET_TCP_H #include #endif #ifdef ENABLE_GSS #if defined(HAVE_GSSAPI_H) #include #else #include #endif /* HAVE_GSSAPI_H */ /* * GSSAPI brings in headers that set a lot of things in the global namespace on win32, * that doesn't match the msvc build. It gives a bunch of compiler warnings that we ignore, * but also defines a symbol that simply does not exist. Undefine it again. */ #ifdef WIN32_ONLY_COMPILER #undef HAVE_GETADDRINFO #endif #endif /* ENABLE_GSS */ #ifdef ENABLE_SSPI #define SECURITY_WIN32 #if defined(WIN32) && !defined(WIN32_ONLY_COMPILER) #include #endif #include #undef SECURITY_WIN32 #ifndef ENABLE_GSS /* * Define a fake structure compatible with GSSAPI on Unix. */ typedef struct { void *value; int length; } gss_buffer_desc; #endif #endif /* ENABLE_SSPI */ #include "datatype/timestamp.h" #include "libpq/hba.h" #include "libpq/pqcomm.h" typedef enum CAC_state { CAC_OK, CAC_STARTUP, CAC_SHUTDOWN, CAC_RECOVERY, CAC_TOOMANY, CAC_WAITBACKUP } CAC_state; /* * GSSAPI specific state information */ #if defined(ENABLE_GSS) | defined(ENABLE_SSPI) typedef struct { gss_buffer_desc outbuf; /* GSSAPI output token buffer */ #ifdef ENABLE_GSS gss_cred_id_t cred; /* GSSAPI connection cred's */ gss_ctx_id_t ctx; /* GSSAPI connection context */ gss_name_t name; /* GSSAPI client name */ #endif } pg_gssinfo; #endif /* * This is used by the postmaster in its communication with frontends. It * contains all state information needed during this communication before the * backend is run. The Port structure is kept in malloc'd memory and is * still available when a backend is running (see MyProcPort). The data * it points to must also be malloc'd, or else palloc'd in TopMemoryContext, * so that it survives into PostgresMain execution! * * remote_hostname is set if we did a successful reverse lookup of the * client's IP address during connection setup. * remote_hostname_resolv tracks the state of hostname verification: * +1 = remote_hostname is known to resolve to client's IP address * -1 = remote_hostname is known NOT to resolve to client's IP address * 0 = we have not done the forward DNS lookup yet * -2 = there was an error in name resolution * If reverse lookup of the client IP address fails, remote_hostname will be * left NULL while remote_hostname_resolv is set to -2. If reverse lookup * succeeds but forward lookup fails, remote_hostname_resolv is also set to -2 * (the case is distinguishable because remote_hostname isn't NULL). In * either of the -2 cases, remote_hostname_errcode saves the lookup return * code for possible later use with gai_strerror. */ typedef struct Port { pgsocket sock; /* File descriptor */ bool noblock; /* is the socket in non-blocking mode? */ ProtocolVersion proto; /* FE/BE protocol version */ SockAddr laddr; /* local addr (postmaster) */ SockAddr raddr; /* remote addr (client) */ char *remote_host; /* name (or ip addr) of remote host */ char *remote_hostname;/* name (not ip addr) of remote host, if * available */ int remote_hostname_resolv; /* see above */ char *remote_port; /* text rep of remote port */ CAC_state canAcceptConnections; /* postmaster connection status */ /* * Information that needs to be saved from the startup packet and passed * into backend execution. "char *" fields are NULL if not set. * guc_options points to a List of alternating option names and values. */ char *database_name; char *user_name; char *cmdline_options; List *guc_options; /* * Information that needs to be held during the authentication cycle. */ HbaLine *hba; char md5Salt[4]; /* Password salt */ /* * Information that really has no business at all being in struct Port, * but since it gets used by elog.c in the same way as database_name and * other members of this struct, we may as well keep it here. */ TimestampTz SessionStartTime; /* backend start time */ /* * TCP keepalive settings. * * default values are 0 if AF_UNIX or not yet known; current values are 0 * if AF_UNIX or using the default. Also, -1 in a default value means we * were unable to find out the default (getsockopt failed). */ int default_keepalives_idle; int default_keepalives_interval; int default_keepalives_count; int keepalives_idle; int keepalives_interval; int keepalives_count; #if defined(ENABLE_GSS) || defined(ENABLE_SSPI) /* * If GSSAPI is supported, store GSSAPI information. Otherwise, store a * NULL pointer to make sure offsets in the struct remain the same. */ pg_gssinfo *gss; #else void *gss; #endif /* * SSL structures (keep these last so that USE_SSL doesn't affect * locations of other fields) */ #ifdef USE_SSL SSL *ssl; X509 *peer; char *peer_cn; unsigned long count; #endif /* This field will be in a saner place in 9.4 and up */ int remote_hostname_errcode; /* see above */ } Port; extern ProtocolVersion FrontendProtocol; /* TCP keepalives configuration. These are no-ops on an AF_UNIX socket. */ extern int pq_getkeepalivesidle(Port *port); extern int pq_getkeepalivesinterval(Port *port); extern int pq_getkeepalivescount(Port *port); extern int pq_setkeepalivesidle(int idle, Port *port); extern int pq_setkeepalivesinterval(int interval, Port *port); extern int pq_setkeepalivescount(int count, Port *port); #endif /* LIBPQ_BE_H */ PKBiZ &&server/libpq/crypt.hnu[/*------------------------------------------------------------------------- * * crypt.h * Interface to libpq/crypt.c * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/libpq/crypt.h * *------------------------------------------------------------------------- */ #ifndef PG_CRYPT_H #define PG_CRYPT_H #include "libpq/libpq-be.h" extern int md5_crypt_verify(const Port *port, const char *user, char *client_pass); #endif PKBiZooserver/libpq/pqcomm.hnu[/*------------------------------------------------------------------------- * * pqcomm.h * Definitions common to frontends and backends. * * NOTE: for historical reasons, this does not correspond to pqcomm.c. * pqcomm.c's routines are declared in libpq.h. * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/libpq/pqcomm.h * *------------------------------------------------------------------------- */ #ifndef PQCOMM_H #define PQCOMM_H #include #include #ifdef HAVE_SYS_UN_H #include #endif #include #ifdef HAVE_STRUCT_SOCKADDR_STORAGE #ifndef HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY #ifdef HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY #define ss_family __ss_family #else #error struct sockaddr_storage does not provide an ss_family member #endif #endif #ifdef HAVE_STRUCT_SOCKADDR_STORAGE___SS_LEN #define ss_len __ss_len #define HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN 1 #endif #else /* !HAVE_STRUCT_SOCKADDR_STORAGE */ /* Define a struct sockaddr_storage if we don't have one. */ struct sockaddr_storage { union { struct sockaddr sa; /* get the system-dependent fields */ int64 ss_align; /* ensures struct is properly aligned */ char ss_pad[128]; /* ensures struct has desired size */ } ss_stuff; }; #define ss_family ss_stuff.sa.sa_family /* It should have an ss_len field if sockaddr has sa_len. */ #ifdef HAVE_STRUCT_SOCKADDR_SA_LEN #define ss_len ss_stuff.sa.sa_len #define HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN 1 #endif #endif /* HAVE_STRUCT_SOCKADDR_STORAGE */ typedef struct { struct sockaddr_storage addr; ACCEPT_TYPE_ARG3 salen; } SockAddr; /* Configure the UNIX socket location for the well known port. */ #define UNIXSOCK_PATH(path, port, sockdir) \ snprintf(path, sizeof(path), "%s/.s.PGSQL.%d", \ ((sockdir) && *(sockdir) != '\0') ? (sockdir) : \ DEFAULT_PGSOCKET_DIR, \ (port)) /* * The maximum workable length of a socket path is what will fit into * struct sockaddr_un. This is usually only 100 or so bytes :-(. * * For consistency, always pass a MAXPGPATH-sized buffer to UNIXSOCK_PATH(), * then complain if the resulting string is >= UNIXSOCK_PATH_BUFLEN bytes. * (Because the standard API for getaddrinfo doesn't allow it to complain in * a useful way when the socket pathname is too long, we have to test for * this explicitly, instead of just letting the subroutine return an error.) */ #define UNIXSOCK_PATH_BUFLEN sizeof(((struct sockaddr_un *) NULL)->sun_path) /* * These manipulate the frontend/backend protocol version number. * * The major number should be incremented for incompatible changes. The minor * number should be incremented for compatible changes (eg. additional * functionality). * * If a backend supports version m.n of the protocol it must actually support * versions m.[0..n]. Backend support for version m-1 can be dropped after a * `reasonable' length of time. * * A frontend isn't required to support anything other than the current * version. */ #define PG_PROTOCOL_MAJOR(v) ((v) >> 16) #define PG_PROTOCOL_MINOR(v) ((v) & 0x0000ffff) #define PG_PROTOCOL(m,n) (((m) << 16) | (n)) /* The earliest and latest frontend/backend protocol version supported. */ #define PG_PROTOCOL_EARLIEST PG_PROTOCOL(1,0) #define PG_PROTOCOL_LATEST PG_PROTOCOL(3,0) typedef uint32 ProtocolVersion; /* FE/BE protocol version number */ typedef ProtocolVersion MsgType; /* * Packet lengths are 4 bytes in network byte order. * * The initial length is omitted from the packet layouts appearing below. */ typedef uint32 PacketLen; /* * Old-style startup packet layout with fixed-width fields. This is used in * protocol 1.0 and 2.0, but not in later versions. Note that the fields * in this layout are '\0' terminated only if there is room. */ #define SM_DATABASE 64 #define SM_USER 32 /* We append database name if db_user_namespace true. */ #define SM_DATABASE_USER (SM_DATABASE+SM_USER+1) /* +1 for @ */ #define SM_OPTIONS 64 #define SM_UNUSED 64 #define SM_TTY 64 typedef struct StartupPacket { ProtocolVersion protoVersion; /* Protocol version */ char database[SM_DATABASE]; /* Database name */ /* Db_user_namespace appends dbname */ char user[SM_USER]; /* User name */ char options[SM_OPTIONS]; /* Optional additional args */ char unused[SM_UNUSED]; /* Unused */ char tty[SM_TTY]; /* Tty for debug output */ } StartupPacket; extern bool Db_user_namespace; /* * In protocol 3.0 and later, the startup packet length is not fixed, but * we set an arbitrary limit on it anyway. This is just to prevent simple * denial-of-service attacks via sending enough data to run the server * out of memory. */ #define MAX_STARTUP_PACKET_LENGTH 10000 /* These are the authentication request codes sent by the backend. */ #define AUTH_REQ_OK 0 /* User is authenticated */ #define AUTH_REQ_KRB4 1 /* Kerberos V4. Not supported any more. */ #define AUTH_REQ_KRB5 2 /* Kerberos V5 */ #define AUTH_REQ_PASSWORD 3 /* Password */ #define AUTH_REQ_CRYPT 4 /* crypt password. Not supported any more. */ #define AUTH_REQ_MD5 5 /* md5 password */ #define AUTH_REQ_SCM_CREDS 6 /* transfer SCM credentials */ #define AUTH_REQ_GSS 7 /* GSSAPI without wrap() */ #define AUTH_REQ_GSS_CONT 8 /* Continue GSS exchanges */ #define AUTH_REQ_SSPI 9 /* SSPI negotiate without wrap() */ #define AUTH_REQ_SASL 10 /* SASL authentication. Not supported before * libpq version 10. */ typedef uint32 AuthRequest; /* * A client can also send a cancel-current-operation request to the postmaster. * This is uglier than sending it directly to the client's backend, but it * avoids depending on out-of-band communication facilities. * * The cancel request code must not match any protocol version number * we're ever likely to use. This random choice should do. */ #define CANCEL_REQUEST_CODE PG_PROTOCOL(1234,5678) typedef struct CancelRequestPacket { /* Note that each field is stored in network byte order! */ MsgType cancelRequestCode; /* code to identify a cancel request */ uint32 backendPID; /* PID of client's backend */ uint32 cancelAuthCode; /* secret key to authorize cancel */ } CancelRequestPacket; /* * A client can also start by sending a SSL negotiation request, to get a * secure channel. */ #define NEGOTIATE_SSL_CODE PG_PROTOCOL(1234,5679) #endif /* PQCOMM_H */ PKBiZ:server/portability/instr_time.hnu[/*------------------------------------------------------------------------- * * instr_time.h * portable high-precision interval timing * * This file provides an abstraction layer to hide portability issues in * interval timing. On Unix we use gettimeofday(), but on Windows that * gives a low-precision result so we must use QueryPerformanceCounter() * instead. These macros also give some breathing room to use other * high-precision-timing APIs on yet other platforms. * * The basic data type is instr_time, which all callers should treat as an * opaque typedef. instr_time can store either an absolute time (of * unspecified reference time) or an interval. The operations provided * for it are: * * INSTR_TIME_IS_ZERO(t) is t equal to zero? * * INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too) * * INSTR_TIME_SET_CURRENT(t) set t to current time * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y * * INSTR_TIME_ACCUM_DIFF(x, y, z) x += (y - z) * * INSTR_TIME_GET_DOUBLE(t) convert t to double (in seconds) * * INSTR_TIME_GET_MILLISEC(t) convert t to double (in milliseconds) * * INSTR_TIME_GET_MICROSEC(t) convert t to uint64 (in microseconds) * * Note that INSTR_TIME_SUBTRACT and INSTR_TIME_ACCUM_DIFF convert * absolute times to intervals. The INSTR_TIME_GET_xxx operations are * only useful on intervals. * * When summing multiple measurements, it's recommended to leave the * running sum in instr_time form (ie, use INSTR_TIME_ADD or * INSTR_TIME_ACCUM_DIFF) and convert to a result format only at the end. * * Beware of multiple evaluations of the macro arguments. * * * Copyright (c) 2001-2012, PostgreSQL Global Development Group * * src/include/portability/instr_time.h * *------------------------------------------------------------------------- */ #ifndef INSTR_TIME_H #define INSTR_TIME_H #ifndef WIN32 #include typedef struct timeval instr_time; #define INSTR_TIME_IS_ZERO(t) ((t).tv_usec == 0 && (t).tv_sec == 0) #define INSTR_TIME_SET_ZERO(t) ((t).tv_sec = 0, (t).tv_usec = 0) #define INSTR_TIME_SET_CURRENT(t) gettimeofday(&(t), NULL) #define INSTR_TIME_ADD(x,y) \ do { \ (x).tv_sec += (y).tv_sec; \ (x).tv_usec += (y).tv_usec; \ /* Normalize */ \ while ((x).tv_usec >= 1000000) \ { \ (x).tv_usec -= 1000000; \ (x).tv_sec++; \ } \ } while (0) #define INSTR_TIME_SUBTRACT(x,y) \ do { \ (x).tv_sec -= (y).tv_sec; \ (x).tv_usec -= (y).tv_usec; \ /* Normalize */ \ while ((x).tv_usec < 0) \ { \ (x).tv_usec += 1000000; \ (x).tv_sec--; \ } \ } while (0) #define INSTR_TIME_ACCUM_DIFF(x,y,z) \ do { \ (x).tv_sec += (y).tv_sec - (z).tv_sec; \ (x).tv_usec += (y).tv_usec - (z).tv_usec; \ /* Normalize after each add to avoid overflow/underflow of tv_usec */ \ while ((x).tv_usec < 0) \ { \ (x).tv_usec += 1000000; \ (x).tv_sec--; \ } \ while ((x).tv_usec >= 1000000) \ { \ (x).tv_usec -= 1000000; \ (x).tv_sec++; \ } \ } while (0) #define INSTR_TIME_GET_DOUBLE(t) \ (((double) (t).tv_sec) + ((double) (t).tv_usec) / 1000000.0) #define INSTR_TIME_GET_MILLISEC(t) \ (((double) (t).tv_sec * 1000.0) + ((double) (t).tv_usec) / 1000.0) #define INSTR_TIME_GET_MICROSEC(t) \ (((uint64) (t).tv_sec * (uint64) 1000000) + (uint64) (t).tv_usec) #else /* WIN32 */ typedef LARGE_INTEGER instr_time; #define INSTR_TIME_IS_ZERO(t) ((t).QuadPart == 0) #define INSTR_TIME_SET_ZERO(t) ((t).QuadPart = 0) #define INSTR_TIME_SET_CURRENT(t) QueryPerformanceCounter(&(t)) #define INSTR_TIME_ADD(x,y) \ ((x).QuadPart += (y).QuadPart) #define INSTR_TIME_SUBTRACT(x,y) \ ((x).QuadPart -= (y).QuadPart) #define INSTR_TIME_ACCUM_DIFF(x,y,z) \ ((x).QuadPart += (y).QuadPart - (z).QuadPart) #define INSTR_TIME_GET_DOUBLE(t) \ (((double) (t).QuadPart) / GetTimerFrequency()) #define INSTR_TIME_GET_MILLISEC(t) \ (((double) (t).QuadPart * 1000.0) / GetTimerFrequency()) #define INSTR_TIME_GET_MICROSEC(t) \ ((uint64) (((double) (t).QuadPart * 1000000.0) / GetTimerFrequency())) static inline double GetTimerFrequency(void) { LARGE_INTEGER f; QueryPerformanceFrequency(&f); return (double) f.QuadPart; } #endif /* WIN32 */ #endif /* INSTR_TIME_H */ PKBiZny!77internal/port.hnu[PKBiZ3A8internal/pqexpbuffer.hnu[PKBiZAeAe Qinternal/c.hnu[PKBiZiJyMinternal/postgres_fe.hnu[PKBiZW1ZZminternal/libpq-int.hnu[PKBiZoointernal/libpq/pqcomm.hnu[PKBiZ1\.informix/esql/decimal.hnu[PKBiZBF/informix/esql/sqltypes.hnu[PKBiZ|DD5informix/esql/datetime.hnu[PKBiZ'KS7server/pgtar.hnu[PKBiZny!77 ;:server/port.hnu[PKBiZViP @rserver/regex/regcustom.hnu[PKBiZ{ ??*server/regex/regguts.hnu[PKBiZЃ44server/regex/regerrs.hnu[PKBiZ//server/regex/regex.hnu[PKBiZTUcCcCrserver/mb/pg_wchar.hnu[PKBiZ],I#server/tcop/utility.hnu[PKBiZ--)server/tcop/dest.hnu[PKBiZS+h h r?server/tcop/tcopprot.hnu[PKBiZbG%% Mserver/tcop/tcopdebug.hnu[PKBiZTk00Rserver/tcop/fastpath.hnu[PKBiZYUserver/tcop/pquery.hnu[PKBiZN..Yserver/rewrite/prs2lock.hnu[PKBiZ.q?^server/rewrite/rewriteSupport.hnu[PKBiZXNwwbserver/rewrite/rewriteDefine.hnu[PKBiZfserver/rewrite/rewriteRemove.hnu[PKBiZdIiserver/rewrite/rewriteHandler.hnu[PKBiZ+i lserver/rewrite/rewriteManip.hnu[PKBiZwserver/catalog/pg_index.hnu[PKBiZ~~ server/catalog/pg_operator.hnu[PKBiZ$f@??Gserver/catalog/schemapg.hnu[PKBiZx9%%Eserver/catalog/dependency.hnu[PKBiZÇs 8 8kserver/catalog/pg_amproc.hnu[PKBiZƾ1q)q)server/catalog/pg_aggregate.hnu[PKBiZg server/catalog/pg_shdepend.hnu[PKBiZ{b server/catalog/pg_collation_fn.hnu[PKBiZ2ܦmmGserver/catalog/pg_ts_config.hnu[PKBiZW&lserver/catalog/pg_ts_parser.hnu[PKBiZ?JqPserver/catalog/pg_collation.hnu[PKBiZѺs.A.APserver/catalog/indexing.hnu[PKBiZ0! ! 5server/catalog/index.hnu[PKBiZI#.Bserver/catalog/pg_conversion.hnu[PKBiZȈlAA!Jserver/catalog/pg_conversion_fn.hnu[PKBiZAwZ  !Nserver/catalog/pg_ts_config_map.hnu[PKBiZ# m&??Wserver/catalog/pg_shseclabel.hnu[PKBiZDuINN]server/catalog/pg_type_fn.hnu[PKBiZV>("fserver/catalog/pg_foreign_data_wrapper.hnu[PKBiZt t nserver/catalog/pg_constraint.hnu[PKBiZ_o# # Nserver/catalog/pg_range.hnu[PKBiZ~ server/catalog/objectaddress.hnu[PKBiZfDffܞserver/catalog/pg_rewrite.hnu[PKBiZ   server/catalog/catversion.hnu[PKBiZ server/catalog/pg_language.hnu[PKBiZY ɺserver/catalog/pg_description.hnu[PKBiZhж--server/catalog/pg_opclass.hnu[PKBiZj|ց server/catalog/pg_database.hnu[PKBiZ*hhserver/catalog/pg_default_acl.hnu[PKBiZ& Iserver/catalog/pg_ts_dict.hnu[PKBiZ@)SSserver/catalog/pg_seclabel.hnu[PKBiZIRserver/catalog/toasting.hnu[PKBiZVp =server/catalog/pg_auth_members.hnu[PKBiZq\&&$server/catalog/pg_largeobject.hnu[PKBiZS}ss,server/catalog/pg_trigger.hnu[PKBiZ Bserver/catalog/pg_authid.hnu[PKBiZVi|RROserver/catalog/pg_inherits_fn.hnu[PKBiZ33qSserver/catalog/catalog.hnu[PKBiZY핅[server/catalog/pg_type.hnu[PKBiZdserver/catalog/pg_inherits.hnu[PKBiZ2server/catalog/namespace.hnu[PKBiZ0&&server/catalog/pg_attribute.hnu[PKBiZ@zz"o:server/catalog/pg_foreign_server.hnu[PKBiZ̻XX ;Bserver/catalog/pg_user_mapping.hnu[PKBiZ$ !Hserver/catalog/pg_shdescription.hnu[PKBiZb{2(Rserver/catalog/pg_largeobject_metadata.hnu[PKBiZ;XXYserver/catalog/pg_extension.hnu[PKBiZ0.|,,sbserver/catalog/pg_statistic.hnu[PKBiZ"DVVserver/catalog/storage.hnu[PKBiZ ##server/catalog/pg_db_role_setting.hnu[PKBiZWfCCOserver/catalog/pg_enum.hnu[PKBiZRvvڤserver/catalog/objectaccess.hnu[PKBiZhxserver/catalog/pg_proc_fn.hnu[PKBiZ'Tccyserver/catalog/pg_tablespace.hnu[PKBiZJ$ *server/catalog/pg_depend.hnu[PKBiZ&9]]`server/catalog/pg_opfamily.hnu[PKBiZfs) server/catalog/pg_namespace.hnu[PKBiZG.އ@server/catalog/pg_attrdef.hnu[PKBiZdޞbbserver/catalog/pg_amop.hnu[PKBiZ0edq q nOserver/catalog/pg_pltemplate.hnu[PKBiZH_-\server/catalog/pg_control.hnu[PKBiZaP> \\!`|server/catalog/pg_foreign_table.hnu[PKBiZ&,;; server/catalog/heap.hnu[PKBiZ 55server/catalog/pg_am.hnu[PKBiZ  server/catalog/pg_proc.hnu[PKBiZӌserver/catalog/pg_class.hnu[PKBiZAii server/catalog/pg_ts_template.hnu[PKBiZ7--server/catalog/pg_cast.hnu[PKBiZpFserver/catalog/genbki.hnu[PKBiZ h((E server/funcapi.hnu[PKBiZ`~==y4server/miscadmin.hnu[PKBiZ] rserver/port/netbsd.hnu[PKBiZ۷!!rserver/port/freebsd.hnu[PKBiZC544`sserver/port/hpux.hnu[PKBiZ:RRsserver/port/aix.hnu[PKBiZ`">itserver/port/unixware.hnu[PKBiZK}userver/port/irix.hnu[PKBiZvserver/port/solaris.hnu[PKBiZA--!{server/port/win32_msvc/sys/time.hnu[PKBiZs;--!{server/port/win32_msvc/sys/file.hnu[PKBiZsK.."|server/port/win32_msvc/sys/param.hnu[PKBiZ\|server/port/win32_msvc/dirent.hnu[PKBiZTC**~server/port/win32_msvc/utime.hnu[PKBiZa++~server/port/win32_msvc/unistd.hnu[PKBiZuserver/port/linux.hnu[PKBiZԃserver/port/cygwin.hnu[PKBiZ(ss̅server/port/sco.hnu[PKBiZ=N!!server/port/openbsd.hnu[PKBiZ0 %%server/port/win32/dlfcn.hnu[PKBiZDX''Tserver/port/win32/pwd.hnu[PKBiZIR##‡server/port/win32/grp.hnu[PKBiZEow,,,server/port/win32/sys/wait.hnu[PKBiZ­}server/port/win32/sys/socket.hnu[PKBiZZ%%server/port/win32/netdb.hnu[PKBiZwwCCserver/port/win32/netinet/in.hnu[PKBiZS$BBserver/port/win32/arpa/inet.hnu[PKBiZ(ﺑU3U38server/port/win32.hnu[PKBiZ+IIserver/port/osf.hnu[PKBiZMFZserver/port/darwin.hnu[PKBiZC#KK;server/rusagestub.hnu[PKBiZ@m%m%server/pg_config_manual.hnu[PKBiZ'JPJPserver/postgres.hnu[PKBiZ <server/getaddrinfo.hnu[PKBiZ9Kserver/utils/varbit.hnu[PKBiZ=]server/utils/datum.hnu[PKBiZ!?;2;2qcserver/utils/elog.hnu[PKBiZX[CCserver/utils/ascii.hnu[PKBiZ_t  vserver/utils/rbtree.hnu[PKBiZ; ˃áserver/utils/tzparser.hnu[PKBiZ5server/utils/relmapper.hnu[PKBiZbiOOserver/utils/bytea.hnu[PKBiZIserver/utils/attoptcache.hnu[PKBiZ)&&>server/utils/timestamp.hnu[PKBiZa"rrserver/utils/pg_crc.hnu[PKBiZL >@server/utils/lsyscache.hnu[PKBiZZ  server/utils/inet.hnu[PKBiZLzzuserver/utils/tuplesort.hnu[PKBiZa!"7'server/utils/ps_status.hnu[PKBiZ*server/utils/memutils.hnu[PKBiZ)M2?server/utils/builtins.hnu[PKBiZ=YYserver/utils/snapmgr.hnu[PKBiZ_EEFF.server/utils/cash.hnu[PKBiZY99 server/utils/inval.hnu[PKBiZϒ 4server/utils/tuplestore.hnu[PKBiZpЉoNoN "server/utils/errcodes.hnu[PKBiZڮ7  pserver/utils/plancache.hnu[PKBiZOU3""server/utils/int8.hnu[PKBiZserver/utils/dynamic_loader.hnu[PKBiZC(aeFFWserver/utils/resowner.hnu[PKBiZI{  server/utils/typcache.hnu[PKBiZ7server/utils/dynahash.hnu[PKBiZ$ pserver/utils/rangetypes.hnu[PKBiZGt Rserver/utils/tqual.hnu[PKBiZ;(BNNserver/utils/pg_crc_tables.hnu[PKBiZ2mGserver/utils/reltrigger.hnu[PKBiZ Oserver/utils/relcache.hnu[PKBiZ\server/utils/guc_tables.hnu[PKBiZ%P̃]]yserver/utils/uuid.hnu[PKBiZY;Q}server/utils/xml.hnu[PKBiZ244%server/utils/guc.hnu[PKBiZH.44(server/utils/sortsupport.hnu[PKBiZt11T server/utils/rel.hnu[PKBiZ~>|;server/utils/date.hnu[PKBiZь[6Zserver/utils/help_config.hnu[PKBiZg\server/utils/selfuncs.hnu[PKBiZcM5{server/utils/logtape.hnu[PKBiZ*+ɔgserver/utils/json.hnu[PKBiZml''>server/utils/datetime.hnu[PKBiZ 1server/utils/numeric.hnu[PKBiZ server/utils/probes.hnu[PKBiZ=^ ^ Lserver/utils/pg_locale.hnu[PKBiZ)P,,Wserver/utils/spccache.hnu[PKBiZ&Zserver/utils/hsearch.hnu[PKBiZD6] ] ]pserver/utils/snapshot.hnu[PKBiZ8z${server/pg_config.hnu[PKBiZ} Iserver/datatype/timestamp.hnu[PKBiZxk  server/pgtime.hnu[PKBiZua$##מserver/tsearch/ts_type.hnu[PKBiZVx *!server/tsearch/ts_locale.hnu[PKBiZa0;==rserver/tsearch/ts_cache.hnu[PKBiZ server/tsearch/ts_public.hnu[PKBiZ< {;server/tsearch/ts_utils.hnu[PKBiZ8pserver/tsearch/dicts/regis.hnu[PKBiZj47Hqqserver/tsearch/dicts/spell.hnu[PKBiZޘserver/postgres_ext.hnu[PKBiZ+++server/bootstrap/bootstrap.hnu[PKBiZ)``dserver/dynloader.hnu[PKBiZXΉ"server/snowball/header.hnu[PKBiZlBB2(server/snowball/libstemmer/stem_ISO_8859_1_dutch.hnu[PKBiZ7dEE3*server/snowball/libstemmer/stem_ISO_8859_1_german.hnu[PKBiZc,99/5,server/snowball/libstemmer/stem_UTF_8_russian.hnu[PKBiZCEE3-server/snowball/libstemmer/stem_ISO_8859_1_porter.hnu[PKBiZd #u/server/snowball/libstemmer/header.hnu[PKBiZ)MaNN69server/snowball/libstemmer/stem_ISO_8859_1_norwegian.hnu[PKBiZN<<03;server/snowball/libstemmer/stem_UTF_8_romanian.hnu[PKBiZ;99/<server/snowball/libstemmer/stem_UTF_8_spanish.hnu[PKBiZDQ99/g>server/snowball/libstemmer/stem_UTF_8_english.hnu[PKBiZ99/?server/snowball/libstemmer/stem_UTF_8_turkish.hnu[PKBiZ?6HH4Aserver/snowball/libstemmer/stem_ISO_8859_1_italian.hnu[PKBiZsj|_HH4CCserver/snowball/libstemmer/stem_ISO_8859_1_spanish.hnu[PKBiZ.466.Dserver/snowball/libstemmer/stem_UTF_8_danish.hnu[PKBiZ$pD99/Fserver/snowball/libstemmer/stem_UTF_8_swedish.hnu[PKBiZ99/Hserver/snowball/libstemmer/stem_UTF_8_italian.hnu[PKBiZ qQQ7Iserver/snowball/libstemmer/stem_ISO_8859_1_portuguese.hnu[PKBiZ^0KK5kKserver/snowball/libstemmer/stem_ISO_8859_2_romanian.hnu[PKBiZSBB2Mserver/snowball/libstemmer/stem_UTF_8_portuguese.hnu[PKBiZJ99/Nserver/snowball/libstemmer/stem_UTF_8_finnish.hnu[PKBiZC?66.WPserver/snowball/libstemmer/stem_UTF_8_german.hnu[PKBiZ%g33-Qserver/snowball/libstemmer/stem_UTF_8_dutch.hnu[PKBiZxQIHH4{Sserver/snowball/libstemmer/stem_ISO_8859_1_finnish.hnu[PKBiZO<<0'Userver/snowball/libstemmer/stem_KOI8_R_russian.hnu[PKBiZG66.Vserver/snowball/libstemmer/stem_UTF_8_porter.hnu[PKBiZHH4WXserver/snowball/libstemmer/stem_ISO_8859_1_english.hnu[PKBiZEE3Zserver/snowball/libstemmer/stem_ISO_8859_1_danish.hnu[PKBiZAY4??1[server/snowball/libstemmer/stem_UTF_8_norwegian.hnu[PKBiZXwNN6K]server/snowball/libstemmer/stem_ISO_8859_1_hungarian.hnu[PKBiZN;HH4^server/snowball/libstemmer/stem_ISO_8859_1_swedish.hnu[PKBiZ a `server/snowball/libstemmer/api.hnu[PKBiZ̈,??1cserver/snowball/libstemmer/stem_UTF_8_hungarian.hnu[PKBiZz|OEE3eserver/snowball/libstemmer/stem_ISO_8859_1_french.hnu[PKBiZA66.>gserver/snowball/libstemmer/stem_UTF_8_french.hnu[PKBiZaffhserver/plpgsql.hnu[PKBiZ$uu server/fmgr.hnu[PKBiZ !!Fserver/access/xact.hnu[PKBiZthserver/access/twophase.hnu[PKBiZ eoserver/access/rewriteheap.hnu[PKBiZsserver/access/subtrans.hnu[PKBiZ~[wserver/access/tupconvert.hnu[PKBiZPT2mm}server/access/nbtree.hnu[PKBiZ`server/access/attnum.hnu[PKBiZ:jjserver/access/xlogdefs.hnu[PKBiZw`server/access/tupmacs.hnu[PKBiZI00 server/access/genam.hnu[PKBiZe/>server/access/gin.hnu[PKBiZA1Dserver/access/gistscan.hnu[PKBiZ11Gserver/access/xlog.hnu[PKBiZI#yserver/access/heapam.hnu[PKBiZbT#server/access/clog.hnu[PKBiZd|HHKserver/access/relscan.hnu[PKBiZz3کserver/access/hio.hnu[PKBiZٚVn"n"server/access/reloptions.hnu[PKBiZKhGO{{server/access/skey.hnu[PKBiZ~\{{server/access/sysattr.hnu[PKBiZoIVserver/access/visibilitymap.hnu[PKBiZoj$$=server/access/rmgr.hnu[PKBiZ 2z3z3server/access/hash.hnu[PKBiZUN N c-server/access/multixact.hnu[PKBiZA558server/access/itup.hnu[PKBiZLsJserver/access/twophase_rmgr.hnu[PKBiZ1'.{Oserver/access/sdir.hnu[PKBiZWMUserver/access/slru.hnu[PKBiZejserver/access/tupdesc.hnu[PKBiZR{server/access/htup.hnu[PKBiZwpXpXserver/access/spgist_private.hnu[PKBiZ`fUserver/access/transam.hnu[PKBiZ*mserver/access/gist.hnu[PKBiZtma%a%server/access/xlog_internal.hnu[PKBiZ~[[Fserver/access/gin_private.hnu[PKBiZ server/access/printtup.hnu[PKBiZ^[L[Lsserver/access/gist_private.hnu[PKBiZK[server/access/xlogutils.hnu[PKBiZmA_server/access/tuptoaster.hnu[PKBiZ,S}userver/access/spgist.hnu[PKBiZͱserver/access/valid.hnu[PKBiZ;;server/getopt_long.hnu[PKBiZ_:UUserver/commands/comment.hnu[PKBiZrserver/commands/seclabel.hnu[PKBiZ*EE͡server/commands/dbcommands.hnu[PKBiZDz ^server/commands/explain.hnu[PKBiZhRYserver/commands/portalcmds.hnu[PKBiZAQQ%server/commands/user.hnu[PKBiZěϕserver/commands/prepare.hnu[PKBiZ񉬗#server/commands/collationcmds.hnu[PKBiZgZ  server/commands/conversioncmds.hnu[PKBiZE oJ  server/commands/tablespace.hnu[PKBiZ͔//]server/commands/lockcmds.hnu[PKBiZ_server/commands/proclang.hnu[PKBiZ930server/commands/alter.hnu[PKBiZ^L!!hserver/commands/createas.hnu[PKBiZ3^server/commands/typecmds.hnu[PKBiZj=*V V 0server/commands/tablecmds.hnu[PKBiZn   server/commands/vacuum.hnu[PKBiZe&server/commands/extension.hnu[PKBiZ"*server/commands/sequence.hnu[PKBiZiq server/commands/defrem.hnu[PKBiZdM?server/commands/cluster.hnu[PKBiZ^ZDserver/commands/view.hnu[PKBiZF?om((Fserver/commands/async.hnu[PKBiZ Nserver/commands/trigger.hnu[PKBiZx;]KKhserver/commands/schemacmds.hnu[PKBiZQ fYYlserver/commands/variable.hnu[PKBiZ'tserver/commands/discard.hnu[PKBiZ4%Gvserver/commands/copy.hnu[PKBiZT. . f{server/foreign/foreign.hnu[PKBiZ8 ܅server/foreign/fdwapi.hnu[PKBiZaq .server/optimizer/geqo_mutation.hnu[PKBiZ]mdd=server/optimizer/geqo_misc.hnu[PKBiZ$*server/optimizer/geqo_copy.hnu[PKBiZVpserver/optimizer/predtest.hnu[PKBiZ8T T %server/optimizer/geqo_recombination.hnu[PKBiZ?server/optimizer/plancat.hnu[PKBiZz(##tserver/optimizer/pathnode.hnu[PKBiZYN}}server/optimizer/geqo.hnu[PKBiZDDserver/optimizer/joininfo.hnu[PKBiZ#qTNN5server/optimizer/cost.hnu[PKBiZq SSserver/optimizer/planner.hnu[PKBiZP!gserver/optimizer/geqo_selection.hnu[PKBiZ̃ server/optimizer/clauses.hnu[PKBiZk| server/optimizer/restrictinfo.hnu[PKBiZ2O server/optimizer/subselect.hnu[PKBiZd|mUUz server/optimizer/paths.hnu[PKBiZ4d2 server/optimizer/tlist.hnu[PKBiZ  9 server/optimizer/geqo_random.hnu[PKBiZSϞ> server/optimizer/prep.hnu[PKBiZ=E server/optimizer/placeholder.hnu[PKBiZpJ server/optimizer/var.hnu[PKBiZZZQ server/optimizer/geqo_gene.hnu[PKBiZDc+hhU server/optimizer/planmain.hnu[PKBiZA',%%xj server/optimizer/geqo_pool.hnu[PKBiZAeAe o server/c.hnu[PKBiZ'd server/nodes/params.hnu[PKBiZ_Hrm server/nodes/value.hnu[PKBiZx~-- server/nodes/pg_list.hnu[PKBiZ2:p p !server/nodes/bitmapset.hnu[PKBiZsL L '!server/nodes/makefuncs.hnu[PKBiZӀ D1!server/nodes/nodeFuncs.hnu[PKBiZ(3Z;!server/nodes/tidbitmap.hnu[PKBiZazqnqnaD!server/nodes/plannodes.hnu[PKBiZXCd9d9!server/nodes/nodes.hnu[PKBiZ j[[!server/nodes/parsenodes.hnu[PKBiZ"_,H#server/nodes/execnodes.hnu[PKBiZz--!&server/executor/nodeMergeAppend.hnu[PKBiZ`H#&server/executor/nodeIndexonlyscan.hnu[PKBiZrz︻&server/executor/hashjoin.hnu[PKBiZW 'server/executor/nodeIndexscan.hnu[PKBiZs /'server/executor/nodeLimit.hnu[PKBiZ-m)'server/executor/nodeLockRows.hnu[PKBiZU3gP'server/executor/nodeGroup.hnu[PKBiZU2g'server/executor/nodeWindowAgg.hnu[PKBiZ'server/executor/nodeUnique.hnu[PKBiZ 1,,'server/executor/nodeSeqscan.hnu[PKBiẐ]) ) @#'server/executor/instrument.hnu[PKBiZ-..'server/executor/spi.hnu[PKBiZ' <:<:E'server/executor/executor.hnu[PKBiZppS' ' 'server/replication/walprotocol.hnu[PKBiZ-- 'server/replication/walreceiver.hnu[PKBiZH6 &'server/replication/walsender_private.hnu[PKBiZ;Ũ'server/replication/basebackup.hnu[PKBiZ]Π'server/replication/syncrep.hnu[PKBiZm'server/replication/walsender.hnu[PKBiZɗŵii%'server/pg_config_x86_64.hnu[PKBiZA#(server/postmaster/bgwriter.hnu[PKBiZJOF$(server/postmaster/postmaster.hnu[PKBiZ0+(server/postmaster/pgarch.hnu[PKBiZ[ N.(server/postmaster/fork_process.hnu[PKBiZٿ!X]0(server/postmaster/autovacuum.hnu[PKBiZ6X8(server/postmaster/walwriter.hnu[PKBiZ{{:(server/postmaster/startup.hnu[PKBiZ;] R=(server/postmaster/syslogger.hnu[PKBiZݭ <<G(server/pg_trace.hnu[PKBiZ(I(server/pg_config_os.hnu[PKBiZyߕ7 7 M(server/lib/dllist.hnu[PKBiZY4qssY(server/lib/stringinfo.hnu[PKBiZiJyn(server/postgres_fe.hnu[PKBiZԧ__q(server/pgstat.hnu[PKBiZ? (server/storage/lmgr.hnu[PKBiZJnTT(server/storage/lock.hnu[PKBiZ_Yߺ 3)server/storage/block.hnu[PKBiZ A)server/storage/spin.hnu[PKBiZYL)server/storage/item.hnu[PKBiZ*AA9N)server/storage/fd.hnu[PKBiZN׮ 99\)server/storage/pos.hnu[PKBiZyK:c)server/storage/fsm_internals.hnu[PKBiZ3>l)server/storage/buffile.hnu[PKBiZ zs)server/storage/procarray.hnu[PKBiZeCC$)server/storage/predicate_internals.hnu[PKBiZr)server/storage/bufmgr.hnu[PKBiZL/,,)server/storage/buf_internals.hnu[PKBiZ+33g*server/storage/bufpage.hnu[PKBiZԺ Q4*server/storage/large_object.hnu[PKBiZpp2@*server/storage/s_lock.hnu[PKBiZX{|*server/storage/standby.hnu[PKBiZi*server/storage/latch.hnu[PKBiZi:*server/storage/sinval.hnu[PKBiZY2*server/storage/itemptr.hnu[PKBiZM_*server/storage/smgr.hnu[PKBiZoAAQ+server/storage/relfilenode.hnu[PKBiZ-4UJ11!+server/storage/copydir.hnu[PKBiZ L W$+server/storage/shmem.hnu[PKBiZFQQ#/+server/storage/lwlock.hnu[PKBiZ'=+server/storage/backendid.hnu[PKBiZb0::@+server/storage/buf.hnu[PKBiZ2cc]E+server/storage/barrier.hnu[PKBiZ$`+server/storage/sinvaladt.hnu[PKBiZ|4Ef+server/storage/itemid.hnu[PKBiZ( w+server/storage/pg_sema.hnu[PKBiZWp+server/storage/indexfsm.hnu[PKBiZ٘"RRԄ+server/storage/off.hnu[PKBiZTjLLj+server/storage/reinit.hnu[PKBiZ+server/storage/freespace.hnu[PKBiZ-PM&M&7+server/storage/proc.hnu[PKBiZ8  ɹ+server/storage/pmsignal.hnu[PKBiZ9\2+server/storage/pg_shmem.hnu[PKBiZv\L+server/storage/procsignal.hnu[PKBiZ0? ? +server/storage/predicate.hnu[PKBiZp) ) &+server/storage/ipc.hnu[PKBiZJdK K +server/windowapi.hnu[PKBiZ%@ +server/parser/keywords.hnu[PKBiZ] Q Q+server/parser/kwlist.hnu[PKBiZvffE,server/parser/gramparse.hnu[PKBiZL}dN,server/parser/parse_param.hnu[PKBiZ7T?Q,server/parser/parse_agg.hnu[PKBiZyuV,server/parser/parse_cte.hnu[PKBiZ;iiY,server/parser/scanner.hnu[PKBiZ~ FFPj,server/parser/parse_type.hnu[PKBiZqaM**q,server/parser/gram.hnu[PKBiZTVkk,server/parser/parse_expr.hnu[PKBiZ zz,server/parser/parser.hnu[PKBiZ|&==m,server/parser/parse_collate.hnu[PKBiZK^, , ,server/parser/parse_coerce.hnu[PKBiZl҉"o,server/parser/analyze.hnu[PKBiZxM.o,server/parser/parse_target.hnu[PKBiZ{ffL,server/parser/parse_node.hnu[PKBiZJ\,server/parser/scansup.hnu[PKBiZ,'3,server/parser/parsetree.hnu[PKBiZh@p p ,server/parser/parse_func.hnu[PKBiZucK,server/parser/parse_clause.hnu[PKBiZ͛d ,server/parser/parse_relation.hnu[PKBiZ:-server/parser/parse_utilcmd.hnu[PKBiZ^Zv -server/parser/parse_oper.hnu[PKBiZ-server/libpq/ip.hnu[PKBiZ'JJ-server/libpq/be-fsstubs.hnu[PKBiZyy-server/libpq/libpq-fs.hnu[PKBiZ{n"-server/libpq/auth.hnu[PKBiZ%8&-server/libpq/hba.hnu[PKBiZG+( ( n--server/libpq/libpq.hnu[PKBiZ{7-server/libpq/md5.hnu[PKBiZ ;-server/libpq/pqsignal.hnu[PKBiZh@-server/libpq/pqformat.hnu[PKBiZI-server/libpq/libpq-be.hnu[PKBiZ &&b-server/libpq/crypt.hnu[PKBiZookd-server/libpq/pqcomm.hnu[PKBiZ:~-server/portability/instr_time.hnu[PK-