Re: BUG #6699: pg_restore with -j -- doesn't restore view that groups by primary key - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #6699: pg_restore with -j -- doesn't restore view that groups by primary key
Date
Msg-id 22882.1340141854@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #6699: pg_restore with -j -- doesn't restore view that groups by primary key  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: BUG #6699: pg_restore with -j -- doesn't restore view that groups by primary key
List pgsql-bugs
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Excerpts from Ryan Kelly's message of mar jun 19 16:20:58 -0400 2012:
>> On Tue, Jun 19, 2012 at 07:49:20PM +0000, joe@tanga.com wrote:
>>> SELECT channels.id, channels.start_at, channels.end_at, channels.title
>>> FROM channels
>>> LEFT JOIN channels_products cp ON cp.channel_id = channels.id
>>> LEFT JOIN buyable_products bp ON bp.id = cp.product_id
>>> GROUP BY channels.id;

> The reason this doesn't work is that the primary key is not defined
> until later in the restore process.

> I think the fix is to make the view dependant on the primary key in the
> dump file.

Hmm ... check_functional_grouping does add the PK's OID to the query's
constraintDeps list.  Apparently we're losing that dependency knowledge
somewhere between the parser and pg_dump?

            regards, tom lane

pgsql-bugs by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: BUG #6699: pg_restore with -j -- doesn't restore view that groups by primary key
Next
From: Tom Lane
Date:
Subject: Re: BUG #6699: pg_restore with -j -- doesn't restore view that groups by primary key