diff options
| author | Bruce Momjian | 2000-06-15 18:55:34 +0000 |
|---|---|---|
| committer | Bruce Momjian | 2000-06-15 18:55:34 +0000 |
| commit | f7f177d372750e4f766ccefdf20e1b30d66cba0a (patch) | |
| tree | d4e2a148640ba36d9a1e8cbf8557faa606ce5ba1 /contrib/miscutil | |
| parent | 82c4733116813ff862dade1984b6fb74149f4124 (diff) | |
/contrib patch from Karel.
Diffstat (limited to 'contrib/miscutil')
| -rw-r--r-- | contrib/miscutil/Makefile | 75 | ||||
| -rw-r--r-- | contrib/miscutil/README | 43 |
2 files changed, 74 insertions, 44 deletions
diff --git a/contrib/miscutil/Makefile b/contrib/miscutil/Makefile index 742db0334f5..38118a6f8e3 100644 --- a/contrib/miscutil/Makefile +++ b/contrib/miscutil/Makefile @@ -1,65 +1,52 @@ -#------------------------------------------------------------------------- # -# Makefile -- +# $Header: /cvsroot/pgsql/contrib/miscutil/Attic/Makefile,v 1.8 2000/06/15 18:55:01 momjian Exp $ # -# Makefile for the misc_util module. -# -#------------------------------------------------------------------------- - -PGDIR = ../.. -SRCDIR = $(PGDIR)/src - -include $(SRCDIR)/Makefile.global - -CFLAGS += -I. $(CFLAGS_SL) - -MODNAME = misc_utils -SQLDEFS = $(MODNAME).sql +TOPDIR=../.. -MODULE = $(MODNAME)$(DLSUFFIX) +include ../Makefile.global -MODDIR = $(LIBDIR)/modules +NAME = misc_utils -SQLDIR = $(LIBDIR)/sql +PROGRAM = +OBJS = $(NAME).o +DOCS = $(NAME).doc +SQLS = $(NAME).sql +BINS = +EXAMPLES= +MODS = $(NAME)$(DLSUFFIX) -all: module sql - -module: $(MODULE) - -sql: $(SQLDEFS) +CFLAGS += -I. $(CFLAGS_SL) -install: $(MODULE) $(SQLDEFS) $(MODDIR) $(SQLDIR) - cp -p $(MODULE) $(MODDIR)/ - strip $(MODDIR)/$(MODULE) - cp -p $(SQLDEFS) $(SQLDIR)/ +OTHER_CLEAN = $(SQLS) -install-doc: - if [ -d "$(DOCDIR)" ]; then \ - cp -p *.doc $(DOCDIR); \ - else \ - cp -p *.doc $(SQLDIR); \ - fi +all: $(MODS) $(SQLS) -$(MODDIR): - mkdir -p $@ +%.sql: %.sql.in + $(SED) "s|MODULE_PATHNAME|$(CONTRIB_MODDIR)/$@|" < $< > $@ -$(SQLDIR): - mkdir -p $@ +install: install_doc install_sql install_mod -%.sql: %.sql.in - sed "s|MODULE_PATHNAME|$(MODDIR)/$(MODULE)|" < $< > $@ +install_doc: + for inst_file in $(DOCS); do \ + $(INSTALL) $(INSTL_LIB_OPTS) $$inst_file $(CONTRIB_DOCDIR); \ + done -.SUFFIXES: $(DLSUFFIX) +install_sql: + for inst_file in $(SQLS); do \ + $(INSTALL) $(INSTL_LIB_OPTS) $$inst_file $(CONTRIB_SQLDIR); \ + done -%$(DLSUFFIX): %.c - $(CC) $(CFLAGS) -shared -o $@ $< +install_mod: + for inst_file in $(MODS); do \ + $(INSTALL) $(INSTL_SHLIB_OPTS) $$inst_file $(CONTRIB_MODDIR); \ + done depend dep: - $(CC) -MM $(CFLAGS) *.c >depend + $(CC) -MM -MG $(CFLAGS) *.c > depend clean: - rm -f *~ $(MODULE) $(MODNAME).sql + $(RM) *~ $(OBJS) $(MODS) $(PROGRAM) depend $(OTHER_CLEAN) core log ifeq (depend,$(wildcard depend)) include depend diff --git a/contrib/miscutil/README b/contrib/miscutil/README new file mode 100644 index 00000000000..903455513a2 --- /dev/null +++ b/contrib/miscutil/README @@ -0,0 +1,43 @@ +Miscellaneous utility functions for PostgreSQL. +Copyright (C) 1999, Massimo Dal Zotto <dz@cs.unitn.it> + +This software is distributed under the GNU General Public License +either version 2, or (at your option) any later version. + +query_limit(n) + + sets a limit on the maximum numbers of query returned from + a backend. It can be used to limit the result size retrieved + by the application for poor input data or to avoid accidental + table product while playying with sql. + +backend_pid() + + return the pid of our corresponding backend. + +unlisten(relname) + + unlisten from a relation or from all relations if the argument + is null, empty or '*'. + It is now obsoleted by the new unlisten command but still useful + if you want unlisten a name computed by the query. + Note that a listen/notify relname can be any ascii string, not + just valid relation names. + +min(x,y) +max(x,y) + + return the min or max bteween two integers. + +assert_enable(bool) + + enable/disable assert checkings in the backend, if it has been + compiled with USE_ASSERT_CHECKING. + +assert_test(bool) + + test the assert enable/disable code, if the backend has been + compiled with ASSERT_CHECKING_TEST. + +-- +Massimo Dal Zotto <dz@cs.unitn.it> |
