mirror of
https://github.com/postgres/postgres.git
synced 2025-10-24 01:29:19 +03:00
XLOG stuff for sequences.
CommitDelay in guc.c
This commit is contained in:
@@ -10,6 +10,22 @@
|
||||
#define SEQUENCE_H
|
||||
|
||||
#include "nodes/parsenodes.h"
|
||||
#include "access/xlog.h"
|
||||
|
||||
typedef struct FormData_pg_sequence
|
||||
{
|
||||
NameData sequence_name;
|
||||
int4 last_value;
|
||||
int4 increment_by;
|
||||
int4 max_value;
|
||||
int4 min_value;
|
||||
int4 cache_value;
|
||||
int4 log_cnt;
|
||||
char is_cycled;
|
||||
char is_called;
|
||||
} FormData_pg_sequence;
|
||||
|
||||
typedef FormData_pg_sequence *Form_pg_sequence;
|
||||
|
||||
/*
|
||||
* Columns of a sequence relation
|
||||
@@ -21,12 +37,23 @@
|
||||
#define SEQ_COL_MAXVALUE 4
|
||||
#define SEQ_COL_MINVALUE 5
|
||||
#define SEQ_COL_CACHE 6
|
||||
#define SEQ_COL_CYCLE 7
|
||||
#define SEQ_COL_CALLED 8
|
||||
#define SEQ_COL_LOG 7
|
||||
#define SEQ_COL_CYCLE 8
|
||||
#define SEQ_COL_CALLED 9
|
||||
|
||||
#define SEQ_COL_FIRSTCOL SEQ_COL_NAME
|
||||
#define SEQ_COL_LASTCOL SEQ_COL_CALLED
|
||||
|
||||
/* XLOG stuff */
|
||||
#define XLOG_SEQ_LOG 0x00
|
||||
#define XLOG_SEQ_SET 0x10
|
||||
|
||||
typedef struct xl_seq_rec
|
||||
{
|
||||
RelFileNode node;
|
||||
int4 value; /* last logged value */
|
||||
} xl_seq_rec;
|
||||
|
||||
extern Datum nextval(PG_FUNCTION_ARGS);
|
||||
extern Datum currval(PG_FUNCTION_ARGS);
|
||||
extern Datum setval(PG_FUNCTION_ARGS);
|
||||
@@ -35,4 +62,8 @@ extern Datum setval_and_iscalled(PG_FUNCTION_ARGS);
|
||||
extern void DefineSequence(CreateSeqStmt *stmt);
|
||||
extern void CloseSequences(void);
|
||||
|
||||
extern void seq_redo(XLogRecPtr lsn, XLogRecord *rptr);
|
||||
extern void seq_undo(XLogRecPtr lsn, XLogRecord *rptr);
|
||||
extern void seq_desc(char *buf, uint8 xl_info, char* rec);
|
||||
|
||||
#endif /* SEQUENCE_H */
|
||||
|
||||
Reference in New Issue
Block a user