From: Bruce Momjian <bruce@momjian.us>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Jason O'Donnell <odonnelljp01@gmail.com>
Cc: pgsql-docs@postgresql.org
Subject: Re: Example error in createdb doc
Date: Mon, 20 Mar 2017 21:24:14 -0400
Message-ID: <20170321012414.GA2045@momjian.us> (raw)
In-Reply-To: <16840.1479856655@sss.pgh.pa.us>
References: <CAOYeSOdUxLryVKsNkKs3tXCGSdQi2H7Wr6kMCWLpPnhu-JO_qQ@mail.gmail.com>
<20161122223144.GA31341@momjian.us>
<16840.1479856655@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-docs>
On Tue, Nov 22, 2016 at 06:17:35PM -0500, Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > On Thu, Oct 27, 2016 at 09:01:59PM -0400, Jason O'Donnell wrote:
> >> The example given for createdb fails because template0 is not provided:
>
> > I have looked over this report and patch, and it just doesn't feel
> > right. The example is intending to show how to use common psql-like
> > options to control createdb. Adding the encoding is nice, but then
> > having to switch to template0 so the encoding setting works just seems
> > beyond the scope of what we want do there.
>
> > I think the attached patch is more focused.
>
> I dunno. The use of -e seems pretty pointless for a call that is going to
> yield a trivial CREATE DATABASE command. Besides, we already showed a
> minimal example. If you think Jason's example is too complex, what about
> just subbing in "-T template0" for "-E LATIN1"? That should work
> regardless of other configuration.
[Just getting back to this November email]
Agreed on using -T.
> Also, your change to the text loses the point that -e provokes printing
> the underlying command. Admittedly, that was somewhat indirect in the way
> it was phrased before, but now the concept is just gone entirely; that
> doesn't feel like an improvement either.
>
> Personally I thought Jason's patch was fine as-is.
I tried Jason's example on my server and got an error, so I don't want
to trade one error example for another:
$ createdb -p 5432 -h localhost -E LATIN1 -T template0 -e demo
CREATE DATABASE demo ENCODING 'LATIN1' TEMPLATE template0;
createdb: database creation failed: ERROR: encoding "LATIN1" does not match locale "en_US.UTF-8"
DETAIL: The chosen LC_CTYPE setting requires encoding "UTF8".
I went with the template0 example, attached, and applied it to head.
--
Bruce Momjian <bruce@momjian.us> 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 +
--
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docsAttachments:createdb.diff (text/x-diff, 1.2K) downloaddiff --git a/doc/src/sgml/ref/createdb.sgml b/doc/src/sgml/ref/createdb.sgmlnew file mode 100644index c363bd4..9fc4c16
*** a/doc/src/sgml/ref/createdb.sgml
--- b/doc/src/sgml/ref/createdb.sgml
*************** PostgreSQL documentation
*** 363,373 ****
<para>
To create the database <literal>demo</literal> using the
server on host <literal>eden</>, port 5000, using the
! <literal>LATIN1</literal> encoding scheme with a look at the
! underlying command:
<screen>
! <prompt>$ </prompt><userinput>createdb -p 5000 -h eden -E LATIN1 -e demo</userinput>
! <computeroutput>CREATE DATABASE demo ENCODING 'LATIN1';</computeroutput>
</screen></para>
</refsect1>
--- 363,373 ----
<para>
To create the database <literal>demo</literal> using the
server on host <literal>eden</>, port 5000, using the
! <literal>template0</literal> template database, here is the
! command-line command and the underlying SQL command:
<screen>
! <prompt>$ </prompt><userinput>createdb -p 5000 -h eden -T template0 -e demo</userinput>
! <computeroutput>CREATE DATABASE demo TEMPLATE template0;</computeroutput>
</screen></para>
</refsect1>
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 using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: bruce@momjian.us, tgl@sss.pgh.pa.us, odonnelljp01@gmail.com
Subject: Re: Example error in createdb doc
In-Reply-To: <20170321012414.GA2045@momjian.us>
* 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