Martin Pitt <martin@piware.de> writes:
> create view bar as select count(*) from foo group by cast(null as numeric);
> 3. pg_dump the database to a text file. The file contains
> 'CREATE VIEW bar AS
> SELECT count(*) AS count FROM foo GROUP BY 2;'
Actually, this seems to be provoking an Assert failure, if you use
an assert-enabled backend:
$ pg_dump d1
pg_dump: SQL command failed
pg_dump: Error message from server: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
pg_dump: The command was: SELECT pg_catalog.pg_get_viewdef('40965'::pg_catalog.oid) as viewdef
Server log shows
TRAP: FailedAssertion("!(!tle->resjunk)", File: "ruleutils.c", Line: 2267)
LOG: server process (PID 4507) was terminated by signal 6
So it's a backend problem not pg_dump's fault.
regards, tom lane