Header And Logo

PostgreSQL
| The world's most advanced open source database.

postgres_ext.h

Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *
00003  * postgres_ext.h
00004  *
00005  *     This file contains declarations of things that are visible everywhere
00006  *  in PostgreSQL *and* are visible to clients of frontend interface libraries.
00007  *  For example, the Oid type is part of the API of libpq and other libraries.
00008  *
00009  *     Declarations which are specific to a particular interface should
00010  *  go in the header file for that interface (such as libpq-fe.h).  This
00011  *  file is only for fundamental Postgres declarations.
00012  *
00013  *     User-written C functions don't count as "external to Postgres."
00014  *  Those function much as local modifications to the backend itself, and
00015  *  use header files that are otherwise internal to Postgres to interface
00016  *  with the backend.
00017  *
00018  * src/include/postgres_ext.h
00019  *
00020  *-------------------------------------------------------------------------
00021  */
00022 
00023 #ifndef POSTGRES_EXT_H
00024 #define POSTGRES_EXT_H
00025 
00026 #include "pg_config_ext.h"
00027 
00028 /*
00029  * Object ID is a fundamental type in Postgres.
00030  */
00031 typedef unsigned int Oid;
00032 
00033 #ifdef __cplusplus
00034 #define InvalidOid      (Oid(0))
00035 #else
00036 #define InvalidOid      ((Oid) 0)
00037 #endif
00038 
00039 #define OID_MAX  UINT_MAX
00040 /* you will need to include <limits.h> to use the above #define */
00041 
00042 /* Define a signed 64-bit integer type for use in client API declarations. */
00043 typedef PG_INT64_TYPE pg_int64;
00044 
00045 
00046 /*
00047  * Identifiers of error message fields.  Kept here to keep common
00048  * between frontend and backend, and also to export them to libpq
00049  * applications.
00050  */
00051 #define PG_DIAG_SEVERITY        'S'
00052 #define PG_DIAG_SQLSTATE        'C'
00053 #define PG_DIAG_MESSAGE_PRIMARY 'M'
00054 #define PG_DIAG_MESSAGE_DETAIL  'D'
00055 #define PG_DIAG_MESSAGE_HINT    'H'
00056 #define PG_DIAG_STATEMENT_POSITION 'P'
00057 #define PG_DIAG_INTERNAL_POSITION 'p'
00058 #define PG_DIAG_INTERNAL_QUERY  'q'
00059 #define PG_DIAG_CONTEXT         'W'
00060 #define PG_DIAG_SCHEMA_NAME     's'
00061 #define PG_DIAG_TABLE_NAME      't'
00062 #define PG_DIAG_COLUMN_NAME     'c'
00063 #define PG_DIAG_DATATYPE_NAME   'd'
00064 #define PG_DIAG_CONSTRAINT_NAME 'n'
00065 #define PG_DIAG_SOURCE_FILE     'F'
00066 #define PG_DIAG_SOURCE_LINE     'L'
00067 #define PG_DIAG_SOURCE_FUNCTION 'R'
00068 
00069 #endif   /* POSTGRES_EXT_H */