[BUGS] Can't restore view with pg_restore - Mailing list pgsql-bugs

From Florian Gossin
Subject [BUGS] Can't restore view with pg_restore
Date
Msg-id CAPW7RP=YgN+sa_TV2OvQ5404bJ9vA9_YAOd7upJNiNLbtg4qvw@mail.gmail.com
Whole thread Raw
Responses Re: [BUGS] Can't restore view with pg_restore  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
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.

pgsql-bugs by date:

Previous
From: Florian Gossin
Date:
Subject: [BUGS] Can't restore view
Next
From: Robert Haas
Date:
Subject: Re: [HACKERS] [BUGS] Concurrent ALTER SEQUENCE RESTART Regression