3
.. i18n: single: Installation; PostgreSQL (Windows)
4
.. i18n: single: PostgreSQL; Installation (Windows)
9
single: Installation; PostgreSQL (Windows)
10
single: PostgreSQL; Installation (Windows)
13
.. i18n: .. _installation-windows-postgresql-server:
15
.. i18n: PostgreSQL Server Installation and Configuration
16
.. i18n: ================================================
19
.. _installation-windows-postgresql-server:
21
PostgreSQL Server Installation and Configuration
22
================================================
24
.. i18n: In this chapter, you will see how to configure PostgreSQL for its use with OpenERP. The following procedure is well-tested on PostgreSQL v9.0.
27
In this chapter, you will see how to configure PostgreSQL for its use with OpenERP. The following procedure is well-tested on PostgreSQL v9.0.
29
.. i18n: Installing PostgreSQL Server
30
.. i18n: ----------------------------
33
Installing PostgreSQL Server
34
----------------------------
36
.. i18n: You can download the Windows installer from
37
.. i18n: the `PostgreSQL download page <http://www.postgresql.org/download/windows>`__
40
You can download the Windows installer from
41
the `PostgreSQL download page <http://www.postgresql.org/download/windows>`__
43
.. i18n: Depending on your need, choose either the *One Click Installer* or the
44
.. i18n: *pgInstaller* and run the executable you have just downloaded.
47
Depending on your need, choose either the *One Click Installer* or the
48
*pgInstaller* and run the executable you have just downloaded.
51
.. i18n: single: PostgreSQL; setup a user (Windows)
52
.. i18n: single: PostgreSQL; setup a database (Windows)
57
single: PostgreSQL; setup a user (Windows)
58
single: PostgreSQL; setup a database (Windows)
61
.. i18n: Setup a PostgreSQL User
62
.. i18n: -----------------------
65
Setup a PostgreSQL User
66
-----------------------
68
.. i18n: When the required software installations are complete, you must create a
69
.. i18n: PostgreSQL user. OpenERP will use this user to connect to PostgreSQL.
72
When the required software installations are complete, you must create a
73
PostgreSQL user. OpenERP will use this user to connect to PostgreSQL.
82
.. i18n: Start a Windows console (run the ``cmd`` command in the *Search programs and files* text box of the *Start* menu).
85
Start a Windows console (run the ``cmd`` command in the *Search programs and files* text box of the *Start* menu).
87
.. i18n: Change the directory to the *PostgreSQL* ``bin`` directory
88
.. i18n: (e.g. ``C:\Program Files\PostgreSQL\9.0\bin``) or add this directory to
89
.. i18n: your *PATH* environment variable.
92
Change the directory to the *PostgreSQL* ``bin`` directory
93
(e.g. ``C:\Program Files\PostgreSQL\9.0\bin``) or add this directory to
94
your *PATH* environment variable.
96
.. i18n: The default superuser for PostgreSQL is called *postgres*. The password was
97
.. i18n: chosen during the PostgreSQL installation.
100
The default superuser for PostgreSQL is called *postgres*. The password was
101
chosen during the PostgreSQL installation.
103
.. i18n: In your Windows console, type::
105
.. i18n: C:\Program Files\PostgreSQL\9.0\bin>createuser.exe --createdb --username postgres --no-createrole --pwprompt openpg
106
.. i18n: Enter password for new role: openpgpwd
107
.. i18n: Enter it again: openpgpwd
108
.. i18n: Shall the new role be a superuser? (y/n) y
109
.. i18n: Password: XXXXXXXXXX
111
.. i18n: * line 1 is the command itself
112
.. i18n: * line 2 asks you the new user's password
113
.. i18n: * line 3 asks you to confirm the new user's password
114
.. i18n: * line 4 new role is superuser or not?
115
.. i18n: * line 5 asks you the *postgres* user's password
118
In your Windows console, type::
120
C:\Program Files\PostgreSQL\9.0\bin>createuser.exe --createdb --username postgres --no-createrole --pwprompt openpg
121
Enter password for new role: openpgpwd
122
Enter it again: openpgpwd
123
Shall the new role be a superuser? (y/n) y
126
* line 1 is the command itself
127
* line 2 asks you the new user's password
128
* line 3 asks you to confirm the new user's password
129
* line 4 new role is superuser or not?
130
* line 5 asks you the *postgres* user's password
132
.. i18n: Option explanations:
137
.. i18n: * ``--createdb`` : the new user will be able to create new databases
138
.. i18n: * ``--username postgres`` : *createuser* will use the *postgres* user (superuser)
139
.. i18n: * ``--no-createrole`` : the new user will not be able to create new users
140
.. i18n: * ``--pwprompt`` : *createuser* will ask you the new user's password
141
.. i18n: * ``openpg`` : the new user's name. Alternatively, you may specify a different username.
142
.. i18n: * ``openpgpwd`` : the new user's password. Alternatively, you may specify a different password.
145
* ``--createdb`` : the new user will be able to create new databases
146
* ``--username postgres`` : *createuser* will use the *postgres* user (superuser)
147
* ``--no-createrole`` : the new user will not be able to create new users
148
* ``--pwprompt`` : *createuser* will ask you the new user's password
149
* ``openpg`` : the new user's name. Alternatively, you may specify a different username.
150
* ``openpgpwd`` : the new user's password. Alternatively, you may specify a different password.
152
.. i18n: .. note:: Password
154
.. i18n: In OpenERP v6, ``openpg`` and ``openpgpwd`` are the default username and password used during the OpenERP Server installation. If you plan to change these defaults for the server, or have already installed the server with different values, you have to use those user configuration values when you create a PostgreSQL user for OpenERP.
156
.. i18n: Now use *pgAdmin III* to create database "openerpdemo" with owner "openpg"::
158
.. i18n: CREATE DATABASE openerpdemo WITH OWNER = openpg ENCODING = 'UTF8';
159
.. i18n: COMMENT ON DATABASE openerpdemo IS 'OpenERP Demo DB';
161
.. i18n: If you have installed the OpenERP Server, you can start it now. If needed, you can override the server configuration by starting the server at a Windows console and specifying command-line options. For more on this, refer the section :ref:`sect-custconf`.
166
In OpenERP v6, ``openpg`` and ``openpgpwd`` are the default username and password used during the OpenERP Server installation. If you plan to change these defaults for the server, or have already installed the server with different values, you have to use those user configuration values when you create a PostgreSQL user for OpenERP.
168
Now use *pgAdmin III* to create database "openerpdemo" with owner "openpg"::
170
CREATE DATABASE openerpdemo WITH OWNER = openpg ENCODING = 'UTF8';
171
COMMENT ON DATABASE openerpdemo IS 'OpenERP Demo DB';
173
If you have installed the OpenERP Server, you can start it now. If needed, you can override the server configuration by starting the server at a Windows console and specifying command-line options. For more on this, refer the section :ref:`sect-custconf`.
175
.. i18n: To change a user's password in any Windows version, execute the following::
177
.. i18n: net user <accountname> <newpassword>
178
.. i18n: e.g. net user postgres postgres
181
To change a user's password in any Windows version, execute the following::
183
net user <accountname> <newpassword>
184
e.g. net user postgres postgres
186
.. i18n: If it is a domain account, just add "/DOMAIN" at the end.
189
If it is a domain account, just add "/DOMAIN" at the end.
191
.. i18n: If you want to delete it, just execute::
193
.. i18n: net user <accountname> /delete
196
If you want to delete it, just execute::
198
net user <accountname> /delete
200
.. i18n: Case-Insensitive Search Issue
201
.. i18n: +++++++++++++++++++++++++++++
204
Case-Insensitive Search Issue
205
+++++++++++++++++++++++++++++
207
.. i18n: For an installation which needs full UTF8 character support, consider using
208
.. i18n: postgres >= 8.2.x. Using versions prior to this, OpenERP search will not return the
209
.. i18n: expected results for case-insensitive searches, which are used for searching
210
.. i18n: partners, products etc.
213
For an installation which needs full UTF8 character support, consider using
214
postgres >= 8.2.x. Using versions prior to this, OpenERP search will not return the
215
expected results for case-insensitive searches, which are used for searching
216
partners, products etc.
220
.. i18n: SELECT 'x' FROM my_table WHERE 'bét' ilike 'BÉT'
221
.. i18n: --matches only in 8.2.x
226
SELECT 'x' FROM my_table WHERE 'bét' ilike 'BÉT'
227
--matches only in 8.2.x