Creating and Dropping Tables

Use the standard PostgreSQL commands to create and drop tables in Hyperstage, the same as you would with a PostgreSQL table. For detailed syntax information, see the PostgreSQL 9.2 Documentation.

Important: Do not manually copy a data table from one database to another by copying the database files. Internal table numbering errors and Knowledge Grid inconsistencies may occur. To copy a table from one database to another, export from the source database and then import into the target database (see Importing and Exporting Data in Hyperstage) or back up the entire database directory (see Hyperstage Backup and Recovery). You can rename the entire database by renaming the folder. However, you should not copy a database folder from one active instance to another, or within the same active instance.

To create a table, enter the following command:

psql> create table <table_name> (<column(s)>) with (ENGINE=INFOBRIGHT);
  • 'with (ENGINE=INFOBRIGHT)' syntax is necessary when creating tables manually, to specify that the table will be stored as part of the Hyperstage-specific Infobright engine. Without this syntax, the table will be created and stored as a regular PostgreSQL table.
  • When creating a table, as a matter of practice, you should always use the ENGINE= option to ensure that the correct database engine is used. Hyperstage is shipped with DEFAULT ENGINE=INFOBRIGHT, but this can be changed. The name of the engine can be specified explicitly at the end of the create table statement.

To drop a table, enter the following command:

psql> drop table table_name;

For information on supported and unsupported options when creating columns, see About Column Options.