Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vyyXC-000aTN-2s for pgsql-docs@arkaria.postgresql.org; Sat, 07 Mar 2026 20:46:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vyyXA-009Zq8-09 for pgsql-docs@arkaria.postgresql.org; Sat, 07 Mar 2026 20:46:00 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vyyX9-009Zq0-26 for pgsql-docs@lists.postgresql.org; Sat, 07 Mar 2026 20:46:00 +0000 Received: from mail-oa1-x2e.google.com ([2001:4860:4864:20::2e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vyyX7-000000012oy-3eZf for pgsql-docs@lists.postgresql.org; Sat, 07 Mar 2026 20:45:58 +0000 Received: by mail-oa1-x2e.google.com with SMTP id 586e51a60fabf-4171ff4cb2cso18123fac.1 for ; Sat, 07 Mar 2026 12:45:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1772916357; cv=none; d=google.com; s=arc-20240605; b=Xbh3RIpcp8+nS7JJCWX6+qSb+6PJQqjB/9Z2cxt0YWJcv3NCsW/mCOuV5ahtjLp0cX RMlgVeYXSJQtE4/1S/e716oB4jlM5FIWjNfQDtCyqtGJ+iThnztGI7NmR04U83dIxq17 TdUqgAiGFuIfTDa0klGkl5lzBUApNoIIC07qLrB3Rxyln+wC8ZrNDUpKppB6DdAHqA+I Pz4mTsrKh3EwxH/K/+MyyPNzmb+SWaZ0hWNZ6t/xRLkS9vpSQdZ7U3iglYdOnx0T7NNi ep6EQidSDZ9MrtD9G2vwizBzuGyYmNdtZS0msizezl9bihlKtqIxBFixe5TTjT5miZIm dc/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=hwc/RopH/alf8Gi4m1gWhD4u85maNP6TLT3dN//fAvk=; fh=MIrtwlAdercFJ8MvltavF/wbjnKG4BxhImc4qMOXo7Q=; b=DDQPsjsFI8u2b2ixTwjAe4sIwCO9lN8odCtI5OwrFEyJyxxj3hxDjwdOfS2LsfWSkg 6Cl48uER1UWNGus/iDqQT1cv3YN4owxeEWcq8nb01xixKHJ4ShD9npwaGf4HY9XL1WHM MNng0ZwkCFn3bN6Y+UuqU1RDCESpMWAKB4e2JNR8DFZUwC2pNfLqVIUJ66Vhd6jf28+u qpoRRffW+hGu83wjzb9jTUq//IxORbanB7rU9G4RTzsrlmAPqaJxvbTPhxdBwPAUjYPS VpiOzw3SY2jq9/t0eE17k3Hwbqtjvtp17t/1fsmmkgT5RVhDqlZOeUGOcgmmLhGwPRsg yNJQ==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772916357; x=1773521157; darn=lists.postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=hwc/RopH/alf8Gi4m1gWhD4u85maNP6TLT3dN//fAvk=; b=gS1GNCmL9SgkIulYCBDndcXc/BTmBI9P7LV6uopFpLXFdocRYXXuo7ufN949YFzhRz T3GbbXs2h+cFFo2eH+JmiAc5je294PCxgvJ2rfW+TqyPOKW+XfeLMSOlMUIBY/n2oQFC 9NIqNOiQamnElsDlLTv//O2WnJcl3T5Duh8qNas23SSqcsJ/0wwAh2+NRJ+ULAYVexW8 c1o0iD3BPxKd/LN/nmLMQPExKX1EVBiAmo11VP7y2+VYVbPobJHuaBb+smQpPCQDe9dT CRqLGrP+N5qhXWFb9DvhvlNcxUWyMoDVV3tVf6k0/ZvyHnlUiEy6kIhDzSVC7QHYI9Va haFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772916357; x=1773521157; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hwc/RopH/alf8Gi4m1gWhD4u85maNP6TLT3dN//fAvk=; b=V5xygPKrC2Cj6QPJ1UH4sqremDMpsU2PPry9Uo5a4bKxpRrEJrpcE1FRehpD2ESOxs /wf11/gG2v1QS4zX2AQpgc6GH+JyRVHKr0F7GKEtBHwB9yoSq6kfabxLuLjfZ7oZ0Olt ePjb/oyeACtiQPo0mGvj1srNfHWi1r1HjoZLk7VBzOrYl3PXsYW0NQlBwQelGMmuawd6 qcqbPZUlmdZ9/w0y69tnlNwu/JGjNqAU3lYRftxI6ewkOwVzw6RIQuTuXyAYAYH+hxGf wULh9SzDd/5KVNjEDoR4VlqLtUENJil8zkq0lycTEVLgjxxVWmQVV3fkoCLGxAjU8Id0 uqUw== X-Forwarded-Encrypted: i=1; AJvYcCXgUkMlR2duHLyVF4sK0BBvbRZ9Im8BaHxI2+G5MKreqsmGMjhAoI+jRmuXz7Qy3VYv7qGF0OgnCSC3@lists.postgresql.org X-Gm-Message-State: AOJu0Ywd3w1960IgTzg0XYW/BuwN7CQoXJhrBNDBBZB6N30t/YAKQSUX Q7Aov/WKEKAjVcIzS0XWJkeg4f4leZviSvNPikeFTBRPP7bH1+xbrYJyrvB6tp2E8umeVjeS783 SBwuamPzQ4OSZIA6sW4ArLvVnyvSLvSY= X-Gm-Gg: ATEYQzwvp7wh5UhQWxpcHh47OoGVMgoLam/PhXgy54+wosxp5xBfgi92d5GIno+2aIR Ya1ObHdpBtjCpdCIgIKqN4/BBq7fM5DNWTWW/Ezck7+/tuiYUdpTR9GHREmrtI0Di9D7KYmLl4K EZCV95ldbTkbCgm+hQNz0pxPhHB4a5xsNZ+VdKfMFyOUzfqEwe+gzU2lpWsVlXOCmqaIsq+XMMs 2H0DoPHLUoCS+9+V1i08YNx3Q2Cv/nlQCtNBt/CUsTNM2uXWDvrkIKLzAg3wrrd7kjgeQGxOLxl xd5i5Gvs0XAJPUblww== X-Received: by 2002:a05:6870:b14e:b0:404:3010:b95a with SMTP id 586e51a60fabf-416e4497ca6mr3430061fac.44.1772916357116; Sat, 07 Mar 2026 12:45:57 -0800 (PST) MIME-Version: 1.0 References: <177288448489.777.2795338816825861811@wrigleys.postgresql.org> In-Reply-To: <177288448489.777.2795338816825861811@wrigleys.postgresql.org> From: "David G. Johnston" Date: Sat, 7 Mar 2026 13:45:19 -0700 X-Gm-Features: AaiRm529lQLXdi-c_RXdvbDTNSiDRdp65YJc3Ih1mhwIxBYS0qUevCBjMp9KzJQ Message-ID: Subject: Re: An example in UPDATE documentation page is a bit outdated To: emorgunov@mail.ru, pgsql-docs@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000aeb543064c7541e1" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000aeb543064c7541e1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Mar 7, 2026 at 1:38=E2=80=AFPM PG Doc comments form wrote: > The following documentation comment has been logged on the website: > > Page: https://www.postgresql.org/docs/18/sql-update.html > Description: > > There is an example on UPDATE documentation page -- > > BEGIN; > -- other operations > SAVEPOINT sp1; > INSERT INTO wines VALUES('Chateau Lafite 2003', '24'); > -- Assume the above fails because of a unique key violation, > -- so now we issue these commands: > ROLLBACK TO sp1; > UPDATE wines SET stock =3D stock + 24 WHERE winename =3D 'Chateau Lafite = 2003'; > -- continue with other operations, and eventually > COMMIT; > > Now we can use INSERT ... ON CONFLICT DO UPDATE command in this case. > > My second reaction was why would we put either variant on the update command reference page. Admittedly both of those examples are probably good to have somewhere, and I'm not sure where would be the most discoverable place. I'd rather remove the example and write a paragraph pointing the reader to the savepoint and insert pages if they have a need to perform a conditional insert/update pairing. David J. --000000000000aeb543064c7541e1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sat, Mar 7, 2026 at 1:38=E2=80=AFPM PG Doc comments for= m <noreply@postgresql.org&= gt; wrote:
The following document= ation comment has been logged on the website:

Page: https://www.postgresql.org/docs/18/sql-updat= e.html
Description:

There is an example on UPDATE documentation page --

BEGIN;
-- other operations
SAVEPOINT sp1;
INSERT INTO wines VALUES('Chateau Lafite 2003', '24');
-- Assume the above fails because of a unique key violation,
-- so now we issue these commands:
ROLLBACK TO sp1;
UPDATE wines SET stock =3D stock + 24 WHERE winename =3D 'Chateau Lafit= e 2003';
-- continue with other operations, and eventually
COMMIT;

Now we can use INSERT ... ON CONFLICT DO UPDATE command in this case.

My second reaction was why would we put ei= ther variant on the update command reference page.

Adm= ittedly both of those examples are probably good to have somewhere, and I&#= 39;m not sure where would be the most discoverable place.

I'd rather remove the example and write a paragraph pointing the = reader to the savepoint and insert pages if they have a need to perform a c= onditional insert/update pairing.

David J.
<= br>
--000000000000aeb543064c7541e1--