Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
7f3630e2
Commit
7f3630e2
authored
Aug 30, 1998
by
Marc G. Fournier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sequence contrib directory removed, as already integrated into the main backend...
parent
eec4c736
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
145 deletions
+0
-145
contrib/sequence/Makefile
contrib/sequence/Makefile
+0
-62
contrib/sequence/set_sequence.c
contrib/sequence/set_sequence.c
+0
-41
contrib/sequence/set_sequence.h
contrib/sequence/set_sequence.h
+0
-9
contrib/sequence/set_sequence.sql.in
contrib/sequence/set_sequence.sql.in
+0
-33
No files found.
contrib/sequence/Makefile
deleted
100644 → 0
View file @
eec4c736
#-------------------------------------------------------------------------
#
# Makefile--
# Makefile for new sequence functions.
#
#-------------------------------------------------------------------------
PGDIR
=
../..
SRCDIR
=
$(PGDIR)
/src
include
$(SRCDIR)/Makefile.global
INCLUDE_OPT
=
-I
./
\
-I
$(SRCDIR)
/
\
-I
$(SRCDIR)
/include
\
-I
$(SRCDIR)
/port/
$(PORTNAME)
CFLAGS
+=
$(INCLUDE_OPT)
ifeq
($(PORTNAME), linux)
ifdef
LINUX_ELF
ifeq
($(CC), gcc)
CFLAGS
+=
-fPIC
endif
endif
endif
ifeq
($(PORTNAME), i386_solaris)
CFLAGS
+=
-fPIC
endif
MODNAME
=
set_sequence
MODULE
=
$(MODNAME)$(DLSUFFIX)
all
:
module sql
module
:
$(MODULE)
sql
:
$(MODNAME).sql
install
:
$(MODULE)
cp
-p
$(MODULE)
$(LIBDIR)
/modules
cd
$(LIBDIR)
/modules
;
strip
$(MODULE)
%.sql
:
%.sql.in
sed
"s|MODULE_PATHNAME|
$(LIBDIR)
/modules/
$(MODULE)
|"
<
$<
>
$@
.SUFFIXES
:
$(DLSUFFIX)
%$(DLSUFFIX)
:
%.c
$(CC)
$(CFLAGS)
-shared
-o
$@
$<
depend dep
:
$(CC)
-MM
$(INCLUDE_OPT)
*
.c
>
depend
clean
:
rm
-f
$(MODULE)
$(MODNAME)
.sql
ifeq
(depend,$(wildcard depend))
include
depend
endif
contrib/sequence/set_sequence.c
deleted
100644 → 0
View file @
eec4c736
/*
* 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 */
contrib/sequence/set_sequence.h
deleted
100644 → 0
View file @
eec4c736
#ifndef SET_SEQUENCE_H
#define SET_SEQUENCE_H
int
set_currval
(
struct
varlena
*
sequence
,
int4
nextval
);
int
next_id
(
struct
varlena
*
sequence
);
int
last_id
(
struct
varlena
*
sequence
);
int
set_last_id
(
struct
varlena
*
sequence
,
int4
nextval
);
#endif
contrib/sequence/set_sequence.sql.in
deleted
100644 → 0
View file @
eec4c736
-- SQL code to define new sequence utilities
-- Set a new sequence value
--
create function set_currval(text, int4) returns int4
as 'MODULE_PATHNAME'
language 'C';
-- Increment the value of sequence
--
-- select next_id('sequence_name');
--
create function next_id(text) returns int4
as 'MODULE_PATHNAME'
language 'C';
-- Return the last value set for a sequence
--
-- select last_id('sequence_name');
--
create function last_id(text) returns int4
as 'MODULE_PATHNAME'
language 'C';
-- Set the current value of a sequence
--
-- select set_last_id('sequence_name', 1);
--
create function set_last_id(text,int4) returns int4
as 'MODULE_PATHNAME'
language 'C';
-- end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment