Initial Postgres Configuration
Note that since Glom 1.4, no manual configuration of your local PostgreSQL server is necessary. However, these notes might be useful when configuring a central database server for use with Glom.
Each distro has a different default configuration for Postgres. These notes should help you make Postgres work with Glom.
If you can improve this advice, then please go ahead and edit this page. In the future, we hope to provide a user interface to make this easier. Since Glom 1.3.5, Glom can use Postgres directly for self-hosting, without needing any Postgres configuration.
Create a user who can create databases
<pre> [murrayc@localhost]$ su Password: [root@localhost]# su postgres </pre> (Or "sudo -s -u postgres" on Ubuntu, entering your password when asked)
Now use createuser to create a user that may access the postgres server.
With Postgres 8.1, it looks like this: <pre> $ createuser -P
(-P means "assign password")
Enter name of role to add: murrayc Enter password for new role: Enter it again: Shall the new role be a superuser? (y/n) y CREATE ROLE </pre>
With Postgres 7.4, it looks like this: <pre> $ createuser -P
(-P means "assign password")
Enter name of user to add: murrayc Enter password for new user: Enter it again: Shall the new user be allowed to create databases? (y/n) y Shall the new user be allowed to create more new users? (y/n) y CREATE USER </pre>
By default, Postgres usually only allows connections from the same computer, and not via the TCP/IP connection method that Glom uses. You need to change this like so:
As root, edit <pre>/etc/postgresql/8.1/main/postgresql.conf</pre> (In Ubuntu Dapper, using sudo) or <pre>/etc/postgresql/7.4/main/postgresql.conf</pre> (In Ubuntu Breezy, using sudo) or <pre>/var/lib/pgsql/data/postgresql.conf</pre> (In Fedora Core.) Note that FC3 and FC4 have Postgres 7.4. FC5 has Postgres 8.1.
If you have postgres >=8.1
Add this line, replacing (or commenting-out) any previous settings for listen_addresses <pre> listen_addresses = '*' </pre>
The default, which is also often on a commented-out line, when you don't set listen_addresses, is <pre> listen_addresses = 'localhost' </pre> but this does not allow connections from other computers.
(The tcpip_socket variable from postgres 7.4 is not recognized with postgres 8.1.)
If you have postgres 7.4
- tcpip_socket = false
</pre> to <pre> tcpip_socket = true </pre>
As root, edit <pre>/etc/postgresql/8.1/main/pg_hba.conf</pre> (In Ubuntu Dapper, using sudo) or <pre>/etc/postgresql/7.4/main/pg_hba.conf</pre> (In Ubuntu Breezy, using sudo) or <pre>/var/lib/pgsql/data/pg_hba.conf</pre> (on Fedora Core)
Add this host line, before any other uncommented host lines:
- Allow any IP to connect, with a password:
host all all 0.0.0.0 0.0.0.0 md5 </pre> (I think the gaps can be either tabs or spaces.)
Now, restart the Postgres server. The easiest way to do this is to restart your computer.
Useful test tools