pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Maciej Łopuszański <lopuszanski@oleofarm.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #7842: pg_dump scripts view to table
Date: Fri, 01 Feb 2013 12:27:17 +0100
Message-ID: <510BA695.3060408@oleofarm.com> (raw)
In-Reply-To: <18122.1359660455@sss.pgh.pa.us>
References: <E1U0veF-0007cU-7z@wrigleys.postgresql.org>
	<18122.1359660455@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

is there a way to find exactly what object/table/column creates this 
circular dependency?

pg_dumb even in verbose mode does not warn/error of this situation. I 
managed to find this by testing copy of production db(this should be 
reported by pg_dump). also there is nothing fancy about this 'view' of mine.

in db it looks like this:
t1, t2, t3.......t10
create view1 from t1-t10

create view2 from view1 (only agregation with group by).

pg_dump creates table from view1.

best regards,
maciej lopuszanski


W dniu 31.01.2013 20:27, Tom Lane pisze:
> lopuszanski@oleofarm.com writes:
>> 1. after using pg_dump to dump WHOLE database to file, 1 of views 'turned'
>> into a table.
>> so there is no 'create or replace VIEW XXXX .......' with definition, but
>> instead:
>> its scripted as 'create TABLE XXXX......' and definition.(in file that
>> pg_dump created)
> There's probably a CREATE RULE command further down that turns it into a
> view again.
>
>> 2. but after using pg_dump to dump only this 1 problematic 'view'  (with -t
>> option) it stores it correcly as 'create or replace VIEW XXXX .......'
> That's not terribly surprising.  The separate table and rule entries
> would only be used when it's necessary to work around a circular
> dependency with some other object.
>
>> it looks like pg_dump has problem with dependancies of this view.....
> I see no reason to think there's a bug here.  If you still think it's
> a bug, you need to provide enough information for someone else to
> reproduce the case.
> http://www.postgresql.org/docs/9.1/static/bug-reporting.html
>
> 			regards, tom lane



-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (5+ messages)  latest in thread

Message-ID: <510BA695.3060408@oleofarm.com>
Permalink:  ../510BA695.3060408@oleofarm.com/
Also on:    postgresql.org/message-id/510BA695.3060408@oleofarm.com

 · 

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: lopuszanski@oleofarm.com, tgl@sss.pgh.pa.us
  Subject: Re: BUG #7842: pg_dump scripts view to table
  In-Reply-To: <510BA695.3060408@oleofarm.com>
  References: <E1U0veF-0007cU-7z@wrigleys.postgresql.org> <18122.1359660455@sss.pgh.pa.us> <510BA695.3060408@oleofarm.com>

* 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