Christophe Pettus <xof(at)thebuild(dot)com> writes:
> PostgreSQL 9.5.2.
> Summary: The view text returned by pg_get_viewdef() strips some casts, which can result in an error in trying to recreate the view. This means you can't successfully recreate those views from a pg_dump.
Fixed as of 9.5.3.
http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=1f7c85b820814810f985a270e92cde4c12ceded4
regards, tom lane