From: Daniel Gustafsson Date: Wed, 23 Oct 2024 12:58:17 +0000 (+0200) Subject: doc: Fix INSERT statement syntax for identity columns X-Git-Tag: REL_18_BETA1~1655 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=17b4aa77c3a161a9d0e7b08bd9931fe9fd051540;p=postgresql.git doc: Fix INSERT statement syntax for identity columns The INSERT statements in the examples were erroneously using VALUE instead of VALUES. Backpatch to v17 where the examples were added through a37bb7c1399. Reported-by: shixiong327926@gmail.com Discussion: https://postgr.es/m/172958472112.696.6075270400394560263@wrigleys.postgresql.org Backpatch-through: 17 --- diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml index 8ab0ddb112f..f6344b3b79a 100644 --- a/doc/src/sgml/ddl.sgml +++ b/doc/src/sgml/ddl.sgml @@ -271,8 +271,8 @@ CREATE TABLE people ( example, with the above definitions and assuming additional appropriate columns, writing -INSERT INTO people (name, address) VALUE ('A', 'foo'); -INSERT INTO people (name, address) VALUE ('B', 'bar'); +INSERT INTO people (name, address) VALUES ('A', 'foo'); +INSERT INTO people (name, address) VALUES ('B', 'bar'); would generate values for the id column starting at 1 and result in the following table data: @@ -285,7 +285,7 @@ INSERT INTO people (name, address) VALUE ('B', 'bar'); Alternatively, the keyword DEFAULT can be specified in place of a value to explicitly request the sequence-generated value, like -INSERT INTO people (id, name, address) VALUE (DEFAULT, 'C', 'baz'); +INSERT INTO people (id, name, address) VALUES (DEFAULT, 'C', 'baz'); Similarly, the keyword DEFAULT can be used in UPDATE commands.