File: set_sequence.c

package info (click to toggle)
postgresql 6.3.2-15
  • links: PTS
  • area: main
  • in suites: slink
  • size: 21,136 kB
  • ctags: 15,441
  • sloc: ansic: 162,182; sh: 5,538; java: 5,143; yacc: 4,891; tcl: 4,778; sql: 4,120; makefile: 2,653; lex: 906; cpp: 839; python: 836; perl: 678; asm: 70; csh: 5; sed: 2
file content (41 lines) | stat: -rw-r--r-- 641 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
 * set_sequence.c --
 *
 * Set a new sequence value.
 *
 * Copyright (c) 1996, Massimo Dal Zotto <dz@cs.unitn.it>
 */

#include "postgres.h"
#include "nodes/parsenodes.h"
#include "commands/sequence.h"

#include "set_sequence.h"

extern int	setval(struct varlena * seqin, int4 val);

int
set_currval(struct varlena * sequence, int4 nextval)
{
	return setval(sequence, nextval);
}

int
next_id(struct varlena * sequence)
{
	return nextval(sequence);
}

int
last_id(struct varlena * sequence)
{
	return currval(sequence);
}

int
set_last_id(struct varlena * sequence, int4 nextval)
{
	return setval(sequence, nextval);
}

/* end of file */