Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 8203410

Browse files
committed
From: Michael Meskes <meskes@topsystem.de>
Well this is not really a patch. But I mananged to get Linus' old Postgres95 precompiler to compile and work with PostgreSQL. The next step would be to collect bug/missing feature reports and to put it into the distribution so that it is made with the standard make procedure. Warning! So far it is not tested much and it does not install correctly. But I was able to create a small binary with it.
1 parent c10908e commit 8203410

32 files changed

+7969
-0
lines changed

src/interfaces/ecpg/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
SUBDIRS = src/include src/lib src/preproc
2+
3+
all install uninstall clean::
4+
for i in $(SUBDIRS); do ( cd $$i; make $@ ); done

src/interfaces/ecpg/TODO

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
This list is still from Linus. MM
2+
3+
The variables should be static.
4+
5+
The preprocessor interface is strange, to say the least It would be better
6+
with a consistant unix arguments interface, perhaps builtin default
7+
filenames so they won't have to be given all the time.
8+
9+
Preprocessor cannot do syntax checking on your SQL statements Whatever you
10+
write is copied more or less exactly to the postgres95 and you will not be
11+
able to locate your errors until run-time.
12+
13+
No restriction to strings only The PQ interface, and most of all the PQexec
14+
function, that is used by the ecpg relies on that the request is built up as
15+
a string. In some cases, like when the data contains the null character,
16+
this will be a serious problem.
17+
18+
There should be different error numbers for the different errors instead of
19+
just -1 for them all.
20+
21+
Missing library functions to_date et al.
22+
23+
Possibility to define records or structs in the declare section in a way
24+
that the record can be filled from one row in the database. This is a
25+
simpler way to handle an entire row at a time.
26+
27+
Oracle has array operations that enhances speed. When implementing it in
28+
ecpg it is done for compatibility reasons only. For them to improve speed
29+
would require a lot more insight in the postgres internal mechanisms than I
30+
possess.
31+
32+
Oracle has indicator variables that tell if a value is null or if it is
33+
empty. This largely simplifies array operations and provides for a way to
34+
hack around some design flaws in the handling of VARCHAR2 (like that an
35+
empty string isn't distinguishable from a null value). I am not sure if this
36+
is an Oracle extension or part of the ANSI standard.
37+
38+
As well as complex types like records and arrays, typedefs would be a good
39+
thing to take care of.
40+
41+
To set up a database you need a few scripts with table definitions and other
42+
configuration parameters. If you have these scripts for an old database you
43+
would like to just apply them to get a postgres database that works in the
44+
same way. The functionality could be accomplished with some conversion
45+
scripts. Speed will never be accomplished in this way. To do this you need a
46+
bigger insight in the database construction and the use of the database than
47+
could be realised in a script.
48+

src/interfaces/ecpg/config.cache

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# This file is a shell script that caches the results of configure
2+
# tests run on this system so they can be shared between configure
3+
# scripts and configure runs. It is not useful on other systems.
4+
# If it contains results you don't want to keep, you may remove or edit it.
5+
#
6+
# By default, configure uses ./config.cache as the cache file,
7+
# creating it if it does not exist already. You can give configure
8+
# the --cache-file=FILE option to use a different cache file; that is
9+
# what configure does when it calls configure scripts in
10+
# subdirectories, so they share the cache.
11+
# Giving --cache-file=/dev/null disables caching, for debugging configure.
12+
# config.status only pays attention to the cache file if you give it the
13+
# --recheck option to rerun configure.
14+
#
15+
ac_cv_lib_fl_yywrap=${ac_cv_lib_fl_yywrap=yes}
16+
ac_cv_prog_CC=${ac_cv_prog_CC=gcc}
17+
ac_cv_prog_LEX=${ac_cv_prog_LEX=flex}
18+
ac_cv_prog_YACC=${ac_cv_prog_YACC='bison -y'}
19+
ac_cv_prog_cc_cross=${ac_cv_prog_cc_cross=no}
20+
ac_cv_prog_cc_g=${ac_cv_prog_cc_g=yes}
21+
ac_cv_prog_cc_works=${ac_cv_prog_cc_works=yes}
22+
ac_cv_prog_gcc=${ac_cv_prog_gcc=yes}

src/interfaces/ecpg/config.log

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
This file contains any messages produced by compilers while
2+
running configure, to aid debugging if configure makes a mistake.
3+
4+
configure:526: checking for gcc
5+
configure:603: checking whether the C compiler (gcc ) works
6+
configure:617: gcc -o conftest conftest.c 1>&5
7+
configure:637: checking whether the C compiler (gcc ) is a cross-compiler
8+
configure:642: checking whether we are using GNU C
9+
configure:666: checking whether gcc accepts -g
10+
configure:696: checking for flex
11+
configure:729: checking for yywrap in -lfl
12+
configure:775: checking for bison

src/interfaces/ecpg/config.status

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
#! /bin/sh
2+
# Generated automatically by configure.
3+
# Run this file to recreate the current configuration.
4+
# This directory was configured as follows,
5+
# on host gauss:
6+
#
7+
# ./configure
8+
#
9+
# Compiler output produced by configure, useful for debugging
10+
# configure, is in ./config.log if it exists.
11+
12+
ac_cs_usage="Usage: ./config.status [--recheck] [--version] [--help]"
13+
for ac_option
14+
do
15+
case "$ac_option" in
16+
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
17+
echo "running ${CONFIG_SHELL-/bin/sh} ./configure --no-create --no-recursion"
18+
exec ${CONFIG_SHELL-/bin/sh} ./configure --no-create --no-recursion ;;
19+
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
20+
echo "./config.status generated by autoconf version 2.12"
21+
exit 0 ;;
22+
-help | --help | --hel | --he | --h)
23+
echo "$ac_cs_usage"; exit 0 ;;
24+
*) echo "$ac_cs_usage"; exit 1 ;;
25+
esac
26+
done
27+
28+
ac_given_srcdir=.
29+
30+
trap 'rm -fr src/include/Makefile src/lib/Makefile src/preproc/Makefile src/preproc/ecpg conftest*; exit 1' 1 2 15
31+
32+
# Protect against being on the right side of a sed subst in config.status.
33+
sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\&%]/\\&/g;
34+
s/@@/%@/; s/@@/@%/; s/@g$/%g/' > conftest.subs <<\CEOF
35+
/^[ ]*VPATH[ ]*=[^:]*$/d
36+
37+
s%@CFLAGS@%-g -O2%g
38+
s%@CPPFLAGS@%%g
39+
s%@CXXFLAGS@%%g
40+
s%@DEFS@% %g
41+
s%@LDFLAGS@%%g
42+
s%@LIBS@%%g
43+
s%@exec_prefix@%${prefix}%g
44+
s%@prefix@%/usr/local%g
45+
s%@program_transform_name@%s,x,x,%g
46+
s%@bindir@%${exec_prefix}/bin%g
47+
s%@sbindir@%${exec_prefix}/sbin%g
48+
s%@libexecdir@%${exec_prefix}/libexec%g
49+
s%@datadir@%${prefix}/share%g
50+
s%@sysconfdir@%${prefix}/etc%g
51+
s%@sharedstatedir@%${prefix}/com%g
52+
s%@localstatedir@%${prefix}/var%g
53+
s%@libdir@%${exec_prefix}/lib%g
54+
s%@includedir@%${prefix}/include%g
55+
s%@oldincludedir@%/usr/include%g
56+
s%@infodir@%${prefix}/info%g
57+
s%@mandir@%${prefix}/man%g
58+
s%@CC@%gcc%g
59+
s%@LEX@%flex%g
60+
s%@LEXLIB@%-lfl%g
61+
s%@YACC@%bison -y%g
62+
s%@TOPSRC@%/home/meskes/data/computer/databases/postgres/pgsql/src/interfaces/ecpg/../..%g
63+
64+
CEOF
65+
66+
# Split the substitutions into bite-sized pieces for seds with
67+
# small command number limits, like on Digital OSF/1 and HP-UX.
68+
ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
69+
ac_file=1 # Number of current file.
70+
ac_beg=1 # First line for current file.
71+
ac_end=$ac_max_sed_cmds # Line after last line for current file.
72+
ac_more_lines=:
73+
ac_sed_cmds=""
74+
while $ac_more_lines; do
75+
if test $ac_beg -gt 1; then
76+
sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
77+
else
78+
sed "${ac_end}q" conftest.subs > conftest.s$ac_file
79+
fi
80+
if test ! -s conftest.s$ac_file; then
81+
ac_more_lines=false
82+
rm -f conftest.s$ac_file
83+
else
84+
if test -z "$ac_sed_cmds"; then
85+
ac_sed_cmds="sed -f conftest.s$ac_file"
86+
else
87+
ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
88+
fi
89+
ac_file=`expr $ac_file + 1`
90+
ac_beg=$ac_end
91+
ac_end=`expr $ac_end + $ac_max_sed_cmds`
92+
fi
93+
done
94+
if test -z "$ac_sed_cmds"; then
95+
ac_sed_cmds=cat
96+
fi
97+
98+
CONFIG_FILES=${CONFIG_FILES-"src/include/Makefile src/lib/Makefile src/preproc/Makefile src/preproc/ecpg"}
99+
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
100+
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
101+
case "$ac_file" in
102+
*:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
103+
ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
104+
*) ac_file_in="${ac_file}.in" ;;
105+
esac
106+
107+
# Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
108+
109+
# Remove last slash and all that follows it. Not all systems have dirname.
110+
ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
111+
if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
112+
# The file is in a subdirectory.
113+
test ! -d "$ac_dir" && mkdir "$ac_dir"
114+
ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
115+
# A "../" for each directory in $ac_dir_suffix.
116+
ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
117+
else
118+
ac_dir_suffix= ac_dots=
119+
fi
120+
121+
case "$ac_given_srcdir" in
122+
.) srcdir=.
123+
if test -z "$ac_dots"; then top_srcdir=.
124+
else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
125+
/*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
126+
*) # Relative path.
127+
srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
128+
top_srcdir="$ac_dots$ac_given_srcdir" ;;
129+
esac
130+
131+
132+
echo creating "$ac_file"
133+
rm -f "$ac_file"
134+
configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
135+
case "$ac_file" in
136+
*Makefile*) ac_comsub="1i\\
137+
# $configure_input" ;;
138+
*) ac_comsub= ;;
139+
esac
140+
141+
ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
142+
sed -e "$ac_comsub
143+
s%@configure_input@%$configure_input%g
144+
s%@srcdir@%$srcdir%g
145+
s%@top_srcdir@%$top_srcdir%g
146+
" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
147+
fi; done
148+
rm -f conftest.s*
149+
150+
151+
152+
exit 0

0 commit comments

Comments
 (0)