| From: | kasaharatt <kasaharatt(at)oss(dot)nttdata(dot)com> |
|---|---|
| To: | pgsql-hackers(at)postgresql(dot)org |
| Subject: | Doc: typo in ddl.sgml |
| Date: | 2024-11-07 05:37:50 |
| Message-ID: | 84c1305f471bb5f73b4b407b4c2de64c@oss.nttdata.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
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 <emphasis>(author_id)</emphasis>
+ FOREIGN KEY (tenant_id, user_id) REFERENCES users ON DELETE SET
NULL <emphasis>(user_id)</emphasis>
);
</programlisting>
Without the specification of the column, the foreign key would also
set
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tatsuo Ishii | 2024-11-07 05:42:13 | Re: Fix for Extra Parenthesis in pgbench progress message |
| Previous Message | Michael Paquier | 2024-11-07 05:36:58 | Re: Parallel workers stats in pg_stat_database |