Skip to content

Commit 51908a3

Browse files
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 <boshomi@gmail.com> Discussion: https://postgr.es/m/CAJVkCUparn4_Oarernm=U6LWVsTkecKcALHtwGr5M3qJRj_czw@mail.gmail.com
1 parent a0a5e0f commit 51908a3

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

doc/src/sgml/file-fdw.sgml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,4 +279,20 @@ OPTIONS ( filename 'log/pglog.csv', format 'csv' );
279279
</para>
280280
</example>
281281

282+
<example>
283+
<title>Create a Foreign Table with an option on a column</title>
284+
<para>
285+
To set the <literal>force_null</literal> option for a column, use the
286+
<literal>OPTIONS</literal> keyword.
287+
</para>
288+
<programlisting>
289+
CREATE FOREIGN TABLE films (
290+
code char(5) NOT NULL,
291+
title text NOT NULL,
292+
rating text OPTIONS (force_null 'true')
293+
) SERVER film_server
294+
OPTIONS ( filename 'films/db.csv', format 'csv' );
295+
</programlisting>
296+
</example>
297+
282298
</sect1>

0 commit comments

Comments
 (0)