22 #define MAXPG_LSNLEN 17
23 #define MAXPG_LSNCOMPONENT 8
38 Assert(have_error != NULL);
42 len1 = strspn(
str,
"0123456789abcdefABCDEF");
48 len2 = strspn(
str + len1 + 1,
"0123456789abcdefABCDEF");
57 off = (
uint32) strtoul(
str + len1 + 1, NULL, 16);
58 result = ((uint64)
id << 32) | off;
68 bool have_error =
false;
73 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
74 errmsg(
"invalid input syntax for type %s: \"%s\"",
262 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
263 errmsg(
"cannot add NaN to pg_lsn")));
296 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
297 errmsg(
"cannot subtract NaN from pg_lsn")));
Datum numeric_sub(PG_FUNCTION_ARGS)
Datum numeric_in(PG_FUNCTION_ARGS)
bool numeric_is_nan(Numeric num)
Datum numeric_add(PG_FUNCTION_ARGS)
Datum numeric_pg_lsn(PG_FUNCTION_ARGS)
static void PGresult * res
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereturn(context, dummy_value,...)
#define ereport(elevel,...)
#define PG_RETURN_BYTEA_P(x)
#define DirectFunctionCall2(func, arg1, arg2)
#define PG_GETARG_POINTER(n)
#define PG_RETURN_CSTRING(x)
#define DirectFunctionCall1(func, arg1)
#define PG_GETARG_CSTRING(n)
#define PG_RETURN_INT32(x)
#define DirectFunctionCall3(func, arg1, arg2, arg3)
#define PG_RETURN_BOOL(x)
Datum hashint8extended(PG_FUNCTION_ARGS)
Datum hashint8(PG_FUNCTION_ARGS)
Assert(fmt[strlen(fmt) - 1] !='\n')
char * pstrdup(const char *in)
#define PG_GETARG_NUMERIC(n)
static Datum NumericGetDatum(Numeric X)
Datum pg_lsn_ne(PG_FUNCTION_ARGS)
Datum pg_lsn_eq(PG_FUNCTION_ARGS)
Datum pg_lsn_cmp(PG_FUNCTION_ARGS)
Datum pg_lsn_out(PG_FUNCTION_ARGS)
Datum pg_lsn_smaller(PG_FUNCTION_ARGS)
Datum pg_lsn_send(PG_FUNCTION_ARGS)
XLogRecPtr pg_lsn_in_internal(const char *str, bool *have_error)
#define MAXPG_LSNCOMPONENT
Datum pg_lsn_le(PG_FUNCTION_ARGS)
Datum pg_lsn_in(PG_FUNCTION_ARGS)
Datum pg_lsn_pli(PG_FUNCTION_ARGS)
Datum pg_lsn_mii(PG_FUNCTION_ARGS)
Datum pg_lsn_hash(PG_FUNCTION_ARGS)
Datum pg_lsn_ge(PG_FUNCTION_ARGS)
Datum pg_lsn_hash_extended(PG_FUNCTION_ARGS)
Datum pg_lsn_gt(PG_FUNCTION_ARGS)
Datum pg_lsn_larger(PG_FUNCTION_ARGS)
Datum pg_lsn_recv(PG_FUNCTION_ARGS)
Datum pg_lsn_mi(PG_FUNCTION_ARGS)
Datum pg_lsn_lt(PG_FUNCTION_ARGS)
static Datum ObjectIdGetDatum(Oid X)
static Datum CStringGetDatum(const char *X)
static Datum Int32GetDatum(int32 X)
StringInfoData * StringInfo
#define LSN_FORMAT_ARGS(lsn)
#define InvalidXLogRecPtr