{"id":307,"date":"2013-07-12T16:48:07","date_gmt":"2013-07-12T16:48:07","guid":{"rendered":"http:\/\/blog.shineservers.com\/?p=307"},"modified":"2013-07-12T16:48:07","modified_gmt":"2013-07-12T16:48:07","slug":"how-to-fix-pgsql-query-failed-error","status":"publish","type":"post","link":"https:\/\/www.shineservers.com\/2013\/07\/12\/how-to-fix-pgsql-query-failed-error\/","title":{"rendered":"How to Fix PGSQL query failed Error"},"content":{"rendered":"<h3><strong>Steps to fix the error\u00a0Pgsql query failed<\/strong><\/h3>\n<p><strong>If you receive the following error while trying to access a page using postgresql database credentials, you can follow the steps listed below to fix this.<\/strong><\/p>\n<div>\n<blockquote>\n<pre>Warning: pg_query() [function.pg-query]: Query failed: ERROR: permission denied for relation in \/home\/username\/public_html\/123.php\u00a0\nWarning: pg_num_rows(): supplied argument is not a valid PostgreSQL result resource in \/home\/username\/public_html\/123.php<\/pre>\n<\/blockquote>\n<\/div>\n<p><strong>Step 1: Open the postgresql configuration file.<\/strong><\/p>\n<blockquote>\n<pre>vi \/var\/lib\/pgsql\/data\/pg_hba.conf<\/pre>\n<\/blockquote>\n<p><strong>Scroll down and check for the following lines.<\/strong><\/p>\n<blockquote>\n<pre>local all all md5<\/pre>\n<pre>host all all 127.0.0.1 255.255.255.255 md5<\/pre>\n<\/blockquote>\n<div>\n<p><strong>\u00a0Just change it as given below and save the file.<\/strong><\/p>\n<blockquote>\n<pre> local all all md5\n host all all 127.0.0.1 255.255.255.255 password<\/pre>\n<\/blockquote>\n<\/div>\n<p><strong>Step 2: Restart Postgresql.<\/strong><\/p>\n<blockquote>\n<pre>\/etc\/rc.d\/init.d\/postgresql restart<\/pre>\n<\/blockquote>\n<p><strong>Done!!!<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Steps to fix the error\u00a0Pgsql query failed If you receive the following error while trying to access a page using postgresql database credentials, you can follow the steps listed below to fix this. Warning: pg_query() [function.pg-query]: Query failed: ERROR: permission denied for relation in \/home\/username\/public_html\/123.php\u00a0 Warning: pg_num_rows(): supplied argument is not a valid PostgreSQL result [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[58],"tags":[135],"class_list":["post-307","post","type-post","status-publish","format-standard","hentry","category-cpanel-control-panel","tag-how-to-fix-pgsql-query-failed-error"],"acf":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/posts\/307","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/comments?post=307"}],"version-history":[{"count":0,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/posts\/307\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/media?parent=307"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/categories?post=307"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/tags?post=307"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}