मैं 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.