Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit72aa1da

Browse files
committed
From: Michael Meskes <meskes@topsystem.de>
Cleanups for ecpg, as well as a missing patch so that its configured in
1 parent755c2be commit72aa1da

File tree

6 files changed

+48
-85
lines changed

6 files changed

+48
-85
lines changed

‎src/configure

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4481,7 +4481,7 @@ done
44814481
44824482
ac_given_srcdir=$srcdir
44834483
4484-
trap 'rm -fr`echo"GNUmakefile Makefile.global backend/port/Makefile bin/pg_version/Makefile bin/psql/Makefile bin/pg_dump/Makefile backend/utils/Gen_fmgrtab.sh interfaces/libpq/Makefile interfaces/libpgtcl/Makefile include/config.h"| sed"s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
4484+
trap 'rm -fr`echo"GNUmakefile Makefile.global backend/port/Makefile bin/pg_version/Makefile bin/psql/Makefile bin/pg_dump/Makefile backend/utils/Gen_fmgrtab.sh interfaces/libpq/Makefile interfaces/libpgtcl/Makefileinterfaces/ecpg/preproc/Makefile interfaces/ecpg/lib/Makefile interfaces/ecpg/include/Makefileinclude/config.h"| sed"s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
44854485
EOF
44864486
cat>>$CONFIG_STATUS<<EOF
44874487
@@ -4603,7 +4603,7 @@ EOF
46034603

46044604
cat>>$CONFIG_STATUS<<EOF
46054605
4606-
CONFIG_FILES=\${CONFIG_FILES-"GNUmakefile Makefile.global backend/port/Makefile bin/pg_version/Makefile bin/psql/Makefile bin/pg_dump/Makefile backend/utils/Gen_fmgrtab.sh interfaces/libpq/Makefile interfaces/libpgtcl/Makefile"}
4606+
CONFIG_FILES=\${CONFIG_FILES-"GNUmakefile Makefile.global backend/port/Makefile bin/pg_version/Makefile bin/psql/Makefile bin/pg_dump/Makefile backend/utils/Gen_fmgrtab.sh interfaces/libpq/Makefile interfaces/libpgtcl/Makefile interfaces/ecpg/preproc/Makefile interfaces/ecpg/lib/Makefile interfaces/ecpg/include/Makefile"}
46074607
EOF
46084608
cat>>$CONFIG_STATUS<<\EOF
46094609
for ac_file in ..$CONFIG_FILES; do if test "x$ac_file" != x..; then

‎src/configure.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,4 +541,4 @@ else
541541
fi
542542

543543

544-
AC_OUTPUT(GNUmakefile Makefile.global backend/port/Makefile bin/pg_version/Makefile bin/psql/Makefile bin/pg_dump/Makefile backend/utils/Gen_fmgrtab.sh interfaces/libpq/Makefile interfaces/libpgtcl/Makefile)
544+
AC_OUTPUT(GNUmakefile Makefile.global backend/port/Makefile bin/pg_version/Makefile bin/psql/Makefile bin/pg_dump/Makefile backend/utils/Gen_fmgrtab.sh interfaces/libpq/Makefile interfaces/libpgtcl/Makefile interfaces/ecpg/preproc/Makefile interfaces/ecpg/lib/Makefile interfaces/ecpg/include/Makefile)

‎src/interfaces/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#
88
#
99
# IDENTIFICATION
10-
# $Header: /cvsroot/pgsql/src/interfaces/Makefile,v 1.4 1998/01/25 04:14:36 scrappy Exp $
10+
# $Header: /cvsroot/pgsql/src/interfaces/Makefile,v 1.5 1998/02/11 15:17:47 scrappy Exp $
1111
#
1212
#-------------------------------------------------------------------------
1313

@@ -16,6 +16,7 @@ include $(SRCDIR)/Makefile.global
1616

1717
.DEFAULTall:
1818
$(MAKE) -C libpq$@
19+
$(MAKE) -C ecpg$@
1920
ifeq ($(HAVE_Cplusplus), true)
2021
$(MAKE) -C libpq++ $@
2122
else

‎src/interfaces/ecpg/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SUBDIRS = include lib preproc
1+
SUBDIRS = include lib preproc doc
22

33
allinstalluninstallclean:
44
foriin$(SUBDIRS);do (cd$$i; make$@ );done

‎src/interfaces/ecpg/TODO

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ This list is still from Linus. MM
22

33
The variables should be static.
44

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. (Done: MM 2/5/98)
8-
95
Preprocessor cannot do syntax checking on your SQL statements Whatever you
106
write is copied more or less exactly to the postgres95 and you will not be
117
able to locate your errors until run-time.
@@ -48,6 +44,8 @@ could be realised in a script.
4844

4945
Now comes my list (MM):
5046

51-
libecpg should be made a shared library.
47+
Ecpg should remove variables from its list as soon as they are undefined and
48+
not rely on cc to report an error.
49+
50+
Variable definitions containing static/volatile have to be possible.
5251

53-
Makefiles have to able to correctly install and clean.

‎src/interfaces/ecpg/doc/ecpg.texinfo

Lines changed: 38 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,47 @@
11
\inputtexinfo@c -*-texinfo-*-
22
@c %**start of header
33
@setfilenameecpg.info
4-
@settitleEcpg-EmbeddedSQLinCforPostgres95
4+
@settitleEcpg-EmbeddedSQLinCforPostgreSQL
55
@setchapternewpageodd
66
@c %**end of header
77

88
@ifinfo
9-
This file documents an embedded SQL in C package forPostgres 95.
9+
This file documents an embedded SQL in C package forPostgreSQL.
1010

1111
Copyright 1996 Linus Tolke
1212

1313
Permission is granted to copy and use in the same way as you are allowed
14-
to copy and use the rest of thePostgres 95.
14+
to copy and use the rest of thePostgreSQL.
1515
@end ifinfo
1616

1717
@c This title page illustrates only one of the
1818
@c two methods of forming a title page.
1919

2020
@titlepage
2121
@titleECPG
22-
@subtitleEmbeddedSQLinCforPostgres95
22+
@subtitleEmbeddedSQLinCforPostgreSQL
2323
@authorLinusTolke
2424

2525
@c The following two commands
2626
@c start the copyright page.
2727
@page
2828
@vskip0ptplus1filll
29-
Copyright@copyright{} 1996 Linus Tolke
29+
Copyright@copyright{} 1996-1997 Linus Tolke, 1998 Michael Meskes
3030

3131
Published by Linus Tolke
3232

3333
Permission is granted to copy and use in the same way as you are allowed
34-
to copy and use the rest of thePostgres 95.
34+
to copy and use the rest of thePostgreSQL.
3535
@end titlepage
3636

3737
@nodeTop,WhyembeddedSQL,(dir),(dir)
3838
@comment node-name, next, previous, up
3939

4040
@ifinfo
41-
Ecpg is an embedded sql preprocessor for C and library forPostgres95.
41+
Ecpg is an embedded sql preprocessor for C and library forPostgresSQL
4242

43-
It is written by Linus Tolke <linus@@epact.se>
43+
It is written by Linus Tolke <linus@@epact.se> and Michael Meskes <meskes@@debian.org>.
4444

45-
This texinfo page and the code is all the documentation you get. There
46-
will not be any separate manual page, installation description or
47-
buglist.
4845
@end ifinfo
4946

5047
@menu
@@ -86,7 +83,7 @@ work. Most embedded sql preprocessors I have seen and heard of makes
8683
extensions so it is difficult to obtain portability even between them
8784
anyway. I have not read the standard but I hope that my implementation
8885
does not deviate to much and that it would be possible to port programs
89-
with embedded sql written for other DBMS:s toPostgres95 and thus
86+
with embedded sql written for other DBMS:s toPostgreSQL and thus
9087
promoting the spirit of free software.
9188

9289

@@ -135,36 +132,34 @@ This chapter describes how to use the ECPG tool.
135132
@cindexpreprocessor
136133
@cindex@code{ecpg}
137134
The preprocessor is called@code{ecpg}. After installation it resides in
138-
the postgres@code{bin} directory. It accepts two arguments like
139-
@code{iname=filename} and@code{oname=filename}. Both arguments must be
140-
present or an error will occur.
135+
the postgres@code{bin} directory.
141136

142137
@nodeLibrary,Errorhandling,Preprocessor,Howtouseit
143138
@section Library
144139

145140
@cindexlibraryfunctions
146141
@cindex@code{libecpg.a}
147142
@cindex@code{-lecpg}
148-
The library is called@code{libecpg.a}. The library used the pq library
149-
for the communication to the postgres server so you will have to link
150-
your program with@code{-lecpg-lpq}.
143+
The library is called@code{libecpg.a} resp.@code{libecpg.so}. The library
144+
used the pq libraryfor the communication to the postgres server so you will
145+
have to linkyour program with@code{-lecpg-lpq}.
151146

152147
The library has some methods that are "hidden" but that could prove very
153148
useful sometime.
154149

155150
@table@asis
156-
@item@code{ECPGdebug(int)}
157-
@cindex@code{ECPGdebug(int)}
151+
@item@code{ECPGdebug(int,FILE*stream)}
152+
@cindex@code{ECPGdebug(int,FILE*stream)}
158153
@cindexdebuglogging
159-
If this is called, withanon-zero argument, then debuglogging is turned
160-
on. Debuglogging is done on@code{stderr}. Most SQL statement logs its
154+
If this is called, withthe first argumentnon-zero, then debuglogging is turned
155+
on. Debuglogging is done on@code{stream}. Most SQL statement logs its
161156
arguments and result.
162157

163158
The most important one (@code{ECPGdo}) that is called on all SQL
164159
statements except@code{EXECSQLCOMMIT},@code{EXECSQLROLLBACK},
165160
@code{EXECSQLCONNECT} logs both its expanded string, i.e. the string
166161
with all the input variables inserted, and the result from the
167-
postgres95 server. This can be very useful when searching for errors
162+
PostgreSQL server. This can be very useful when searching for errors
168163
in your SQL statements.
169164

170165
@item@code{ECPGstatus()}
@@ -222,11 +217,11 @@ are running incompatible versions of the preprocessor and the library.
222217
The preprocessor has goofed up and generated some incorrect code.
223218

224219
@item -1, Error starting transaction line %d.
225-
Postgres95 signalled to us that we cannot open the connection.
220+
PostgreSQL signalled to us that we cannot open the connection.
226221

227222
@item -1, Postgres error: %s line %d.
228-
Somepostgres95 error. The message contains the error message from the
229-
postgres95 backend.
223+
SomePostgreSQL error. The message contains the error message from the
224+
PostgreSQL backend.
230225

231226
@item 1, Data not found line %d.
232227
This is a "normal" error that tells you that what you are quering cannot
@@ -238,53 +233,53 @@ you made probably was not unique.
238233

239234
@item -1, Not correctly formatted int type: %s line %d.
240235
This means that the host variable is of an@code{int} type and the field
241-
in thepostgres95 database is of another type and contains a value that
236+
in thePostgreSQL database is of another type and contains a value that
242237
cannot be interpreted as an@code{int}. The library uses@code{strtol}
243238
for this conversion.
244239

245240
@item -1, Not correctly formatted unsigned type: %s line %d.
246241
This means that the host variable is of an@code{unsignedint} type and
247-
the field in thepostgres95 database is of another type and contains a
242+
the field in thePostgreSQL database is of another type and contains a
248243
value that cannot be interpreted as an@code{unsignedint}. The library
249244
uses@code{strtoul} for this conversion.
250245

251246
@item -1, Not correctly formatted floating point type: %s line %d.
252247
This means that the host variable is of an@code{float} type and
253-
the field in thepostgres95 database is of another type and contains a
248+
the field in thePostgreSQL database is of another type and contains a
254249
value that cannot be interpreted as an@code{float}. The library
255250
uses@code{strtod} for this conversion.
256251

257252
@item -1, Too few arguments line %d.
258-
This means thatthe postgres95 has returned more records than we have
253+
This means thatPostgreSQL has returned more records than we have
259254
matching variables. Perhaps you have forgotten a couple of the host
260255
variables in the@code{INTO:var1,:var2}-list.
261256

262257
@item -1, Too many arguments line %d.
263-
This means thatth postgres95 has returned fewer records than we have
258+
This means thatPostgreSQL has returned fewer records than we have
264259
host variables. Perhaps you have to many host variables in the
265260
@code{INTO:var1,:var2}-list.
266261

267262
@item -1, Empty query line %d.
268-
Postgres95 returned PGRES_EMPTY_QUERY.
263+
PostgreSQL returned PGRES_EMPTY_QUERY.
269264

270265
@item -1, Error: %s line %d.
271-
This means thatPostgres95 returned on of the errors
266+
This means thatPostgreSQL returned on of the errors
272267
PGRES_NONFATAL_ERROR, PGRES_FATAL_ERROR or PGRES_BAD_RESPONSE. Which one
273268
and why is explained in the message.
274269

275270
@item -1, Postgres error line %d.
276-
Postgres95 returns something that the library does not know how to
277-
handle. This is probably because the version ofpostgres95 does not
271+
PostgreSQL returns something that the library does not know how to
272+
handle. This is probably because the version ofPostgreSQL does not
278273
match the version of the ecpg library.
279274

280275
@item -1, Error committing line %d.
281276
Error during@code{COMMIT}.@code{EXECSQLCOMMIT} is translated to an
282-
@code{end} operation inpostgres95 and that is the operation that could
277+
@code{end} operation inPostgreSQL and that is the operation that could
283278
not be performed.
284279

285280
@item -1, Error rolling back line %d.
286281
Error during@code{ROLLBACK}.@code{EXECSQLROLLBACK} is translated to
287-
an@code{abort} operation inpostgres95 and that is the operation that
282+
an@code{abort} operation inPostgreSQL and that is the operation that
288283
could not be performed.
289284

290285
@item -1, ECPGconnect: could not open database %s.
@@ -328,36 +323,9 @@ actually does port something...
328323
@chapter Installation
329324
@cindexinstallation
330325

331-
Step by step installation (if everything goes ok):
332-
333-
@enumerate
334-
@item Fetch everything and unpack
335-
336-
If you are reading this documentation you have probably managed this
337-
step already.
338-
339-
@item@code{./configure--with-postgres=/path/to/postgres}
340-
341-
This is to be done in the ecpg directory, i.e. the directory containing
342-
the@file{configure} file.
343-
344-
The@file{/path/to/postgres} is the path to the installed postgres. It
345-
points out the directory where the include, lib and bin directories
346-
reside. The include directory is used when building the library and all
347-
three of them become residents for ecpg include files, library and
348-
binaries.
349-
350-
@item@code{makeall}
351-
352-
@item As the postgres user@code{makeinstall}
353-
354-
The postgres user is the owner of the postgres include, lib and bin
355-
directories. The installation procedure installs its files there
356-
alongside the postgres files.
357-
@item Done.
358-
359-
@end enumerate
360-
326+
Since version 0.5 ecpg is distributed together with PostgreSQL. So you
327+
should get your precompiler, libraries and header files compiled and
328+
installed on the fly.
361329

362330
@nodeIndex,Forthedeveloper,Installation,Top
363331
@unnumbered Index
@@ -394,12 +362,8 @@ In the alpha version the preprocessor has a lot of flaws:
394362
@item Preprocessor output
395363
The variables should be static.
396364

397-
@item The preprocessor interface is strange, to say the least
398-
It would be better with a consistant unix arguments interface, perhaps
399-
builtin default filenames so they won't have to be given all the time.
400-
401365
@item Preprocessor cannot do syntax checking on your SQL statements
402-
Whatever you write is copied more or less exactly to thepostgres95 and
366+
Whatever you write is copied more or less exactly to thePostgreSQL and
403367
you will not be able to locate your errors until run-time.
404368

405369
@item no restriction to strings only
@@ -464,7 +428,7 @@ than could be realised in a script.
464428
@comment node-name, next, previous, up
465429
@section The preprocessor
466430

467-
Firstthree lines are written to the output.A comment and two include
431+
Firstfour lines are written to the output.Two comments and two include
468432
lines necessary for the interface to the library.
469433

470434
Then the preprocessor works in one pass only reading the input file and
@@ -533,7 +497,7 @@ An open cursor statement looks like:
533497
@example
534498
exec sql open blablabla;
535499
@end example
536-
andthatis ignore and not copied from the output.
500+
and is ignore and not copied from the output.
537501

538502
@item Commit statement
539503
@cindexCommitstatement

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp