Hello Alvaro,
It looks like pg_dump emits incorrect text for domain constraint comments:
Assuming the following structure,
CREATE DOMAIN "dom" AS integer
CONSTRAINT "dom_constraint" CHECK ((VALUE > 10));
COMMENT ON CONSTRAINT "dom_constraint" ON DOMAIN "dom" IS 'domain constraint comment'
pg_dump will dump the COMMENT as follow:
COMMENT ON CONSTRAINT "dom_constraint" ON DOMAIN """dom""" IS 'domain constraint comment'
Note the double-quoting issue of the domain name.
Attached patch fixes that.
Elvis