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
16#include "access/xlogreader.h"
18#include "fmgr.h"
19#include "lib/stringinfo.h"
20#include "nodes/parsenodes.h"
21#include "parser/parse_node.h"
23
24
26{
31
33
34/*
35 * Columns of a sequence relation
36 */
37
38#define SEQ_COL_LASTVAL 1
39#define SEQ_COL_LOG 2
40#define SEQ_COL_CALLED 3
41
42#define SEQ_COL_FIRSTCOL SEQ_COL_LASTVAL
43#define SEQ_COL_LASTCOL SEQ_COL_CALLED
44
45/* XLOG stuff */
46#define XLOG_SEQ_LOG 0x00
47
48typedef struct xl_seq_rec
49{
51 /* SEQUENCE TUPLE DATA FOLLOWS AT THE END */
53
54extern int64 nextval_internal(Oid relid, bool check_permissions);
56extern List *sequence_options(Oid relid);
57
60extern void SequenceChangePersistence(Oid relid, char newrelpersistence);
61extern void DeleteSequenceTuple(Oid relid);
62extern void ResetSequence(Oid seq_relid);
63extern void SetSequence(Oid relid, int64 next, bool is_called);
64extern void ResetSequenceCaches(void);
65
66extern void seq_redo(XLogReaderState *record);
67extern void seq_desc(StringInfo buf, XLogReaderState *record);
68extern const char *seq_identify(uint8 info);
69extern void seq_mask(char *page, BlockNumber blkno);
70
71#endif /* SEQUENCE_H */
uint32 BlockNumber
Definition: block.h:31
static int32 next
Definition: blutils.c:224
uint8_t uint8
Definition: c.h:541
int64_t int64
Definition: c.h:540
ObjectAddress DefineSequence(ParseState *pstate, CreateSeqStmt *seq)
Definition: sequence.c:123
void ResetSequence(Oid seq_relid)
Definition: sequence.c:266
FormData_pg_sequence_data * Form_pg_sequence_data
Definition: sequence.h:32
List * sequence_options(Oid relid)
Definition: sequence.c:1723
ObjectAddress AlterSequence(ParseState *pstate, AlterSeqStmt *stmt)
Definition: sequence.c:440
struct FormData_pg_sequence_data FormData_pg_sequence_data
void seq_mask(char *page, BlockNumber blkno)
Definition: sequence.c:1979
Datum nextval(PG_FUNCTION_ARGS)
Definition: sequence.c:605
int64 nextval_internal(Oid relid, bool check_permissions)
Definition: sequence.c:635
void SequenceChangePersistence(Oid relid, char newrelpersistence)
Definition: sequence.c:553
void seq_desc(StringInfo buf, XLogReaderState *record)
Definition: seqdesc.c:21
struct xl_seq_rec xl_seq_rec
void seq_redo(XLogReaderState *record)
Definition: sequence.c:1912
const char * seq_identify(uint8 info)
Definition: seqdesc.c:34
void ResetSequenceCaches(void)
Definition: sequence.c:1964
void SetSequence(Oid relid, int64 next, bool is_called)
Definition: sequence.c:957
void DeleteSequenceTuple(Oid relid)
Definition: sequence.c:582
#define PG_FUNCTION_ARGS
Definition: fmgr.h:193
#define stmt
Definition: indent_codes.h:59
static char * buf
Definition: pg_test_fsync.c:72
uint64_t Datum
Definition: postgres.h:70
unsigned int Oid
Definition: postgres_ext.h:32
Definition: pg_list.h:54
RelFileLocator locator
Definition: sequence.h:50