PostgreSQL Source Code
git master
Main Page
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
tablesample.c
Go to the documentation of this file.
1
/*-------------------------------------------------------------------------
2
*
3
* tablesample.c
4
* Support functions for TABLESAMPLE feature
5
*
6
* Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
7
* Portions Copyright (c) 1994, Regents of the University of California
8
*
9
*
10
* IDENTIFICATION
11
* src/backend/access/tablesample/tablesample.c
12
*
13
* -------------------------------------------------------------------------
14
*/
15
16
#include "
postgres.h
"
17
18
#include "
access/tsmapi.h
"
19
20
21
/*
22
* GetTsmRoutine --- get a TsmRoutine struct by invoking the handler.
23
*
24
* This is a convenience routine that's just meant to check for errors.
25
*/
26
TsmRoutine
*
27
GetTsmRoutine
(
Oid
tsmhandler)
28
{
29
Datum
datum;
30
TsmRoutine
*routine;
31
32
datum =
OidFunctionCall1
(tsmhandler,
PointerGetDatum
(
NULL
));
33
routine = (
TsmRoutine
*)
DatumGetPointer
(datum);
34
35
if
(routine ==
NULL
|| !
IsA
(routine,
TsmRoutine
))
36
elog
(
ERROR
,
"tablesample handler function %u did not return a TsmRoutine struct"
,
37
tsmhandler);
38
39
return
routine;
40
}
IsA
#define IsA(nodeptr, _type_)
Definition:
nodes.h:542
PointerGetDatum
#define PointerGetDatum(X)
Definition:
postgres.h:564
Oid
unsigned int Oid
Definition:
postgres_ext.h:31
TsmRoutine
Definition:
tsmapi.h:55
ERROR
#define ERROR
Definition:
elog.h:43
OidFunctionCall1
#define OidFunctionCall1(functionId, arg1)
Definition:
fmgr.h:586
postgres.h
Datum
uintptr_t Datum
Definition:
postgres.h:374
GetTsmRoutine
TsmRoutine * GetTsmRoutine(Oid tsmhandler)
Definition:
tablesample.c:27
NULL
#define NULL
Definition:
c.h:226
DatumGetPointer
#define DatumGetPointer(X)
Definition:
postgres.h:557
tsmapi.h
elog
#define elog
Definition:
elog.h:218
src
backend
access
tablesample
tablesample.c
Generated on Sat Jun 4 2016 04:14:55 for PostgreSQL Source Code by
1.8.8