]> granicus.if.org Git - postgresql/commitdiff
From: Jun Kuwamura <juk@rccm.co.jp>
authorMarc G. Fournier <scrappy@hub.org>
Wed, 22 Apr 1998 04:16:46 +0000 (04:16 +0000)
committerMarc G. Fournier <scrappy@hub.org>
Wed, 22 Apr 1998 04:16:46 +0000 (04:16 +0000)
  This patch fix the Makefiles in contrib/{pginterface, spi,
miscutil, int8, ip_and_mac, sequence, soundex, string, userlock,
array, datetime} to install their modules in one directory(lib/modules/).

17 files changed:
contrib/array/Makefile
contrib/array/array_iterator.c
contrib/array/array_iterator.sql [deleted file]
contrib/datetime/Makefile
contrib/datetime/datetime_functions.sql [deleted file]
contrib/int8/Makefile
contrib/ip_and_mac/Makefile
contrib/ip_and_mac/ip.sql [deleted file]
contrib/ip_and_mac/mac.sql [deleted file]
contrib/miscutil/Makefile
contrib/pginterface/Makefile
contrib/sequence/Makefile
contrib/soundex/soundex.sql [deleted file]
contrib/spi/Makefile
contrib/string/Makefile
contrib/string/string_io.sql [deleted file]
contrib/userlock/Makefile

index 03c57e57c6822f77a517d2beac5fc7795056d78f..dd2ff66091dbaba11ac4c695dbb7f923c792c4e6 100644 (file)
@@ -40,16 +40,16 @@ module:             $(MODULE)
 sql:           $(MODNAME).sql
 
 install:       $(MODULE)
-               cp -p $(MODULE) $(LIBDIR)
-               cd $(LIBDIR); strip $(MODULE)
+               cp -p $(MODULE) $(LIBDIR)/modules
+               cd $(LIBDIR)/modules; strip $(MODULE)
 
 %.sql: %.sql.in
-               sed "s|MODULE_PATHNAME|$(LIBDIR)/$(MODULE)|" < $< > $@
+               sed "s|MODULE_PATHNAME|$(LIBDIR)/modules/$(MODULE)|" < $< > $@
 
 .SUFFIXES: $(DLSUFFIX)
 
 %$(DLSUFFIX): %.c
-               cc $(CFLAGS) -shared -o $@ $<
+               $(CC) $(CFLAGS) -shared -o $@ $<
 
 depend dep:
                $(CC) -MM $(INCLUDE_OPT) *.c >depend
index 7c301c8e23642edfa30c998b5a39b413b1304dbf..b97530b124db570c2be78f9baa1b262047c84a2b 100644 (file)
@@ -71,7 +71,7 @@ array_iterator(Oid elemtype, Oid proc, int and, ArrayType *array, Datum value)
 
        /* Lookup the function entry point */
        proc_fn = (func_ptr) NULL;
-       fmgr_info(proc, &proc_fn, &pronargs);
+       fmgr_info(proc, &pronargs);     /* (proc, &proc_fn, &pronargs); */
        if ((proc_fn == NULL) || (pronargs != 2))
        {
                elog(ERROR, "array_iterator: fmgr_info lookup failed for oid %d", proc);
diff --git a/contrib/array/array_iterator.sql b/contrib/array/array_iterator.sql
deleted file mode 100644 (file)
index 7a33562..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * SQL code
-
-- - -- load the new functions
-- - --
-load '/home/dz/lib/postgres/array_iterator.so';
-
-- - -- define the array operators *=, **=, *~ and **~ for type _text
-- - --
-create function array_texteq(_text, text)
-  returns bool
-  as '/home/dz/lib/postgres/array_iterator.so' 
-  language 'c';
-
-create function array_all_texteq(_text, text)
-  returns bool
-  as '/home/dz/lib/postgres/array_iterator.so' 
-  language 'c';
-
-create function array_textregexeq(_text, text)
-  returns bool
-  as '/home/dz/lib/postgres/array_iterator.so' 
-  language 'c';
-
-create function array_all_textregexeq(_text, text)
-  returns bool
-  as '/home/dz/lib/postgres/array_iterator.so' 
-  language 'c';
-
-create operator *= (
-  leftarg=_text, 
-  rightarg=text, 
-  procedure=array_texteq);
-
-create operator **= (
-  leftarg=_text,
-  rightarg=text,
-  procedure=array_all_texteq);
-
-create operator *~ (
-  leftarg=_text,
-  rightarg=text,
-  procedure=array_textregexeq);
-
-create operator **~ (
-  leftarg=_text,
-  rightarg=text,
-  procedure=array_all_textregexeq);
-
-- - -- define the array operators *=, **=, *~ and **~ for type _char16
-- - --
-create function array_char16eq(_char16, char16)
-  returns bool
-  as '/home/dz/lib/postgres/array_iterator.so' 
-  language 'c';
-
-create function array_all_char16eq(_char16, char16)
-  returns bool
-  as '/home/dz/lib/postgres/array_iterator.so' 
-  language 'c';
-
-create function array_char16regexeq(_char16, text)
-  returns bool
-  as '/home/dz/lib/postgres/array_iterator.so' 
-  language 'c';
-
-create function array_all_char16regexeq(_char16, text)
-  returns bool
-  as '/home/dz/lib/postgres/array_iterator.so' 
-  language 'c';
-
-create operator *= (
-  leftarg=_char16,
-  rightarg=char16,
-  procedure=array_char16eq);
-
-create operator **= (
-  leftarg=_char16,
-  rightarg=char16,
-  procedure=array_all_char16eq);
-
-create operator *~ (
-  leftarg=_char16,
-  rightarg=text,
-  procedure=array_char16regexeq);
-
-create operator **~ (
-  leftarg=_char16,
-  rightarg=text,
-  procedure=array_all_char16regexeq);
-
-- - -- define the array operators *=, **=, *> and **> for type _int4
-- - --
-create function array_int4eq(_int4, int4)
-  returns bool
-  as '/home/dz/lib/postgres/array_iterator.so' 
-  language 'c';
-
-create function array_all_int4eq(_int4, int4)
-  returns bool
-  as '/home/dz/lib/postgres/array_iterator.so' 
-  language 'c';
-
-create function array_int4gt(_int4, int4)
-  returns bool
-  as '/home/dz/lib/postgres/array_iterator.so' 
-  language 'c';
-
-create function array_all_int4gt(_int4, int4)
-  returns bool
-  as '/home/dz/lib/postgres/array_iterator.so' 
-  language 'c';
-
-create operator *= (
-  leftarg=_int4,
-  rightarg=int4,
-  procedure=array_int4eq);
-
-create operator **= (
-  leftarg=_int4,
-  rightarg=int4,
-  procedure=array_all_int4eq);
-
-create operator *> (
-  leftarg=_int4,
-  rightarg=int4,
-  procedure=array_int4gt);
-
-create operator **> (
-  leftarg=_int4,
-  rightarg=int4,
-  procedure=array_all_int4gt);
-
-*/
-
-/* end of file */
-
index 52023b8e8aff37cad5143eea77e75930f64d3644..fdab004eda0bf4cafb119630bf4b27c7635c1c5d 100644 (file)
@@ -40,16 +40,16 @@ module:             $(MODULE)
 sql:           $(MODNAME).sql
 
 install:       $(MODULE)
-               cp -p $(MODULE) $(LIBDIR)
-               cd $(LIBDIR); strip $(MODULE)
+               cp -p $(MODULE) $(LIBDIR)/modules
+               cd $(LIBDIR)/modules; strip $(MODULE)
 
 %.sql: %.sql.in
-               sed "s|MODULE_PATHNAME|$(LIBDIR)/$(MODULE)|" < $< > $@
+               sed "s|MODULE_PATHNAME|$(LIBDIR)/modules/$(MODULE)|" < $< > $@
 
 .SUFFIXES: $(DLSUFFIX)
 
 %$(DLSUFFIX): %.c
-               cc $(CFLAGS) -shared -o $@ $<
+               $(CC) $(CFLAGS) -shared -o $@ $<
 
 depend dep:
                $(CC) -MM $(INCLUDE_OPT) *.c >depend
diff --git a/contrib/datetime/datetime_functions.sql b/contrib/datetime/datetime_functions.sql
deleted file mode 100644 (file)
index 9553779..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-func=$1
-cat <<% > datetime_functions.sql
-drop function time_difference(time,time);
-drop function currentdate();
-drop function currenttime();
-drop function hours(time);
-drop function minutes(time);
-drop function seconds(time);
-drop function day(date);
-drop function month(date);
-drop function year(date);
-drop function asminutes(time);
-drop function asseconds(time);
-drop operator - (time,time);
-
-create function time_difference(time,time)
-  returns time
-  as '$func' 
-  language 'c';
-
-create function currentdate()
-  returns date
-  as '$func' 
-  language 'c';
-
-create function currenttime()
-  returns time
-  as '$func' 
-  language 'c';
-
-create function hours(time)
-  returns int4
-  as '$func' 
-  language 'c';
-
-create function minutes(time)
-  returns int4
-  as '$func' 
-  language 'c';
-
-create function seconds(time)
-  returns int4
-  as '$func' 
-  language 'c';
-
-create function day(date)
-  returns int4
-  as '$func'
-  language 'c';
-
-create function month(date)
-  returns int4
-  as '$func'
-  language 'c';
-
-create function year(date)
-  returns int4
-  as '$func'
-  language 'c';
-
-create function asminutes(time)
-  returns int4
-  as '$func' 
-  language 'c';
-
-create function asseconds(time)
-  returns int4
-  as '$func' 
-  language 'c';
-
-create operator - (
-  leftarg=time, 
-  rightarg=time, 
-  procedure=time_difference);
-%
index 13528fc185ebdc472b167797b13cb1d02acab161..d5e093058aa294c4b6128e80707e387d6e6adefb 100644 (file)
@@ -17,7 +17,7 @@
 #-------------------------------------------------------------------------
 
 ifndef PGDIR
-PGDIR= /opt/postgres/current
+PGDIR= ../..
 endif
 
 SRCDIR= $(PGDIR)/src
@@ -27,13 +27,13 @@ include $(SRCDIR)/Makefile.global
 # Comment out this re-declaration of LIBDIR
 #  if you are installing as the postgres superuser
 #   into a specific database or into template1.
-LIBDIR= /home/tgl/lib
+#LIBDIR= /home/tgl/lib
 
 CFLAGS+= -I$(PGDIR)/include -I$(PGDIR)/src/include -I$(LIBPQDIR)
 
 # This extra library is for the 64-bit division routine on my Linux box
 # and probably will need to be commented-out for most other platforms.
-CLIBS+= /usr/lib/gcc-lib/i486-linux/2.7.2/libgcc.a
+#CLIBS+= /usr/lib/gcc-lib/i486-linux/2.7.2/libgcc.a
 
 TARGETS= int8.sql int8$(DLSUFFIX)
 
@@ -44,7 +44,7 @@ int8$(DLSUFFIX):      int8.o
 
 install:
        $(MAKE) all
-       cp -p int8$(DLSUFFIX) $(LIBDIR)
+       cp -p int8$(DLSUFFIX) $(LIBDIR)/modules
 
 %.sql: %.source
        if [ -z "$$USER" ]; then USER=$$LOGNAME; fi; \
@@ -53,7 +53,7 @@ install:
        rm -f $@; \
        C=`pwd`; \
        O=$C; \
-       if [ -d ${LIBDIR} ]; then O=${LIBDIR}; fi; \
+       if [ -d ${LIBDIR}/contrib ]; then O=${LIBDIR}/contrib; fi; \
        sed -e "s:_CWD_:$$C:g" \
            -e "s:_OBJWD_:$$O:g" \
            -e "s:_DLSUFFIX_:$(DLSUFFIX):g" \
index 773fdc24f9c70dd79b50c26b08bdcd8d00b95be5..3ec9c3f59aa55fc75ad503b2cc3b361fc2b6c8e5 100644 (file)
@@ -1,25 +1,37 @@
 #
 #      PostgreSQL types for IP and MAC addresses
 #
-#      $Id: Makefile,v 1.2 1998/02/14 17:58:02 scrappy Exp $
+#      $Id: Makefile,v 1.3 1998/04/22 04:14:11 scrappy Exp $
 
-all: ip.so mac.so
+SRCDIR= ../../src
 
-ip.so: ip.o
-       ld -Bshareable -o ip.so ip.o
+include $(SRCDIR)/Makefile.global
 
-ip.o: ip.c
-       cc -g -O -fPIC -I/usr/local/pgsql/include -c ip.c
+CONTRIBDIR=$(LIBDIR)/modules
 
-mac.so: mac.o
-       ld -Bshareable -o mac.so mac.o
+CFLAGS+= $(CFLAGS_SL) -I$(SRCDIR)/include
 
-mac.o: mac.c mac.h
-       cc -g -O -fPIC -I/usr/local/pgsql/include -c mac.c
+ifdef REFINT_VERBOSE
+CFLAGS+= -DREFINT_VERBOSE
+endif
 
-install: ip.so mac.so
-       install -c ip.so mac.so /usr/local/pgsql/modules
+TARGETS= ip$(DLSUFFIX) ip.sql mac$(DLSUFFIX) mac.sql
 
-#
-#      eof
-#
+CLEANFILES+= $(TARGETS)
+
+all:: $(TARGETS)
+
+install:: all $(CONTRIBDIR)
+       for f in *$(DLSUFFIX); do $(INSTALL) -c $$f $(CONTRIBDIR)/$$f; done
+
+$(CONTRIBDIR):
+       mkdir -p $(CONTRIBDIR)
+
+%.sql: %.sql.in
+       rm -f $@; \
+       C=`pwd`; \
+       sed -e "s:_OBJWD_:$(CONTRIBDIR):g" \
+           -e "s:_DLSUFFIX_:$(DLSUFFIX):g" < $< > $@
+
+clean: 
+       rm -f $(TARGETS) *.o
diff --git a/contrib/ip_and_mac/ip.sql b/contrib/ip_and_mac/ip.sql
deleted file mode 100644 (file)
index d5a695b..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
---
---     PostgreSQL code for IP addresses.
---
---     $Id: ip.sql,v 1.2 1998/02/14 17:58:04 scrappy Exp $
---
-
-load '/usr/local/pgsql/modules/ip.so';
-
---
---     Input and output functions and the type itself:
---
-
-create function ipaddr_in(opaque)
-       returns opaque
-       as '/usr/local/pgsql/modules/ip.so'
-       language 'c';
-
-create function ipaddr_out(opaque)
-       returns opaque
-       as '/usr/local/pgsql/modules/ip.so'
-       language 'c';
-
-create type ipaddr (
-       internallength = 6,
-       externallength = variable,
-       input = ipaddr_in,
-       output = ipaddr_out
-);
-
---
---     The various boolean tests:
---
-
-create function ipaddr_lt(ipaddr, ipaddr)
-       returns bool
-       as '/usr/local/pgsql/modules/ip.so'
-       language 'c';
-
-create function ipaddr_le(ipaddr, ipaddr)
-       returns bool
-       as '/usr/local/pgsql/modules/ip.so'
-       language 'c';
-
-create function ipaddr_eq(ipaddr, ipaddr)
-       returns bool
-       as '/usr/local/pgsql/modules/ip.so'
-       language 'c';
-
-create function ipaddr_ge(ipaddr, ipaddr)
-       returns bool
-       as '/usr/local/pgsql/modules/ip.so'
-       language 'c';
-
-create function ipaddr_gt(ipaddr, ipaddr)
-       returns bool
-       as '/usr/local/pgsql/modules/ip.so'
-       language 'c';
-
-create function ipaddr_ne(ipaddr, ipaddr)
-       returns bool
-       as '/usr/local/pgsql/modules/ip.so'
-       language 'c';
-
-create function ipaddr_in_net(ipaddr, ipaddr)
-       returns bool
-       as '/usr/local/pgsql/modules/ip.so'
-       language 'c';
-
-create function ipaddr_mask(ipaddr)
-       returns ipaddr
-       as '/usr/local/pgsql/modules/ip.so'
-       language 'c';
-
-create function ipaddr_bcast(ipaddr)
-       returns ipaddr
-       as '/usr/local/pgsql/modules/ip.so'
-       language 'c';
-
---
---     Now the operators.  Note how some of the parameters to some
---     of the 'create operator' commands are commented out.  This
---     is because they reference as yet undefined operators, and
---     will be implicitly defined when those are, further down.
---
-
-create operator < (
-       leftarg = ipaddr,
-       rightarg = ipaddr,
---     negator = >=,
-       procedure = ipaddr_lt
-);
-
-create operator <= (
-       leftarg = ipaddr,
-       rightarg = ipaddr,
---     negator = >,
-       procedure = ipaddr_le
-);
-
-create operator = (
-       leftarg = ipaddr,
-       rightarg = ipaddr,
-       commutator = =,
---     negator = <>,
-       procedure = ipaddr_eq
-);
-
-create operator >= (
-       leftarg = ipaddr,
-       rightarg = ipaddr,
-       negator = <,
-       procedure = ipaddr_ge
-);
-
-create operator > (
-       leftarg = ipaddr,
-       rightarg = ipaddr,
-       negator = <=,
-       procedure = ipaddr_gt
-);
-
-create operator <> (
-       leftarg = ipaddr,
-       rightarg = ipaddr,
-       negator = =,
-       procedure = ipaddr_ne
-);
-
---
---     eof
---
diff --git a/contrib/ip_and_mac/mac.sql b/contrib/ip_and_mac/mac.sql
deleted file mode 100644 (file)
index 47c6b81..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
---
---     PostgreSQL code for MAC addresses.
---
---     $Id: mac.sql,v 1.2 1998/02/14 17:58:08 scrappy Exp $
---
-
-load '/usr/local/pgsql/modules/mac.so';
-
---
---     Input and output functions and the type itself:
---
-
-create function macaddr_in(opaque)
-       returns opaque
-       as '/usr/local/pgsql/modules/mac.so'
-       language 'c';
-
-create function macaddr_out(opaque)
-       returns opaque
-       as '/usr/local/pgsql/modules/mac.so'
-       language 'c';
-
-create type macaddr (
-       internallength = 6,
-       externallength = variable,
-       input = macaddr_in,
-       output = macaddr_out
-);
-
---
---     The boolean tests:
---
-
-create function macaddr_lt(macaddr, macaddr)
-       returns bool
-       as '/usr/local/pgsql/modules/mac.so'
-       language 'c';
-
-create function macaddr_le(macaddr, macaddr)
-       returns bool
-       as '/usr/local/pgsql/modules/mac.so'
-       language 'c';
-
-create function macaddr_eq(macaddr, macaddr)
-       returns bool
-       as '/usr/local/pgsql/modules/mac.so'
-       language 'c';
-
-create function macaddr_ge(macaddr, macaddr)
-       returns bool
-       as '/usr/local/pgsql/modules/mac.so'
-       language 'c';
-
-create function macaddr_gt(macaddr, macaddr)
-       returns bool
-       as '/usr/local/pgsql/modules/mac.so'
-       language 'c';
-
-create function macaddr_ne(macaddr, macaddr)
-       returns bool
-       as '/usr/local/pgsql/modules/mac.so'
-       language 'c';
-
---
---     Now the operators.  Note how some of the parameters to some
---     of the 'create operator' commands are commented out.  This
---     is because they reference as yet undefined operators, and
---     will be implicitly defined when those are, further down.
---
-
-create operator < (
-       leftarg = macaddr,
-       rightarg = macaddr,
---     negator = >=,
-       procedure = macaddr_lt
-);
-
-create operator <= (
-       leftarg = macaddr,
-       rightarg = macaddr,
---     negator = >,
-       procedure = macaddr_le
-);
-
-create operator = (
-       leftarg = macaddr,
-       rightarg = macaddr,
-       commutator = =,
---     negator = <>,
-       procedure = macaddr_eq
-);
-
-create operator >= (
-       leftarg = macaddr,
-       rightarg = macaddr,
-       negator = <,
-       procedure = macaddr_ge
-);
-
-create operator > (
-       leftarg = macaddr,
-       rightarg = macaddr,
-       negator = <=,
-       procedure = macaddr_gt
-);
-
-create operator <> (
-       leftarg = macaddr,
-       rightarg = macaddr,
-       negator = =,
-       procedure = macaddr_ne
-);
-
---
---     Finally, the special manufacurer matching function:
---
-
-create function macaddr_manuf(macaddr)
-       returns text
-       as '/usr/local/pgsql/modules/mac.so'
-       language 'c';
-
---
---     eof
---
index 982515ab296af05d41df3cea2da712622c0e445d..33ba1e09370e11c4262aabc516f4a8834fe21aaf 100644 (file)
@@ -40,16 +40,16 @@ module:             $(MODULE)
 sql:           $(MODNAME).sql
 
 install:       $(MODULE)
-               cp -p $(MODULE) $(LIBDIR)
-               cd $(LIBDIR); strip $(MODULE)
+               cp -p $(MODULE) $(LIBDIR)/modules
+               cd $(LIBDIR)/modules; strip $(MODULE)
 
 %.sql: %.sql.in
-               sed "s|MODULE_PATHNAME|$(LIBDIR)/$(MODULE)|" < $< > $@
+               sed "s|MODULE_PATHNAME|$(LIBDIR)/modules/$(MODULE)|" < $< > $@
 
 .SUFFIXES: $(DLSUFFIX)
 
 %$(DLSUFFIX): %.c
-               cc $(CFLAGS) -shared -o $@ $<
+               $(CC) $(CFLAGS) -shared -o $@ $<
 
 depend dep:
                $(CC) -MM $(INCLUDE_OPT) *.c >depend
index 8e86345a4481dcef28fa0635f39f5dfd545178a6..a13b336fb2f238c2f602b4d98fd656e15b657217 100644 (file)
@@ -4,21 +4,29 @@
 #
 PGINTERFACE = pginterface.o halt.o 
 TARGET = pginsert pgwordcount pgnulltest
-CFLAGS = -g -Wall -I/usr/local/pgsql/include 
+CFLAGS = -g -fpic -Wall -I. -I../../src/interfaces/libpq  -I/usr/local/pgsql/include
 LDFLAGS = -L/usr/local/pgsql/lib -lpq
 
 all : $(TARGET)
 
-$(TARGET):     $(PGINTERFACE) $*.c
-       cc -o $* $(CFLAGS) $*.c $(PGINTERFACE) $(LDFLAGS)
+pginsert:      $(PGINTERFACE) pginsert.c
+       gcc -o $@ $(CFLAGS) $@.c $(PGINTERFACE) $(LDFLAGS)
+
+pgwordcount:   $(PGINTERFACE) pgwordcount.c
+       gcc -o $@ $(CFLAGS) $@.c $(PGINTERFACE) $(LDFLAGS)
+
+pgnulltest:    $(PGINTERFACE) pgnulltest.c
+       gcc -o $@ $(CFLAGS) $@.c $(PGINTERFACE) $(LDFLAGS)
+
+pginterface.o: pginterface.c
+       gcc -c $(CFLAGS) pginterface.c
+
+halt.o:        halt.c
+       gcc -c $(CFLAGS) halt.c
 
-$(PGINTERFACE):        pginterface.c halt.c
-       cc -c $(CFLAGS) pginterface.c halt.c
-       
 clean:
        rm -f *.o $(TARGET) log core
 
 install:
-       make clean
-       make CFLAGS=-O
-       install -s -o bin -g bin $(TARGET) /usr/local/bin
+       install -s -o bin -g bin $(TARGET) /usr/local/pgsql/bin
+
index e82817fd15a648adbf9d5516938819fde44f3c30..ade134651d3e832b5260a1472598cf5cd867b066 100644 (file)
@@ -40,16 +40,16 @@ module:             $(MODULE)
 sql:           $(MODNAME).sql
 
 install:       $(MODULE)
-               cp -p $(MODULE) $(LIBDIR)
-               cd $(LIBDIR); strip $(MODULE)
+               cp -p $(MODULE) $(LIBDIR)/modules
+               cd $(LIBDIR)/modules; strip $(MODULE)
 
 %.sql: %.sql.in
-               sed "s|MODULE_PATHNAME|$(LIBDIR)/$(MODULE)|" < $< > $@
+               sed "s|MODULE_PATHNAME|$(LIBDIR)/modules/$(MODULE)|" < $< > $@
 
 .SUFFIXES: $(DLSUFFIX)
 
 %$(DLSUFFIX): %.c
-               cc $(CFLAGS) -shared -o $@ $<
+               $(CC) $(CFLAGS) -shared -o $@ $<
 
 depend dep:
                $(CC) -MM $(INCLUDE_OPT) *.c >depend
diff --git a/contrib/soundex/soundex.sql b/contrib/soundex/soundex.sql
deleted file mode 100644 (file)
index af8ea41..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
---------------- soundex.sql:
-
-CREATE FUNCTION text_soundex(text) RETURNS text
-   AS '/usr/local/postgres/postgres95/src/funcs/soundex.so' LANGUAGE 'c';
-
-SELECT text_soundex('hello world!');
-
-CREATE TABLE s (nm text)\g
-
-insert into s values ('john')\g
-insert into s values ('joan')\g
-insert into s values ('wobbly')\g
-
-select * from s
-where text_soundex(nm) = text_soundex('john')\g
-
-select nm from s a, s b
-where text_soundex(a.nm) = text_soundex(b.nm)
-and a.oid <> b.oid\g
-
-CREATE FUNCTION text_sx_eq(text, text) RETURNS bool AS
-'select text_soundex($1) = text_soundex($2)'
-LANGUAGE 'sql'\g
-
-CREATE FUNCTION text_sx_lt(text,text) RETURNS bool AS
-'select text_soundex($1) < text_soundex($2)'
-LANGUAGE 'sql'\g
-
-CREATE FUNCTION text_sx_gt(text,text) RETURNS bool AS
-'select text_soundex($1) > text_soundex($2)'
-LANGUAGE 'sql';
-
-CREATE FUNCTION text_sx_le(text,text) RETURNS bool AS
-'select text_soundex($1) <= text_soundex($2)'
-LANGUAGE 'sql';
-
-CREATE FUNCTION text_sx_ge(text,text) RETURNS bool AS
-'select text_soundex($1) >= text_soundex($2)'
-LANGUAGE 'sql';
-
-CREATE FUNCTION text_sx_ne(text,text) RETURNS bool AS
-'select text_soundex($1) <> text_soundex($2)'
-LANGUAGE 'sql';
-
-DROP OPERATOR #= (text,text)\g
-
-CREATE OPERATOR #= (leftarg=text, rightarg=text, procedure=text_sx_eq,
-commutator=text_sx_eq)\g
-
-SELECT *
-FROM s
-WHERE text_sx_eq(nm,'john')\g
-
-SELECT *
-from s
-where s.nm #= 'john';
-
index d0c4af56bc9c18fad21d9833779a6ae6a81b37b4..6bb634aa7703285a09464a4fcf44fd13d201f04b 100644 (file)
@@ -3,7 +3,7 @@ SRCDIR= ../../src
 
 include $(SRCDIR)/Makefile.global
 
-CONTRIBDIR=$(LIBDIR)/contrib
+CONTRIBDIR=$(LIBDIR)/modules
 
 CFLAGS+= $(CFLAGS_SL) -I$(SRCDIR)/include
 
index b9ff534137e15a2b05cacce7e6c9e5a5bb45e245..4aba9482772e628f4af82de83d904d66ffb748e0 100644 (file)
@@ -40,16 +40,16 @@ module:             $(MODULE)
 sql:           $(MODNAME).sql
 
 install:       $(MODULE)
-               cp -p $(MODULE) $(LIBDIR)
-               cd $(LIBDIR); strip $(MODULE)
+               cp -p $(MODULE) $(LIBDIR)/modules
+               cd $(LIBDIR)/modules; strip $(MODULE)
 
 %.sql: %.sql.in
-               sed "s|MODULE_PATHNAME|$(LIBDIR)/$(MODULE)|" < $< > $@
+               sed "s|MODULE_PATHNAME|$(LIBDIR)/modules/$(MODULE)|" < $< > $@
 
 .SUFFIXES: $(DLSUFFIX)
 
 %$(DLSUFFIX): %.c
-               cc $(CFLAGS) -shared -o $@ $<
+               $(CC) $(CFLAGS) -shared -o $@ $<
 
 depend dep:
                $(CC) -MM $(INCLUDE_OPT) *.c >depend
diff --git a/contrib/string/string_io.sql b/contrib/string/string_io.sql
deleted file mode 100644 (file)
index 0113717..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-
-- - -- load the new functions
-- - --
-load '/home/dz/lib/postgres/string_output.so';
-
-- - -- create function c_textin(opaque)
-- - --   returns text
-- - --   as '/home/dz/lib/postgres/string_output.so' 
-- - --   language 'c';
-
-create function c_charout(opaque)
-  returns int4
-  as '/home/dz/lib/postgres/string_output.so' 
-  language 'c';
-
-create function c_char2out(opaque)
-  returns int4
-  as '/home/dz/lib/postgres/string_output.so' 
-  language 'c';
-
-create function c_char4out(opaque)
-  returns int4
-  as '/home/dz/lib/postgres/string_output.so' 
-  language 'c';
-
-create function c_char8out(opaque)
-  returns int4
-  as '/home/dz/lib/postgres/string_output.so' 
-  language 'c';
-
-create function c_char16out(opaque)
-  returns int4
-  as '/home/dz/lib/postgres/string_output.so' 
-  language 'c';
-
-create function c_textout(opaque)
-  returns int4
-  as '/home/dz/lib/postgres/string_output.so' 
-  language 'c';
-
-create function c_varcharout(opaque)
-  returns int4
-  as '/home/dz/lib/postgres/string_output.so' 
-  language 'c';
-
-- - -- define a function which sets the new output routines for char types
-- - --
-- - --   select c_mode();
-- - --
-create function c_mode()
-  returns text
-  as 'update pg_type set typoutput=''c_charout''    where typname=''char''\;
-      update pg_type set typoutput=''c_char2out''   where typname=''char2''\;
-      update pg_type set typoutput=''c_char4out''   where typname=''char4''\;
-      update pg_type set typoutput=''c_char8out''   where typname=''char8''\;
-      update pg_type set typoutput=''c_char16out''  where typname=''char16''\;
-      update pg_type set typoutput=''c_textout''    where typname=''text''\;
-      update pg_type set typoutput=''c_textout''    where typname=''bytea''\;
-      update pg_type set typoutput=''c_textout''    where typname=''unknown''\;
-      update pg_type set typoutput=''c_textout''    where typname=''SET''\;
-      update pg_type set typoutput=''c_varcharout'' where typname=''varchar''\;
-      update pg_type set typoutput=''c_varcharout'' where typname=''bpchar''\;
-      select ''c_mode''::text'
-  language 'sql';
-
-- - -- define a function which restores the original routines for char types
-- - --
-- - --   select pg_mode();
-- - --
-create function pg_mode()
-  returns text
-  as 'update pg_type set typoutput=''charout''    where typname=''char''\;
-      update pg_type set typoutput=''char2out''   where typname=''char2''\;
-      update pg_type set typoutput=''char4out''   where typname=''char4''\;
-      update pg_type set typoutput=''char8out''   where typname=''char8''\;
-      update pg_type set typoutput=''char16out''  where typname=''char16''\;
-      update pg_type set typoutput=''textout''    where typname=''text''\;
-      update pg_type set typoutput=''textout''    where typname=''bytea''\;
-      update pg_type set typoutput=''textout''    where typname=''unknown''\;
-      update pg_type set typoutput=''textout''    where typname=''SET''\;
-      update pg_type set typoutput=''varcharout'' where typname=''varchar''\;
-      update pg_type set typoutput=''varcharout'' where typname=''bpchar''\;
-      select ''pg_mode''::text'
-  language 'sql';
-
-- - -- or do the changes manually
-- - --
-- - -- update pg_type set typoutput='charout'    where typname='char';
-- - -- update pg_type set typoutput='char2out'   where typname='char2';
-- - -- update pg_type set typoutput='char4out'   where typname='char4';
-- - -- update pg_type set typoutput='char8out'   where typname='char8';
-- - -- update pg_type set typoutput='char16out'  where typname='char16';
-- - -- update pg_type set typoutput='textout'    where typname='text';
-- - -- update pg_type set typoutput='textout'    where typname='bytea';
-- - -- update pg_type set typoutput='textout'    where typname='unknown';
-- - -- update pg_type set typoutput='textout'    where typname='SET';
-- - -- update pg_type set typoutput='varcharout' where typname='varchar';
-- - -- update pg_type set typoutput='varcharout' where typname='bpchar';
-- - --
-- - -- update pg_type set typoutput='c_charout'    where typname='char';
-- - -- update pg_type set typoutput='c_char2out'   where typname='char2';
-- - -- update pg_type set typoutput='c_char4out'   where typname='char4';
-- - -- update pg_type set typoutput='c_char8out'   where typname='char8';
-- - -- update pg_type set typoutput='c_char16out'  where typname='char16';
-- - -- update pg_type set typoutput='c_textout'    where typname='text';
-- - -- update pg_type set typoutput='c_textout'    where typname='bytea';
-- - -- update pg_type set typoutput='c_textout'    where typname='unknown';
-- - -- update pg_type set typoutput='c_textout'    where typname='SET';
-- - -- update pg_type set typoutput='c_varcharout' where typname='varchar';
-- - -- update pg_type set typoutput='c_varcharout' where typname='bpchar';
-
index 0865bde7321b18a35fcec05e55ce7d708da36413..2b6785945384284a96bf638be35100db19d6b335 100644 (file)
@@ -40,16 +40,16 @@ module:             $(MODULE)
 sql:           $(MODNAME).sql
 
 install:       $(MODULE)
-               cp -p $(MODULE) $(LIBDIR)
-               cd $(LIBDIR); strip $(MODULE)
+               cp -p $(MODULE) $(LIBDIR)/modules
+               cd $(LIBDIR)/modules; strip $(MODULE)
 
 %.sql: %.sql.in
-               sed "s|MODULE_PATHNAME|$(LIBDIR)/$(MODULE)|" < $< > $@
+               sed "s|MODULE_PATHNAME|$(LIBDIR)/modules/$(MODULE)|" < $< > $@
 
 .SUFFIXES: $(DLSUFFIX)
 
 %$(DLSUFFIX): %.c
-               cc $(CFLAGS) -shared -o $@ $<
+               $(CC) $(CFLAGS) -shared -o $@ $<
 
 depend dep:
                $(CC) -MM $(INCLUDE_OPT) *.c >depend