docs: Fix format of CREATE FOREIGN TABLE example in postgres_fdw

Started by Daniel Westermann (DWE)4 months ago4 messageshackers
Beta feature

Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.

appliessuccessCI history

You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:

docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t139344
psql -h localhost -U postgres

Built from patchset v3 (message #3), August 23, 2026 at 08:52 AM.

Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:

git clone --branch t139344_3 https://github.com/hackorum-dev/postgres.git

In a checkout you already have, add the fork once:

git remote add hackorum https://github.com/hackorum-dev/postgres.git

then, for this patchset and every later one:

git fetch hackorum t139344_3 && git checkout t139344_3

Patchset v3 (message #3) is on t139344_3

Jump to latest
#1Daniel Westermann (DWE)
daniel.westermann@dbi-services.com

Hi,

while reading https://www.postgresql.org/docs/devel/postgres-fdw.html I've noticed that there is a single bracket on one line of the CREATE FOREIGN TABLE example.

Browsing through other docs (e,g. https://www.postgresql.org/docs/devel/sql-createtable.html ) there doesn't seem to be a rule for that but if there is a single bracket (e.g. CREATE TABLE distributors), the options that follow usually start at position one and are not indented (or they follow directly after the bracket).

The examples in file_fdw (https://www.postgresql.org/docs/devel/file-fdw.html) follow a mix of options which directly follow the bracket and on a new line.

Attached a small patch which makes it looking a bit better, at least in my opinion.

Regards
Daniel

Attachments:

fix-create-foreign-table-example-format.patchtext/x-patch; name=fix-create-foreign-table-example-format.patchDownload+3-3
#2Yuchen Li
liyuchen_xyz@163.com
In reply to: Daniel Westermann (DWE) (#1)
Re: docs: Fix format of CREATE FOREIGN TABLE example in postgres_fdw

On 4/15/2026 5:27 PM, Daniel Westermann (DWE) wrote:

Hi,

while reading https://www.postgresql.org/docs/devel/postgres-fdw.html
<https://www.postgresql.org/docs/devel/postgres-fdw.html&gt; I've noticed
that there is a single bracket on one line of the CREATE FOREIGN TABLE
example.

Browsing through other docs (e,g.
https://www.postgresql.org/docs/devel/sql-createtable.html
<https://www.postgresql.org/docs/devel/sql-createtable.html&gt; ) there
doesn't seem to be a rule for that but if there is a single bracket
(e.g. CREATE TABLE distributors), the options that follow usually
start at position one and are not indented (or they follow directly
after the bracket).

The examples in file_fdw
(https://www.postgresql.org/docs/devel/file-fdw.html) follow a mix of
options which directly follow the bracket and on a new line.

Attached a small patch which makes it looking a bit better, at least
in my opinion.

Regards
Daniel

While looking through the patch, I noticed a small formatting issue in
the following part:

+)
+SERVER foreign_server
+OPTIONS (schema_name 'some_schema', table_name 'some_table');

The added +) line appears to have a trailing space after the closing
parenthesis.

Regards,
Yuchen Li

#3Daniel Westermann (DWE)
daniel.westermann@dbi-services.com
In reply to: Yuchen Li (#2)
Re: docs: Fix format of CREATE FOREIGN TABLE example in postgres_fdw
+)
+SERVER foreign_server
+OPTIONS (schema_name 'some_schema', table_name 'some_table');

The added +) line appears to have a trailing space after the closing
parenthesis.

Fixed, thank you.

Regards
Daniel

Attachments:

t139344_3
fix-create-foreign-table-example-format_v2.patchtext/x-patch; name=fix-create-foreign-table-example-format_v2.patchDownload+2-2
#4Michael Paquier
michael@paquier.xyz
In reply to: Daniel Westermann (DWE) (#3)
Re: docs: Fix format of CREATE FOREIGN TABLE example in postgres_fdw

On Thu, Apr 16, 2026 at 10:20:02AM +0000, Daniel Westermann (DWE) wrote:

The added +) line appears to have a trailing space after the closing
parenthesis.

Fixed, thank you.

While the grammar of the query itself is correct, I agree that this is
a beautification worth it. Not correcting a problem, just easier for
the eye, so why not :)
--
Michael