pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@commandprompt.com>
To: Ryan Kelly <rpkelly22@gmail.com>
Cc: joe <joe@tanga.com>
Cc: Pg Bugs <pgsql-bugs@postgresql.org>
Subject: Re: BUG #6699: pg_restore with -j -- doesn't restore view that groups by primary key
Date: Tue, 19 Jun 2012 16:57:53 -0400
Message-ID: <1340139400-sup-7121@alvh.no-ip.org> (raw)
In-Reply-To: <20120619202058.GA7792@llserver.lakeliving.com>
References: <E1Sh4QS-0000EB-4R@wrigleys.postgresql.org>
	<20120619202058.GA7792@llserver.lakeliving.com>


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:

> > View definition:
> >  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;
> > 
> > channels.id is a primary key.
> 
> Attached is a test case to reproduce the problem, courtesy of the
> original reporter.

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.

-- 
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support



view thread (9+ messages)  latest in thread

Message-ID: <1340139400-sup-7121@alvh.no-ip.org>
Permalink:  ../1340139400-sup-7121@alvh.no-ip.org/
Also on:    postgresql.org/message-id/1340139400-sup-7121@alvh.no-ip.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: alvherre@commandprompt.com, rpkelly22@gmail.com, joe@tanga.com
  Subject: Re: BUG #6699: pg_restore with -j -- doesn't restore view that groups by primary key
  In-Reply-To: <1340139400-sup-7121@alvh.no-ip.org>
  References: <E1Sh4QS-0000EB-4R@wrigleys.postgresql.org> <20120619202058.GA7792@llserver.lakeliving.com> <1340139400-sup-7121@alvh.no-ip.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox