[BUGS] Postgres database problem
Hi, I am using postgresql 7.0 When i am connecting my database it is giving error [EMAIL PROTECTED] /root]# su - postgres bash-2.04$ psql GROUPSMS NOTICE: mdopen: couldn't open /var/lib/pgsql/data/pg_log: Permission denied NOTICE: mdopen: couldn't open /var/lib/pgsql/data/pg_log: Permission denied psql: FATAL 1: cannot open relation pg_log bash-2.04$ psql psql: FATAL 1: Database "postgres" does not exist in the system catalog. bash-2.04$ psql GROUPSMS NOTICE: mdopen: couldn't open /var/lib/pgsql/data/pg_log: Permission denied psql: pqReadData() -- backend closed the channel unexpectedly. This probably means the backend terminated abnormally before or while processing the request. (2) When i am trying to connect via application it is giving error [EMAIL PROTECTED] GroupSMS]# java SendGrpSmpp Before Connection W 15/10/08 18:51:34 EventLog : No log file configured SMS JDK (tm) Version 2.2 Build $Date: 2002/05/10 10:55:06 $ Copyright (c) 2001 Noctor Consulting Limited. All rights reserved. After Connection Before Bind After Bind Polling at Wed Oct 15 18:51:34 IST 2008 Something unusual has occured to cause the driver to fail. Please report this exception: java .sql.SQLException: NOTICE: mdopen: couldn't open /var/lib/pgsql/data/pg_log: Permission deni ed at org.postgresql.Driver.connect(Driver.java:125) at java.sql.DriverManager.getConnection(DriverManager.java:517) at java.sql.DriverManager.getConnection(DriverManager.java:177) at SendGrpSmpp.readSMPPtable(SendGrpSmpp.java:213) at SendGrpSmpp.run(SendGrpSmpp.java:93) -Within Read Group- inside readFromTable Something unusual has occured to cause the driver to fail. Please report this exception: java .sql.SQLException: NOTICE: mdopen: couldn't open /var/lib/pgsql/data/pg_log: Permission deni ed at org.postgresql.Driver.connect(Driver.java:125) at java.sql.DriverManager.getConnection(DriverManager.java:517) at java.sql.DriverManager.getConnection(DriverManager.java:177) at SendGrpSmpp.readFromTable(SendGrpSmpp.java:119) at SendGrpSmpp.run(SendGrpSmpp.java:94) Kindly provide solution ,as it is urgent Regards: Nitin Saxena
[BUGS] error while starting database
I am using postgres 7.0 on linux platform. My java application was running fine ,but i got this message Connection refused. Check that the hostname and port is correct, and that the postmaster is r unning with the -i flag, which enables TCP/IP networking. at org.postgresql.Connection.openConnection(Connection.java:123) at org.postgresql.Driver.connect(Driver.java:116) at java.sql.DriverManager.getConnection(DriverManager.java:517) at java.sql.DriverManager.getConnection(DriverManager.java:177) at SendGrpSmpp.readSMPPtable(SendGrpSmpp.java:219) at SendGrpSmpp.run(SendGrpSmpp.java:96) When i am connecting as su via su - postgres at bash: when i give psql Database Name It is giving error: psql: connectDBStart() -- connect() failed: No such file or directory Is the postmaster running at 'localhost' and accepting connections on Unix socket '5432'? when i am using pg_ctl status command: it gives output: pg_ctl: postmaster is running (pid: 776) options are: /usr/bin/postmaster -p 5432 -D /var/lib/pgsql/data -B 64 -b /usr/bin/postgres -i -N 32 when i am using pg_ctl stop it gives /usr/bin/pg_ctl: kill: (776) - No such pid postmaster successfully shut down. when i am using pg_ctl restart it gives bash-2.04$ pg_ctl restart /usr/bin/pg_ctl: kill: (776) - No such pid Waiting for postmaster shutting down...pg_ctl: postmaster does not shut down when i am giving pg_ctl start: pg_ctl: It seems another postmaster is running. Try to start postmaster anyway. FATAL: StreamServerPort: bind() failed: No such file or directory Is another postmaster already running on that port? If not, remove socket node (/tmp/.s.PGSQL.5432) and retry. pg_ctl: Cannot start postmaster. Is another postmaster is running? bash-2.04$ /usr/bin/postmaster: cannot create UNIX stream port. Expecting your kind help on urgent. Regards-- NItin Saxena
Fwd: [BUGS] error while starting database
Hi, When i m using ps -ax |grep postgres [EMAIL PROTECTED] /root]# ps -ax |grep postgres 994 tty1 S 0:00 su - postgres when i am using netstat -a , it gives Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State tcp0 0 *:32768 *:* LISTEN tcp0 0 *:shell *:* LISTEN tcp0 0 *:time *:* LISTEN tcp0 0 *:8007 *:* LISTEN tcp0 0 *:netbios-ssn *:* LISTEN tcp0 0 *:pop3 *:* LISTEN tcp0 0 *:imap *:* LISTEN tcp0 0 *:finger*:* LISTEN tcp0 0 *:sunrpc*:* LISTEN tcp0 0 *:http *:* LISTEN tcp0 0 *:ftp *:* LISTEN tcp0 0 *:ssh *:* LISTEN tcp0 0 *:telnet*:* LISTEN tcp0 0 *:smtp *:* LISTEN tcp0 0 10.2.0.48:http 192.168.255.10:35046 TIME_WAIT tcp0138 10.2.0.48:telnet10.1.65.25:4468 ESTABLISHED udp0 0 *:32768 *:* udp0 0 10.2.0.48:netbios-ns*:* udp0 0 *:netbios-ns*:* udp0 0 10.2.0.48:netbios-dgm *:* udp0 0 *:netbios-dgm *:* udp0 0 *:680 *:* udp0 0 *:tftp *:* udp0 0 *:sunrpc*:* Active UNIX domain sockets (servers and established) Proto RefCnt Flags Type State I-Node Path unix 2 [ ACC ] STREAM LISTENING 1405 /dev/gpmctl unix 10 [ ] DGRAM776/dev/log unix 2 [ ] DGRAM9828 unix 2 [ ] DGRAM1556 unix 2 [ ] DGRAM1417 unix 2 [ ] DGRAM1386 unix 2 [ ] DGRAM1032 unix 2 [ ] DGRAM973 unix 2 [ ] DGRAM821 unix 2 [ ] DGRAM785 unix 2 [ ] STREAM CONNECTED 525 Please help as it is urgent. Regards: Nitin Saxena 91-985709 -- Forwarded message -- From: Nitin Saxena <[EMAIL PROTECTED]> Date: Aug 18, 2007 8:42 AM Subject: Re: [BUGS] error while starting database To: Douglas Toltzman <[EMAIL PROTECTED]>, pgsql-bugs@postgresql.org Hi All the command such asgives following output; 1: :ls -a/tmp: No such file or directory 2 : "rm -f/tmp/.s.PGSQL.5432" bash: rm -f/tmp/.s.PGSQL.5432: No such file or directory 3:"ps -ax|grep postgres" bash: ps -ax|grep postgres: command not found Does PID in postmaster.pid file is automatically created when we start the database. When i am giving command pg_ctl status at root, It is giving error message as pg_ctl: No database directory or environment variable $PGDATA is specified and When i am giving command pg_ctl status at bash it is giving postmaster is running [EMAIL PROTECTED] /root]# su - postgres bash-2.04$ pg_ctl status pg_ctl: postmaster is running (pid: 776) options are: /usr/bin/postmaster -p 5432 -D /var/lib/pgsql/data -B 64 -b /usr/bin/postgres -i -N 32 When i am giving command at root directory: [EMAIL PROTECTED] /root]# pg_ctl stop pg_ctl: No database directory or environment variable $PGDATA is specified [EMAIL PROTECTED] /root]# su - postgres bash-2.04$ pg_ctl stop /usr/bin/pg_ctl: kill: (776) - No such pid postmaster successfully shut down. when i am giving command bash-2.04$ pg_ctl start pg_ctl: It seems another postmaster is running. Try to start postmaster anyway. FATAL: StreamServerPort: bind() failed: No such file or directory Is another postmaster already running on that port? If not, remove socket node (/tmp/.s.PGSQL.5432) and retry. pg_ctl: Cannot start postmaster. Is another postmaster is running? bash-2.04$ /usr/bin/postmaster: cannot create UNIX stream port when i am giving pg_ctl restart bash-2.04$ pg_ctl restart /usr/bin/pg_ctl: kill: (776) - No such pid Waiting for postmaster shutting down...pg_ctl: postmaster does not shut down Please tell how to start services in postgres when i m giving command [EMAIL PROTECTED] /root]# service postgresql restart Stopping postgresql service: [FAILED]
Re: [BUGS] error while starting database
Hi All the command such asgives following output; 1: :ls -a/tmp: No such file or directory 2 : "rm -f/tmp/.s.PGSQL.5432" bash: rm -f/tmp/.s.PGSQL.5432: No such file or directory 3:"ps -ax|grep postgres" bash: ps -ax|grep postgres: command not found Does PID in postmaster.pid file is automatically created when we start the database. When i am giving command pg_ctl status at root, It is giving error message as pg_ctl: No database directory or environment variable $PGDATA is specified and When i am giving command pg_ctl status at bash it is giving postmaster is running [EMAIL PROTECTED] /root]# su - postgres bash-2.04$ pg_ctl status pg_ctl: postmaster is running (pid: 776) options are: /usr/bin/postmaster -p 5432 -D /var/lib/pgsql/data -B 64 -b /usr/bin/postgres -i -N 32 When i am giving command at root directory: [EMAIL PROTECTED] /root]# pg_ctl stop pg_ctl: No database directory or environment variable $PGDATA is specified [EMAIL PROTECTED] /root]# su - postgres bash-2.04$ pg_ctl stop /usr/bin/pg_ctl: kill: (776) - No such pid postmaster successfully shut down. when i am giving command bash-2.04$ pg_ctl start pg_ctl: It seems another postmaster is running. Try to start postmaster anyway. FATAL: StreamServerPort: bind() failed: No such file or directory Is another postmaster already running on that port? If not, remove socket node (/tmp/.s.PGSQL.5432) and retry. pg_ctl: Cannot start postmaster. Is another postmaster is running? bash-2.04$ /usr/bin/postmaster: cannot create UNIX stream port when i am giving pg_ctl restart bash-2.04$ pg_ctl restart /usr/bin/pg_ctl: kill: (776) - No such pid Waiting for postmaster shutting down...pg_ctl: postmaster does not shut down Please tell how to start services in postgres when i m giving command [EMAIL PROTECTED] /root]# service postgresql restart Stopping postgresql service: [FAILED] Checking postgresql installation: [ OK ] Starting postgresql service: [FAILED] Please help ASAP, as i have to up the application as soon as possible Thanks & Regards: Nitin Saxena On 8/17/07, Douglas Toltzman <[EMAIL PROTECTED]> wrote: > > PostgreSQL version 7.0 is really, really out of date, but as far as I > know, it should still work. > > I generally use "ps -ax | grep postges" to see if there is a postgres > process running. Also, I use "netstat -a" to see open sockets and listening > servers. > > Have you removed the socket file in /tmp and tried to start the server? > You may also want to check the server log to see if there is any indication > of why it crashed. Once you clean up the residue from the server that > abended, you'll be able to start it again, unless there are serious problems > with the database. I've only seen one case where I couldn't get the server > restarted, though, and that was after a hard drive failure caused corruption > in several files. Even then, I was able to recover everything. > > BTW: the socket file ("/tmp/.s.PGSQL.5432") will be a hidden file. You'll > need to "ls -a /tmp" to see it. You can just "rm -f /tmp/.s.PGSQL.5432" as > root and that should clean it up for you. > > p.s. This is not a bug, and even if it was, I'm sure version 7.0 is no > longer supported. You may want to use a different list if you require > additional assistance. > > On Aug 17, 2007, at 10:31 AM, Nitin Saxena wrote: > > > > I am using postgres 7.0 on linux platform. > My java application was running fine ,but i got this message > > Connection refused. Check that the hostname and port is correct, and that > the postmaster is r > unning with the -i flag, which enables TCP/IP networking. > at org.postgresql.Connection.openConnection(Connection.java:123) > at org.postgresql.Driver.connect(Driver.java:116) > at java.sql.DriverManager.getConnection(DriverManager.java:517) > at java.sql.DriverManager.getConnection(DriverManager.java:177) > at SendGrpSmpp.readSMPPtable(SendGrpSmpp.java:219) > at SendGrpSmpp.run(SendGrpSmpp.java:96) > > > When i am connecting as su via su - postgres > at bash: when i give psql Database Name > > It is giving error: > > psql: connectDBStart() -- connect() failed: No such file or directory > Is the postmaster running at 'localhost' > and accepting connections on Unix socket '5432'? > > when i am using pg_ctl status command: > > it gives output: pg_ctl: postmaster is running (pid: 776) > options are: > /usr/bin/postmaster > -p 5432 > -D /var/lib/pgsql/data > -B 64 > -b /usr/bin/postgres