pg_parse 0.14.0

PostgreSQL parser that uses the actual PostgreSQL server source to parse SQL queries and return the internal PostgreSQL parse tree.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/*
 * Thin wrapper over the libpg_query SysCacheGetAttr mock: assert the value
 * isn't NULL and return its Datum.
 */
Datum
SysCacheGetAttrNotNull(int cacheId, HeapTuple tup, AttrNumber attributeNumber)
{
	bool		isNull;
	Datum		d = SysCacheGetAttr(cacheId, tup, attributeNumber, &isNull);

	if (isNull)
		elog(ERROR, "unexpected null attribute %d from pg_proc tuple", attributeNumber);
	return d;
}