Обсуждение: database location problems

Поиск
Список
Период
Сортировка

database location problems

От
"Devinder K Rajput"
Дата:
Hi,

I have installed 7.3 in /usr/local/pgsql.  However, I want the system
tables, config files, etc. located in the /data/db/system directory.  I am
able to do "initdb -D PGDATA" (PGDATA = /data/db/system) and it works fine.
However, when I try to create a database, createdb tells me that it cannot
find  /usr/local/pgsql/data/global/1262 (which i assume is template1).
However, I can do an initdb with PGDATA set to /usr/local/pgsql/data and
then I am able to create databases, but this is not what I need.

I also tried setting the datadir=/data/db/system before running
./configure.  However, this creates a postgresql directory under
/data/db/system and puts sample files there.  And when I go to do an initdb
with PGDATA set to /data/db/system, it complains that the directory is not
empty.

short version:
  I need:
      installation dir:                                    /usr/local/pgsql
      system tables, config files, etc.:   /data/db/system
                 databases
/data/db/<dbname>

Can anybody please show me the light, so to speak.  Thank you,

Devinder Rajput
Stores Division Corporate Offices
Chicago, IL
(773) 442-6474




Re: database location problems

От
Tom Lane
Дата:
"Devinder K Rajput" <Devinder.Rajput@ipaper.com> writes:
> I have installed 7.3 in /usr/local/pgsql.  However, I want the system
> tables, config files, etc. located in the /data/db/system directory.  I am
> able to do "initdb -D PGDATA" (PGDATA = /data/db/system) and it works fine.
> However, when I try to create a database, createdb tells me that it cannot
> find  /usr/local/pgsql/data/global/1262 (which i assume is template1).

You have not mentioned the step where you start the postmaster --- but
you need to make sure you give that same -D switch to the postmaster.

            regards, tom lane