PostgreSQL 8.1 + phppgadmin on Debian mini-HOWTO

The default installation of PostgreSQL in Debian etch is not yet well configured, and so not suitable to work with phppgadmin, too. This simple mini-HOWTO will guide you though those critical but minor procedures, which will let all of your PostgreSQL functioning within 5 min :)

Install required packages

apt-get update
apt-get install postgresql-8.1 postgresql-client-8.1 postgresql-doc-8.1 phppgadmin php5-pgsql libapache2-mod-php5

First test with PostgreSQL

Login pgsql console as user "postgres":

localhost:~# su
localhost:~# su - postgres
postgres@localhost:~$ psql template1
Welcome to psql 8.1.9, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

template1=#

Update pgsql user "postgres" password (required by phppgadmin):

template1=# ALTER USER postgres PASSWORD 'passwd';
ALTER ROLE
template1=# \q
postgres@localhost:~$

Create pgsql user "root" with database "AL32UTF8", with basic login:

localhost:~# su
localhost:~# su - postgres
postgres@localhost:~$ createuser -DRS root
CREATE ROLE
postgres@localhost:~$ createdb -O root AL32UTF8
CREATE DATABASE
postgres@localhost:~$ psql template1
Welcome to psql 8.1.9, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

template1=# ALTER USER root PASSWORD 'passwd';
ALTER ROLE
template1=# \q
postgres@localhost:~$ psql AL32UTF8
Welcome to psql 8.1.9, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

AL32UTF8=# \q
postgres@localhost:~$ exit
logout
localhost:~# psql AL32UTF8
Password:
Welcome to psql 8.1.9, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

AL32UTF8=> \q
localhost:~#

Configure and working with phppgadmin

Edit /etc/phppgadmin/config.inc.php, change the following line from:

$conf['extra_login_security'] = true;

into:
$conf['extra_login_security'] = false;

in order to allow root/postgres user login from phppgadmin.

Create symbolic link for phppgadmin web access:

localhost:~# ln -s /usr/share/phppgadmin /var/www/

Access http://localhost/phppgadmin, login as root or postgres, enjoy your newly installed PostgreSQL server :)


Thanks!

blaze's picture

Thanks!

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <h1> <h2> <h3> <h4> <h5> <h6> <em> <strong> <code> <del> <blockquote> <q> <sub> <p> <br> <ul> <ol> <li> <dl> <dt> <dd> <a> <b> <u> <i> <sup> <acronym> <pre> <img>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Images can be added to this post.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.