Re: BUG #7838: pg_dump major bug - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #7838: pg_dump major bug
Date
Msg-id 9691.1359567073@sss.pgh.pa.us
Whole thread Raw
In response to BUG #7838: pg_dump major bug  (jan.mate@inf-it.com)
List pgsql-bugs
jan.mate@inf-it.com writes:
> I created a very simple example to reproduce the problem (looks like it is a
> pg_dump problem). Here are the links to files used in my example:
> http://www.inf-it.com/fixes/postgres-bugreport/test.sql

Huh.  That's not pg_dump's fault --- it's a grammar bug.  The server
should accept something like

    select ((select array[1,2]))[1];

but it does not.  I see that you dodged the grammar bug in your view
definition by inserting a useless cast:

    select ((select array[1,2])::int[])[1];

but you shouldn't have had to do that.  The useless cast is omitted when
the view definition is regurgitated (indeed it's not there in the
internal form at all), and then the parser fails on that version of the
query text.

This seems to be easy to fix with one more grammar production to cover
the case of "c_expr ::= select_with_parens indirection".  But I'm
surprised we've not heard complaints before, because this area of the
grammar has been like that for a very long time.

Will fix, thanks for the report!

            regards, tom lane

pgsql-bugs by date:

Previous
From: jan.mate@inf-it.com
Date:
Subject: BUG #7838: pg_dump major bug
Next
From: Toby Murray
Date:
Subject: Violation of primary key constraint