5.10. Schemas #

This section explains how to manage schemas. It contains the following instructions:

Creating a Schema

  1. In the navigation panel, go to Databases.

  2. (Optional) To display system databases, turn on Show system databases.

  3. Click the name of the database.

  4. In the top-right corner of the page, click Create schema.

  5. Enter parameters of the new schema (parameters marked with an asterisk are required):

    • Name.

    • Owner.

    • lock_timeout, s: Abort any statement that waits longer than the specified time while attempting to acquire a lock on a table, index, row, or other database object. The time limit applies separately to each lock acquisition attempt.

      For more information about this parameter, refer to the official Postgres Pro documentation.

  6. Click Create.

Viewing Schemas

  1. In the navigation panel, go to Databases.

  2. (Optional) To display system databases, turn on Show system databases.

  3. Click the name of the database.

The table of schemas with the following columns will be displayed:

  • Schemas: The unique name of the schema.

  • Total size.

    The horizontal indicator displays the size of tables, bloat, and indexes.

  • Owner.

  • Tables:

    • the number of tables

    • the size of tables

    • the table bloat percentage

  • Indexes:

    • the number of indexes

    • the size of indexes

    • the index bloat percentage

  • Actions.

    For more information about available actions, refer to other instructions in this section.

The size of the schema objects is calculated as the total sum of all its relational objects.

Important

If a schema is created outside PPEM, the information about it can be displayed in the web application with a delay. The delay duration depends on the agent configuration. By default, it is one minute.

Editing a Schema

  1. In the navigation panel, go to Databases.

  2. (Optional) To display system databases, turn on Show system databases.

  3. Click the name of the database.

  4. Click Edit next to the schema.

  5. Edit schema parameters.

  6. Click Save.

Deleting a Schema

The DROP SCHEMA SQL command is executed when deleting a schema.

Important

Deleted schemas cannot be restored.

To delete a schema:

  1. In the navigation panel, go to Databases.

  2. (Optional) To display system databases, turn on Show system databases.

  3. Click the name of the database.

  4. Click Delete next to the schema.

  5. (Optional) To delete all dependent objects of the schema, turn on Cascade deletion.

  6. Click Delete.

  7. Confirm the operation.