Re: basic questions: Postgres with yum on CentOS 5.1

From: Andrew Sullivan <ajs(at)crankycanuck(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: basic questions: Postgres with yum on CentOS 5.1
Date: 2008-01-02 15:32:08
Message-ID: 20080102153208.GI22706@crankycanuck.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2008-01-02 15:47:15 Re: Slow count(*)
Previous Message Abraham, Danny 2008-01-02 15:29:24 Slow count(*)