Notes about PostgreSQL: Difference between revisions

From OpenPetra Wiki
Jump to navigation Jump to search
m (1 revision)
 
Line 1: Line 1:
== installation ==
== installation ==
=== Windows ===
== Windows ==
* see http://www.postgresql.org/download/windows for current version
* see http://www.postgresql.org/download/windows for current version
* eg. http://wwwmaster.postgresql.org/download/mirrors-ftp/binary/v8.3.7/win32/postgresql-8.3.7-1.zip
* eg. http://wwwmaster.postgresql.org/download/mirrors-ftp/binary/v8.3.7/win32/postgresql-8.3.7-1.zip
Line 15: Line 15:
  nant recreateDatabase
  nant recreateDatabase
  nant resetDatabase
  nant resetDatabase
== Some notes ==
* drop database but tables are still there when creating the database again: [http://bytes.com/groups/postgresql/423960-drop-database-but-still-there]; 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; [http://archives.postgresql.org/pgsql-novice/2004-08/msg00272.php]

Revision as of 15:05, 24 July 2009

installation

Windows

  • don't install as a service
initdb
"postgres" -D "petra"
psql 
 CREATE USER tom WITH PASSWORD 'myPassword';
nant createSQLStatements
nant recreateDatabase
nant resetDatabase

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]