Marc Cousin <mcousin(at)sigma(dot)fr> writes:
> I'm having a strange problem : I created a view in a database, and I cannot restore it after a pg_dump.
> ...
> ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list
You need this patch:
http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/arrayfuncs.c?r1=1.140&r2=1.140.2.1
I found that this problem was introduced in 8.2, which may explain why
you'd not seen it before, if you were previously using an older release.
regards, tom lane