Doc: typo in ddl.sgml

2024-11-06 Thread kasaharatt

Hi.

I noticed that it seems to me a mistake in the sample code in the 
document.

https://www.postgresql.org/docs/devel/ddl-constraints.html#DDL-CONSTRAINTS-FK

I think it is a typo for user_id instead of author_id.
See bellow.

Best reghards,

diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml
index 898b6dd..c0de169 100644
--- a/doc/src/sgml/ddl.sgml
+++ b/doc/src/sgml/ddl.sgml
@@ -1269,9 +1269,9 @@ CREATE TABLE users (
 CREATE TABLE posts (
 tenant_id integer REFERENCES tenants ON DELETE CASCADE,
 post_id integer NOT NULL,
-author_id integer,
+user_id integer,
 PRIMARY KEY (tenant_id, post_id),
-FOREIGN KEY (tenant_id, author_id) REFERENCES users ON DELETE SET 
NULL (author_id)
+FOREIGN KEY (tenant_id, user_id) REFERENCES users ON DELETE SET 
NULL (user_id)

 );
 
 Without the specification of the column, the foreign key would also 
set





Re: Doc: typo in ddl.sgml

2024-11-06 Thread kasaharatt

Hi, thanks for your comment.


On Wednesday, November 6, 2024, kasaharatt
 wrote:.


I noticed that it seems to me a mistake in the sample code in the
document.


https://www.postgresql.org/docs/devel/ddl-constraints.html#DDL-CONSTRAINTS-FK

[1]

I think it is a typo for user_id instead of author_id.


It’s hard to argue a typo when three different places need to be
changed, and the example is fully functional as-is.

Yeah, you are right.
I mistakenly thought it was syntactically incorrect. The sample code 
works correctly.


Best regards,