1. Install Database Application

    Version      : 9.6 or later
    Characterset : UTF8

    *Please create Tablespace depending on your environment and situation.

       Tablespace for tables
       Tablespace for indexes

    *Version 12 or later is required for using partitions.
     Partitioning in version 11 has performance problems.

2. Create users

   Execute below command by postgres user using psql.

    (1) Create user for application

        create user mtpusr with password 'mtpusr';

    (2) Create admin user

        create user mtpadm with password 'mtpadm' createdb createrole;

3. Create Database

    Execute below command by mtpadm user using psql.

     create database mtdb with encoding 'utf8';

3. Create tables, sequences and triggers

   We have some kinds of DDL according to use.

     Use RDB native partition : postgresql_partition
     Use Pseudo-Partition : postgresql_pseudo or postgresql_pseudo_128
     Not use partition : postgresql

   Connect to mtdb database and execute CREATE_TABLE.ddl in the folder for PostgreSQL.

    *If you make the Tablespaces for indexes,
     please modify the DDL to use that tablespaces.

4. Give the authority to application user

   Execute the commands made by below select commands by mtpadm user.

   <Grant to application user>
    select 'grant select,insert,update,delete on ' || tablename  || ' to mtpusr;' from pg_tables where tableowner = 'mtpadm';
    select 'grant usage on ' || c.relname || ' to mtpusr;' from pg_class c LEFT join pg_user u ON c.relowner = u.usesysid WHERE c.relkind = 'S' order by c.relname;

