Re: pg_dump produces invalid SQL for "group by cast(null as numeric)" - Mailing list pgsql-bugs

From Tom Lane
Subject Re: pg_dump produces invalid SQL for "group by cast(null as numeric)"
Date
Msg-id 4536.1199571184@sss.pgh.pa.us
Whole thread Raw
In response to pg_dump produces invalid SQL for "group by cast(null as numeric)"  (Martin Pitt <martin@piware.de>)
List pgsql-bugs
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

pgsql-bugs by date:

Previous
From: Martin Pitt
Date:
Subject: pg_dump produces invalid SQL for "group by cast(null as numeric)"
Next
From: "Sokolov Yura"
Date:
Subject: BUG #3852: Could not create complex aggregate