insertion of nested array of custom in table for postgres
问题 command = ( CREATE TYPE belongings AS ( item TEXT, quantity INTEGER ) CREATE TYPE student AS ( name TEXT, id INTEGER, bag belongings[] ) CREATE TABLE studentclass( date DATE NOT NULL, time TIMESTAMPTZ NOT NULL, PRIMARY KEY (date, time), class student ) ) Can i ask how to do insert for this in postgres psycog2? thank you. When i put the insert as insert_sql = "INSERT INTO studentclass (date, time, class) VALUES (%s,%s,%s)" error output is DETAIL: Cannot cast type text[] to belongings[] in