Re: basic questions: Postgres with yum on CentOS 5.1 - Mailing list pgsql-general

From Andrew Sullivan
Subject Re: basic questions: Postgres with yum on CentOS 5.1
Date
Msg-id 20080102153208.GI22706@crankycanuck.ca
Whole thread Raw
In response to Re: basic questions: Postgres with yum on CentOS 5.1  (Chuck <chuckr@velofish.com>)
List pgsql-general
Along with the other good remarks people have made, I want to point
something out.

On Tue, Jan 01, 2008 at 06:49:40PM -0800, Chuck wrote:
>
> I created a test database and confirmed that it's created with
> 'SQL_ASCII' encoding.
> [root@vs191 ~]# sudo -u postgres createdb myTest
> could not change directory to "/root"
> CREATE DATABASE

There are two issues above worth noting.  First, by doing this as user
postgres, you're creating a database _owned by postgres_.  There's nothing
fundamentally wrong with that, but I think it generally a good practice to
reduce as much as possible the reliance on the superuser.  You can create
other accounts.  See the sections of the manual on users.

Second, that "could not change directory to '/root'" tells me that your
postgres user really is, as already suggested upthread, not intended by your
package maintainer to be used with any regularity.  It has no home
directory.

> Without a package manager, I believe that this would be my initdb command:
> sudo -u postgres initdb -D /var/lib/pgsql/data -E UTF8 --no-locale
>
> I found the '--no-locale' option from 'initdb --help' and from this link:
> http://docs.planetargon.com/PostgreSQL_Installation
> I couldn't find the '--no-locale' option in the documentation.

Yes, that should work.  But see the other posts for suggestions on better
ways to deal with this.

A


pgsql-general by date:

Previous
From: "Pavel Stehule"
Date:
Subject: Re: Creating XML/KML documents from single tables
Next
From: Glyn Astill
Date:
Subject: Table auditing / Pg/tcl help