PostgreSQL Source Code git master
sequence.h
Go to the documentation of this file.
1/*-------------------------------------------------------------------------
2 *
3 * sequence.h
4 * prototypes for sequence.c.
5 *
6 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
8 *
9 * src/include/commands/sequence.h
10 *
11 *-------------------------------------------------------------------------
12 */
13#ifndef SEQUENCE_H
14#define SEQUENCE_H
15
17#include "fmgr.h"
18#include "nodes/parsenodes.h"
19#include "parser/parse_node.h"
20
22{
27
29
30/*
31 * Columns of a sequence relation
32 */
33
34#define SEQ_COL_LASTVAL 1
35#define SEQ_COL_LOG 2
36#define SEQ_COL_CALLED 3
37
38#define SEQ_COL_FIRSTCOL SEQ_COL_LASTVAL
39#define SEQ_COL_LASTCOL SEQ_COL_CALLED
40
41extern int64 nextval_internal(Oid relid, bool check_permissions);
43extern List *sequence_options(Oid relid);
44
47extern void SequenceChangePersistence(Oid relid, char newrelpersistence);
48extern void DeleteSequenceTuple(Oid relid);
49extern void ResetSequence(Oid seq_relid);
50extern void SetSequence(Oid relid, int64 next, bool is_called);
51extern void ResetSequenceCaches(void);
52
53#endif /* SEQUENCE_H */
static int32 next
Definition: blutils.c:224
int64_t int64
Definition: c.h:540
ObjectAddress DefineSequence(ParseState *pstate, CreateSeqStmt *seq)
Definition: sequence.c:112
void ResetSequence(Oid seq_relid)
Definition: sequence.c:255
FormData_pg_sequence_data * Form_pg_sequence_data
Definition: sequence.h:28
List * sequence_options(Oid relid)
Definition: sequence.c:1712
ObjectAddress AlterSequence(ParseState *pstate, AlterSeqStmt *stmt)
Definition: sequence.c:429
struct FormData_pg_sequence_data FormData_pg_sequence_data
Datum nextval(PG_FUNCTION_ARGS)
Definition: sequence.c:594
int64 nextval_internal(Oid relid, bool check_permissions)
Definition: sequence.c:624
void SequenceChangePersistence(Oid relid, char newrelpersistence)
Definition: sequence.c:542
void ResetSequenceCaches(void)
Definition: sequence.c:1903
void SetSequence(Oid relid, int64 next, bool is_called)
Definition: sequence.c:946
void DeleteSequenceTuple(Oid relid)
Definition: sequence.c:571
#define PG_FUNCTION_ARGS
Definition: fmgr.h:193
#define stmt
Definition: indent_codes.h:59
uint64_t Datum
Definition: postgres.h:70
unsigned int Oid
Definition: postgres_ext.h:32
Definition: pg_list.h:54