Skip to main content
To create a database manually:
  1. Create a blank database.
  1. Use the standard psql client to connect to the PostgreSQL server using an account with CREATEDB+CREATEROLE or SUPERUSER privileges:
psql -h srvname -U postgres
  1. Create a user account with a predefined password and the right to log in to the PostgreSQL server:
CREATE ROLE rolename WITH ENCRYPTED PASSWORD 'rolepwd' LOGIN;
Note: Here and subsequent steps, rolename=“user_name”
  1. Create a new database:
CREATE DATABASE dbname;
Note: Here and subsequent steps, dbname=“database_name”
  1. Grant the user the rights to connect to the database and to create temporary tables:
GRANT CONNECT, TEMPORARY ON DATABASE dbname TO rolename;
  1. Prioritize the fc schema over the public schema:
ALTER DATABASE dbname SET search_path = "$user", fc, public;
  1. Connect to the newly created database:
\c dbname
  1. Create an fc schema and specify the user you have created as its owner:
CREATE SCHEMA fc AUTHORIZATION rolename;
  1. Create an ltree extension in the database:
CREATE EXTENSION IF NOT EXISTS ltree;
  1. Disconnect from the PostgreSQL server.
Important! Any subsequent manipulations with PostgreSQL database must be carried out under this user account.
  1. For an SQL database, run the Description.sql script.
    For an Oracle database, run the Description_Oracle.sql script.
    For a PostgreSQL database, run the Description_PostgreSQL.sql script.
    Note: By default, the scripts are placed into the C:\inetpub\wwwroot\FlexiCapture12\Server folder on the computer where the Application Server is installed.
  2. For an SQL database, run the DBInitFill.sql script.
    For an Oracle database, run the DBInitFill_Oracle.sql script.
    For a PostgreSQL database, run the DBInitFill_PostgreSQL.sql script.
    Note: By default, the scripts are placed into the C:\inetpub\wwwroot\FlexiCapture12\Server folder on the computer where the Application Server is installed.
  3. Provide a unique identifier for the database:
INSERT INTO dbo.Settings( Name, Value, ProjectId, BatchTypeId, UserId, Workstation, RoleId, ProcessingStage) VALUES (‘DatabaseGUID’, NEWID(), NULL, NULL, NULL, NULL, NULL, NULL ) For a PostgreSQL database: INSERT INTO Settings (Name, Value) VALUES (‘DatabaseGUID’, upper(md5(clock_timestamp()::text)::uuid::text));
  1. Add the first user:
INSERT INTO principal (Name, FullName, EMail, PasswordHash, PasswordReset) values (N’Login’, N’FullName’, N’email’, ”, 0) For a PostgreSQL database: INSERT INTO Principal (Name, FullName, Email, PasswordHash, PasswordReset) values (‘Login’, ‘FullName’, ‘email’, ”, false); where
  • Login is the login that the user will use,
    Important! You must specify the login of the Windows user that will be used to open the Administration and Monitoring Console when connecting to the database.
  • FullName is the full name of the user as displayed in their profile, and
  • Email is the user’s e-mail address.
  1. Specify the system administrator roles for the newly created user:
INSERT INTO principalpermission (PrincipalId, RoleType, IsAllowed) values (1, 10, 1); For a PostgreSQL database: INSERT INTO principalpermission (PrincipalId, RoleType, IsAllowed) values (1, 10, true);
  1. Connect to the newly created database using the Administration and Monitoring Console.
SQL database users For details about user permissions, see Permissions required for creating and configuring a Microsoft SQL database.