root / pykota / trunk / initscripts / postgresql / README.postgresql @ 2823

Revision 2817, 6.5 kB (checked in by jerome, 19 years ago)

Improved documentation for PostgreSQL and MySQL backends setup.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1# $Id$
2
3PyKota - Print Quotas for CUPS and LPRng
4
5(c) 2003, 2004, 2005, 2006 Jerome Alet <alet@librelogiciel.com>
6This program is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2 of the License, or
9(at your option) any later version.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with this program; if not, write to the Free Software
18Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
20============================================================
21
22Documentation for the pykota-postgresql.sql script :
23----------------------------------------------------
24
25This script is to be used to create an empty Quota Storage
26DataBase using PostgreSQL as a backend.
27
28If you have already installed PyKota, and have datas in your
29Quota Storage DataBase, you may prefer to skip this section
30and read the next one.
31
32        - edit the pykota-postgresql.sql file and modify the passwords on
33          the 'CREATE USER' lines.
34         
35        - Launch the psql frontend and connect to the
36          database template1 as a PostgreSQL administrator
37          (i.e. the postgres user) :
38         
39          as user 'root' :
40         
41            # su - postgres
42           
43          you're now user 'postgres', then continue with :   
44         
45            $ psql -h localhost -U postgres -f pykota-postgresql.sql template1
46         
47        - If no error message appears, your PostgreSQL PyKota storage
48          is now ready for use. NB : a lot of NOTICE messages might appear,
49          this is perfectly normal.
50         
51        - In ~pykota/pykota.conf, ensure that the following lines
52          are present and unique inside the [global] section :
53       
54            storagebackend : pgstorage
55            storageserver : localhost
56            storagename : pykota
57            storageuser : pykotauser
58            storageuserpw : readonlypw
59           
60            NB : replace 'readonlypw' with the password you chose
61            for user 'pykotauser' when you modified pykota-postgresql.sql
62           
63        - In ~pykota/pykotadmin.conf ensure that the following lines
64          are present and unique inside the [global] section :
65       
66            storageadmin : pykotaadmin
67            storageadminpw : readwritepw
68           
69            NB : replace 'readwritepw' with the password you chose
70            for user 'pykotaadmin' when you modified pykota-postgresql.sql
71       
72        - IMPORTANT : if your database is not located on the print server,
73          replace 'localhost' in the lines above with your database server's
74          hostname or IP address. If your database server doesn't listen on
75          its standard port, add the port number at the end of the hostname
76          with a colon to separate the hostname from the port.
77          See pykota/conf/pykota.conf.sample for examples.
78         
79============================================================
80
81Upgrade scripts :
82
83  DON'T DO ANYTHING IF THIS IS YOUR FIRST INSTALLATION
84  OF PYKOTA.
85
86  Some scripts to upgrade old PyKota databases to the new
87  database schema are included. You may have to run all
88  of them or only some of them, depending on your
89  version of PyKota. Usually running them several times, for
90  example if you used several different development versions
91  of PyKota, won't do any harm.
92 
93  If you're connected as user 'root', you have to be user 'postgres'
94  instead :
95         
96            # su - postgres
97           
98  You're now user 'postgres', then continue the upgrade by following
99  the instructions below, depending on the version you actually use :
100 
101  * An SQL script to upgrade a 1.22 PyKota Storage DataBase to
102    1.23 is included. Launch it this way on the Quota Storage Server :
103   
104        $ psql -U postgres pykota
105        pykota=# \i upgrade-to-1.23.sql
106        pykota=# \q
107        $
108       
109    This script adds many fields to existing tables, and a table to
110    manage billing codes.
111   
112  * An SQL script to upgrade a 1.20 PyKota Storage DataBase to
113    1.21 is included. Launch it this way on the Quota Storage Server :
114   
115        $ psql -U postgres pykota
116        pykota=# \i upgrade-to-1.21.sql
117        pykota=# \q
118        $
119       
120    This script adds many fields to existing tables, and also adds
121    some tables in indexes.
122   
123  * An SQL script to upgrade a 1.18 PyKota Storage DataBase to
124    1.19 is included. Launch it this way on the Quota Storage Server :
125   
126        $ psql -U postgres pykota
127        pykota=# \i upgrade-to-1.19.sql
128        pykota=# \q
129        $
130       
131    This script adds a field to the print job history. The field that
132    is added is : hostname
133   
134  * An SQL script to upgrade a pre-1.16 PyKota Storage DataBase to
135    1.16 is included. Launch it this way on the Quota Storage Server :
136   
137        $ psql -U postgres pykota
138        pykota=# \i upgrade-to-1.16.sql
139        pykota=# \q
140        $
141       
142    This script adds some fields to the print job history, so that
143    more complete information will be known. The fields that
144    are added are : jobprice, filename, title, copies and print
145    command options. Also some indexes are created to speed things up.
146 
147What is below is for historical reasons only, real people don't use 
148such old beasts, and YOU SHOULDN'T EITHER !
149
150  * An SQL script to upgrade a pre-1.14 PyKota Storage DataBase to
151    1.14 is included. Launch it this way on the Quota Storage Server :
152   
153        $ psql -U postgres pykota
154        pykota=# \i upgrade-to-1.14.sql
155        pykota=# \q
156        $
157       
158    This script adds an "email" field for each user. This field, if not   
159    NULL, is used as the email address of the user when sending warning
160    messages in case he is over quota.
161   
162  * An sql script to upgrade a pre-1.01 PyKota Quota Storage DataBase to
163    1.01 is still included for historical reasons. PLEASE DON'T USE IT !
164 
165  * If you are already running an old version of PyKota (<1.03) and
166    want to upgrade to 1.03, YOU HAVE TO RUN the
167    upgrade-from-before-1.03.py shell script. NOT LAUNCHING THIS SCRIPT
168    WILL CAUSE PYKOTA TO STOP WORKING ! PLEASE NEVER RUN THIS SCRIPT IF
169    YOUR EXISTING VERSION OF PYKOTA IS ALREADY 1.03 OR HIGHER.
Note: See TracBrowser for help on using the browser.