Pgsql query failed Error
If may receive the following error while trying to access a page using postgresql database credentials.
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.confScroll 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 passwordStep 2: Restart Postgresql.
/etc/rc.d/init.d/postgresql restart
Done!!!