1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

/contrib patch from Karel.

This commit is contained in:
Bruce Momjian
2000-06-15 18:55:34 +00:00
parent 82c4733116
commit f7f177d372
73 changed files with 1156 additions and 4508 deletions

View File

@ -1,65 +1,53 @@
#-------------------------------------------------------------------------
#
# $Header: /cvsroot/pgsql/contrib/string/Attic/Makefile,v 1.8 2000/06/15 18:55:21 momjian Exp $
#
# Makefile --
#
# Makefile for string I/O module.
#
#-------------------------------------------------------------------------
PGDIR = ../..
SRCDIR = $(PGDIR)/src
TOPDIR=../..
include $(SRCDIR)/Makefile.global
include ../Makefile.global
NAME = string_io
PROGRAM =
OBJS = $(NAME).o
DOCS = $(NAME).doc
SQLS = $(NAME).sql
BINS =
EXAMPLES=
MODS = $(NAME)$(DLSUFFIX)
CFLAGS += -I. $(CFLAGS_SL)
MODNAME = string_io
OTHER_CLEAN = $(SQLS)
SQLDEFS = $(MODNAME).sql
all: $(MODS) $(SQLS)
MODULE = $(MODNAME)$(DLSUFFIX)
MODDIR = $(LIBDIR)/modules
SQLDIR = $(LIBDIR)/sql
all: module sql
module: $(MODULE)
sql: $(SQLDEFS)
install: $(MODULE) $(SQLDEFS) $(MODDIR) $(SQLDIR)
cp -p $(MODULE) $(MODDIR)/
strip $(MODDIR)/$(MODULE)
cp -p $(SQLDEFS) $(SQLDIR)/
install-doc:
if [ -d "$(DOCDIR)" ]; then \
cp -p *.doc $(DOCDIR); \
else \
cp -p *.doc $(SQLDIR); \
fi
$(MODDIR):
mkdir -p $@
$(SQLDIR):
mkdir -p $@
%.sql: %.sql.in
sed "s|MODULE_PATHNAME|$(MODDIR)/$(MODULE)|" < $< > $@
$(SED) "s|MODULE_PATHNAME|$(CONTRIB_MODDIR)/$@|" < $< > $@
.SUFFIXES: $(DLSUFFIX)
install: install_doc install_sql install_mod
%$(DLSUFFIX): %.c
$(CC) $(CFLAGS) -shared -o $@ $<
install_doc:
for inst_file in $(DOCS); do \
$(INSTALL) $(INSTL_LIB_OPTS) $$inst_file $(CONTRIB_DOCDIR); \
done
install_sql:
for inst_file in $(SQLS); do \
$(INSTALL) $(INSTL_LIB_OPTS) $$inst_file $(CONTRIB_SQLDIR); \
done
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

23
contrib/string/README Normal file
View File

@ -0,0 +1,23 @@
String io module 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.
These output functions can be used as substitution of the standard text
output functions to get the value of text fields printed in the format
used for C strings. This allows the output of queries or the exported
files to be processed more easily using standard unix filter programs
like perl or awk.
If you use the standard functions instead you could find a single tuple
splitted into many lines and the tabs embedded in the values could be
confused with those used as field delimters.
My function translates all non-printing characters into corresponding
esacape sequences as defined by the C syntax. All you need to reconstruct
the exact value in your application is a corresponding unescape function
like the string_input defined in the source code.
Massimo Dal Zotto <dz@cs.unitn.it>