aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2001-10-26 20:45:33 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2001-10-26 20:45:33 +0000
commit8dcf998dd148e41fc48071d5ad36828732c7faa4 (patch)
tree523a21c5ced37ed118010a3f79215bf794c27fe2
parent62651c01764aae57f3383338b75136ea25427222 (diff)
downloadpostgresql-8dcf998dd148e41fc48071d5ad36828732c7faa4.tar.gz
postgresql-8dcf998dd148e41fc48071d5ad36828732c7faa4.zip
Remove no-longer-needed dependencies on DLSUFFIX.
-rw-r--r--src/tutorial/Makefile12
-rw-r--r--src/tutorial/README19
-rw-r--r--src/tutorial/complex.source23
-rw-r--r--src/tutorial/funcs.source10
4 files changed, 24 insertions, 40 deletions
diff --git a/src/tutorial/Makefile b/src/tutorial/Makefile
index cdbc2318a04..07ed26f3de6 100644
--- a/src/tutorial/Makefile
+++ b/src/tutorial/Makefile
@@ -4,7 +4,7 @@
# Makefile for tutorial
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/tutorial/Makefile,v 1.13 2001/08/09 13:52:06 tgl Exp $
+# $Header: /cvsroot/pgsql/src/tutorial/Makefile,v 1.14 2001/10/26 20:45:33 tgl Exp $
#
#-------------------------------------------------------------------------
@@ -16,7 +16,7 @@ override CFLAGS+= $(CFLAGS_SL)
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
#
-# DLOBJS is the dynamically-loaded object files. The "funcs" queries
+# DLOBJS are the dynamically-loaded object files. The "funcs" queries
# include CREATE FUNCTIONs that load routines from these files.
#
DLOBJS= complex$(DLSUFFIX) funcs$(DLSUFFIX)
@@ -26,15 +26,9 @@ QUERIES= advanced.sql basics.sql complex.sql funcs.sql syscat.sql
all: $(DLOBJS) $(QUERIES)
%.sql: %.source
- if [ -z "$$USER" ]; then USER=$$LOGNAME; fi; \
- if [ -z "$$USER" ]; then USER=`whoami`; fi; \
- if [ -z "$$USER" ]; then echo 'Cannot deduce $$USER.'; exit 1; fi; \
rm -f $@; \
C=`pwd`; \
- sed -e "s:_CWD_:$$C:g" \
- -e "s:_OBJWD_:$$C:g" \
- -e "s:_DLSUFFIX_:$(DLSUFFIX):g" \
- -e "s/_USER_/$$USER/g" < $< > $@
+ sed -e "s:_OBJWD_:$$C:g" < $< > $@
clean:
rm -f $(DLOBJS) $(QUERIES)
diff --git a/src/tutorial/README b/src/tutorial/README
index 9115c3d9db5..6d05cb578f4 100644
--- a/src/tutorial/README
+++ b/src/tutorial/README
@@ -1,22 +1,11 @@
This directory contains SQL tutorial scripts. To look at them, first do a
% make
to compile all the scripts and C files for the user-defined functions
-and types. (make needs to be GNU make and may be named something
-different on your system)
+and types. (make needs to be GNU make --- it may be named something
+different on your system, often gmake)
-Then, run psql with the -s flag:
+Then, run psql with the -s (single-step) flag:
% psql -s
-Welcome to the POSTGRESQL interactive sql monitor:
- Please read the file COPYRIGHT for copyright terms of POSTGRESQL
-
- type \? for help on slash commands
- type \q to quit
- type \g or terminate with semicolon to execute query
- You are currently connected to the database: jolly
-
-jolly==>
-
From within psql, you can try each individual script file by using
-the \i <filename> psql command.
-
+psql's \i <filename> command.
diff --git a/src/tutorial/complex.source b/src/tutorial/complex.source
index fdd66506671..c30e048f3cb 100644
--- a/src/tutorial/complex.source
+++ b/src/tutorial/complex.source
@@ -7,7 +7,7 @@
--
-- Copyright (c) 1994, Regents of the University of California
--
--- $Id: complex.source,v 1.10 2001/10/03 20:54:22 tgl Exp $
+-- $Id: complex.source,v 1.11 2001/10/26 20:45:33 tgl Exp $
--
---------------------------------------------------------------------------
@@ -18,7 +18,8 @@
-- called 'complex' which represents complex numbers.
-----------------------------
--- Assume the user defined functions are in _OBJWD_/complex_DLSUFFIX_
+-- Assume the user defined functions are in _OBJWD_/complex$DLSUFFIX
+-- (we do not want to assume this is in the dynamic loader search path)
-- Look at $PWD/complex.c for the source.
-- the input function 'complex_in' takes a null-terminated string (the
@@ -28,7 +29,7 @@
CREATE FUNCTION complex_in(opaque)
RETURNS complex
- AS '_OBJWD_/complex_DLSUFFIX_'
+ AS '_OBJWD_/complex'
LANGUAGE 'c';
-- the output function 'complex_out' takes the internal representation and
@@ -36,7 +37,7 @@ CREATE FUNCTION complex_in(opaque)
CREATE FUNCTION complex_out(opaque)
RETURNS opaque
- AS '_OBJWD_/complex_DLSUFFIX_'
+ AS '_OBJWD_/complex'
LANGUAGE 'c';
-- now, we can create the type. The internallength specifies the size of the
@@ -80,7 +81,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_DLSUFFIX_'
+ AS '_OBJWD_/complex'
LANGUAGE 'c';
-- we can now define the operator. We show a binary operator here but you
@@ -138,15 +139,15 @@ SELECT 'READ ABOVE!' AS STOP;
-- first, define the required operators
CREATE FUNCTION complex_abs_lt(complex, complex) RETURNS bool
- AS '_OBJWD_/complex_DLSUFFIX_' LANGUAGE 'c';
+ AS '_OBJWD_/complex' LANGUAGE 'c';
CREATE FUNCTION complex_abs_le(complex, complex) RETURNS bool
- AS '_OBJWD_/complex_DLSUFFIX_' LANGUAGE 'c';
+ AS '_OBJWD_/complex' LANGUAGE 'c';
CREATE FUNCTION complex_abs_eq(complex, complex) RETURNS bool
- AS '_OBJWD_/complex_DLSUFFIX_' LANGUAGE 'c';
+ AS '_OBJWD_/complex' LANGUAGE 'c';
CREATE FUNCTION complex_abs_ge(complex, complex) RETURNS bool
- AS '_OBJWD_/complex_DLSUFFIX_' LANGUAGE 'c';
+ AS '_OBJWD_/complex' LANGUAGE 'c';
CREATE FUNCTION complex_abs_gt(complex, complex) RETURNS bool
- AS '_OBJWD_/complex_DLSUFFIX_' LANGUAGE 'c';
+ AS '_OBJWD_/complex' LANGUAGE 'c';
CREATE OPERATOR < (
leftarg = complex, rightarg = complex, procedure = complex_abs_lt,
@@ -231,7 +232,7 @@ INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr)
--
CREATE FUNCTION complex_abs_cmp(complex, complex) RETURNS int4
- AS '_OBJWD_/complex_DLSUFFIX_' LANGUAGE 'c';
+ AS '_OBJWD_/complex' LANGUAGE 'c';
SELECT oid, proname FROM pg_proc WHERE proname = 'complex_abs_cmp';
diff --git a/src/tutorial/funcs.source b/src/tutorial/funcs.source
index b2b20e6928d..8438e6daece 100644
--- a/src/tutorial/funcs.source
+++ b/src/tutorial/funcs.source
@@ -6,7 +6,7 @@
--
-- Copyright (c) 1994-5, Regents of the University of California
--
--- $Id: funcs.source,v 1.4 2000/03/28 02:49:19 tgl Exp $
+-- $Id: funcs.source,v 1.5 2001/10/26 20:45:33 tgl Exp $
--
---------------------------------------------------------------------------
@@ -126,16 +126,16 @@ SELECT name(high_pay()) AS overpaid;
-----------------------------
CREATE FUNCTION add_one(int4) RETURNS int4
- AS '_OBJWD_/funcs_DLSUFFIX_' LANGUAGE 'c';
+ AS '_OBJWD_/funcs' LANGUAGE 'c';
CREATE FUNCTION makepoint(point, point) RETURNS point
- AS '_OBJWD_/funcs_DLSUFFIX_' LANGUAGE 'c';
+ AS '_OBJWD_/funcs' LANGUAGE 'c';
CREATE FUNCTION copytext(text) RETURNS text
- AS '_OBJWD_/funcs_DLSUFFIX_' LANGUAGE 'c';
+ AS '_OBJWD_/funcs' LANGUAGE 'c';
CREATE FUNCTION c_overpaid(EMP, int4) RETURNS bool
- AS '_OBJWD_/funcs_DLSUFFIX_' LANGUAGE 'c';
+ AS '_OBJWD_/funcs' LANGUAGE 'c';
SELECT add_one(3) AS four;