Thread: Postgres database problem
Hi, I am using postgresql 7.0=20 When i am connecting my database it is giving error [root@imap /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 [root@imap 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 th= is exception: java .sql.SQLException: NOTICE: mdopen: couldn't open /var/lib/pgsql/data/pg_lo= g: 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 th= is exception: java .sql.SQLException: NOTICE: mdopen: couldn't open /var/lib/pgsql/data/pg_lo= g: 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
"Nitin Saxena" <nsaxena@systime.net> writes: > I am using postgresql 7.0 You really, really, really need to update to some remotely-modern PG version. 7.0 *will* eat your data someday. > NOTICE: mdopen: couldn't open /var/lib/pgsql/data/pg_log: Permission denied So, what's the permissions on /var/lib/pgsql/data/pg_log ? (Hint: should be mode 600 owner postgres) regards, tom lane
Nitin Saxena escribió: > Hi, > > I am using postgresql 7.0 > When i am connecting my database it is giving error > [root@imap /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 > > [root@imap 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 Hola , probá chown -r postgres: /var/lib/pgsql/data el "-r" es para que sea recursivo