diff options
Diffstat (limited to 'src/include/utils/lockwaitpolicy.h')
-rw-r--r-- | src/include/utils/lockwaitpolicy.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/include/utils/lockwaitpolicy.h b/src/include/utils/lockwaitpolicy.h new file mode 100644 index 00000000000..7ec9c26717d --- /dev/null +++ b/src/include/utils/lockwaitpolicy.h @@ -0,0 +1,31 @@ +/*------------------------------------------------------------------------- + * lockwaitpolicy.h + * Header file for LockWaitPolicy enum. + * + * Copyright (c) 2014, PostgreSQL Global Development Group + * + * src/include/utils/lockwaitpolicy.h + *------------------------------------------------------------------------- + */ +#ifndef LOCKWAITPOLICY_H +#define LOCKWAITPOLICY_H + +/* + * This enum controls how to deal with rows being locked by FOR UPDATE/SHARE + * clauses (i.e., NOWAIT and SKIP LOCKED clauses). The ordering here is + * important, because the highest numerical value takes precedence when a + * RTE is specified multiple ways. See applyLockingClause. + */ +typedef enum +{ + /* Wait for the lock to become available (default behavior) */ + LockWaitBlock, + + /* Skip rows that can't be locked (SKIP LOCKED) */ + LockWaitSkip, + + /* Raise an error if a row cannot be locked (NOWAIT) */ + LockWaitError +} LockWaitPolicy; + +#endif /* LOCKWAITPOLICY_H */ |