LinuxCommandLibrary

ecpg

PostgreSQL embedded SQL preprocessor

TLDR

Preprocess embedded SQL file

$ ecpg [file.pgc]
copy
Specify output file
$ ecpg -o [output.c] [input.pgc]
copy
Include search path
$ ecpg -I [/include/path] [file.pgc]
copy
Enable compatibility mode
$ ecpg -C [INFORMIX] [file.pgc]
copy
Generate header file
$ ecpg -h [file.pgc]
copy

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 uses the libpq library.
The tool reads .pgc files containing EXEC SQL statements embedded in C code and generates standard C files that can be compiled and linked with PostgreSQL's libpq library. This enables database operations to be written directly in the application code rather than as separate SQL strings.

PARAMETERS

-o file

Write output to file.
-I directory
Include search path.
-c
Generate C code (default).
-C mode
Compatibility mode (INFORMIX, INFORMIX_SE).
-D name
Define preprocessor symbol.
-h
Parse header file only.
-i
Parse system includes.
-t
Turn on autocommit.

SEE ALSO

psql(1), pg_config(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community