Subject: docs: Fix format of CREATE FOREIGN TABLE example in postgres_fdw

From: "Daniel Westermann (DWE)" <[email-masked]>
Date: Wed, 15 Apr 2026 09:27:01 +0000

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
diff --git a/doc/src/sgml/postgres-fdw.sgml b/doc/src/sgml/postgres-fdw.sgml
index b81f33732fb..bf54f8937c4 100644
--- a/doc/src/sgml/postgres-fdw.sgml
+++ b/doc/src/sgml/postgres-fdw.sgml
@@ -1470,9 +1470,9 @@ CREATE USER MAPPING FOR local_user
 CREATE FOREIGN TABLE foreign_table (
         id integer NOT NULL,
         data text
-)
-        SERVER foreign_server
-        OPTIONS (schema_name 'some_schema', table_name 'some_table');
+) 
+SERVER foreign_server
+OPTIONS (schema_name 'some_schema', table_name 'some_table');
 </programlisting>
 
    It's essential that the data types and other properties of the columns

---

From: Yuchen Li <[email-masked]>
Date: Thu, 16 Apr 2026 17:17:24 +0800

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> 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> ) 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.
>

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

+)
+SERVER foreign_server

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

Regards,
Yuchen Li

---

From: "Daniel Westermann (DWE)" <[email-masked]>
Date: Thu, 16 Apr 2026 10:20:02 +0000

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

Fixed, thank you.

Regards
Daniel
diff --git a/doc/src/sgml/postgres-fdw.sgml b/doc/src/sgml/postgres-fdw.sgml
index b81f33732fb..74c66fb6110 100644
--- a/doc/src/sgml/postgres-fdw.sgml
+++ b/doc/src/sgml/postgres-fdw.sgml
@@ -1471,8 +1471,8 @@ CREATE FOREIGN TABLE foreign_table (
         id integer NOT NULL,
         data text
 )
-        SERVER foreign_server
-        OPTIONS (schema_name 'some_schema', table_name 'some_table');
+SERVER foreign_server
+OPTIONS (schema_name 'some_schema', table_name 'some_table');
 </programlisting>

---

From: Michael Paquier <[email-masked]>
Date: Sat, 18 Apr 2026 06:53:45 +0900

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

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