Come posso inserire uno array of enums
?
Ecco il mio enum
:INSERIMENTO PostgreSQL in una serie di enumerazioni
CREATE TYPE equipment AS ENUM ('projector','PAsystem','safe','PC','phone');
Poi il mio tavolo ha una serie di attrezzature:
CREATE TABLE lecture_room (
id INTEGER DEFAULT NEXTVAL('lecture_id_seq')
, seatCount int
, equipment equipment[]
) INHERITS(venue);
Ecco il mio tentativo di inserire:
INSERT INTO lecture_room (building_code, floorNo, roomNo, length, width
, seatCount, equipment)
VALUES
('IT', 4, 2, 10, 15 ,120, ARRAY['projector','PAsystem','safe']),
Ma mi dà il seguente errore:
ERROR: column "equipment" is of type equipment[] but expression is of type text[] SQL state: 42804 Hint: You will need to rewrite or cast the expression.