THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
Panel | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
|
Homepage: | http://www.postgresql.org/![]() |
Download: | http://www.postgresql.org/download/![]() |
File(s): | postgresql-8.4.1-1-windows.exe (39 MB) |
...
Per default PostgreSQL is running on port 5432.
Trusted connections for all users only from localhost
To allow trusted connections for all users only from localhost:
Windows:
Code Block | ||||
---|---|---|---|---|
| ||||
$ psql -U postgres -d template1 -c "GRANT ALL PRIVILEGES ON DATABASE pg_liferay to pg_liferay;"
GRANT
$
|
Restart the service ("Restart Server").
Usage
Windows:
- You can connect to the database with the pgAdmin tool (Start - Programs - PostgreSQL 8.4 - pgAdmin III)
- Use psql command shell.
Create a new user
Create an user with password for e.g. Liferay Portal usage:
Code Block | ||||
---|---|---|---|---|
| ||||
$ psql -U postgres -c "CREATE USER pg_liferay WITH PASSWORD 'life1ray2' CREATEDB" CREATE ROLE $ ... # IPv4 local connections: #host all all 127.0.0.1/32 md5 host all all 127.0.0.1/32 trust ... |
Create a new database
Create e.g. database pg_liferay for Liferay Portal usage:
...
Code Block | ||||
---|---|---|---|---|
| ||||
$ psql -U postgres -d template1 -c "GRANT ALL PRIVILEGES ON DATABASE pg_liferay to pg_liferay;"
GRANT
$
|
Connect to a database
Code Block | ||||
---|---|---|---|---|
| ||||
$ psql -d pg_liferay -U pg_liferay -W
...
pg_liferay=>
|
psql usage
Code Block | ||||
---|---|---|---|---|
| ||||
$ psql -d pg_liferay -U pg_liferay -W Passwort für Benutzer pg_liferay: psql (8.4.1) Warnung: Konsolencodeseite (437) unterscheidet sich von der Windows- Codeseite (1252). 8-Bit-Zeichen funktionieren möglicherweise nicht richtig. Einzelheiten finden Sie auf der psql-Handbuchseite unter »Notes for Windows users«. Geben Sie »help« für Hilfe ein. pg_liferay=> help Dies ist psql, die Kommandozeilenschnittstelle für PostgreSQL. Geben Sie ein: \copyright für Urheberrechtsinformationen \h für Hilfe über SQL-Anweisungen \? für Hilfe über interne Anweisungen \g oder Semikolon, um eine Anfrage auszuführen \q um zu beenden pg_liferay=> |
- show all databases: pg_liferay=> \l
- change database: pg_liferay=> \connect otherdatabasename
- show all tables of a database: pg_liferay=> \dt
- exit: pg_liferay=> \q