0
À l'étude

Support for Postgres array data types

Phil Constantinou il y a 6 ans mis à jour par Mariusz Zakrzewski il y a 6 ans 1

How should I handle array data types from Postgres 9.2 in Vertabelo. 

- Can I declare them visually?

- Can I create indexes on them?

- If not, is there a workaround.

À l'étude

Hi,

Simply input the desired data type in form - e.g. 'integer[]'. Yes, you can create an index on them - the same as on any other column. 

Resulting DDL is:

CREATE TABLE sample_table (
   id int  NOT NULL,
   sample_column integer[]  NOT NULL,
   CONSTRAINT sample_table_pk PRIMARY KEY (id)
);
CREATE INDEX sample_table_idx_1 on sample_table (sample_column ASC);