Re: pg_dump produces invalid SQL for "group by cast(null as numeric)"

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martin Pitt <martin(at)piware(dot)de>
Cc: PostgreSQL Bugs <pgsql-bugs(at)postgresql(dot)org>, ubuntubug(at)acrasis(dot)net
Subject: Re: pg_dump produces invalid SQL for "group by cast(null as numeric)"
Date: 2008-01-05 22:13:04
Message-ID: 4536.1199571184@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Martin Pitt <martin(at)piware(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Sokolov Yura 2008-01-06 08:57:03 BUG #3852: Could not create complex aggregate
Previous Message Martin Pitt 2008-01-05 20:43:57 pg_dump produces invalid SQL for "group by cast(null as numeric)"