Notes about PostgreSQL: Difference between revisions

From OpenPetra Wiki
Jump to navigation Jump to search
Line 20: Line 20:
  nant recreateDatabase
  nant recreateDatabase
  nant resetDatabase
  nant resetDatabase
== Linux ==
* if you get this error message when starting the OpenPetra server:
** <code>no pg_hba.conf entry for host "xx.yyy.zz.xx", user "petraserver", database "openpetra", SSL off</code>
** solution: add to file <code>/etc/postgresql/8.3/main/pg_hba.conf</code>: <code>host  openpetra  petraserver  xx.yyy.zz.xx/0  md5</code>


== Some notes ==
== Some notes ==

Revision as of 07:10, 14 April 2010

installation

Windows

  • don't install as a service
initdb
"postgres" -D "petra"
psql 
 CREATE USER tom WITH PASSWORD 'myPassword';
You might want to set the environment variables before creating the database:
set PGUSER=postgres
set PGPASSWORD=myPassword
or alternatively, write the file pgpass.conf; see http://www.postgresql.org/docs/8.0/interactive/libpq-pgpass.html
nant recreateDatabase
nant resetDatabase

Linux

  • if you get this error message when starting the OpenPetra server:
    • no pg_hba.conf entry for host "xx.yyy.zz.xx", user "petraserver", database "openpetra", SSL off
    • solution: add to file /etc/postgresql/8.3/main/pg_hba.conf: host openpetra petraserver xx.yyy.zz.xx/0 md5

Some notes

  • drop database but tables are still there when creating the database again: [1]; reason: tables are in template1 db, and that is used as a template for creating the new database
  • drop all tables in db: DROP SCHEMA public CASCADE; [2]
    • you should create a new schema public again (especially if this is the template1 db): CREATE SCHEMA public;