mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-12 01:18:35 +08:00
This reverts a sequence of commits, implementing features related to logical decoding and replication of sequences: - 0da92dc530c9251735fc70b20cd004d9630a1266 - 80901b32913ffa59bf157a4d88284b2b3a7511d9 - b779d7d8fdae088d70da5ed9fcd8205035676df3 - d5ed9da41d96988d905b49bebb273a9b2d6e2915 - a180c2b34de0989269fdb819bff241a249bf5380 - 75b1521dae1ff1fde17fda2e30e591f2e5d64b6a - 2d2232933b02d9396113662e44dca5f120d6830e - 002c9dd97a0c874fd1693a570383e2dd38cd40d5 - 05843b1aa49df2ecc9b97c693b755bd1b6f856a9 The implementation has issues, mostly due to combining transactional and non-transactional behavior of sequences. It's not clear how this could be fixed, but it'll require reworking significant part of the patch. Discussion: https://postgr.es/m/95345a19-d508-63d1-860a-f5c2f41e8d40@enterprisedb.com
71 lines
1.9 KiB
C
71 lines
1.9 KiB
C
/*-------------------------------------------------------------------------
|
|
*
|
|
* sequence.h
|
|
* prototypes for sequence.c.
|
|
*
|
|
* Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
|
*
|
|
* src/include/commands/sequence.h
|
|
*
|
|
*-------------------------------------------------------------------------
|
|
*/
|
|
#ifndef SEQUENCE_H
|
|
#define SEQUENCE_H
|
|
|
|
#include "access/xlogreader.h"
|
|
#include "catalog/objectaddress.h"
|
|
#include "fmgr.h"
|
|
#include "lib/stringinfo.h"
|
|
#include "nodes/parsenodes.h"
|
|
#include "parser/parse_node.h"
|
|
#include "storage/relfilenode.h"
|
|
|
|
|
|
typedef struct FormData_pg_sequence_data
|
|
{
|
|
int64 last_value;
|
|
int64 log_cnt;
|
|
bool is_called;
|
|
} FormData_pg_sequence_data;
|
|
|
|
typedef FormData_pg_sequence_data *Form_pg_sequence_data;
|
|
|
|
/*
|
|
* Columns of a sequence relation
|
|
*/
|
|
|
|
#define SEQ_COL_LASTVAL 1
|
|
#define SEQ_COL_LOG 2
|
|
#define SEQ_COL_CALLED 3
|
|
|
|
#define SEQ_COL_FIRSTCOL SEQ_COL_LASTVAL
|
|
#define SEQ_COL_LASTCOL SEQ_COL_CALLED
|
|
|
|
/* XLOG stuff */
|
|
#define XLOG_SEQ_LOG 0x00
|
|
|
|
typedef struct xl_seq_rec
|
|
{
|
|
RelFileNode node;
|
|
/* SEQUENCE TUPLE DATA FOLLOWS AT THE END */
|
|
} xl_seq_rec;
|
|
|
|
extern int64 nextval_internal(Oid relid, bool check_permissions);
|
|
extern Datum nextval(PG_FUNCTION_ARGS);
|
|
extern List *sequence_options(Oid relid);
|
|
|
|
extern ObjectAddress DefineSequence(ParseState *pstate, CreateSeqStmt *stmt);
|
|
extern ObjectAddress AlterSequence(ParseState *pstate, AlterSeqStmt *stmt);
|
|
extern void SequenceChangePersistence(Oid relid, char newrelpersistence);
|
|
extern void DeleteSequenceTuple(Oid relid);
|
|
extern void ResetSequence(Oid seq_relid);
|
|
extern void ResetSequenceCaches(void);
|
|
|
|
extern void seq_redo(XLogReaderState *rptr);
|
|
extern void seq_desc(StringInfo buf, XLogReaderState *rptr);
|
|
extern const char *seq_identify(uint8 info);
|
|
extern void seq_mask(char *pagedata, BlockNumber blkno);
|
|
|
|
#endif /* SEQUENCE_H */
|