Re: Environment variables

From: Bruno LEVEQUE <bruno(dot)leveque(at)net6d(dot)com>
To: Roy MacGregor Paterson <roy(at)macgregortech(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Environment variables
Date: 2003-11-22 13:52:55
Message-ID: 3FBF6A37.3060303@net6d.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi Roy,

Fisrt, the good syntax is

setenv PGDATA "/usr/local/pgsql/data" (with or without "")

Because PGDATA is a variable with only one value
(/usr/local/pgsql/data), so before this setenv, PGDATA is empty and
after it should take only /usr/local/pgsql/data.

You use $PGDATA when you want to know wath the variable PGDATA contains

for example :

setenv PGDATA anywhere/your/data/are
echo $PGDATA ->>>>>>>>>>>>> in the screen you take anywhere/your/data/are

Second, you must give the path where are you data, ie where you say to
initdb.

Were you used initdb ? (initdb -D DATADIR)

BR

Bruno

Roy MacGregor Paterson wrote:

> Hi Bruno,
>
> Thanks: my .tcshrc works with this...
>
> setenv PATH "$PATH":/Library/MySQL/bin
> setenv PATH "$PATH":/usr/local/bin
> setenv PATH "$PATH":/usr/local/pgsql
> setenv PATH "$PATH":/usr/local/pgsql/bin
>
> ...so now I get this response...
> [MacGregor:/Users/roy] postgres% pg_ctl -D /usr/local/pgsql/data start
> postmaster successfully started
> [MacGregor:/Users/roy] postgres% LOG: database system was shut down
> at 2003-11-22 12:06:33 GMT
> LOG: checkpoint record is at 0/805FB4
> LOG: redo record is at 0/805FB4; undo record is at 0/0; shutdown TRUE
> LOG: next transaction id: 490; next oid: 16977
> LOG: database system is ready
>
>
> OK. Now I'm trying to get the PGDATA environment variable to work.
> I've tried each the following lines in . tcshrc one at a time...
> setenv PGDATA "$PGDATA":/usr/local/pgsql
> setenv PGDATA "$PGDATA":/usr/local/pgsql/data
> setenv PGDATA /usr/local/pgsql
> setenv PGDATA /usr/local/pgsql/data
> setenv $PGDATA /usr/local/pgsql
> setenv $PGDATA /usr/local/pgsql/data
>
> ...and always get this response...
> [MacGregor:/Users/roy] postgres% pg_ctl start
> pg_ctl: no database directory or environment variable $PGDATA is
> specified
> Try 'pg_ctl --help' for more information.
> [MacGregor:/Users/roy] postgres%
>
> ...so what's going on?
>
> regards,
> Roy

--
Bruno LEVEQUE
System Engineer
SARL NET6D
bruno(dot)leveque(at)net6d(dot)com
http://www.net6d.com

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Bo Lorentsen 2003-11-22 14:34:00 Re: pg_hda.conf
Previous Message Oliver Elphick 2003-11-22 13:41:15 Re: pg_hda.conf