Search Postgresql Archives

Re: basic questions: Postgres with yum on CentOS 5.1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux