From: | Bruce Momjian <bruce(at)momjian(dot)us> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Jason O'Donnell <odonnelljp01(at)gmail(dot)com>, pgsql-docs(at)postgresql(dot)org |
Subject: | Re: Example error in createdb doc |
Date: | 2017-03-21 01:24:14 |
Message-ID: | 20170321012414.GA2045@momjian.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-docs |
On Tue, Nov 22, 2016 at 06:17:35PM -0500, Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)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(at)momjian(dot)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 +
Attachment | Content-Type | Size |
---|---|---|
createdb.diff | text/x-diff | 1.2 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2017-03-21 02:22:23 | Re: Better example |
Previous Message | Tatsuo Ishii | 2017-03-19 10:18:48 | Re: [HACKERS] Questionable tag usage |