~ubuntu-branches/ubuntu/precise/postgresql-9.1/precise-security

« back to all changes in this revision

Viewing changes to src/include/commands/sequence.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-05-11 10:41:53 UTC
  • Revision ID: james.westby@ubuntu.com-20110511104153-psbh2o58553fv1m0
Tags: upstream-9.1~beta1
ImportĀ upstreamĀ versionĀ 9.1~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*-------------------------------------------------------------------------
 
2
 *
 
3
 * sequence.h
 
4
 *        prototypes for sequence.c.
 
5
 *
 
6
 * Portions Copyright (c) 1996-2011, 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 "nodes/parsenodes.h"
 
17
#include "storage/relfilenode.h"
 
18
#include "access/xlog.h"
 
19
#include "fmgr.h"
 
20
 
 
21
 
 
22
typedef struct FormData_pg_sequence
 
23
{
 
24
        NameData        sequence_name;
 
25
        int64           last_value;
 
26
        int64           start_value;
 
27
        int64           increment_by;
 
28
        int64           max_value;
 
29
        int64           min_value;
 
30
        int64           cache_value;
 
31
        int64           log_cnt;
 
32
        bool            is_cycled;
 
33
        bool            is_called;
 
34
} FormData_pg_sequence;
 
35
 
 
36
typedef FormData_pg_sequence *Form_pg_sequence;
 
37
 
 
38
/*
 
39
 * Columns of a sequence relation
 
40
 */
 
41
 
 
42
#define SEQ_COL_NAME                    1
 
43
#define SEQ_COL_LASTVAL                 2
 
44
#define SEQ_COL_STARTVAL                3
 
45
#define SEQ_COL_INCBY                   4
 
46
#define SEQ_COL_MAXVALUE                5
 
47
#define SEQ_COL_MINVALUE                6
 
48
#define SEQ_COL_CACHE                   7
 
49
#define SEQ_COL_LOG                             8
 
50
#define SEQ_COL_CYCLE                   9
 
51
#define SEQ_COL_CALLED                  10
 
52
 
 
53
#define SEQ_COL_FIRSTCOL                SEQ_COL_NAME
 
54
#define SEQ_COL_LASTCOL                 SEQ_COL_CALLED
 
55
 
 
56
/* XLOG stuff */
 
57
#define XLOG_SEQ_LOG                    0x00
 
58
 
 
59
typedef struct xl_seq_rec
 
60
{
 
61
        RelFileNode node;
 
62
        /* SEQUENCE TUPLE DATA FOLLOWS AT THE END */
 
63
} xl_seq_rec;
 
64
 
 
65
extern Datum nextval(PG_FUNCTION_ARGS);
 
66
extern Datum nextval_oid(PG_FUNCTION_ARGS);
 
67
extern Datum currval_oid(PG_FUNCTION_ARGS);
 
68
extern Datum setval_oid(PG_FUNCTION_ARGS);
 
69
extern Datum setval3_oid(PG_FUNCTION_ARGS);
 
70
extern Datum lastval(PG_FUNCTION_ARGS);
 
71
 
 
72
extern Datum pg_sequence_parameters(PG_FUNCTION_ARGS);
 
73
 
 
74
extern void DefineSequence(CreateSeqStmt *stmt);
 
75
extern void AlterSequence(AlterSeqStmt *stmt);
 
76
extern void ResetSequence(Oid seq_relid);
 
77
 
 
78
extern void seq_redo(XLogRecPtr lsn, XLogRecord *rptr);
 
79
extern void seq_desc(StringInfo buf, uint8 xl_info, char *rec);
 
80
 
 
81
#endif   /* SEQUENCE_H */