ecpg
PostgreSQL embedded SQL preprocessor
TLDR
SYNOPSIS
ecpg [options] file...
DESCRIPTION
ecpg is the PostgreSQL embedded SQL preprocessor. It converts C programs with embedded SQL statements into regular C code that calls the ECPG runtime library, which in turn talks to the server through libpq.The tool reads .pgc files containing EXEC SQL statements embedded in C code and generates standard C files. By default the output for `prog.pgc` is written to `prog.c`. The generated code must be compiled and linked against libecpg (for example with `gcc prog.c -lecpg`), and the include path from `pg_config --includedir` is usually needed.
PARAMETERS
-o file
Write output to file.-I directory
Include search path.-c
Automatically generate C code from SQL code, currently for EXEC SQL TYPE declarations.-C mode
Compatibility mode: INFORMIX, INFORMIX_SE or ORACLE.-D symbol[=value]
Define a C preprocessor symbol.-h
Process a header file. Implies -c and writes a .h file rather than a .c file.-i
Parse system include files as well.-r option
Set a run-time behavior: no_indicator, prepare, questionmarks.-t
Turn on autocommit of transactions.-v
Print version, include path and other build information.--version
Print version and exit.
INSTALL
CAVEATS
The generated C file links against libecpg, not libpq directly, so the PostgreSQL client development package must be installed. Compatibility modes change SQL parsing and null handling to match Informix or Oracle, and code written for one mode is generally not portable to another.
