Configuring the database in POSTGRESQL
The steps to install the database of thee-Estudo in POSTGRESQL are the following
- To create a group with the name ´x´;
- To create a user that will be the administrator of the e-Estudo and put it in the group ´x´;
- To create a database where the objects of the e-Estudo system will be placed; the proprietor should be the user created in the previous stage;
CREATE DATABASE "
CREATE DATABASE "<name of the database> "
ENCODING = 'LATIN1'
TABLESPACE = pg_default;
- If the language plpgsql is not present in the database, you should install it through the following command in Linux:
# createlang plpgsql
or, through the commands SQL
CREATE FUNCTION plpgsql_call_handler() RETURNS language_handler AS
'$libdir/plpgsql' LANGUAGE C;
CREATE FUNCTION plpgsql_validator(oid) RETURNS void AS
'$libdir/plpgsql' LANGUAGE C;
CREATE TRUSTED PROCEDURAL LANGUAGE plpgsql
HANDLER plpgsql_call_handler
VALIDATOR plpgsql_validator;
in the database that it created.
IMPORTANT:
a) The scripts below were tested in version 8.0.3 of POSTGRESQL. Mistakes may occur in case the version used is different.
b) Execute the scripts below loging with the user's name that was created above
- Execute the script ´e-Estudo/scripts/sistema.sql´ in the database created previously to create the basic tables used by the e-Estudo
- Optional: In case you want to install the REGISTRATION program Of the e-Estudo, execute the script ´e-estudo/scripts/cadastro.sql´ in the database created in the previous stage;
- Execute the script ´e-estudo/scripts/diario.sql´ in the database created previously to generate the objects of the class schedule;
- Modify the permissions of the database that created previously and all the objects giving access to the group ´x´;