* This is essentially just the same as table_openrv(), except that it caters
* to some parser-specific error reporting needs, notably that it arranges
* to include the RangeVar's parse location in any resulting error.
- *
- * Note: properly, lockmode should be declared LOCKMODE not int, but that
- * would require importing storage/lock.h into parse_relation.h. Since
- * LOCKMODE is typedef'd as int anyway, that seems like overkill.
*/
Relation
-parserOpenTable(ParseState *pstate, const RangeVar *relation, int lockmode)
+parserOpenTable(ParseState *pstate, const RangeVar *relation, LOCKMODE lockmode)
{
Relation rel;
ParseCallbackState pcbstate;
* of AccessShareLock, RowShareLock, or RowExclusiveLock depending on the
* RTE's role within the query. The caller must hold that lock mode
* or a stronger one.
- *
- * Note: properly, lockmode should be declared LOCKMODE not int, but that
- * would require importing storage/lock.h into parse_relation.h. Since
- * LOCKMODE is typedef'd as int anyway, that seems like overkill.
*/
ParseNamespaceItem *
addRangeTableEntryForRelation(ParseState *pstate,
Relation rel,
- int lockmode,
+ LOCKMODE lockmode,
Alias *alias,
bool inh,
bool inFromCl)
#define PARSE_RELATION_H
#include "parser/parse_node.h"
+#include "storage/lockdefs.h"
extern ParseNamespaceItem *refnameNamespaceItem(ParseState *pstate,
extern void markNullableIfNeeded(ParseState *pstate, Var *var);
extern void markVarForSelectPriv(ParseState *pstate, Var *var);
extern Relation parserOpenTable(ParseState *pstate, const RangeVar *relation,
- int lockmode);
+ LOCKMODE lockmode);
extern ParseNamespaceItem *addRangeTableEntry(ParseState *pstate,
RangeVar *relation,
Alias *alias,
bool inFromCl);
extern ParseNamespaceItem *addRangeTableEntryForRelation(ParseState *pstate,
Relation rel,
- int lockmode,
+ LOCKMODE lockmode,
Alias *alias,
bool inh,
bool inFromCl);