Subject: The word "virgin" used incorrectly and probably better off replaced

From: PG Doc comments form <[email-masked]>
Date: Thu, 07 Nov 2019 14:32:02 +0000

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/12/manage-ag-templatedbs.html
Description:

The use of the word virgin as an adjective is incorrect here and also an
anachronism. It is better off replaced with the word pristine - quotes
unnecessary. Note the word virgin appears in another page of the
documentation (a search will find it).

---

From: Alvaro Herrera <[email-masked]>
Date: Thu, 7 Nov 2019 12:03:20 -0300

> documentation (a search will find it).

Just because a word has sexual connotations does not imply that it
doesn't have non-sexual meanings.

Merriam-Webster lists https://www.merriam-webster.com/dictionary/virgin

2: FRESH, UNSPOILED
specifically : not altered by human activity

6: free of impurity or stain : UNSULLIED

which seems to apply well to all cases at hand.  Also:
  First Known Use of virgin
  Noun: 13th century, in the meaning defined at sense 2a
  Adjective: 14th century, in the meaning defined at sense 6

  History and Etymology for virgin
  Noun: Middle English, from Anglo-French virgine, from Latin virgin-, virgo young woman, virgin

That said, in two of the three phrases where the word appears, the quoted
adjective adds no value.  We could remove the quoted word entirely in
all three places and nothing would be lost.  But if we do that, then the
third occurrence of the word would become inintelligible:

  "This is particularly handy when restoring a pg_dump dump: the dump
  script should be restored in a virgin database to ensure that one
  recreates the correct contents of the dumped database, without
  conflicting with objects that might have been added to template1 later
  on."

because we have not explained what a "virgin database" is.  We could say
"empty", which seems better suited than both "virgin" and "pristine"
anyway.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

---

From: Daniel Gustafsson <[email-masked]>
Date: Thu, 7 Nov 2019 19:55:22 +0100

> On 7 Nov 2019, at 16:03, Alvaro Herrera <[email-masked]> wrote:

> because we have not explained what a "virgin database" is.  

I think this is the key observation.

> We could say "empty", which seems better suited than both "virgin" and
> "pristine" anyway.

empty is a lot better, but still isn't conveying the state of the database
without there being room for interpretation.  (My grasp of the english language
isn't enough to suggest a better alternative however).

cheers ./daniel

---

From: Bruce Momjian <[email-masked]>
Date: Thu, 7 Nov 2019 16:27:50 -0500

> isn't enough to suggest a better alternative however).

I am thinking "pristine" would be a good word here.

-- 
  Bruce Momjian  <[email-masked]>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +

---

From: Alvaro Herrera <[email-masked]>
Date: Thu, 7 Nov 2019 18:50:10 -0300

> I am thinking "pristine" would be a good word here.

But you would have to explain that a database created as a copy of
template1 may somehow not be pristine.  Maybe we should just use a
phrase that describes what we mean, something like "a database that
doesn't contain objects other than default system ones."

---

From: Bruce Momjian <[email-masked]>
Date: Thu, 7 Nov 2019 18:05:16 -0500

> doesn't contain objects other than default system ones."

True.

---

From: Daniel Gustafsson <[email-masked]>
Date: Fri, 8 Nov 2019 09:52:48 +0100

> On 7 Nov 2019, at 22:50, Alvaro Herrera <[email-masked]> wrote:
> 

Agreed.  I like your suggestion, or the inverse of it: "a database without any
user defined objects".

cheers ./daniel

---

From: Alvaro Herrera <[email-masked]>
Date: Fri, 8 Nov 2019 10:10:14 -0300

> Agreed.  I like your suggestion, or the inverse of it: "a database without any

Here's a proposed patch.

---

From: Daniel Gustafsson <[email-masked]>
Date: Fri, 8 Nov 2019 14:51:57 +0100

> On 8 Nov 2019, at 14:10, Alvaro Herrera <[email-masked]> wrote:
> 

+1, LGTM

cheers ./daniel

---

From: Tom Lane <[email-masked]>
Date: Fri, 08 Nov 2019 09:56:22 -0500

> Here's a proposed patch.

I don't like this wording much, because "no user-defined objects"
is not a sufficient specification of what we are talking about.
You need to also capture the property that none of the system-
defined objects have been altered.  Now that we explicitly support
things like altering the ACLs of system-defined objects, I do not
think it's okay to take that part for granted.

			regards, tom lane

---

From: Alvaro Herrera <[email-masked]>
Date: Fri, 8 Nov 2019 12:08:52 -0300

> think it's okay to take that part for granted.

Hmm.  Maybe we can say "pristine database" and then add this explanation
in a parenthical comment:

    This is particularly handy when restoring a
    <literal>pg_dump</literal> dump: the dump script should be restored in a
    pristine database (one where no user-defined objects exist and where
    system objects have not been altered), to ensure that one recreates
    the correct contents of the dumped database, without conflicting
    with objects that might have been added to
    <literal>template1</literal> later on.

---

From: Tom Lane <[email-masked]>
Date: Fri, 08 Nov 2019 10:19:20 -0500

>     <literal>template1</literal> later on.

So the patch becomes s/virgin/pristine/g plus add a parenthetical
definition for the first use?  Works for me.

			regards, tom lane

---

From: Daniel Gustafsson <[email-masked]>
Date: Fri, 8 Nov 2019 16:37:18 +0100

> On 8 Nov 2019, at 16:19, Tom Lane <[email-masked]> wrote:

> definition for the first use?  Works for me.

Agreed.

cheers ./daniel

---

From: Alvaro Herrera <[email-masked]>
Date: Fri, 8 Nov 2019 13:30:07 -0300

> definition for the first use?  Works for me.

Well, there are three uses of the word "virgin".  The first is for
"virgin user", and the patch turns that into just "user".  The second
one is for "virgin database" and the patch has the effect you describe.
The third one is also s/virgin//.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
diff --git a/doc/src/sgml/manage-ag.sgml b/doc/src/sgml/manage-ag.sgml
index 0154064e50..7e7f0ed00c 100644
--- a/doc/src/sgml/manage-ag.sgml
+++ b/doc/src/sgml/manage-ag.sgml
@@ -197,15 +197,17 @@ createdb -O <replaceable>rolename</replaceable> <replaceable>dbname</replaceable
    predefined by your version of
    <productname>PostgreSQL</productname>.  <literal>template0</literal>
    should never be changed after the database cluster has been
    initialized.  By instructing
    <command>CREATE DATABASE</command> to copy <literal>template0</literal> instead
-   of <literal>template1</literal>, you can create a <quote>virgin</quote> user
+   of <literal>template1</literal>, you can create a user
    database that contains none of the site-local additions in
    <literal>template1</literal>.  This is particularly handy when restoring a
    <literal>pg_dump</literal> dump: the dump script should be restored in a
-   virgin database to ensure that one recreates the correct contents
+   pristine database (one where no user-defined objects exist and where
+   system objects have not been altered), to ensure that one recreates
+   the correct contents
    of the dumped database, without conflicting with objects that
    might have been added to <literal>template1</literal> later on.
   </para>
 
   <para>
diff --git a/doc/src/sgml/ref/create_database.sgml b/doc/src/sgml/ref/create_database.sgml
index 4014f6703b..e56aca6d30 100644
--- a/doc/src/sgml/ref/create_database.sgml
+++ b/doc/src/sgml/ref/create_database.sgml
@@ -52,11 +52,11 @@ CREATE DATABASE <replaceable class="parameter">name</replaceable>
   <para>
    By default, the new database will be created by cloning the standard
    system database <literal>template1</literal>.  A different template can be
    specified by writing <literal>TEMPLATE
    <replaceable class="parameter">name</replaceable></literal>.  In particular,
-   by writing <literal>TEMPLATE template0</literal>, you can create a virgin
+   by writing <literal>TEMPLATE template0</literal>, you can create a
    database containing only the standard objects predefined by your
    version of <productname>PostgreSQL</productname>.  This is useful
    if you wish to avoid copying
    any installation-local objects that might have been added to
    <literal>template1</literal>.

---

From: Tom Lane <[email-masked]>
Date: Fri, 08 Nov 2019 11:41:59 -0500

> "virgin user", and the patch turns that into just "user".

Uh, no, read the next lines.  In both cases those are referring
to "virgin user database" or "virgin database", and this patch
is removing an important qualifier.  It needs to be s/virgin/pristine/
in all these places.

Since the third case is well separated from the other two, maybe
we need to repeat the parenthetical definition there too.

			regards, tom lane

---

From: Brian Williams <[email-masked]>
Date: Sun, 10 Nov 2019 09:01:38 -0500

Everyone,

Thank you for the attention paid to this.

Brian

> On Nov 8, 2019, at 10:37 AM, Daniel Gustafsson <[email-masked]> wrote:
>

---

From: Alvaro Herrera <[email-masked]>
Date: Mon, 11 Nov 2019 10:14:29 -0300

> is removing an important qualifier.  It needs to be s/virgin/pristine/

Doh, right.

One problem with doing it that way is that the proposed parenthical
comment partly duplicates the text immediately following it, so I'm no
longer so sure that adding it is good; I think that changing "local
additions" to "local additions and changes" might be sufficient, or
maybe that is too obscure for novices?  For create_database.sgml it does
seem to make a little more sense, but I'm not 100% there either.

Maybe "changes" can become "database-local system changes"? i.e.,

    By instructing CREATE DATABASE to copy template0 instead of
    template1, you can create a pristine user database that contains
    none of the site-local additions and database-local system changes
    in template1.

... though, argh, "-local" appearing twice makes that look bad too :-(
(I'm not sure that it is clear what a "database-local system change" is.)

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
diff --git a/doc/src/sgml/manage-ag.sgml b/doc/src/sgml/manage-ag.sgml
index 0154064e50..00ecc2d843 100644
--- a/doc/src/sgml/manage-ag.sgml
+++ b/doc/src/sgml/manage-ag.sgml
@@ -199,11 +199,11 @@ createdb -O <replaceable>rolename</replaceable> <replaceable>dbname</replaceable
    should never be changed after the database cluster has been
    initialized.  By instructing
    <command>CREATE DATABASE</command> to copy <literal>template0</literal> instead
-   of <literal>template1</literal>, you can create a <quote>virgin</quote> user
-   database that contains none of the site-local additions in
+   of <literal>template1</literal>, you can create a <quote>pristine</quote> user
+   database that contains none of the site-local additions and changes in
    <literal>template1</literal>.  This is particularly handy when restoring a
    <literal>pg_dump</literal> dump: the dump script should be restored in a
-   virgin database to ensure that one recreates the correct contents
+   pristine database to ensure that one recreates the correct contents
    of the dumped database, without conflicting with objects that
    might have been added to <literal>template1</literal> later on.
   </para>
diff --git a/doc/src/sgml/ref/create_database.sgml b/doc/src/sgml/ref/create_database.sgml
index 4014f6703b..7b48263364 100644
--- a/doc/src/sgml/ref/create_database.sgml
+++ b/doc/src/sgml/ref/create_database.sgml
@@ -54,8 +54,10 @@ CREATE DATABASE <replaceable class="parameter">name</replaceable>
    system database <literal>template1</literal>.  A different template can be
    specified by writing <literal>TEMPLATE
    <replaceable class="parameter">name</replaceable></literal>.  In particular,
-   by writing <literal>TEMPLATE template0</literal>, you can create a virgin
-   database containing only the standard objects predefined by your
+   by writing <literal>TEMPLATE template0</literal>, you can create a
+   pristine database (one where no user-defined objects exist and where
+   system objects have not been altered)
+   containing only the standard objects predefined by your
    version of <productname>PostgreSQL</productname>.  This is useful
    if you wish to avoid copying
    any installation-local objects that might have been added to

---

From: Tom Lane <[email-masked]>
Date: Mon, 11 Nov 2019 09:29:02 -0500

> seem to make a little more sense, but I'm not 100% there either.

I think we should stick to the wording we've agreed to be clearer.
Maybe do manage-ag.sgml like so:

     By instructing CREATE DATABASE to copy template0 instead of
     template1, you can create a pristine user database, that is one where
     no user-defined objects exist and where system objects have not been
     altered.  This is particularly handy ...

			regards, tom lane