aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2022-07-14 16:19:45 -0400
committerBruce Momjian <bruce@momjian.us>2022-07-14 16:19:45 -0400
commit76fa4bf321c5f13c729f225a465e754958c0a5c5 (patch)
treea62e7607956aac4afa78f50d60cc73d00d26cdd2
parent64d364bb39cbb1d97ab6dbd6b873a1016a261d4b (diff)
downloadpostgresql-76fa4bf321c5f13c729f225a465e754958c0a5c5.tar.gz
postgresql-76fa4bf321c5f13c729f225a465e754958c0a5c5.zip
doc: add documentation about ecpg Oracle-compatibility mode
Reported-by: Takeshi Ideriha Discussion: https://postgr.es/m/TYCPR01MB7041A157067208327D8DAAF9EAA59@TYCPR01MB7041.jpnprd01.prod.outlook.com Backpatch-through: 11
-rw-r--r--doc/src/sgml/ecpg.sgml39
1 files changed, 38 insertions, 1 deletions
diff --git a/doc/src/sgml/ecpg.sgml b/doc/src/sgml/ecpg.sgml
index 6f702d0c8ea..16853ced6f2 100644
--- a/doc/src/sgml/ecpg.sgml
+++ b/doc/src/sgml/ecpg.sgml
@@ -1927,7 +1927,8 @@ EXEC SQL SELECT b INTO :val :val_ind FROM test1;
</programlisting>
The indicator variable <varname>val_ind</varname> will be zero if
the value was not null, and it will be negative if the value was
- null.
+ null. (See <xref linkend="ecpg-oracle-compat"/> to enable
+ Oracle-specific behavior.)
</para>
<para>
@@ -9836,6 +9837,42 @@ risnull(CINTTYPE, (char *) &i);
</sect2>
</sect1>
+ <sect1 id="ecpg-oracle-compat">
+ <title><productname>Oracle</productname> Compatibility Mode</title>
+ <para>
+ <command>ecpg</command> can be run in a so-called <firstterm>Oracle
+ compatibility mode</firstterm>. If this mode is active, it tries to
+ behave as if it were Oracle <productname>Pro*C</productname>.
+ </para>
+
+ <para>
+ Specifically, this mode changes <command>ecpg</command> in three ways:
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ Pad character arrays receiving character string types with
+ trailing spaces to the specified length
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Zero byte terminate these character arrays, and set the indicator
+ variable if truncation occurs
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Set the null indicator to <literal>-1</literal> when character
+ arrays receive empty character string types
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </sect1>
+
<sect1 id="ecpg-develop">
<title>Internals</title>