Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id E50B4D45796 for ; Tue, 31 Jan 2012 20:42:24 -0400 (AST) Received: from nm28-vm0.bullet.mail.bf1.yahoo.com ([98.139.213.149]) by makus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1RsOHH-00017X-Cn for pgsql-sql@postgresql.org; Wed, 01 Feb 2012 00:42:24 +0000 Received: from [98.139.212.150] by nm28.bullet.mail.bf1.yahoo.com with NNFMP; 01 Feb 2012 00:42:10 -0000 Received: from [98.139.212.205] by tm7.bullet.mail.bf1.yahoo.com with NNFMP; 01 Feb 2012 00:42:10 -0000 Received: from [127.0.0.1] by omp1014.mail.bf1.yahoo.com with NNFMP; 01 Feb 2012 00:42:10 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 381129.51752.bm@omp1014.mail.bf1.yahoo.com Received: (qmail 61430 invoked by uid 60001); 1 Feb 2012 00:42:10 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1328056930; bh=XTcYj78GyC0qH0kQmuwcDxUh2/EiY/M9BtAc1499+H0=; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=iV4n7mHq4NKhwFqGS+fErk6LRQX+bfpitCJBI+rnggRU9eTVyZkH25ADctaUz2t/hGpRWMqBTdLyTSJKmQlhkffQURjNL5N1X4O2o/aiiV9nTP4tAfqhX/Yzep+7mOQ9AC1Iy2c/0G4UYQ3z2xB6jFWJj9yls9b6tMTmtyKs3nc= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=dHe6IKWFHhisfBdNnR0Y9v9hNSJrVR5mtA93NAqMGgpOm6TlXD6dUsTDnVpnu6jn6dgPr/7eF8RffHV93qwY9N+BwmQZnvQhKIp0E2eLuTVaLD7NB9vS8MVFlJwMhbpWe7PabGYSz5+VcDcBd/hXN0F0CKdqrFwcPbNQrhEmtMQ=; X-YMail-OSG: YLmD71kVM1l5PzMHh7.GjBxO8KsBDKdYXnm4061abobADxy NiTrY2Ghq2hNJR.kadL4ukjZgsQBkNhVKzzbikBbx1dmarFXgrJznVm78HX7 9pe3vXV7GM1OFclf0qBlfXfRWfNWjzIag3O6tgzUVNE0VfE5jTRP4YUN_3yQ JXTtABP9toM1eAA4n9F3LFx6YMN8od4um49G7R83F9rmtxZYTecguL1wmSpW 9miXDubL_MKG3oB441A7YJ3O5YuDw3Aq12djuilDGHeOAdijU7TZqCHj3k2w wFI9IxSkifcympWM9wP.K46rLbAJvNKqFjMImozqPUzSisGV4NxG6qsHrrYs AfQHW4ZntIfzA6aA3QGRUoThtXB5TAFGOjStDUJ5KhzKvYesjhii9NT2u0Lg iwB5XKJnZqSoEip_LoivxDqI5bTY7csVYaVQRANI738yLTLY7RlmUCsZ8rqO zGzvwFNmiNkSZqzLSSsOxwi1XnPeN6hpkn_YH2BXjWrkR6ySXYFL8TAE- Received: from [118.172.192.132] by web161406.mail.bf1.yahoo.com via HTTP; Tue, 31 Jan 2012 16:42:10 PST X-Mailer: YahooMailClassic/15.0.4 YahooMailWebService/0.8.116.331537 Message-ID: <1328056930.13462.YahooMailClassic@web161406.mail.bf1.yahoo.com> Date: Tue, 31 Jan 2012 16:42:10 -0800 (PST) From: chester c young Subject: Fw: Re: pg_dump not correctly saving schema with partitioned tables? To: pgsql-sql@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201201/122 X-Sequence-Number: 36293 > From: chester c young =0A> Subject: Re: [SQL] pg= _dump not correctly saving schema with partitioned tables?=0A> To: "Tom Lan= e" =0A> Date: Tuesday, January 31, 2012, 5:40 PM=0A> ---= On Tue, 1/31/12, Tom Lane =0A> wrote:=0A> =0A> > From: = Tom Lane =0A> > Subject: Re: [SQL] pg_dump not correctly= saving schema=0A> with partitioned tables?=0A> > To: "chester c young" =0A> > Cc: pgsql-sql@postgresql.org=0A> > Date: Tuesd= ay, January 31, 2012, 2:04 PM=0A> > chester c young =0A> > writes:=0A> > > have database with many partitions.=A0 each=0A> > = partition table has its own primary key sequence.=0A> > >=A0 =A0 Column=A0 = ||=A0 =A0 =A0 =A0=0A> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=0A> > =A0 Modifiers= =A0 =A0 =A0 =A0 =A0 =A0=0A> > =A0 =A0 =A0 =A0 =A0 =A0=0A> > =A0=A0=A0=0A> >= >=0A> >=0A> -----------++-------------------------------------------------= -------------=0A> > >=A0 uno_id=A0 =A0 || not null default=0A> > nextval('c= mp0004.cmt_uno_id_seq'::regclass)=0A> > =0A> > > when dumped and then resor= ted, the pk sequence is=0A> > changed to an inherited- from table:=0A> > = =0A> > =0A> > >=A0 =A0=A0=A0Column=A0 =A0 ||=A0=0A> > =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0=0A> > =A0 =A0 Modifiers=A0 =A0 =A0 =A0 =A0=0A> > =A0 =A0 =A0 = =A0 =A0 =A0=A0=A0=0A> > >=0A> >=0A> --------------++-----------------------= -------------------------------=0A> > >=A0 uno_id=A0 =A0 =A0=A0=A0|| not nu= ll=0A> > default nextval('uno_uno_id_seq'::regclass)=0A> > =0A> > > (anothe= r error is that the pk sequence does not=0A> spec=0A> > the schema!)=0A> > = =0A> > I see no reason to think there is a bug here; it's=0A> more=0A> > li= kely that you=0A> > do not understand the display behavior of regclass=0A> = > constants.=A0 They only=0A> > print a schema name if your current search_= path is such=0A> that=0A> > the=0A> > relation wouldn't be found by writing= just the=0A> unqualified=0A> > name.=0A> > So the most likely explanation = for the discrepancy=0A> above is=0A> > that you=0A> > executed the two \d c= ommands under different=0A> search_path=0A> > settings.=0A> > =0A> > It's p= ossible that you have actually found a pg_dump=0A> bug,=0A> > but if so=0A>= > you'll need to submit a complete test-case exhibiting=0A> the=0A> > bug.= =0A> > =0A> here is a test case:=0A> =0A> =0A> create database test2;=0A> \= c test2;=0A> =0A> create schema s1;=0A> create schema s2;=0A> =0A> create t= able s1.t1(=0A> =A0 =A0 c1=A0 bigserial=A0=A0=A0primary=0A> key,=0A> =A0 = =A0 c2 text );=0A> =0A> create table s2.t1(=0A> =A0 =A0 c1=A0 bigserial=A0= =A0=A0primary=0A> key=0A> ) inherits( s1.t1 );=0A> =0A> test2=3D# \d s2.t2= =0A> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=0A> =A0 =A0 =A0 =A0 =A0 =A0 Table "s2.= t2"=0A> Column |=A0 Type=A0 |=A0 =A0 =A0 =A0=0A> =A0 =A0 =A0 =A0 =A0=0A> = =A0=A0=A0Modifiers=A0 =A0 =A0 =A0=0A> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =0A> ----= ----+--------+----------------------------------------------------=0A> c1= =A0 =A0=A0=A0| bigint | not null default=0A> nextval('s2.t2_c1_seq'::regcla= ss)=0A> c2=A0 =A0=A0=A0| text=A0=A0=A0| =0A> =0A> -- pg_dump test2 > test2= .dmp=0A> =0A> create database test3=0A> \c test3=0A> \i test2.dmp=0A> =0A> = test3=3D# \d s2.t1=0A> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=0A> =A0 =A0 =A0 =A0 = =A0 =A0 Table "s2.t1"=0A> Column |=A0 Type=A0 |=A0 =A0 =A0 =A0=0A> =A0 =A0= =A0 =A0 =A0=0A> =A0=A0=A0Modifiers=A0 =A0 =A0 =A0=0A> =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =0A> --------+--------+--------------------------------------------= --------=0A> c1=A0 =A0=A0=A0| bigint | not null default=0A> nextval('s1.t1= _c1_seq'::regclass)=0A> c2=A0 =A0=A0=A0| text=A0=A0=A0| =0A> =0A> ## in th= e original db table s2.t1 pk is using s2.t1_c1_seq=0A> ## in the dumped db = table s2.t1 pk is using s1.t1_c1_seq=0A> =0A>