Skip to main content

Design PostgreSQL Table Structures

NineData provides a visual table designer in SQL Console. Create PostgreSQL tables, configure columns, indexes, foreign keys, constraints, and partitions, and review the generated SQL before saving the change.

Before you begin

  • The data source type is PostgreSQL.

  • In organization mode, you have the permission for the SQL Console function module.

  • In organization mode, you have read and write permissions for the target data source.

    tip

    If you do not have these permissions, contact your organization administrator to configure permissions or bind roles.

  • In the commercial versions (DevOps Pro, DevOps Enterprise), make sure your monthly or yearly subscription has not expired. An expired subscription may prevent you from using the Database DevOps service. Check the remaining quota and expiration date in the NineData Console header.

    check_quota

Procedure

Design the table structure when you create or edit a table in SQL Console. This procedure uses table creation as the example.

  1. Open SQL Console and go to the target data source.

  2. In the SQL Console database tree, right-click the target database, schema, or data table, and click Create Table.

    tip

    The object you right-click determines the default table location:

    • Database: NineData creates the table in the public schema by default.
    • Schema: NineData creates the table in this schema by default.
    • Data table: NineData creates the table in the schema that contains this table by default.
  3. In the Create Table tab, configure the table structure. NineData generates SQL Script at the bottom of the page based on your configuration. Use the tabs below to review the available settings.

  • Name: Enter a custom table name.
  • Database: Select the database where the table is created.
  • Schema: Select the schema where the table is created.
  • Comment: Add a table comment.
  1. Click Save, and in the Submit window, click OK.

    tip

    Alternatively, copy the SQL script and run it in another database client.

Result

NineData creates the PostgreSQL table and keeps the generated SQL script available for review or reuse.

Next steps

  • Review the generated SQL script before you run the change in production.
  • Open the table in SQL Console and confirm that columns, indexes, constraints, and partition settings match your design.