Unix Technical Forum

pg_ctl problem

This is a discussion on pg_ctl problem within the pgsql Bugs forums, part of the PostgreSQL category; --> When running the pg_ctl command i am facing this error pg_ctl: no database directory specified and environment variable PGDATA ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Bugs

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 11:14 AM
madhu.harchandani@wipro.com
 
Posts: n/a
Default pg_ctl problem


When running the pg_ctl command i am facing this error
pg_ctl: no database directory specified and environment variable PGDATA unset
I use other options also but no solution was found.
could someone help me on this

Regards
Madhu Harchandani

The information contained in this electronic message and any attachments tothis message are intended for the exclusive use of the addressee(s) and maycontain proprietary, confidential or privileged information. If you are notthe intended recipient, you should not disseminate, distribute or copy thise-mail. Please notify the sender immediately and destroy all copies of thismessage and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient shouldcheck this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 11:14 AM
Gurjeet Singh
 
Posts: n/a
Default Re: pg_ctl problem

On Tue, Mar 4, 2008 at 4:11 PM, <madhu.harchandani@wipro.com> wrote:

>
> When running the pg_ctl command i am facing this error
> pg_ctl: no database directory specified and environment variable PGDATA
> unset
> I use other options also but no solution was found.
> could someone help me on this
>

Thats not enough information to resolve anything. Please be a bit more
descriptive.

Anyway, its pretty clear that you do not have PGDATA set in the environment..
So you need to run the command as follows:

pg_ctl -D /your/postgres/data/directory start

RTFM will definitely help.

--
gurjeet[.singh]@EnterpriseDB.com
singh.gurjeet@{ gmail | hotmail | indiatimes | yahoo }.com

EnterpriseDB http://www.enterprisedb.com

17° 29' 34.37"N, 78° 30' 59.76"E - Hyderabad
18° 32' 57.25"N, 73° 56' 25.42"E - Pune *
37° 47' 19.72"N, 122° 24' 1.69" W - San Francisco

http://gurjeet.frihost.net

Mail sent from my BlackLaptop device

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-10-2008, 11:14 AM
Gurjeet Singh
 
Posts: n/a
Default Re: pg_ctl problem

On Tue, Mar 4, 2008 at 4:51 PM, <madhu.harchandani@wipro.com> wrote:

>
>
> thanks for replying
>
> when i run this command i found the error as
>
> pg_ctl reload -l logfile -D /var/lib/pgsql/data
> could not change directory to "/root"
> pg_ctl: PID file "/var/lib/pgsql/data/postmaster.pid" does not exist
> Is server running?
>
> plz could u help me for this thank in advance
>


Please DO NOT exclude the list from the conversation. Adding GENERAL again.

I am not able to understand the following line in your error log:
<>
could not change directory to "/root"
</>

maybe someone else can help here.

Are you sure you have a running postgres instance on this box? The 'reload'
command can be executed only for a running Postgres instance.

If postgres is running (ps or top commands can help determine that), then
figure out which directory is that instance using as it's DATA directory. If
postgres is not running, then substitute the 'reload' in your command with
'start'.

If you are still unable to solve the problem, then please send us the output
of following commands: (assuming you are on a nixen (linux/Unix))

ps aux | grep postmaster
ps aux | grep postgres

which pg_ctl


Best regards
--
gurjeet[.singh]@EnterpriseDB.com
singh.gurjeet@{ gmail | hotmail | indiatimes | yahoo }.com

EnterpriseDB http://www.enterprisedb.com

17° 29' 34.37"N, 78° 30' 59.76"E - Hyderabad
18° 32' 57.25"N, 73° 56' 25.42"E - Pune *
37° 47' 19.72"N, 122° 24' 1.69" W - San Francisco

http://gurjeet.frihost.net

Mail sent from my BlackLaptop device

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-10-2008, 11:14 AM
Gurjeet Singh
 
Posts: n/a
Default Fwd: pg_ctl problem

Madhu... Please.... please... please.... use the 'REPLY TO ALL' option in
your mail client.

Forwarding again to the bugs list, in the hopes of pooling in others.

---------- Forwarded message ----------
From: <madhu.harchandani@wipro.com>
Date: Tue, Mar 4, 2008 at 7:02 PM
Subject: RE: [BUGS] pg_ctl problem
To: singh.gurjeet@gmail.com



Hi again


pg_ctl start is running

pg_ctl start -l logfile -D /var/lib/pgsql/data
could not change directory to "/root"
server starting
************************************************** *******************
Sir there is no any problem if we start rather than reload it.

************************************************** ****************
but if i write
pg_ctl reload -l logfile -D /var/lib/pgsql/data
could not change directory to "/root"
pg_ctl: PID file "/var/lib/pgsql/data/postmaster.pid" does not exist
Is server running?

Here i am writing in /var/lib/pgsql/data
the output of the command which u told me is
[root@mkd2ts2s-167471 ~]# ps aux | grep postmaster
postgres 6219 0.0 0.3 35872 3048 ? S 15:16 0:00
/usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data
root 7270 0.0 0.0 4044 680 pts/1 S+ 17:56 0:00 grep
postmaster


[root@mkd2ts2s-167471 ~]# ps aux | grep postgres
postgres 6219 0.0 0.3 35872 3048 ? S 15:16 0:00
/usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data
postgres 6221 0.0 0.1 35872 976 ? Ss 15:16 0:00 postgres:
writer process
postgres 6222 0.0 0.0 7320 656 ? Ss 15:16 0:00 postgres:
stats collector process
root 6223 0.0 0.1 4700 1204 pts/2 S 15:16 0:00 su postgres
postgres 6224 0.0 0.1 4704 1376 pts/2 S+ 15:16 0:00 bash
root 7300 0.0 0.0 4044 684 pts/1 S+ 17:56 0:00 grep
postgres
************************************************88 8




One more problem sir
bash-3.2$ psql -d xnat -f sql/xnat.sql -U xnat
could not change directory to "/root"
psql: FATAL: Ident authentication failed for user "xnat"

I will be very obliged if u would solve my problem actually i have to start
my project

thanks
Regards
Madhu Harchandani

The information contained in this electronic message and any attachments to
this message are intended for the exclusive use of the addressee(s) and may
contain proprietary, confidential or privileged information. If you are not
the intended recipient, you should not disseminate, distribute or copy this
e-mail. Please notify the sender immediately and destroy all copies of this
message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should
check this email and any attachments for the presence of viruses. The
company accepts no liability for any damage caused by any virus transmitted
by this email.

www.wipro.com



--
gurjeet[.singh]@EnterpriseDB.com
singh.gurjeet@{ gmail | hotmail | indiatimes | yahoo }.com

EnterpriseDB http://www.enterprisedb.com

17° 29' 34.37"N, 78° 30' 59.76"E - Hyderabad
18° 32' 57.25"N, 73° 56' 25.42"E - Pune *
37° 47' 19.72"N, 122° 24' 1.69" W - San Francisco

http://gurjeet.frihost.net

Mail sent from my BlackLaptop device

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:18 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com