1997-04-02 05:23:38 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
1999-02-14 00:22:53 +01:00
|
|
|
* sequence.h
|
1997-09-07 07:04:48 +02:00
|
|
|
* prototypes for sequence.c.
|
1997-04-02 05:23:38 +02:00
|
|
|
*
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
#ifndef SEQUENCE_H
|
|
|
|
#define SEQUENCE_H
|
|
|
|
|
1997-11-26 02:14:33 +01:00
|
|
|
#include "nodes/parsenodes.h"
|
2000-11-30 02:47:33 +01:00
|
|
|
#include "access/xlog.h"
|
|
|
|
|
|
|
|
typedef struct FormData_pg_sequence
|
|
|
|
{
|
|
|
|
NameData sequence_name;
|
2001-01-23 02:48:17 +01:00
|
|
|
int32 last_value;
|
|
|
|
int32 increment_by;
|
|
|
|
int32 max_value;
|
|
|
|
int32 min_value;
|
|
|
|
int32 cache_value;
|
|
|
|
int32 log_cnt;
|
2000-11-30 02:47:33 +01:00
|
|
|
char is_cycled;
|
|
|
|
char is_called;
|
|
|
|
} FormData_pg_sequence;
|
|
|
|
|
|
|
|
typedef FormData_pg_sequence *Form_pg_sequence;
|
1997-11-26 02:14:33 +01:00
|
|
|
|
1997-09-07 07:04:48 +02:00
|
|
|
/*
|
2000-06-11 22:08:01 +02:00
|
|
|
* Columns of a sequence relation
|
1997-04-02 05:23:38 +02:00
|
|
|
*/
|
|
|
|
|
1997-09-07 07:04:48 +02:00
|
|
|
#define SEQ_COL_NAME 1
|
|
|
|
#define SEQ_COL_LASTVAL 2
|
|
|
|
#define SEQ_COL_INCBY 3
|
|
|
|
#define SEQ_COL_MAXVALUE 4
|
|
|
|
#define SEQ_COL_MINVALUE 5
|
|
|
|
#define SEQ_COL_CACHE 6
|
2001-03-22 05:01:46 +01:00
|
|
|
#define SEQ_COL_LOG 7
|
2000-11-30 02:47:33 +01:00
|
|
|
#define SEQ_COL_CYCLE 8
|
|
|
|
#define SEQ_COL_CALLED 9
|
1997-04-02 05:23:38 +02:00
|
|
|
|
1997-09-07 07:04:48 +02:00
|
|
|
#define SEQ_COL_FIRSTCOL SEQ_COL_NAME
|
|
|
|
#define SEQ_COL_LASTCOL SEQ_COL_CALLED
|
1997-04-02 05:23:38 +02:00
|
|
|
|
2000-11-30 02:47:33 +01:00
|
|
|
/* XLOG stuff */
|
2001-03-22 05:01:46 +01:00
|
|
|
#define XLOG_SEQ_LOG 0x00
|
2000-11-30 02:47:33 +01:00
|
|
|
|
|
|
|
typedef struct xl_seq_rec
|
|
|
|
{
|
2001-03-22 05:01:46 +01:00
|
|
|
RelFileNode node;
|
2000-12-28 14:00:29 +01:00
|
|
|
/* SEQUENCE TUPLE DATA FOLLOWS AT THE END */
|
2000-11-30 02:47:33 +01:00
|
|
|
} xl_seq_rec;
|
|
|
|
|
2000-06-11 22:08:01 +02:00
|
|
|
extern Datum nextval(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum currval(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum setval(PG_FUNCTION_ARGS);
|
2000-10-11 17:31:34 +02:00
|
|
|
extern Datum setval_and_iscalled(PG_FUNCTION_ARGS);
|
2000-06-11 22:08:01 +02:00
|
|
|
|
1997-09-08 23:56:23 +02:00
|
|
|
extern void DefineSequence(CreateSeqStmt *stmt);
|
1997-09-08 04:41:22 +02:00
|
|
|
extern void CloseSequences(void);
|
1997-09-07 07:04:48 +02:00
|
|
|
|
2000-11-30 02:47:33 +01:00
|
|
|
extern void seq_redo(XLogRecPtr lsn, XLogRecord *rptr);
|
|
|
|
extern void seq_undo(XLogRecPtr lsn, XLogRecord *rptr);
|
2001-03-22 05:01:46 +01:00
|
|
|
extern void seq_desc(char *buf, uint8 xl_info, char *rec);
|
2000-11-30 02:47:33 +01:00
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
#endif /* SEQUENCE_H */
|