Hello,
I'm writing here, however I'm not sure if it's a bug or if there's something I don't understand correctly.
I'm doing a dump in directory format of database with several schemas using pg_dump and when I try to restore it using pg_restore, I get the following error:
ERROR: could not convert table "bmv_visits_list" to a view because it has triggers
STATEMENT: CREATE RULE "_RETURN" AS
ON SELECT TO bmv_visits_list DO INSTEAD SELECT patient.firstname,
patient.lastname,
patient.birthdate,
company.code,
jsonb_agg(jsonb_build_object('
nb', v.nb, 'admissiondt', v.admitdt, 'patientroom', v.patientroom)) AS visits
FROM (((ehealth.visit v
JOIN ehealth.company ON ((v.company_id =
company.id)))
JOIN ehealth.m_rd_opa_pcl pcl ON ((((v.patientclass)::text = (pcl.code)::text) AND (v.company_id = pcl.company_id))))
JOIN ehealth.patient ON ((
patient.id = v.patient_id)))
WHERE (((v.patientclass)::text <> 'DEVE'::text) AND ((pcl.hl7code)::text = 'I'::text) AND ((v.admitstatus)::text = 'admitted'::text) AND ((v.dischargedt IS NULL) OR (v.dischargedt > ('now'::text)::timestamp without time zone)))
GROUP BY
patient.id, company.code;
I don't understand what the message means in that context.