54 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
55 errmsg(
"invalid block number")));
81 (
errmsg(
"wrong number of arguments to get_raw_page()"),
82 errhint(
"Run the updated pageinspect.sql script.")));
109 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
110 errmsg(
"invalid block number")));
152 (
errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
153 errmsg(
"must be superuser to use raw page functions")));
158 if (!RELKIND_HAS_STORAGE(rel->
rd_rel->relkind))
160 (
errcode(ERRCODE_WRONG_OBJECT_TYPE),
161 errmsg(
"cannot get raw page from relation \"%s\"",
172 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
173 errmsg(
"cannot access temporary tables of other sessions")));
177 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
178 errmsg(
"block number %u is out of range for relation \"%s\"",
184 raw_page_data =
VARDATA(raw_page);
222 if (raw_page_size != BLCKSZ)
224 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
225 errmsg(
"invalid page size"),
227 BLCKSZ, raw_page_size)));
229 page =
palloc(raw_page_size);
231 memcpy(page,
VARDATA_ANY(raw_page), raw_page_size);
263 (
errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
264 errmsg(
"must be superuser to use raw page functions")));
271 elog(
ERROR,
"return type must be a row type");
321 memset(nulls, 0,
sizeof(nulls));
347 (
errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
348 errmsg(
"must be superuser to use raw page functions")));
352 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
353 errmsg(
"invalid block number")));
static Datum values[MAXATTR]
BlockNumber RelationGetNumberOfBlocksInFork(Relation relation, ForkNumber forkNum)
void ReleaseBuffer(Buffer buffer)
void LockBuffer(Buffer buffer, int mode)
Buffer ReadBufferExtended(Relation reln, ForkNumber forkNum, BlockNumber blockNum, ReadBufferMode mode, BufferAccessStrategy strategy)
#define BUFFER_LOCK_UNLOCK
#define BUFFER_LOCK_SHARE
static Page BufferGetPage(Buffer buffer)
PageHeaderData * PageHeader
static Size PageGetPageSize(Page page)
static bool PageIsNew(Page page)
static XLogRecPtr PageGetLSN(const char *page)
static uint8 PageGetPageLayoutVersion(Page page)
#define CStringGetTextDatum(s)
#define Assert(condition)
uint16 pg_checksum_page(char *page, BlockNumber blkno)
int errdetail(const char *fmt,...)
int errhint(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define PG_GETARG_TEXT_PP(n)
#define PG_RETURN_BYTEA_P(x)
#define PG_GETARG_UINT32(n)
#define PG_GETARG_INT64(n)
#define PG_RETURN_INT16(x)
#define PG_RETURN_DATUM(x)
#define PG_GETARG_BYTEA_P(n)
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)
RangeVar * makeRangeVarFromNameList(const List *names)
int errdetail_relkind_not_supported(char relkind)
static Datum LSNGetDatum(XLogRecPtr X)
static Datum TransactionIdGetDatum(TransactionId X)
static Datum UInt16GetDatum(uint16 X)
static Datum Int32GetDatum(int32 X)
Datum get_raw_page(PG_FUNCTION_ARGS)
Datum page_checksum(PG_FUNCTION_ARGS)
Datum page_checksum_1_9(PG_FUNCTION_ARGS)
Datum get_raw_page_fork_1_9(PG_FUNCTION_ARGS)
static Datum page_checksum_internal(PG_FUNCTION_ARGS, enum pageinspect_version ext_version)
static bytea * get_raw_page_internal(text *relname, ForkNumber forknum, BlockNumber blkno)
Datum page_header(PG_FUNCTION_ARGS)
Datum get_raw_page_1_9(PG_FUNCTION_ARGS)
PG_FUNCTION_INFO_V1(get_raw_page_1_9)
Page get_page_from_raw(bytea *raw_page)
Datum get_raw_page_fork(PG_FUNCTION_ARGS)
#define RelationGetRelationName(relation)
#define RELATION_IS_OTHER_TEMP(relation)
ForkNumber forkname_to_number(const char *forkName)
void relation_close(Relation relation, LOCKMODE lockmode)
Relation relation_openrv(const RangeVar *relation, LOCKMODE lockmode)
#define TupleDescAttr(tupdesc, i)
#define SET_VARSIZE(PTR, len)
#define VARSIZE_ANY_EXHDR(PTR)
List * textToQualifiedNameList(text *textval)
char * text_to_cstring(const text *t)
#define LSN_FORMAT_ARGS(lsn)