summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Gustafsson2023-09-18 12:59:16 +0000
committerDaniel Gustafsson2023-09-18 12:59:16 +0000
commit51908a37d7ea67655560ff2efcba66816ca458e2 (patch)
treed7d1c3868e13db25e9a5161b3e1ff3b3686d87aa
parenta0a5e0feb35c1209e340046dc4e40af3b0e79d59 (diff)
doc: Add example for how to set file_fdw column option
The documentation is pretty light on how to set column options on foreign tables, and the file_fdw docs refer to COPY when documenting force_null even though it's not used in the same way. Add a small example to describe how to use it. Reported-by: Boshomi Phenix <[email protected]> Discussion: https://postgr.es/m/CAJVkCUparn4_Oarernm=U6LWVsTkecKcALHtwGr5M3qJRj_czw@mail.gmail.com
-rw-r--r--doc/src/sgml/file-fdw.sgml16
1 files changed, 16 insertions, 0 deletions
diff --git a/doc/src/sgml/file-fdw.sgml b/doc/src/sgml/file-fdw.sgml
index 56d696c323c..b7f64930f06 100644
--- a/doc/src/sgml/file-fdw.sgml
+++ b/doc/src/sgml/file-fdw.sgml
@@ -279,4 +279,20 @@ OPTIONS ( filename 'log/pglog.csv', format 'csv' );
</para>
</example>
+ <example>
+ <title>Create a Foreign Table with an option on a column</title>
+ <para>
+ To set the <literal>force_null</literal> option for a column, use the
+ <literal>OPTIONS</literal> keyword.
+ </para>
+<programlisting>
+CREATE FOREIGN TABLE films (
+ code char(5) NOT NULL,
+ title text NOT NULL,
+ rating text OPTIONS (force_null 'true')
+) SERVER film_server
+OPTIONS ( filename 'films/db.csv', format 'csv' );
+</programlisting>
+ </example>
+
</sect1>