Thread: New User - options and other "get going" questions.

New User - options and other "get going" questions.

From
BobH
Date:
Hi,
   I have just installed the lastest PostGreSQL version as an RPM.  I am
using the /etc/init.d/postgresql file provided to start and stop. I am not
that conversant with shell programming (YET).

   I want to keep tables in "/rwhdata2/data" rather than
/var/lib/pgsql/data".  I presume that $PGDATA is set to
"/var/lib/pgsql/data", but I can't find out where.

   Typing "echo $PGDATA" logged in as either root or postgres returns a
blank line.  Can someone point me in the right direction.  I have three
books on my desk that purport to explain Postgresql and they all mention
PGDATA but none clearly delineate where it is set.

   Thanks,

Bob

Please reply directly as I am not sure that I am getting any list traffic
even though I checked to receive all messages when I subscribed.  Thanks!




Re: New User - options and other "get going" questions.

From
Peter Eisentraut
Date:
BobH writes:

>    I want to keep tables in "/rwhdata2/data" rather than
> /var/lib/pgsql/data".  I presume that $PGDATA is set to
> "/var/lib/pgsql/data", but I can't find out where.

It's set somewhere in the init script.  (The exact location may vary with
the version.)  It might be easier to make a symlink from the "standard"
location to your desired location.

--
Peter Eisentraut   peter_e@gmx.net


Re: New User - options and other "get going" questions.

From
"Nick Fankhauser"
Date:
Bob-

I'm pasting in a chunk from some of my local documentation for our system.
In our case, we don't touch the default, but rather set up some new
locations, but you may want to do something similar, and the description of
the process may help if you still want to change the default location. The
bits in parentheses are examples of the commands that work on our system-
you'll want to substitute your own directories and database names of course.

1)If an initdb was not done by the package install, you may have to do it:
(su; su - postgres; initdb)
2)Create the directories that you want the database(s) to live in. Make the
directory owner postgres (mkdir /data/staging; chown postgres /data/staging)
3)Define DB data locations as environment variables in
/var/lib/postgres/.profile eg: export PG_STAGING=/data/staging
4)Restart postmaster to pick up the new env variable: /etc/init.d/postgresql
restart
5)Initialize the database location: (su - postgres; initlocation PG_STAGING)
6)Create the database: (createdb staging -D PG_STAGING)

Regards,

-Nick

--------------------------------------------------------------------------
Nick Fankhauser  nickf@ontko.com  Phone 1.765.935.4283  Fax 1.765.962.9788
Ray Ontko & Co.     Software Consulting Services     http://www.ontko.com/

> -----Original Message-----
> From: pgsql-admin-owner@postgresql.org
> [mailto:pgsql-admin-owner@postgresql.org]On Behalf Of BobH
> Sent: Sunday, April 07, 2002 11:12 PM
> To: pgsql-admin@postgresql.org
> Subject: [ADMIN] New User - options and other "get going" questions.
>
>
> Hi,
>    I have just installed the lastest PostGreSQL version as an RPM.  I am
> using the /etc/init.d/postgresql file provided to start and stop.
> I am not
> that conversant with shell programming (YET).
>
>    I want to keep tables in "/rwhdata2/data" rather than
> /var/lib/pgsql/data".  I presume that $PGDATA is set to
> "/var/lib/pgsql/data", but I can't find out where.
>
>    Typing "echo $PGDATA" logged in as either root or postgres returns a
> blank line.  Can someone point me in the right direction.  I have three
> books on my desk that purport to explain Postgresql and they all mention
> PGDATA but none clearly delineate where it is set.
>
>    Thanks,
>
> Bob
>
> Please reply directly as I am not sure that I am getting any list traffic
> even though I checked to receive all messages when I subscribed.  Thanks!
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>