1/*-------------------------------------------------------------------------
2 *
3 * table.h
4 * Generic routines for table related code.
5 *
6 *
7 * Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
9 *
10 * src/include/access/table.h
11 *
12 *-------------------------------------------------------------------------
13 */
14#ifndef TABLE_H
15#define TABLE_H
16
17#include "nodes/primnodes.h"
18#include "utils/relcache.h"
19#include "storage/lockdefs.h"
20
21
22extern Relation table_open(Oid relationId, LOCKMODE lockmode);
23extern Relation table_openrv(const RangeVar *relation, LOCKMODE lockmode);
24extern Relation table_openrv_extended(const RangeVar *relation,
25 LOCKMODE lockmode, bool missing_ok);
26extern void table_close(Relation relation, LOCKMODE lockmode);
27
28/*
29 * heap_ used to be the prefix for these routines, and a lot of code will just
30 * continue to work without adaptions after the introduction of pluggable
31 * storage, therefore just map these names.
32 */
33#define heap_open(r, l) table_open(r, l)
34#define heap_openrv(r, l) table_openrv(r, l)
35#define heap_openrv_extended(r, l, m) table_openrv_extended(r, l, m)
36#define heap_close(r, l) table_close(r, l)
37
38#endif /* TABLE_H */
39