1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
8
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
10
HREF="mailto:pgsql-docs@postgresql.org"><LINK
12
TITLE="PostgreSQL 9.1beta1 Documentation"
13
HREF="index.html"><LINK
15
TITLE="PostgreSQL Client Applications"
16
HREF="reference-client.html"><LINK
19
HREF="app-dropuser.html"><LINK
22
HREF="app-pgbasebackup.html"><LINK
25
HREF="stylesheet.css"><META
26
HTTP-EQUIV="Content-Type"
27
CONTENT="text/html; charset=ISO-8859-1"><META
29
CONTENT="2011-04-27T21:20:33"></HEAD
35
SUMMARY="Header navigation table"
47
>PostgreSQL 9.1beta1 Documentation</A
57
HREF="app-dropuser.html"
67
HREF="app-dropuser.html"
81
HREF="app-pgbasebackup.html"
90
HREF="app-pgbasebackup.html"
117
> -- embedded SQL C preprocessor</DIV
119
CLASS="REFSYNOPSISDIV"
144
NAME="APP-ECPG-DESCRIPTION"
152
> is the embedded SQL preprocessor for C
153
programs. It converts C programs with embedded SQL statements to
154
normal C code by replacing the SQL invocations with special
155
function calls. The output files can then be processed with any C
162
> will convert each input file given on the
163
command line to the corresponding C output file. Input files
164
preferably have the extension <TT
168
case the extension will be replaced by <TT
172
determine the output file name. If the extension of the input file
176
>, then the output file name is
177
computed by appending <TT
180
> to the full file name.
181
The output file name can also be overridden using the
188
> This reference page does not describe the embedded SQL language.
192
> for more information on that topic.
206
> accepts the following command-line
221
> Automatically generate certain C code from SQL code. Currently, this
240
> Set a compatibility mode. <TT
268
> Define a C preprocessor symbol.
278
> Parse system include files as well.
293
> Specify an additional include path, used to find files included
296
>EXEC SQL INCLUDE</TT
301
> (current directory),
304
>/usr/local/include</TT
309
> include directory which
310
is defined at compile time (default:
313
>/usr/local/pgsql/include</TT
337
its output to the given <TT
357
> Selects run-time behavior. <TT
363
one of the following:
376
> Do not use indicators but instead use special values to represent
377
NULLs. Historically there have been databases using this approach.
387
> Prepare all statements before using them. Libecpg will keep a cache of
388
prepared statments and reuse a statement if it gets executed again. If the
389
cache runs full, libecpg will free the least used statement.
399
> Allow questionmark as placeholder for compatibility reasons.
400
This used to be the default long ago.
415
> Turn on autocommit of transactions. In this mode, each SQL command is
416
automatically committed unless it is inside an explicit
417
transaction block. In the default mode, commands are committed
431
> Print additional information including the version and the
455
> Show help about <SPAN
475
> When compiling the preprocessed C code files, the compiler needs to
476
be able to find the <SPAN
479
> header files in the
483
> include directory. Therefore, you might
487
> option when invoking the compiler
490
>-I/usr/local/pgsql/include</TT
494
> Programs using C code with embedded SQL have to be linked against
498
> library, for example using the
501
>-L/usr/local/pgsql/lib -lecpg</TT
505
> The value of either of these directories that is appropriate for
506
the installation can be found out using <A
507
HREF="app-pgconfig.html"
520
> If you have an embedded SQL C source file named
524
>, you can create an executable
525
program using the following sequence of commands:
527
CLASS="PROGRAMLISTING"
529
cc -I/usr/local/pgsql/include -c prog1.c
530
cc -o prog1 prog1.o -L/usr/local/pgsql/lib -lecpg</PRE
539
SUMMARY="Footer navigation table"
550
HREF="app-dropuser.html"
568
HREF="app-pgbasebackup.html"
587
HREF="reference-client.html"
b'\\ No newline at end of file'