CREATE TYPE mpaa_rating AS ENUM (
'G',
'PG',
'PG-13'
);
CREATE TABLE film (
film_id integer DEFAULT nextval('film_film_id_seq'::regclass) NOT NULL,
rating mpaa_rating DEFAULT 'G'::mpaa_rating
);
Я пробовал следующее:
pg_insert($dbconn, "film", new array("rating" => "PG"));
pg_insert($dbconn, "film", new array("rating" => "'PG'::mpaa_rating"));
pg_insert($dbconn, "film", new array("rating" => "PG::mpaa_rating"));
Я получаю ошибку: unknown or system data type