pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
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> (raw)

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

Attachments:

0001-doc-replace-salesmen-with-salespeople.patch (text/x-diff, 1.9K) download From fde378ccd44c15f827a3c22630265f477d70d748 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= <ilmari@ilmari.org> 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 @@ <para> Update contact names in an accounts table to match the currently assigned - salesmen: + salespeople: <programlisting> 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); </programlisting> A similar result could be accomplished with a join: <programlisting> 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; </programlisting> However, the second query may give unexpected results - if <structname>salesmen</structname>.<structfield>id</structfield> is not a unique key, whereas - the first query is guaranteed to raise an error if there are multiple + if <structname>salespeople</structname>.<structfield>id</structfield> is not a unique key, + whereas the first query is guaranteed to raise an error if there are multiple <structfield>id</structfield> matches. Also, if there is no match for a particular <structname>accounts</structname>.<structfield>sales_id</structfield> entry, the first query will set the corresponding name fields to NULL, whereas the second query -- 2.30.2

view thread (4+ messages)  latest in thread

Message-ID: <87o81vqjw0.fsf@wibble.ilmari.org>
Permalink:  ../87o81vqjw0.fsf@wibble.ilmari.org/
Also on:    postgresql.org/message-id/87o81vqjw0.fsf@wibble.ilmari.org

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: ilmari@ilmari.org
  Subject: Re: Doc patch: replace 'salesmen' with 'salespeople'
  In-Reply-To: <87o81vqjw0.fsf@wibble.ilmari.org>
  References: <87o81vqjw0.fsf@wibble.ilmari.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox