{"Entry":{"collection":"tool","key":"ecpg","name":"ecpg","aliases":["ecpg"],"metadata":{"aliases":["ecpg"],"category":"Client applications","content_hash":"42d17ba54eb3df3fe6d60c81df266b3556115000637f31dc1d2f902eb0941556","derived_content_hash":"cd806986f11e6a469730a66bdc14446ad46361e45ab1ff4763bce32c14593eef","imported_at":"2026-09-30T00:40:33.936981+08:00","name":"ecpg","name_zh":"","slug":"ecpg","summary":"ecpg — embedded SQL C preprocessor"}},"Definition":{"Collection":"tool","Key":"ecpg","SourceDatabase":"center","Version":"18","SourceTable":"command_tool","SourceKey":"ecpg","SourceRevision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","Facts":{"comparison_data":{"environment":[],"options":[{"description":"Automatically generate certain C code from SQL code. Currently, this works for EXEC SQL TYPE .","names":["-c"],"signature":"-c"},{"description":"Set a compatibility mode. mode can be INFORMIX , INFORMIX_SE , or ORACLE .","names":["-C mode"],"signature":"-C mode"},{"description":"Define a preprocessor symbol, equivalently to the EXEC SQL DEFINE directive. If no value is specified, the symbol is defined with the value 1 .","names":["-D symbol [= value ]"],"signature":"-D symbol [= value ]"},{"description":"Process header files. When this option is specified, the output file extension becomes .h not .c , and the default input file extension is .pgh not .pgc . Also, the -c option is forced on.","names":["-h"],"signature":"-h"},{"description":"Parse system include files as well.","names":["-i"],"signature":"-i"},{"description":"Specify an additional include path, used to find files included via EXEC SQL INCLUDE . Defaults are . (current directory), /usr/local/include , the PostgreSQL include directory which is defined at compile time (default: /usr/local/pgsql/include ), and /usr/include , in that order.","names":["-I directory"],"signature":"-I directory"},{"description":"Specifies that ecpg should write all its output to the given filename . Write -o - to send all output to standard output.","names":["-o filename"],"signature":"-o filename"},{"description":"Selects run-time behavior. Option can be one of the following: no_indicator Do not use indicators but instead use special values to represent null values. Historically there have been databases using this approach. prepare Prepare all statements before using them. Libecpg will keep a cache of prepared statements and reuse a statement if it gets executed again. If the cache runs full, libecpg will free the least used statement. questionmarks Allow question mark as placeholder for compatibility reasons. This used to be the default long ago.","names":["-r option"],"signature":"-r option"},{"description":"Turn on autocommit of transactions. In this mode, each SQL command is automatically committed unless it is inside an explicit transaction block. In the default mode, commands are committed only when EXEC SQL COMMIT is issued.","names":["-t"],"signature":"-t"},{"description":"Print additional information including the version and the \"include\" path.","names":["-v"],"signature":"-v"},{"description":"Print the ecpg version and exit.","names":["--version"],"signature":"--version"},{"description":"Show help about ecpg command line arguments, and exit.","names":["-?","--help"],"signature":"-? --help"}],"synopsis":["ecpg [ option ...] file ..."]},"comparison_hash":"9b115ab9dbd18516028622d20fe8fe477e01f88cb80ad0615213dea618875d6d","description":["ecpg — embedded SQL C preprocessor"],"description_zh":"描述 ecpg 是供 C 程序使用的嵌入式 SQL 预处理器。它会把嵌入了 SQL 语句的 C 程序转换成普通 C 代码，方法是将 SQL 调用替换为特殊的函数调用。生成的输出文件随后可以由任何 C 编译器工具链处理。 ecpg 会将命令行中给出的每个输入文件转换成对应的 C 输出文件。若输入文件名没有任何扩展名，则假定其扩展名为 .pgc 。随后会把该文件的扩展名替换为 .c ，以构造输出文件名。不过，也可以用 -o 选项覆盖输出文件名。 如果输入文件名只是 - ， ecpg 就会从标准输入读取程序（并写到标准输出，除非使用 -o 覆盖该行为）。 本参考页不描述嵌入式 SQL 语言。有关该主题的更多信息，见 第 34 章 。 选项 ecpg 接受以下命令行参数： -c 自动从 SQL 代码生成某些 C 代码。目前，这适用于 EXEC SQL TYPE 。 -C mode 设置兼容模式。 mode 可以是 INFORMIX 、 INFORMIX_SE ，或 ORACLE 。 -D symbol [= value ] 定义一个预处理器符号，等效于 EXEC SQL DEFINE 指令。如果未指定 value ，则该符号会被定义为值 1 。 -h 处理头文件。指定该选项时，输出文件扩展名变为 .h 而不是 .c ，默认输入文件扩展名也变为 .pgh 而不是 .pgc 。此外，还会强制启用 -c 选项。 -i 也解析系统包含文件。 -I directory 指定一个附加的包含文件搜索路径，用于查找通过 EXEC SQL INCLUDE 包含的文件。默认路径依次为 . （当前目录）、 /usr/local/include 、编译时定义的 PostgreSQL 包含文件目录（默认： /usr/local/pgsql/include ），以及 /usr/include 。 -o filename 指定 ecpg 应将全部输出写入给定的 filename 。写成 -o - 可将全部输出发送到标准输出。 -r option 选择运行时行为。 option 可以是下列之一： no_ind","description_zh_html":"\u003cp\u003e命令行工具 ecpg [ option ...] file ...。\u003c/p\u003e\u003ch3\u003e同版本中文手册节选\u003c/h3\u003e\u003cdiv class=\"refsect1\"\u003e\u003ch2\u003e描述\u003c/h2\u003e\u003cp\u003e\n\u003ccode class=\"command\"\u003eecpg\u003c/code\u003e 是供 C 程序使用的嵌入式 SQL 预处理器。它会把嵌入了 SQL 语句的 C 程序转换成普通 C 代码，方法是将 SQL 调用替换为特殊的函数调用。生成的输出文件随后可以由任何 C 编译器工具链处理。\n  \u003c/p\u003e\u003cp\u003e\n\u003ccode class=\"command\"\u003eecpg\u003c/code\u003e 会将命令行中给出的每个输入文件转换成对应的 C 输出文件。若输入文件名没有任何扩展名，则假定其扩展名为\u003ccode class=\"filename\"\u003e.pgc\u003c/code\u003e。随后会把该文件的扩展名替换为\n   \u003ccode class=\"filename\"\u003e.c\u003c/code\u003e，以构造输出文件名。不过，也可以用 \u003ccode class=\"option\"\u003e-o\u003c/code\u003e 选项覆盖输出文件名。\n  \u003c/p\u003e\u003cp\u003e\n   如果输入文件名只是\u003ccode class=\"literal\"\u003e-\u003c/code\u003e，\u003ccode class=\"command\"\u003eecpg\u003c/code\u003e 就会从标准输入读取程序（并写到标准输出，除非使用 \u003ccode class=\"option\"\u003e-o\u003c/code\u003e 覆盖该行为）。\n  \u003c/p\u003e\u003cp\u003e\n   本参考页不描述嵌入式 SQL 语言。有关该主题的更多信息，见\u003ca class=\"xref\" href=\"/zh/docs/18/ecpg.html\"\u003e第 34 章\u003c/a\u003e。\n  \u003c/p\u003e\u003c/div\u003e\u003cdiv class=\"refsect1\"\u003e\u003ch2\u003e选项\u003c/h2\u003e\u003cp\u003e\n\u003ccode class=\"command\"\u003eecpg\u003c/code\u003e 接受以下命令行参数：\n\n   \u003c/p\u003e\u003cdiv class=\"variablelist\"\u003e\u003cdl class=\"variablelist\"\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-c\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       自动从 SQL 代码生成某些 C 代码。目前，这适用于 \u003ccode class=\"literal\"\u003eEXEC SQL TYPE\u003c/code\u003e。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-C \u003cem class=\"replaceable\"\u003e\u003ccode\u003emode\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       设置兼容模式。\u003cem class=\"replaceable\"\u003e\u003ccode\u003emode\u003c/code\u003e\u003c/em\u003e 可以是 \u003ccode class=\"literal\"\u003eINFORMIX\u003c/code\u003e、\u003ccode class=\"literal\"\u003eINFORMIX_SE\u003c/code\u003e，或 \u003ccode class=\"literal\"\u003eORACLE\u003c/code\u003e。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-D \u003cem class=\"replaceable\"\u003e\u003ccode\u003esymbol\u003c/code\u003e\u003c/em\u003e[=\u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue\u003c/code\u003e\u003c/em\u003e]\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       定义一个预处理器符号，等效于 \u003ccode class=\"command\"\u003eEXEC SQL DEFINE\u003c/code\u003e 指令。如果未指定 \u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue\u003c/code\u003e\u003c/em\u003e，则该符号会被定义为值 \u003ccode class=\"literal\"\u003e1\u003c/code\u003e。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-h\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       处理头文件。指定该选项时，输出文件扩展名变为\u003ccode class=\"literal\"\u003e.h\u003c/code\u003e 而不是\u003ccode class=\"literal\"\u003e.c\u003c/code\u003e，默认输入文件扩展名也变为\u003ccode class=\"literal\"\u003e.pgh\u003c/code\u003e 而不是\u003ccode class=\"literal\"\u003e.pgc\u003c/code\u003e。此外，还会强制启用 \u003ccode class=\"option\"\u003e-c\u003c/code\u003e 选项。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-i\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       也解析系统包含文件。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-I \u003cem class=\"replaceable\"\u003e\u003ccode\u003edirectory\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       指定一个附加的包含文件搜索路径，用于查找通过 \u003ccode class=\"literal\"\u003eEXEC SQL INCLUDE\u003c/code\u003e 包含的文件。默认路径依次为\u003ccode class=\"filename\"\u003e.\u003c/code\u003e（当前目录）、\u003ccode class=\"filename\"\u003e/usr/local/include\u003c/code\u003e、编译时定义的 \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 包含文件目录（默认：\u003ccode class=\"filename\"\u003e/usr/local/pgsql/include\u003c/code\u003e），以及 \u003ccode class=\"filename\"\u003e/usr/include\u003c/code\u003e。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-o \u003cem class=\"replaceable\"\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       指定 \u003ccode class=\"command\"\u003eecpg\u003c/code\u003e 应将全部输出写入给定的 \u003cem class=\"replaceable\"\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e。写成 \u003ccode class=\"literal\"\u003e-o -\u003c/code\u003e可将全部输出发送到标准输出。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-r \u003cem class=\"replaceable\"\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       选择运行时行为。\u003cem class=\"replaceable\"\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e 可以是下列之一：\n       \u003c/p\u003e\u003cdiv class=\"variablelist\"\u003e\u003cdl class=\"variablelist\"\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003eno_indicator\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n         不使用指示符，而改用特殊值表示空值。历史上曾有数据库采用这种方式。\n         \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003eprepare\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n         在使用前预备所有语句。libecpg 会维护一个已预备语句的缓存；如果某条语句再次执行，就会复用它。若缓存已满，libecpg 会释放使用次数最少的语句。\n         \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003equestionmarks\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n         出于兼容性原因，允许使用问号作为占位符。这在很久以前曾是默认行为。\n         \u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-t\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       打开事务自动提交。在此模式下，除非 SQL 命令位于显式事务块中，否则每条 SQL 命令都会自动提交。在默认模式下，只有发出 \u003ccode class=\"command\"\u003eEXEC SQL COMMIT\u003c/code\u003e 时才会提交命令。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-v\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       打印附加信息，包括版本和包含文件搜索路径。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--version\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       打印 \u003cspan class=\"application\"\u003eecpg\u003c/span\u003e 版本并退出。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-?\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--help\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       显示关于 \u003cspan class=\"application\"\u003eecpg\u003c/span\u003e 命令行参数的帮助信息，并退出。\n      \u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e\u003cp\u003e\n\u003c/p\u003e\u003c/div\u003e\u003cp\u003e\u003ca href=\"/zh/docs/18/app-ecpg.html\"\u003e查看完整中文手册与上下文\u003c/a\u003e。\u003c/p\u003e","environment":[],"facts":[{"label":"Documented executable","value":"ecpg"},{"label":"Executable version","value":"18.6"},{"label":"Reference inventory","value":"Client applications"},{"label":"Option definition groups","value":"12"}],"facts_zh":[{"label":"手册中的可执行程序","value":"ecpg"},{"label":"程序版本","value":"18.6"},{"label":"参考清单","value":"客户端程序"},{"label":"选项定义组","value":"12"}],"manual_html":"\u003cdiv\u003e\u003cdiv class=\"refentry\" id=\"APP-ECPG\"\u003e\n\u003cdiv class=\"titlepage\"\u003e\u003c/div\u003e\n\u003cdiv class=\"refnamediv\"\u003e\n\u003ch2\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003eecpg\u003c/span\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003eecpg\u003c/span\u003e — embedded SQL C preprocessor\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsynopsisdiv\"\u003e\n\u003ch2\u003eSynopsis\u003c/h2\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.4.8.4.1\"\u003e\u003ccode class=\"command\"\u003eecpg\u003c/code\u003e [\u003cem class=\"replaceable\"\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e...] \u003cem class=\"replaceable\"\u003e\u003ccode\u003efile\u003c/code\u003e\u003c/em\u003e...\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"APP-ECPG-DESCRIPTION\"\u003e\n\u003ch2\u003eDescription\u003c/h2\u003e\n\u003cp\u003e\u003ccode class=\"command\"\u003eecpg\u003c/code\u003e 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.\u003c/p\u003e\n\u003cp\u003e\u003ccode class=\"command\"\u003eecpg\u003c/code\u003e 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, \u003ccode class=\"filename\"\u003e.pgc\u003c/code\u003e is assumed. The file's extension will be replaced by \u003ccode class=\"filename\"\u003e.c\u003c/code\u003e to construct the output file name. But the output file name can be overridden using the \u003ccode class=\"option\"\u003e-o\u003c/code\u003e option.\u003c/p\u003e\n\u003cp\u003eIf an input file name is just \u003ccode class=\"literal\"\u003e-\u003c/code\u003e, \u003ccode class=\"command\"\u003eecpg\u003c/code\u003e reads the program from standard input (and writes to standard output, unless that is overridden with \u003ccode class=\"option\"\u003e-o\u003c/code\u003e).\u003c/p\u003e\n\u003cp\u003eThis reference page does not describe the embedded SQL language. See \u003ca class=\"xref\" href=\"/docs/18/ecpg.html\" title=\"Chapter 34. ECPG — Embedded SQL in C\"\u003eChapter 34\u003c/a\u003e for more information on that topic.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.8.6\"\u003e\n\u003ch2\u003eOptions\u003c/h2\u003e\n\u003cp\u003e\u003ccode class=\"command\"\u003eecpg\u003c/code\u003e accepts the following command-line arguments:\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-c\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eAutomatically generate certain C code from SQL code. Currently, this works for \u003ccode class=\"literal\"\u003eEXEC SQL TYPE\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-C \u003cem class=\"replaceable\"\u003e\u003ccode\u003emode\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSet a compatibility mode. \u003cem class=\"replaceable\"\u003e\u003ccode\u003emode\u003c/code\u003e\u003c/em\u003e can be \u003ccode class=\"literal\"\u003eINFORMIX\u003c/code\u003e, \u003ccode class=\"literal\"\u003eINFORMIX_SE\u003c/code\u003e, or \u003ccode class=\"literal\"\u003eORACLE\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-D \u003cem class=\"replaceable\"\u003e\u003ccode\u003esymbol\u003c/code\u003e\u003c/em\u003e[=\u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue\u003c/code\u003e\u003c/em\u003e]\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDefine a preprocessor symbol, equivalently to the \u003ccode class=\"command\"\u003eEXEC SQL DEFINE\u003c/code\u003e directive. If no \u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue\u003c/code\u003e\u003c/em\u003e is specified, the symbol is defined with the value \u003ccode class=\"literal\"\u003e1\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-h\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eProcess header files. When this option is specified, the output file extension becomes \u003ccode class=\"literal\"\u003e.h\u003c/code\u003e not \u003ccode class=\"literal\"\u003e.c\u003c/code\u003e, and the default input file extension is \u003ccode class=\"literal\"\u003e.pgh\u003c/code\u003e not \u003ccode class=\"literal\"\u003e.pgc\u003c/code\u003e. Also, the \u003ccode class=\"option\"\u003e-c\u003c/code\u003e option is forced on.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-i\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eParse system include files as well.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-I \u003cem class=\"replaceable\"\u003e\u003ccode\u003edirectory\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecify an additional include path, used to find files included via \u003ccode class=\"literal\"\u003eEXEC SQL INCLUDE\u003c/code\u003e. Defaults are \u003ccode class=\"filename\"\u003e.\u003c/code\u003e (current directory), \u003ccode class=\"filename\"\u003e/usr/local/include\u003c/code\u003e, the \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e include directory which is defined at compile time (default: \u003ccode class=\"filename\"\u003e/usr/local/pgsql/include\u003c/code\u003e), and \u003ccode class=\"filename\"\u003e/usr/include\u003c/code\u003e, in that order.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-o \u003cem class=\"replaceable\"\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies that \u003ccode class=\"command\"\u003eecpg\u003c/code\u003e should write all its output to the given \u003cem class=\"replaceable\"\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e. Write \u003ccode class=\"literal\"\u003e-o -\u003c/code\u003e to send all output to standard output.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-r \u003cem class=\"replaceable\"\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSelects run-time behavior. \u003cem class=\"replaceable\"\u003e\u003ccode\u003eOption\u003c/code\u003e\u003c/em\u003e can be one of the following:\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003eno_indicator\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not use indicators but instead use special values to represent null values. Historically there have been databases using this approach.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003eprepare\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrepare all statements before using them. Libecpg will keep a cache of prepared statements and reuse a statement if it gets executed again. If the cache runs full, libecpg will free the least used statement.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003equestionmarks\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eAllow question mark as placeholder for compatibility reasons. This used to be the default long ago.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-t\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eTurn on autocommit of transactions. In this mode, each SQL command is automatically committed unless it is inside an explicit transaction block. In the default mode, commands are committed only when \u003ccode class=\"command\"\u003eEXEC SQL COMMIT\u003c/code\u003e is issued.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-v\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint additional information including the version and the \"include\" path.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--version\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the \u003cspan class=\"application\"\u003eecpg\u003c/span\u003e version and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-?\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--help\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eShow help about \u003cspan class=\"application\"\u003eecpg\u003c/span\u003e command line arguments, and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.8.7\"\u003e\n\u003ch2\u003eNotes\u003c/h2\u003e\n\u003cp\u003eWhen compiling the preprocessed C code files, the compiler needs to be able to find the \u003cspan class=\"application\"\u003eECPG\u003c/span\u003e header files in the \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e include directory. Therefore, you might have to use the \u003ccode class=\"option\"\u003e-I\u003c/code\u003e option when invoking the compiler (e.g., \u003ccode class=\"literal\"\u003e-I/usr/local/pgsql/include\u003c/code\u003e).\u003c/p\u003e\n\u003cp\u003ePrograms using C code with embedded SQL have to be linked against the \u003ccode class=\"filename\"\u003elibecpg\u003c/code\u003e library, for example using the linker options \u003ccode class=\"literal\"\u003e-L/usr/local/pgsql/lib -lecpg\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eThe value of either of these directories that is appropriate for the installation can be found out using \u003ca class=\"xref\" href=\"/docs/18/app-pgconfig.html\" title=\"pg_config\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epg_config\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.8.8\"\u003e\n\u003ch2\u003eExamples\u003c/h2\u003e\n\u003cp\u003eIf you have an embedded SQL C source file named \u003ccode class=\"filename\"\u003eprog1.pgc\u003c/code\u003e, you can create an executable program using the following sequence of commands:\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003eecpg prog1.pgc\ncc -I/usr/local/pgsql/include -c prog1.c\ncc -o prog1 prog1.o -L/usr/local/pgsql/lib -lecpg\n\u003c/pre\u003e\n\u003c/div\u003e\n\u003c/div\u003e\u003c/div\u003e","manual_path":"app-ecpg.html","options":[{"description":"Automatically generate certain C code from SQL code. Currently, this works for EXEC SQL TYPE .","names":["-c"],"signature":"-c","source_url":"/docs/18/app-ecpg.html","summary":"Automatically generate certain C code from SQL code. Currently, this works for EXEC SQL TYPE ."},{"description":"Set a compatibility mode. mode can be INFORMIX , INFORMIX_SE , or ORACLE .","names":["-C mode"],"signature":"-C mode","source_url":"/docs/18/app-ecpg.html","summary":"Set a compatibility mode. mode can be INFORMIX , INFORMIX_SE , or ORACLE ."},{"description":"Define a preprocessor symbol, equivalently to the EXEC SQL DEFINE directive. If no value is specified, the symbol is defined with the value 1 .","names":["-D symbol [= value ]"],"signature":"-D symbol [= value ]","source_url":"/docs/18/app-ecpg.html","summary":"Define a preprocessor symbol, equivalently to the EXEC SQL DEFINE directive. If no value is specified, the symbol is defined with the value 1 ."},{"description":"Process header files. When this option is specified, the output file extension becomes .h not .c , and the default input file extension is .pgh not .pgc . Also, the -c option is forced on.","names":["-h"],"signature":"-h","source_url":"/docs/18/app-ecpg.html","summary":"Process header files. When this option is specified, the output file extension becomes .h not .c , and the default input file extension is .pgh not .pgc . Also, the -c option is forced on."},{"description":"Parse system include files as well.","names":["-i"],"signature":"-i","source_url":"/docs/18/app-ecpg.html","summary":"Parse system include files as well."},{"description":"Specify an additional include path, used to find files included via EXEC SQL INCLUDE . Defaults are . (current directory), /usr/local/include , the PostgreSQL include directory which is defined at compile time (default: /usr/local/pgsql/include ), and /usr/include , in that order.","names":["-I directory"],"signature":"-I directory","source_url":"/docs/18/app-ecpg.html","summary":"Specify an additional include path, used to find files included via EXEC SQL INCLUDE . Defaults are . (current directory), /usr/local/include , the PostgreSQL include directory which is defined at compile time (default: /usr/local/pgsql/include ), and /usr/include , in that order."},{"description":"Specifies that ecpg should write all its output to the given filename . Write -o - to send all output to standard output.","names":["-o filename"],"signature":"-o filename","source_url":"/docs/18/app-ecpg.html","summary":"Specifies that ecpg should write all its output to the given filename . Write -o - to send all output to standard output."},{"description":"Selects run-time behavior. Option can be one of the following: no_indicator Do not use indicators but instead use special values to represent null values. Historically there have been databases using this approach. prepare Prepare all statements before using them. Libecpg will keep a cache of prepared statements and reuse a statement if it gets executed again. If the cache runs full, libecpg will free the least used statement. questionmarks Allow question mark as placeholder for compatibility reasons. This used to be the default long ago.","names":["-r option"],"signature":"-r option","source_url":"/docs/18/app-ecpg.html","summary":"Selects run-time behavior. Option can be one of the following:"},{"description":"Turn on autocommit of transactions. In this mode, each SQL command is automatically committed unless it is inside an explicit transaction block. In the default mode, commands are committed only when EXEC SQL COMMIT is issued.","names":["-t"],"signature":"-t","source_url":"/docs/18/app-ecpg.html","summary":"Turn on autocommit of transactions. In this mode, each SQL command is automatically committed unless it is inside an explicit transaction block. In the default mode, commands are committed only when EXEC SQL COMMIT is issued."},{"description":"Print additional information including the version and the \"include\" path.","names":["-v"],"signature":"-v","source_url":"/docs/18/app-ecpg.html","summary":"Print additional information including the version and the \"include\" path."},{"description":"Print the ecpg version and exit.","names":["--version"],"signature":"--version","source_url":"/docs/18/app-ecpg.html","summary":"Print the ecpg version and exit."},{"description":"Show help about ecpg command line arguments, and exit.","names":["-?","--help"],"signature":"-? --help","source_url":"/docs/18/app-ecpg.html","summary":"Show help about ecpg command line arguments, and exit."}],"related":[],"release":{"channel":"stable","evidence_kind":"English manual and source declarations","label":"18.6","major":"18","manifest":{"index":"index.html","major":"18","pages":1148,"pdf":{"A4":{"built_at":"2026-09-26","bytes":15865106,"pages":3154,"sha256":"19512c405da53f9f7fcf0abba359223aa65f021be025bf3411381918f92e3190","url":"/files/documentation/pdf/18/postgresql-18-A4.pdf"},"US":{"built_at":"2026-09-26","bytes":15748059,"pages":3328,"sha256":"facbe6c229e598b872d3d98bef53308f46e06746006fa4590de9a7de9dd46319","url":"/files/documentation/pdf/18/postgresql-18-US.pdf"}},"release":"18.6","source_mode":"en SGML built with pinned official archive","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","source_url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","svg_assets":3,"tree":"18"},"ref":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","revision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"},"sections":[],"sections_zh":[],"signature":"ecpg [ option ...] file ...","sources":[{"anchor":"","file":"app-ecpg.html","label":"18.6 English manual · app-ecpg.html","sha256":"46e369f91d3516a728d286bbeab8bf7500f9e5016436847622154cb3777b5173","url":"/docs/18/app-ecpg.html"},{"anchor":"","file":"reference-client.html","label":"Client applications inventory","sha256":"68f726af77272fe73a827be2b7b5958d0f2239a6f8ed44264e9d42496bfa4fd0","url":"/docs/18/reference-client.html"}],"synopsis":["ecpg [ option ...] file ..."],"tables":[{"columns":[{"key":"signature","label":"Option and arguments"},{"key":"summary","label":"Description"}],"key":"options","rows":[{"signature":{"text":"-c","url":"/docs/18/app-ecpg.html"},"summary":"Automatically generate certain C code from SQL code. Currently, this works for EXEC SQL TYPE ."},{"signature":{"text":"-C mode","url":"/docs/18/app-ecpg.html"},"summary":"Set a compatibility mode. mode can be INFORMIX , INFORMIX_SE , or ORACLE ."},{"signature":{"text":"-D symbol [= value ]","url":"/docs/18/app-ecpg.html"},"summary":"Define a preprocessor symbol, equivalently to the EXEC SQL DEFINE directive. If no value is specified, the symbol is defined with the value 1 ."},{"signature":{"text":"-h","url":"/docs/18/app-ecpg.html"},"summary":"Process header files. When this option is specified, the output file extension becomes .h not .c , and the default input file extension is .pgh not .pgc . Also, the -c option is forced on."},{"signature":{"text":"-i","url":"/docs/18/app-ecpg.html"},"summary":"Parse system include files as well."},{"signature":{"text":"-I directory","url":"/docs/18/app-ecpg.html"},"summary":"Specify an additional include path, used to find files included via EXEC SQL INCLUDE . Defaults are . (current directory), /usr/local/include , the PostgreSQL include directory which is defined at compile time (default: /usr/local/pgsql/include ), and /usr/include , in that order."},{"signature":{"text":"-o filename","url":"/docs/18/app-ecpg.html"},"summary":"Specifies that ecpg should write all its output to the given filename . Write -o - to send all output to standard output."},{"signature":{"text":"-r option","url":"/docs/18/app-ecpg.html"},"summary":"Selects run-time behavior. Option can be one of the following:"},{"signature":{"text":"-t","url":"/docs/18/app-ecpg.html"},"summary":"Turn on autocommit of transactions. In this mode, each SQL command is automatically committed unless it is inside an explicit transaction block. In the default mode, commands are committed only when EXEC SQL COMMIT is issued."},{"signature":{"text":"-v","url":"/docs/18/app-ecpg.html"},"summary":"Print additional information including the version and the \"include\" path."},{"signature":{"text":"--version","url":"/docs/18/app-ecpg.html"},"summary":"Print the ecpg version and exit."},{"signature":{"text":"-? --help","url":"/docs/18/app-ecpg.html"},"summary":"Show help about ecpg command line arguments, and exit."}],"title":"Documented options"}],"tables_zh":[{"columns":[{"key":"signature","label":"选项与参数"},{"key":"summary","label":"说明"}],"key":"options","rows":[{"signature":{"text":"-c","url":"/docs/18/app-ecpg.html"},"summary":"自动从 SQL 代码生成某些 C 代码。目前，这适用于 EXEC SQL TYPE 。"},{"signature":{"text":"-C mode","url":"/docs/18/app-ecpg.html"},"summary":"设置兼容模式。 mode 可以是 INFORMIX 、 INFORMIX_SE ，或 ORACLE 。"},{"signature":{"text":"-D symbol [= value ]","url":"/docs/18/app-ecpg.html"},"summary":"定义一个预处理器符号，等效于 EXEC SQL DEFINE 指令。如果未指定 value ，则该符号会被定义为值 1 。"},{"signature":{"text":"-h","url":"/docs/18/app-ecpg.html"},"summary":"处理头文件。指定该选项时，输出文件扩展名变为 .h 而不是 .c ，默认输入文件扩展名也变为 .pgh 而不是 .pgc 。此外，还会强制启用 -c 选项。"},{"signature":{"text":"-i","url":"/docs/18/app-ecpg.html"},"summary":"也解析系统包含文件。"},{"signature":{"text":"-I directory","url":"/docs/18/app-ecpg.html"},"summary":"指定一个附加的包含文件搜索路径，用于查找通过 EXEC SQL INCLUDE 包含的文件。默认路径依次为 . （当前目录）、 /usr/local/include 、编译时定义的 PostgreSQL 包含文件目录（默认： /usr/local/pgsql/include ），以及 /usr/include 。"},{"signature":{"text":"-o filename","url":"/docs/18/app-ecpg.html"},"summary":"指定 ecpg 应将全部输出写入给定的 filename 。写成 -o - 可将全部输出发送到标准输出。"},{"signature":{"text":"-r option","url":"/docs/18/app-ecpg.html"},"summary":"选择运行时行为。选项可以是下列值之一："},{"signature":{"text":"-t","url":"/docs/18/app-ecpg.html"},"summary":"打开事务自动提交。在此模式下，除非 SQL 命令位于显式事务块中，否则每条 SQL 命令都会自动提交。在默认模式下，只有发出 EXEC SQL COMMIT 时才会提交命令。"},{"signature":{"text":"-v","url":"/docs/18/app-ecpg.html"},"summary":"打印附加信息，包括版本和包含文件搜索路径。"},{"signature":{"text":"--version","url":"/docs/18/app-ecpg.html"},"summary":"打印 ecpg 版本并退出。"},{"signature":{"text":"-? --help","url":"/docs/18/app-ecpg.html"},"summary":"显示关于 ecpg 命令行参数的帮助信息，并退出。"}],"title":"手册中的选项"}],"zh_from":{"authored_translation":"source-derived-identity","body_sha256":"4ca1a8552154128437ea11b48ef0e78248ceaa5fc22133fe854c61eb16df0470","kind":"same-version-chinese-manual-with-source-derived-identity","manual":{"anchor":"","build_id":107,"extraction":"command-description-and-options","fragment_sha256":"c44d13eaa97f3667cded905de0990b1423b7d7dc614d61afff066be80ad97fcc","locale":"zh-Hans","page_key":"app-ecpg.html","source_hash":"cad8cde40c65a0942071207cb831d80db71e610f660627c448d8ac3c55bded93","source_revision":"unknown:rendered-translation-baseline","translated_from_revision":null,"translation_revision":"git:b1b500221dbe5437cfca004d6b04d3f6e422765d;html-sha256:08e987a66af27b98444a8057c256314eafa13611a3fb9e888214fc436824244b","url":"/zh/docs/18/app-ecpg.html","version":"18"},"runtime_rerun":false,"source_facts_revision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8"}},"ManualEvidence":{"manual_path":"app-ecpg.html","release":{"channel":"stable","evidence_kind":"English manual and source declarations","label":"18.6","major":"18","manifest":{"index":"index.html","major":"18","pages":1148,"pdf":{"A4":{"built_at":"2026-09-26","bytes":15865106,"pages":3154,"sha256":"19512c405da53f9f7fcf0abba359223aa65f021be025bf3411381918f92e3190","url":"/files/documentation/pdf/18/postgresql-18-A4.pdf"},"US":{"built_at":"2026-09-26","bytes":15748059,"pages":3328,"sha256":"facbe6c229e598b872d3d98bef53308f46e06746006fa4590de9a7de9dd46319","url":"/files/documentation/pdf/18/postgresql-18-US.pdf"}},"release":"18.6","source_mode":"en SGML built with pinned official archive","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","source_url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","svg_assets":3,"tree":"18"},"ref":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","revision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"},"sources":[{"anchor":"","file":"app-ecpg.html","label":"18.6 English manual · app-ecpg.html","sha256":"46e369f91d3516a728d286bbeab8bf7500f9e5016436847622154cb3777b5173","url":"/docs/18/app-ecpg.html"},{"anchor":"","file":"reference-client.html","label":"Client applications inventory","sha256":"68f726af77272fe73a827be2b7b5958d0f2239a6f8ed44264e9d42496bfa4fd0","url":"/docs/18/reference-client.html"}]},"MeasuredEvidence":{}},"Text":{"Collection":"tool","Key":"ecpg","SourceDatabase":"center","Version":"18","Locale":"en","Title":"ecpg","Summary":"ecpg — embedded SQL C preprocessor","BodyHTML":"\u003cdiv\u003e\u003cdiv id=\"APP-ECPG\"\u003e\n\u003cdiv\u003e\u003c/div\u003e\n\u003cdiv\u003e\n\u003ch2\u003e\u003cspan\u003e\u003cspan\u003eecpg\u003c/span\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003cp\u003e\u003cspan\u003eecpg\u003c/span\u003e — embedded SQL C preprocessor\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv\u003e\n\u003ch2\u003eSynopsis\u003c/h2\u003e\n\u003cdiv\u003e\n\u003cp id=\"id-1.9.4.8.4.1\"\u003e\u003ccode\u003eecpg\u003c/code\u003e [\u003cem\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e...] \u003cem\u003e\u003ccode\u003efile\u003c/code\u003e\u003c/em\u003e...\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv id=\"APP-ECPG-DESCRIPTION\"\u003e\n\u003ch2\u003eDescription\u003c/h2\u003e\n\u003cp\u003e\u003ccode\u003eecpg\u003c/code\u003e 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.\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003eecpg\u003c/code\u003e 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, \u003ccode\u003e.pgc\u003c/code\u003e is assumed. The file\u0026#39;s extension will be replaced by \u003ccode\u003e.c\u003c/code\u003e to construct the output file name. But the output file name can be overridden using the \u003ccode\u003e-o\u003c/code\u003e option.\u003c/p\u003e\n\u003cp\u003eIf an input file name is just \u003ccode\u003e-\u003c/code\u003e, \u003ccode\u003eecpg\u003c/code\u003e reads the program from standard input (and writes to standard output, unless that is overridden with \u003ccode\u003e-o\u003c/code\u003e).\u003c/p\u003e\n\u003cp\u003eThis reference page does not describe the embedded SQL language. See \u003ca href=\"/docs/18/ecpg.html\" rel=\"nofollow\"\u003eChapter 34\u003c/a\u003e for more information on that topic.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.4.8.6\"\u003e\n\u003ch2\u003eOptions\u003c/h2\u003e\n\u003cp\u003e\u003ccode\u003eecpg\u003c/code\u003e accepts the following command-line arguments:\u003c/p\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-c\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eAutomatically generate certain C code from SQL code. Currently, this works for \u003ccode\u003eEXEC SQL TYPE\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-C \u003cem\u003e\u003ccode\u003emode\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSet a compatibility mode. \u003cem\u003e\u003ccode\u003emode\u003c/code\u003e\u003c/em\u003e can be \u003ccode\u003eINFORMIX\u003c/code\u003e, \u003ccode\u003eINFORMIX_SE\u003c/code\u003e, or \u003ccode\u003eORACLE\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-D \u003cem\u003e\u003ccode\u003esymbol\u003c/code\u003e\u003c/em\u003e[=\u003cem\u003e\u003ccode\u003evalue\u003c/code\u003e\u003c/em\u003e]\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDefine a preprocessor symbol, equivalently to the \u003ccode\u003eEXEC SQL DEFINE\u003c/code\u003e directive. If no \u003cem\u003e\u003ccode\u003evalue\u003c/code\u003e\u003c/em\u003e is specified, the symbol is defined with the value \u003ccode\u003e1\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-h\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eProcess header files. When this option is specified, the output file extension becomes \u003ccode\u003e.h\u003c/code\u003e not \u003ccode\u003e.c\u003c/code\u003e, and the default input file extension is \u003ccode\u003e.pgh\u003c/code\u003e not \u003ccode\u003e.pgc\u003c/code\u003e. Also, the \u003ccode\u003e-c\u003c/code\u003e option is forced on.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-i\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eParse system include files as well.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-I \u003cem\u003e\u003ccode\u003edirectory\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecify an additional include path, used to find files included via \u003ccode\u003eEXEC SQL INCLUDE\u003c/code\u003e. Defaults are \u003ccode\u003e.\u003c/code\u003e (current directory), \u003ccode\u003e/usr/local/include\u003c/code\u003e, the \u003cspan\u003ePostgreSQL\u003c/span\u003e include directory which is defined at compile time (default: \u003ccode\u003e/usr/local/pgsql/include\u003c/code\u003e), and \u003ccode\u003e/usr/include\u003c/code\u003e, in that order.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-o \u003cem\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies that \u003ccode\u003eecpg\u003c/code\u003e should write all its output to the given \u003cem\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e. Write \u003ccode\u003e-o -\u003c/code\u003e to send all output to standard output.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-r \u003cem\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSelects run-time behavior. \u003cem\u003e\u003ccode\u003eOption\u003c/code\u003e\u003c/em\u003e can be one of the following:\u003c/p\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003eno_indicator\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not use indicators but instead use special values to represent null values. Historically there have been databases using this approach.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003eprepare\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrepare all statements before using them. Libecpg will keep a cache of prepared statements and reuse a statement if it gets executed again. If the cache runs full, libecpg will free the least used statement.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003equestionmarks\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eAllow question mark as placeholder for compatibility reasons. This used to be the default long ago.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-t\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eTurn on autocommit of transactions. In this mode, each SQL command is automatically committed unless it is inside an explicit transaction block. In the default mode, commands are committed only when \u003ccode\u003eEXEC SQL COMMIT\u003c/code\u003e is issued.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-v\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint additional information including the version and the \u0026#34;include\u0026#34; path.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--version\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the \u003cspan\u003eecpg\u003c/span\u003e version and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-?\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--help\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eShow help about \u003cspan\u003eecpg\u003c/span\u003e command line arguments, and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.4.8.7\"\u003e\n\u003ch2\u003eNotes\u003c/h2\u003e\n\u003cp\u003eWhen compiling the preprocessed C code files, the compiler needs to be able to find the \u003cspan\u003eECPG\u003c/span\u003e header files in the \u003cspan\u003ePostgreSQL\u003c/span\u003e include directory. Therefore, you might have to use the \u003ccode\u003e-I\u003c/code\u003e option when invoking the compiler (e.g., \u003ccode\u003e-I/usr/local/pgsql/include\u003c/code\u003e).\u003c/p\u003e\n\u003cp\u003ePrograms using C code with embedded SQL have to be linked against the \u003ccode\u003elibecpg\u003c/code\u003e library, for example using the linker options \u003ccode\u003e-L/usr/local/pgsql/lib -lecpg\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eThe value of either of these directories that is appropriate for the installation can be found out using \u003ca href=\"/docs/18/app-pgconfig.html\" title=\"pg_config\" rel=\"nofollow\"\u003e\u003cspan\u003e\u003cspan\u003epg_config\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.4.8.8\"\u003e\n\u003ch2\u003eExamples\u003c/h2\u003e\n\u003cp\u003eIf you have an embedded SQL C source file named \u003ccode\u003eprog1.pgc\u003c/code\u003e, you can create an executable program using the following sequence of commands:\u003c/p\u003e\n\u003cpre\u003eecpg prog1.pgc\ncc -I/usr/local/pgsql/include -c prog1.c\ncc -o prog1 prog1.o -L/usr/local/pgsql/lib -lecpg\n\u003c/pre\u003e\n\u003c/div\u003e\n\u003c/div\u003e\u003c/div\u003e","SourceRevision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","ContentHash":"7f00527fb0b9f683bb44c0fe10602541cbe7b428a3a950399c154d8ea2d48ef8","Payload":{"description":["ecpg — embedded SQL C preprocessor"],"manual_html":"\u003cdiv\u003e\u003cdiv class=\"refentry\" id=\"APP-ECPG\"\u003e\n\u003cdiv class=\"titlepage\"\u003e\u003c/div\u003e\n\u003cdiv class=\"refnamediv\"\u003e\n\u003ch2\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003eecpg\u003c/span\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003eecpg\u003c/span\u003e — embedded SQL C preprocessor\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsynopsisdiv\"\u003e\n\u003ch2\u003eSynopsis\u003c/h2\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.4.8.4.1\"\u003e\u003ccode class=\"command\"\u003eecpg\u003c/code\u003e [\u003cem class=\"replaceable\"\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e...] \u003cem class=\"replaceable\"\u003e\u003ccode\u003efile\u003c/code\u003e\u003c/em\u003e...\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"APP-ECPG-DESCRIPTION\"\u003e\n\u003ch2\u003eDescription\u003c/h2\u003e\n\u003cp\u003e\u003ccode class=\"command\"\u003eecpg\u003c/code\u003e 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.\u003c/p\u003e\n\u003cp\u003e\u003ccode class=\"command\"\u003eecpg\u003c/code\u003e 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, \u003ccode class=\"filename\"\u003e.pgc\u003c/code\u003e is assumed. The file's extension will be replaced by \u003ccode class=\"filename\"\u003e.c\u003c/code\u003e to construct the output file name. But the output file name can be overridden using the \u003ccode class=\"option\"\u003e-o\u003c/code\u003e option.\u003c/p\u003e\n\u003cp\u003eIf an input file name is just \u003ccode class=\"literal\"\u003e-\u003c/code\u003e, \u003ccode class=\"command\"\u003eecpg\u003c/code\u003e reads the program from standard input (and writes to standard output, unless that is overridden with \u003ccode class=\"option\"\u003e-o\u003c/code\u003e).\u003c/p\u003e\n\u003cp\u003eThis reference page does not describe the embedded SQL language. See \u003ca class=\"xref\" href=\"/docs/18/ecpg.html\" title=\"Chapter 34. ECPG — Embedded SQL in C\"\u003eChapter 34\u003c/a\u003e for more information on that topic.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.8.6\"\u003e\n\u003ch2\u003eOptions\u003c/h2\u003e\n\u003cp\u003e\u003ccode class=\"command\"\u003eecpg\u003c/code\u003e accepts the following command-line arguments:\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-c\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eAutomatically generate certain C code from SQL code. Currently, this works for \u003ccode class=\"literal\"\u003eEXEC SQL TYPE\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-C \u003cem class=\"replaceable\"\u003e\u003ccode\u003emode\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSet a compatibility mode. \u003cem class=\"replaceable\"\u003e\u003ccode\u003emode\u003c/code\u003e\u003c/em\u003e can be \u003ccode class=\"literal\"\u003eINFORMIX\u003c/code\u003e, \u003ccode class=\"literal\"\u003eINFORMIX_SE\u003c/code\u003e, or \u003ccode class=\"literal\"\u003eORACLE\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-D \u003cem class=\"replaceable\"\u003e\u003ccode\u003esymbol\u003c/code\u003e\u003c/em\u003e[=\u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue\u003c/code\u003e\u003c/em\u003e]\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDefine a preprocessor symbol, equivalently to the \u003ccode class=\"command\"\u003eEXEC SQL DEFINE\u003c/code\u003e directive. If no \u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue\u003c/code\u003e\u003c/em\u003e is specified, the symbol is defined with the value \u003ccode class=\"literal\"\u003e1\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-h\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eProcess header files. When this option is specified, the output file extension becomes \u003ccode class=\"literal\"\u003e.h\u003c/code\u003e not \u003ccode class=\"literal\"\u003e.c\u003c/code\u003e, and the default input file extension is \u003ccode class=\"literal\"\u003e.pgh\u003c/code\u003e not \u003ccode class=\"literal\"\u003e.pgc\u003c/code\u003e. Also, the \u003ccode class=\"option\"\u003e-c\u003c/code\u003e option is forced on.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-i\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eParse system include files as well.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-I \u003cem class=\"replaceable\"\u003e\u003ccode\u003edirectory\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecify an additional include path, used to find files included via \u003ccode class=\"literal\"\u003eEXEC SQL INCLUDE\u003c/code\u003e. Defaults are \u003ccode class=\"filename\"\u003e.\u003c/code\u003e (current directory), \u003ccode class=\"filename\"\u003e/usr/local/include\u003c/code\u003e, the \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e include directory which is defined at compile time (default: \u003ccode class=\"filename\"\u003e/usr/local/pgsql/include\u003c/code\u003e), and \u003ccode class=\"filename\"\u003e/usr/include\u003c/code\u003e, in that order.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-o \u003cem class=\"replaceable\"\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies that \u003ccode class=\"command\"\u003eecpg\u003c/code\u003e should write all its output to the given \u003cem class=\"replaceable\"\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e. Write \u003ccode class=\"literal\"\u003e-o -\u003c/code\u003e to send all output to standard output.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-r \u003cem class=\"replaceable\"\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSelects run-time behavior. \u003cem class=\"replaceable\"\u003e\u003ccode\u003eOption\u003c/code\u003e\u003c/em\u003e can be one of the following:\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003eno_indicator\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not use indicators but instead use special values to represent null values. Historically there have been databases using this approach.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003eprepare\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrepare all statements before using them. Libecpg will keep a cache of prepared statements and reuse a statement if it gets executed again. If the cache runs full, libecpg will free the least used statement.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003equestionmarks\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eAllow question mark as placeholder for compatibility reasons. This used to be the default long ago.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-t\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eTurn on autocommit of transactions. In this mode, each SQL command is automatically committed unless it is inside an explicit transaction block. In the default mode, commands are committed only when \u003ccode class=\"command\"\u003eEXEC SQL COMMIT\u003c/code\u003e is issued.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-v\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint additional information including the version and the \"include\" path.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--version\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the \u003cspan class=\"application\"\u003eecpg\u003c/span\u003e version and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-?\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--help\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eShow help about \u003cspan class=\"application\"\u003eecpg\u003c/span\u003e command line arguments, and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.8.7\"\u003e\n\u003ch2\u003eNotes\u003c/h2\u003e\n\u003cp\u003eWhen compiling the preprocessed C code files, the compiler needs to be able to find the \u003cspan class=\"application\"\u003eECPG\u003c/span\u003e header files in the \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e include directory. Therefore, you might have to use the \u003ccode class=\"option\"\u003e-I\u003c/code\u003e option when invoking the compiler (e.g., \u003ccode class=\"literal\"\u003e-I/usr/local/pgsql/include\u003c/code\u003e).\u003c/p\u003e\n\u003cp\u003ePrograms using C code with embedded SQL have to be linked against the \u003ccode class=\"filename\"\u003elibecpg\u003c/code\u003e library, for example using the linker options \u003ccode class=\"literal\"\u003e-L/usr/local/pgsql/lib -lecpg\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eThe value of either of these directories that is appropriate for the installation can be found out using \u003ca class=\"xref\" href=\"/docs/18/app-pgconfig.html\" title=\"pg_config\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epg_config\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.8.8\"\u003e\n\u003ch2\u003eExamples\u003c/h2\u003e\n\u003cp\u003eIf you have an embedded SQL C source file named \u003ccode class=\"filename\"\u003eprog1.pgc\u003c/code\u003e, you can create an executable program using the following sequence of commands:\u003c/p\u003e\n\u003cpre class=\"programlisting\"\u003eecpg prog1.pgc\ncc -I/usr/local/pgsql/include -c prog1.c\ncc -o prog1 prog1.o -L/usr/local/pgsql/lib -lecpg\n\u003c/pre\u003e\n\u003c/div\u003e\n\u003c/div\u003e\u003c/div\u003e","related":[],"sections":[],"tables":[{"columns":[{"key":"signature","label":"Option and arguments"},{"key":"summary","label":"Description"}],"key":"options","rows":[{"signature":{"text":"-c","url":"/docs/18/app-ecpg.html"},"summary":"Automatically generate certain C code from SQL code. Currently, this works for EXEC SQL TYPE ."},{"signature":{"text":"-C mode","url":"/docs/18/app-ecpg.html"},"summary":"Set a compatibility mode. mode can be INFORMIX , INFORMIX_SE , or ORACLE ."},{"signature":{"text":"-D symbol [= value ]","url":"/docs/18/app-ecpg.html"},"summary":"Define a preprocessor symbol, equivalently to the EXEC SQL DEFINE directive. If no value is specified, the symbol is defined with the value 1 ."},{"signature":{"text":"-h","url":"/docs/18/app-ecpg.html"},"summary":"Process header files. When this option is specified, the output file extension becomes .h not .c , and the default input file extension is .pgh not .pgc . Also, the -c option is forced on."},{"signature":{"text":"-i","url":"/docs/18/app-ecpg.html"},"summary":"Parse system include files as well."},{"signature":{"text":"-I directory","url":"/docs/18/app-ecpg.html"},"summary":"Specify an additional include path, used to find files included via EXEC SQL INCLUDE . Defaults are . (current directory), /usr/local/include , the PostgreSQL include directory which is defined at compile time (default: /usr/local/pgsql/include ), and /usr/include , in that order."},{"signature":{"text":"-o filename","url":"/docs/18/app-ecpg.html"},"summary":"Specifies that ecpg should write all its output to the given filename . Write -o - to send all output to standard output."},{"signature":{"text":"-r option","url":"/docs/18/app-ecpg.html"},"summary":"Selects run-time behavior. Option can be one of the following:"},{"signature":{"text":"-t","url":"/docs/18/app-ecpg.html"},"summary":"Turn on autocommit of transactions. In this mode, each SQL command is automatically committed unless it is inside an explicit transaction block. In the default mode, commands are committed only when EXEC SQL COMMIT is issued."},{"signature":{"text":"-v","url":"/docs/18/app-ecpg.html"},"summary":"Print additional information including the version and the \"include\" path."},{"signature":{"text":"--version","url":"/docs/18/app-ecpg.html"},"summary":"Print the ecpg version and exit."},{"signature":{"text":"-? --help","url":"/docs/18/app-ecpg.html"},"summary":"Show help about ecpg command line arguments, and exit."}],"title":"Documented options"}]}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
