Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Pgsql query failed Error  (Read 2422 times)

0 Members and 1 Guest are viewing this topic.

rohitj

  • Guest
Pgsql query failed Error
« on: December 28, 2013, 09:15:46 pm »
Pgsql query failed Error


If may receive the following error while trying to access a page using postgresql database credentials.

Code: [Select]
Warning: pg_query() [function.pg-query]: Query failed: ERROR: permission denied for relation in /home/username/public_html/123.php
Warning: pg_num_rows(): supplied argument is not a valid PostgreSQL result resource in /home/username/public_html/123.php

Step 1: Open the postgresql configuration file.

vim /var/lib/pgsql/data/pg_hba.conf

Scroll down and check for the following lines.

local all all md5
host all all 127.0.0.1 255.255.255.255 md5
 Just change it as given below and save the file.


 local all all md5
 host all all 127.0.0.1 255.255.255.255 password


Step 2: Restart Postgresql.

Code: [Select]
/etc/rc.d/init.d/postgresql restart

Done!!!   ;)