Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nXSIZ-0005vV-Dc for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Mar 2022 18:35:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nXSIY-00043R-Cm for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Mar 2022 18:35:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nXSIX-000434-Gu for pgsql-hackers@lists.postgresql.org; Thu, 24 Mar 2022 18:35:02 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nXSIU-0008Be-TF for pgsql-hackers@lists.postgresql.org; Thu, 24 Mar 2022 18:35:01 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 8C6FB5C0139 for ; Thu, 24 Mar 2022 14:34:57 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 24 Mar 2022 14:34:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ilmari.org; h=cc :content-type:date:date:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to; s=fm2; bh=+ QVW5yxKY2A5N8E5Wh8VRoKCve2ZnIRl3u3XFf4jOSY=; b=2QTgvOCALmMn3Bj39 i0k5PFoUoJwmCjYzCVJ197aNW3B8oD5+kBNMtvncfiiUxvJz4V/zrTO4xMzTVfFl ySgtiAunnUroQ66Yq5NwwlI06Hxyv2B2gEVjhrvh0evejj02UsvPxF1oNBG41OHR LEXMSOpjByfWsIVXIh95IPYpaa4kNcPLI7yEtU9NdVAKxXaXl2T5aSF2NEtv5VBF cUS/KknTxlLDDIkZsJqT5As12RanZDji6WurKppHYz5MjiNBkR92gBpYuChCua1P qr4sh5IAI6v62j/mS9T/an8uiyhMXQsESefW1luOrZQCgnrxb2xZ2LS6IJ+P4L0M lsoFA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=+QVW5yxKY2A5N8E5Wh8VRoKCve2ZnIRl3u3XFf4jO SY=; b=RCyIVrr23ABDCQePwm4fjb+EJrTFi2AKjs+SrNGqMuHzUFC6Z3rjlEN/9 Z38uxmMr6zSIskPs6XVBQkcVBVUm5QIcsqWr+0Z5DEBGTL0YakAGCn9EJkYV50GO uFwSdXhdwL9PF9icaEcu0uljMLmOphIx2D8V9AS6ygniCUFBcNX1taTGCBFrGYJO LykFG3FH9dduwnZUci+csALaLCXnc4ZPgNCmrVEO+IOqwXNszILjjNf2oFHtJkB6 ENeDoWowG/BAlKJE3CcQmGtMGisxFtW6eqEJ76Tb7yUevtPNsxth6gMikYMwXAiy UMhi8b6tbB4wsvpb9qPnumGhKdr8Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudegledguddutdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkfgfgggtsehmtderre dtreejnecuhfhrohhmpeffrghgfhhinhhnpgfklhhmrghrihgpofgrnhhnshonkhgvrhcu oehilhhmrghrihesihhlmhgrrhhirdhorhhgqeenucggtffrrghtthgvrhhnpedvvddvve evhfevgfefffdvhfehheekfedtfffffedtjeffudelveevgeetteetieenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehilhhmrghrihesihhlmh grrhhirdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Thu, 24 Mar 2022 14:34:57 -0400 (EDT) From: =?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= To: pgsql-hackers@lists.postgresql.org Subject: Doc patch: replace 'salesmen' with 'salespeople' Date: Thu, 24 Mar 2022 18:34:55 +0000 Message-ID: <87o81vqjw0.fsf@wibble.ilmari.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --=-=-= Content-Type: text/plain Hi Hackers, I just spotted an unnecessarily gendered example involving a 'salesmen' table in the UPDATE docs. Here's a patch that changes that to 'salespeople'. - ilmari --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-doc-replace-salesmen-with-salespeople.patch From fde378ccd44c15f827a3c22630265f477d70d748 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= Date: Thu, 24 Mar 2022 18:21:48 +0000 Subject: [PATCH] doc: replace 'salesmen' with 'salespeople' --- doc/src/sgml/ref/update.sgml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/src/sgml/ref/update.sgml b/doc/src/sgml/ref/update.sgml index 3a0285df79..a1fc4bbb4a 100644 --- a/doc/src/sgml/ref/update.sgml +++ b/doc/src/sgml/ref/update.sgml @@ -387,21 +387,21 @@ Update contact names in an accounts table to match the currently assigned - salesmen: + salespeople: UPDATE accounts SET (contact_first_name, contact_last_name) = - (SELECT first_name, last_name FROM salesmen - WHERE salesmen.id = accounts.sales_id); + (SELECT first_name, last_name FROM salespeople + WHERE salespeople.id = accounts.sales_id); A similar result could be accomplished with a join: UPDATE accounts SET contact_first_name = first_name, contact_last_name = last_name - FROM salesmen WHERE salesmen.id = accounts.sales_id; + FROM salespeople WHERE salespeople.id = accounts.sales_id; However, the second query may give unexpected results - if salesmen.id is not a unique key, whereas - the first query is guaranteed to raise an error if there are multiple + if salespeople.id is not a unique key, + whereas the first query is guaranteed to raise an error if there are multiple id matches. Also, if there is no match for a particular accounts.sales_id entry, the first query will set the corresponding name fields to NULL, whereas the second query -- 2.30.2 --=-=-=--