<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SupportSages &#187; PostgreSQL</title>
	<atom:link href="http://www.supportsages.com/blog/tag/postgresql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.supportsages.com/blog</link>
	<description>Technical Support and Server Management : Musings in the fox hole.</description>
	<lastBuildDate>Fri, 16 Jul 2010 02:47:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>cPanel, postgresql and a default database issue with 8.4.x versions of postgres</title>
		<link>http://www.supportsages.com/blog/2010/05/cpanel-postgresql-and-a-default-database-issues-with-8-4-x-versions-of-postgres/</link>
		<comments>http://www.supportsages.com/blog/2010/05/cpanel-postgresql-and-a-default-database-issues-with-8-4-x-versions-of-postgres/#comments</comments>
		<pubDate>Sun, 23 May 2010 20:18:01 +0000</pubDate>
		<dc:creator>arnold</dc:creator>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[cPanel]]></category>
		<category><![CDATA[default database]]></category>
		<category><![CDATA[template1]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=614</guid>
		<description><![CDATA[The issue was there, because customer wanted a latest version of Postgresql, latest than what cPanel support by default.

<strong>Issue reported in the phppGAdmin page was</strong>

[plain]
FATAL:  password authentication failed for user &#34;cPanel_username&#34;
FATAL:  permission denied for database &#34;template1&#34;
DETAIL:  User does not have CONNECT privilege.
[/plain]

<span id="more-614"></span>

<strong>Solution</strong>

[bash]
# su - postgres
-bash-3.2$ psql
psql (8.4.2)
Type &#34;help&#34; for help.

postgres=# alter user cPanel_username with password 'password_here';
ALTER ROLE
postgres=# alter user cPanelusername_username with password 'password_here';
[/bash]

Check for issues in /var/lib/pgsql/pgstartup.log . That is where postgreSQL throws out errors which will be helpful in debugging the issues.

In prior releases, template1 was used both as a default connection for utilities like ...]]></description>
			<content:encoded><![CDATA[<p>The issue was there, because customer wanted a latest version of Postgresql, latest than what cPanel support by default.</p>
<p><strong>Issue reported in the phppGAdmin page was</strong></p>
<pre class="brush: plain;">
FATAL:  password authentication failed for user &quot;cPanel_username&quot;
FATAL:  permission denied for database &quot;template1&quot;
DETAIL:  User does not have CONNECT privilege.
</pre>
<p><span id="more-614"></span></p>
<p><strong>Solution</strong></p>
<pre class="brush: bash;">
# su - postgres
-bash-3.2$ psql
psql (8.4.2)
Type &quot;help&quot; for help.

postgres=# alter user cPanel_username with password 'password_here';
ALTER ROLE
postgres=# alter user cPanelusername_username with password 'password_here';
</pre>
<p>Check for issues in /var/lib/pgsql/pgstartup.log . That is where postgreSQL throws out errors which will be helpful in debugging the issues.</p>
<p>In prior releases, template1 was used both as a default connection for utilities like createuser, and as a template for new  databases.  This caused CREATE DATABASE to sometimes fail, because a new database cannot be created if anyone else is in the template database. With this change, the default connection database is now postgres, meaning it is much  less likely someone will be using template1 during CREATE DATABASE.</p>
<p>Also, do change the postgresql configuration file of cPanel installation,  /usr/local/cpanel/base/3rdparty/phpPgAdmin/conf/config.inc.php</p>
<p>Look for</p>
<pre class="brush: plain;">
$conf['servers'][0]['defaultdb'] = 'template1';
</pre>
<p>and change it to</p>
<pre class="brush: plain;">
$conf['servers'][0]['defaultdb'] = 'postgres';
</pre>
<p>Don&#8217;t forget to chattr also. BTW now a days, cPanel is intelligent enough to detect and remove the chattrs also <img src='http://www.supportsages.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> .</p>
<p align="left"><a  class="tt" href="http://twitter.com/home/?status=cPanel%2C+postgresql+and+a+default+database+issue+with+8.4.x+versions+of+postgres++http%3A%2F%2Fwww.supportsages.com%2Fblog%2F614" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=cPanel%2C+postgresql+and+a+default+database+issue+with+8.4.x+versions+of+postgres++http%3A%2F%2Fwww.supportsages.com%2Fblog%2F614" title="Post to Twitter">Tweet This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2010/05/cpanel-postgresql-and-a-default-database-issues-with-8-4-x-versions-of-postgres/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Postgresql issues with a cPanel server</title>
		<link>http://www.supportsages.com/blog/2010/01/postgresql-issues-with-a-cpanel-server/</link>
		<comments>http://www.supportsages.com/blog/2010/01/postgresql-issues-with-a-cpanel-server/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 02:30:34 +0000</pubDate>
		<dc:creator>Sam</dc:creator>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[cPanel]]></category>
		<category><![CDATA[error]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=612</guid>
		<description><![CDATA[Recently with a cPanel server, we had this issue of not being able to create postgresql database even after the postgresql package is installed and database server is running. Fixing of one issue lead to another there by needing to fix all the errors.

<blockquote>Cpanel::AdminBin::adminrun(postgres) set error in context postgres
[2010-01-16 12:24:18 -0500] warn [postgres::listdbs] Encountered error in postgres::listdbs: Error from postgres wrapper: PostgreSQL has not been configured by the administrator. Unable to locate pgpass file.</blockquote>

This was fixed by doing these,

<strong>Login to WHM => SQL Services => Postgres Config => Click on “Install Config”.
Login to WHM => SQL Services => Postgres Config ...]]></description>
			<content:encoded><![CDATA[<p>Recently with a cPanel server, we had this issue of not being able to create postgresql database even after the postgresql package is installed and database server is running. Fixing of one issue lead to another there by needing to fix all the errors.</p>
<blockquote><p>Cpanel::AdminBin::adminrun(postgres) set error in context postgres<br />
[2010-01-16 12:24:18 -0500] warn [postgres::listdbs] Encountered error in postgres::listdbs: Error from postgres wrapper: PostgreSQL has not been configured by the administrator. Unable to locate pgpass file.</p></blockquote>
<p>This was fixed by doing these,</p>
<p><strong>Login to WHM => SQL Services => Postgres Config => Click on “Install Config”.<br />
Login to WHM => SQL Services => Postgres Config => &#8220;Set a Postgresql password also&#8221;</strong></p>
<p>No error in cPanel after doing above. However that followed by an issue of created DBs not being appeared in the List DB page of Postgresql databases. Went to shell. Logged in as root . Switched to postgres. &#8220;su &#8211; postgres&#8221; . Ran the command &#8220;psql&#8221; and then</p>
<p><code>-bash-3.2$ psql<br />
Welcome to psql 8.1.18, the PostgreSQL interactive terminal.</p>
<p>Type:  \copyright for distribution terms<br />
       \h for help with SQL commands<br />
       \? for help with psql commands<br />
       \g or terminate with semicolon to execute query<br />
       \q to quit</p>
<p>postgres=# \l<br />
        List of databases<br />
   Name    |  Owner   | Encoding<br />
-----------+----------+----------<br />
 postgres  | postgres | UTF8<br />
 template0 | postgres | UTF8<br />
 template1 | postgres | UTF8<br />
(3 rows)</p>
<p>postgres=# \q</code></p>
<p>No DB was created. Checked the logs /usr/local/cpanel/logs/error_log and it had entries like <strong>ERROR:  role &#8220;username&#8221; does not exist</strong> which meant, no roles to create the database.</p>
<p><code>cd /var/cpanel/users &#038;&#038; for x in *; do su -c "createuser -S -D -R $x" postgres; done</code></p>
<p align="left"><a  class="tt" href="http://twitter.com/home/?status=Postgresql+issues+with+a+cPanel+server+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F612" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=Postgresql+issues+with+a+cPanel+server+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F612" title="Post to Twitter">Tweet This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2010/01/postgresql-issues-with-a-cpanel-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
