34 |
#include "lib/stringinfo.h" |
#include "lib/stringinfo.h" |
35 |
#include "utils/datetime.h" |
#include "utils/datetime.h" |
36 |
#include "utils/palloc.h" |
#include "utils/palloc.h" |
37 |
|
#include "utils/memutils.h" |
38 |
|
|
39 |
#include "pgmemcache.h" |
#include "pgmemcache.h" |
40 |
|
|
471 |
timestamptz = PG_GETARG_TIMESTAMPTZ(2); |
timestamptz = PG_GETARG_TIMESTAMPTZ(2); |
472 |
|
|
473 |
/* convert to timestamptz to produce consistent results */ |
/* convert to timestamptz to produce consistent results */ |
474 |
if (timestamp2tm(timestamptz, NULL, &tm, &fsec, NULL) !=0) |
if (timestamp2tm(timestamptz, NULL, &tm, &fsec, NULL, NULL) !=0) |
475 |
ereport(ERROR, (errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE), |
ereport(ERROR, (errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE), |
476 |
errmsg("timestamp out of range"))); |
errmsg("timestamp out of range"))); |
477 |
|
|
641 |
appendStringInfo(str, "uptime: %llu\n", (uint64)stats->uptime); |
appendStringInfo(str, "uptime: %llu\n", (uint64)stats->uptime); |
642 |
appendStringInfo(str, "time: %llu\n", (uint64)stats->time); |
appendStringInfo(str, "time: %llu\n", (uint64)stats->time); |
643 |
appendStringInfo(str, "version: %s\n", stats->version); |
appendStringInfo(str, "version: %s\n", stats->version); |
644 |
appendStringInfo(str, "rusage_user: %u.%us\n", stats->rusage_user.tv_sec, stats->rusage_user.tv_usec); |
appendStringInfo(str, "rusage_user: %u.%us\n", (uint)stats->rusage_user.tv_sec, (uint)stats->rusage_user.tv_usec); |
645 |
appendStringInfo(str, "rusage_system: %u.%us\n", stats->rusage_system.tv_sec, stats->rusage_system.tv_usec); |
appendStringInfo(str, "rusage_system: %u.%us\n", (uint)stats->rusage_system.tv_sec, (uint)stats->rusage_system.tv_usec); |
646 |
appendStringInfo(str, "curr_items: %u\n", stats->curr_items); |
appendStringInfo(str, "curr_items: %u\n", stats->curr_items); |
647 |
appendStringInfo(str, "total_items: %llu\n", stats->total_items); |
appendStringInfo(str, "total_items: %llu\n", stats->total_items); |
648 |
appendStringInfo(str, "bytes: %llu\n", stats->bytes); |
appendStringInfo(str, "bytes: %llu\n", stats->bytes); |
700 |
else if (pg_strncasecmp("version", VARDATA(stat), stat_len) == 0) |
else if (pg_strncasecmp("version", VARDATA(stat), stat_len) == 0) |
701 |
appendStringInfo(str, "%s", stats->version); |
appendStringInfo(str, "%s", stats->version); |
702 |
else if (pg_strncasecmp("rusage_user", VARDATA(stat), stat_len) == 0) |
else if (pg_strncasecmp("rusage_user", VARDATA(stat), stat_len) == 0) |
703 |
appendStringInfo(str, "%u.%u", stats->rusage_user.tv_sec, stats->rusage_user.tv_usec); |
appendStringInfo(str, "%u.%u", (uint)stats->rusage_user.tv_sec, (uint)stats->rusage_user.tv_usec); |
704 |
else if (pg_strncasecmp("rusage_system", VARDATA(stat), stat_len) == 0) |
else if (pg_strncasecmp("rusage_system", VARDATA(stat), stat_len) == 0) |
705 |
appendStringInfo(str, "%u.%u", stats->rusage_system.tv_sec, stats->rusage_system.tv_usec); |
appendStringInfo(str, "%u.%u", (uint)stats->rusage_system.tv_sec, (uint)stats->rusage_system.tv_usec); |
706 |
else if (pg_strncasecmp("curr_items", VARDATA(stat), stat_len) == 0) |
else if (pg_strncasecmp("curr_items", VARDATA(stat), stat_len) == 0) |
707 |
appendStringInfo(str, "%u", stats->curr_items); |
appendStringInfo(str, "%u", stats->curr_items); |
708 |
else if (pg_strncasecmp("total_itmes", VARDATA(stat), stat_len) == 0) |
else if (pg_strncasecmp("total_itmes", VARDATA(stat), stat_len) == 0) |