20 #include "utils/fmgrprotos.h"
24 #define NUM_SUMMARY_ATTS 6
25 #define NUM_STATE_ATTS 4
26 #define MAX_BLOCKS_PER_CALL 256
43 memset(nulls, 0,
sizeof(nulls));
84 memset(nulls, 0,
sizeof(nulls));
94 errcode(ERRCODE_INVALID_PARAMETER_VALUE),
95 errmsg(
"invalid timeline %lld", (
long long) raw_tli));
156 for (
i = 0;
i < nblocks; ++
i)
192 elog(
ERROR,
"return type must be a row type");
194 memset(nulls, 0,
sizeof(nulls));
200 if (summarizer_pid < 0)
BlockRefTableReader * CreateBlockRefTableReader(io_callback_fn read_callback, void *read_callback_arg, char *error_filename, report_error_fn error_callback, void *error_callback_arg)
bool BlockRefTableReaderNextRelation(BlockRefTableReader *reader, RelFileLocator *rlocator, ForkNumber *forknum, BlockNumber *limit_block)
unsigned BlockRefTableReaderGetBlocks(BlockRefTableReader *reader, BlockNumber *blocks, int nblocks)
void DestroyBlockRefTableReader(BlockRefTableReader *reader)
static bool BlockNumberIsValid(BlockNumber blockNumber)
static Datum values[MAXATTR]
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
void FileClose(File file)
char * FilePathName(File file)
Datum Int64GetDatum(int64 X)
#define PG_GETARG_INT64(n)
#define PG_RETURN_DATUM(x)
void InitMaterializedSRF(FunctionCallInfo fcinfo, bits32 flags)
TypeFuncClass get_call_result_type(FunctionCallInfo fcinfo, Oid *resultTypeId, TupleDesc *resultTupleDesc)
static Datum HeapTupleGetDatum(const HeapTupleData *tuple)
HeapTuple heap_form_tuple(TupleDesc tupleDescriptor, const Datum *values, const bool *isnull)
#define CHECK_FOR_INTERRUPTS()
static Datum LSNGetDatum(XLogRecPtr X)
static Datum Int16GetDatum(int16 X)
static Datum BoolGetDatum(bool X)
static Datum ObjectIdGetDatum(Oid X)
static Datum Int32GetDatum(int32 X)
Tuplestorestate * setResult
void tuplestore_puttuple(Tuplestorestate *state, HeapTuple tuple)
void GetWalSummarizerState(TimeLineID *summarized_tli, XLogRecPtr *summarized_lsn, XLogRecPtr *pending_lsn, int *summarizer_pid)
File OpenWalSummaryFile(WalSummaryFile *ws, bool missing_ok)
List * GetWalSummaries(TimeLineID tli, XLogRecPtr start_lsn, XLogRecPtr end_lsn)
int ReadWalSummary(void *wal_summary_io, void *data, int length)
void ReportWalSummaryError(void *callback_arg, char *fmt,...)
Datum pg_get_wal_summarizer_state(PG_FUNCTION_ARGS)
Datum pg_available_wal_summaries(PG_FUNCTION_ARGS)
#define MAX_BLOCKS_PER_CALL
Datum pg_wal_summary_contents(PG_FUNCTION_ARGS)
#define InvalidXLogRecPtr