1 /*-------------------------------------------------------------------------
4 * Support functions for TABLESAMPLE feature
6 * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
11 * src/backend/access/tablesample/tablesample.c
13 * -------------------------------------------------------------------------
18 #include "access/tsmapi.h"
22 * GetTsmRoutine --- get a TsmRoutine struct by invoking the handler.
24 * This is a convenience routine that's just meant to check for errors.
27 GetTsmRoutine(Oid tsmhandler)
32 datum = OidFunctionCall1(tsmhandler, PointerGetDatum(NULL));
33 routine = (TsmRoutine *) DatumGetPointer(datum);
35 if (routine == NULL || !IsA(routine, TsmRoutine))
36 elog(ERROR, "tablesample handler function %u did not return a TsmRoutine struct",