Collapse AllExpand All

6.4. Initialize PostgreSQL for xTuple

To initialize PostgreSQL for xTuple (i.e., add the superuser admin and the group xtrole), you need to create the user 'admin' and the group xtrole on your PostgreSQL instance.

This is accomplished by executing the init.sql script. You can download init.sql from the xTuple project on GitHub.

The complete text of the init.sql file is as follows:

--
-- Create the database roles that xTuple software needs for bootstrapping
--

CREATE ROLE xtrole WITH NOLOGIN;

CREATE ROLE admin WITH PASSWORD 'admin'
                       SUPERUSER
                       CREATEDB
                       CREATEROLE
                       LOGIN
                       IN ROLE xtrole;

If you are initializing the database server instance from the command line, the init.sql script must be loaded by the postgres superuser. This is not required if you are using pgAdmin to initialize the database server.

Please also note that since the default password the admin user is 'admin', you'll want to change it. You may create a different admin user with a different name if you choose to. However, do this with caution as all documentation examples refer to the default admin user.