Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
1f7ba1eb
Commit
1f7ba1eb
authored
25 years ago
by
Tom Lane
Browse files
Options
Downloads
Patches
Plain Diff
Fix some bogosity in the tutorial examples.
parent
081cba45
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/tutorial/Makefile
+3
-13
3 additions, 13 deletions
src/tutorial/Makefile
src/tutorial/complex.source
+15
-13
15 additions, 13 deletions
src/tutorial/complex.source
src/tutorial/funcs.source
+5
-5
5 additions, 5 deletions
src/tutorial/funcs.source
with
23 additions
and
31 deletions
src/tutorial/Makefile
+
3
−
13
View file @
1f7ba1eb
...
...
@@ -4,22 +4,14 @@
# Makefile for tutorial
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/tutorial/Makefile,v 1.
8 1998/03/01 04:52:55 scrappy
Exp $
# $Header: /cvsroot/pgsql/src/tutorial/Makefile,v 1.
9 2000/03/28 02:49:19 tgl
Exp $
#
#-------------------------------------------------------------------------
SRCDIR
=
..
include
..
/Makefile.global
include
$(SRCDIR)
/Makefile.global
CFLAGS
+=
-I
$(
LIBPQDIR
)
-I
../../include
#
# And where libpq goes, so goes the authentication stuff...
#
ifdef
KRBVERS
LDFLAGS
+=
$(
KRBLIBS
)
CFLAGS
+=
$(
KRBFLAGS
)
endif
CFLAGS
+=
-I
$(
SRCDIR
)
/include
$(
CFLAGS_SL
)
#
# DLOBJS is the dynamically-loaded object files. The "funcs" queries
...
...
@@ -42,7 +34,5 @@ all: $(DLOBJS) $(QUERIES)
-e
"s:_DLSUFFIX_:
$(
DLSUFFIX
)
:g"
\
-e
"s/_USER_/
$$
USER/g"
<
$<
>
$@
funcs.sql
:
$(DLOBJS)
clean
:
rm
-f
$(
DLOBJS
)
$(
QUERIES
)
This diff is collapsed.
Click to expand it.
src/tutorial/complex.source
+
15
−
13
View file @
1f7ba1eb
...
...
@@ -7,7 +7,7 @@
--
-- Copyright (c) 1994, Regents of the University of California
--
-- $Id: complex.source,v 1.
6
2000/0
1
/2
4
0
7:16:48
tgl Exp $
-- $Id: complex.source,v 1.
7
2000/0
3
/2
8
0
2:49:19
tgl Exp $
--
---------------------------------------------------------------------------
...
...
@@ -18,7 +18,7 @@
-- called 'complex' which represents complex numbers.
-----------------------------
-- Assume the user defined functions are in _OBJWD_/complex
.so
-- Assume the user defined functions are in _OBJWD_/complex
_DLSUFFIX_
-- Look at $PWD/complex.c for the source.
-- the input function 'complex_in' takes a null-terminated string (the
...
...
@@ -28,7 +28,7 @@
CREATE FUNCTION complex_in(opaque)
RETURNS complex
AS '_OBJWD_/complex
.so
'
AS '_OBJWD_/complex
_DLSUFFIX_
'
LANGUAGE 'c';
-- the output function 'complex_out' takes the internal representation and
...
...
@@ -36,7 +36,7 @@ CREATE FUNCTION complex_in(opaque)
CREATE FUNCTION complex_out(opaque)
RETURNS opaque
AS '_OBJWD_/complex
.so
'
AS '_OBJWD_/complex
_DLSUFFIX_
'
LANGUAGE 'c';
-- now, we can create the type. The internallength specifies the size of the
...
...
@@ -80,7 +80,7 @@ SELECT * FROM test_complex;
-- first, define a function complex_add (also in complex.c)
CREATE FUNCTION complex_add(complex, complex)
RETURNS complex
AS '_OBJWD_/complex
.so
'
AS '_OBJWD_/complex
_DLSUFFIX_
'
LANGUAGE 'c';
-- we can now define the operator. We show a binary operator here but you
...
...
@@ -138,15 +138,15 @@ SELECT 'READ ABOVE!' AS STOP;
-- first, define the required operators
CREATE FUNCTION complex_abs_lt(complex, complex) RETURNS bool
AS '_OBJWD_/complex
.so
' LANGUAGE 'c';
AS '_OBJWD_/complex
_DLSUFFIX_
' LANGUAGE 'c';
CREATE FUNCTION complex_abs_le(complex, complex) RETURNS bool
AS '_OBJWD_/complex
.so
' LANGUAGE 'c';
AS '_OBJWD_/complex
_DLSUFFIX_
' LANGUAGE 'c';
CREATE FUNCTION complex_abs_eq(complex, complex) RETURNS bool
AS '_OBJWD_/complex
.so
' LANGUAGE 'c';
AS '_OBJWD_/complex
_DLSUFFIX_
' LANGUAGE 'c';
CREATE FUNCTION complex_abs_ge(complex, complex) RETURNS bool
AS '_OBJWD_/complex
.so
' LANGUAGE 'c';
AS '_OBJWD_/complex
_DLSUFFIX_
' LANGUAGE 'c';
CREATE FUNCTION complex_abs_gt(complex, complex) RETURNS bool
AS '_OBJWD_/complex
.so
' LANGUAGE 'c';
AS '_OBJWD_/complex
_DLSUFFIX_
' LANGUAGE 'c';
CREATE OPERATOR < (
leftarg = complex, rightarg = complex, procedure = complex_abs_lt,
...
...
@@ -169,9 +169,11 @@ CREATE OPERATOR > (
restrict = scalargtsel, join = scalargtjoinsel
);
INSERT INTO pg_opclass VALUES ('complex_abs_ops');
INSERT INTO pg_opclass (opcname, opcdeftype)
SELECT 'complex_abs_ops', oid FROM pg_type WHERE typname = 'complex';
SELECT oid, opcname FROM pg_opclass WHERE opcname = 'complex_abs_ops';
SELECT oid, opcname, opcdeftype
FROM pg_opclass WHERE opcname = 'complex_abs_ops';
SELECT o.oid AS opoid, o.oprname
INTO TABLE complex_ops_tmp
...
...
@@ -214,7 +216,7 @@ INSERT INTO pg_amop (amopid, amopclaid, amopopr, amopstrategy)
--
CREATE FUNCTION complex_abs_cmp(complex, complex) RETURNS int4
AS '_OBJWD_/complex
.so
' LANGUAGE 'c';
AS '_OBJWD_/complex
_DLSUFFIX_
' LANGUAGE 'c';
SELECT oid, proname FROM pg_proc WHERE proname = 'complex_abs_cmp';
...
...
This diff is collapsed.
Click to expand it.
src/tutorial/funcs.source
+
5
−
5
View file @
1f7ba1eb
...
...
@@ -6,7 +6,7 @@
--
-- Copyright (c) 1994-5, Regents of the University of California
--
-- $Id: funcs.source,v 1.
3 1999/03/14 15:22:15 momjian
Exp $
-- $Id: funcs.source,v 1.
4 2000/03/28 02:49:19 tgl
Exp $
--
---------------------------------------------------------------------------
...
...
@@ -126,16 +126,16 @@ SELECT name(high_pay()) AS overpaid;
-----------------------------
CREATE FUNCTION add_one(int4) RETURNS int4
AS '_OBJWD_/funcs
.so
' LANGUAGE 'c';
AS '_OBJWD_/funcs
_DLSUFFIX_
' LANGUAGE 'c';
CREATE FUNCTION makepoint(point, point) RETURNS point
AS '_OBJWD_/funcs
.so
' LANGUAGE 'c';
AS '_OBJWD_/funcs
_DLSUFFIX_
' LANGUAGE 'c';
CREATE FUNCTION copytext(text) RETURNS text
AS '_OBJWD_/funcs
.so
' LANGUAGE 'c';
AS '_OBJWD_/funcs
_DLSUFFIX_
' LANGUAGE 'c';
CREATE FUNCTION c_overpaid(EMP, int4) RETURNS bool
AS '_OBJWD_/funcs
.so
' LANGUAGE 'c';
AS '_OBJWD_/funcs
_DLSUFFIX_
' LANGUAGE 'c';
SELECT add_one(3) AS four;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment