postgresql_16:7.2.6.1 Description
PostgreSQL 16 > Reference > PostgreSQL Client Applications > ecpg > Description
ecpg is the embedded SQL preprocessor for C programs. It converts C programs with embedded SQL statements to normal C code by replacing the SQL invocations with special function calls. The output files can then be processed with any C compiler tool chain.
ecpg will convert each input file given on the command line to the corresponding C output file. If an input file name does not have any extension, .pgc is assumed. The file's extension will be replaced by .c to construct the output file name. But the output file name can be overridden using the -o option.
If an input file name is just -, ecpg reads the program from standard input (and writes to standard output, unless that is overridden with -o).
This reference page does not describe the embedded SQL language. See (see postgresql_16:5.3) for more information on that topic.