どうすれば挿入できarray of enums
ますか?
これが私のものenum
です:
CREATE TYPE equipment AS ENUM ('projector','PAsystem','safe','PC','phone');
次に、私のテーブルには一連の機器があります。
CREATE TABLE lecture_room (
id INTEGER DEFAULT NEXTVAL('lecture_id_seq')
, seatCount int
, equipment equipment[]
) INHERITS(venue);
これが私のINSERTへの試みです:
INSERT INTO lecture_room (building_code, floorNo, roomNo, length, width
, seatCount, equipment)
VALUES
('IT', 4, 2, 10, 15 ,120, ARRAY['projector','PAsystem','safe']),
しかし、それは私に次のエラーを与えます:
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.