pg_restore does not restore all tables

This is a multi-part message in MIME format.

------_=_NextPart_001_01CA72A6.137EE339
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hello,



I have a problem restoring a database. I have made a dump of a schema,
with no error messages. When I restore my dump I do not get any error
messages either. But when I look into my schema I see that I have less
tables than before. I don't even know how to debug this problem !



Best regards,



Baubak Gandomi


------_=_NextPart_001_01CA72A6.137EE339
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Font Definitions */
[at] font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
h1
{margin-top:12.0pt;
margin-right:0cm;
margin-bottom:3.0pt;
margin-left:21.6pt;
text-indent:-21.6pt;
page-break-before:always;
page-break-after:avoid;
mso-list:l1 level1 lfo2;
font-size:16.0pt;
font-family:Arial;}
h3
{margin-top:12.0pt;
margin-right:0cm;
margin-bottom:3.0pt;
margin-left:36.0pt;
text-indent:-36.0pt;
page-break-after:avoid;
mso-list:l1 level3 lfo2;
font-size:13.0pt;
font-family:Arial;}
p.MsoHeader, li.MsoHeader, div.MsoHeader
{margin-top:12.0pt;
margin-right:0cm;
margin-bottom:24.0pt;
margin-left:21.6pt;
text-indent:-21.6pt;
page-break-before:always;
page-break-after:avoid;
mso-list:l1 level1 lfo2;
font-size:18.0pt;
font-family:Arial;
font-weight:bold;}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
p.Normal1, li.Normal1, div.Normal1
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
p.Normal2, li.Normal2, div.Normal2
{margin-top:0cm;
margin-right:0cm;
margin-bottom:6.0pt;
margin-left:17.0pt;
font-size:12.0pt;
font-family:"Times New Roman";}
p.Normal3, li.Normal3, div.Normal3
{margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:34.0pt;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
p.Normal4, li.Normal4, div.Normal4
{margin-top:0cm;
margin-right:0cm;
margin-bottom:6.0pt;
margin-left:51.05pt;
font-size:12.0pt;
font-family:"Times New Roman";}
p.Normal2Bulleted, li.Normal2Bulleted, div.Normal2Bulleted
{margin-top:0cm;
margin-right:0cm;
margin-bottom:6.0pt;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman";}
p.Normal3Bulleted, li.Normal3Bulleted, div.Normal3Bulleted
{margin-top:0cm;
margin-right:0cm;
margin-bottom:6.0pt;
margin-left:70.0pt;
text-indent:-18.0pt;
mso-list:l0 level1 lfo3;
font-size:12.0pt;
font-family:"Times New Roman";}
p.Style1, li.Style1, div.Style1
{margin-top:6.0pt;
margin-right:0cm;
margin-bottom:6.0pt;
margin-left:0cm;
background:olive;
font-size:12.0pt;
font-family:"Times New Roman";}
p.Consideromittingormoving, li.Consideromittingormoving, =
div.Consideromittingormoving
{margin-top:0cm;
margin-right:0cm;
margin-bottom:6.0pt;
margin-left:0cm;
background:#FFCCFF;
font-size:12.0pt;
font-family:"Times New Roman";}
span.EmailStyle26
{mso-style-type:personal-compose;
font-family:Arial;
color:windowtext;}
[at] page Section1
{size:595.3pt 841.9pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
{page:Section1;}
/* List Definitions */
[at] list l0
{mso-list-id:103506293;
mso-list-type:hybrid;
mso-list-template-ids:575024078 -19085814 67895299 67895301 67895297 =
67895299 67895301 67895297 67895299 67895301;}
[at] list l0:level1
{mso-level-number-format:bullet;
mso-level-style-link:"Normal 3 Bulleted";
mso-level-text:\F0B7;
mso-level-tab-stop:70.0pt;
mso-level-number-position:left;
margin-left:70.0pt;
text-indent:-18.0pt;
font-family:Symbol;}
[at] list l1
{mso-list-id:350229637;
mso-list-template-ids:-1075798286;}
[at] list l1:level1
{mso-level-style-link:"Heading 1";
mso-level-text:%1;
mso-level-tab-stop:21.6pt;
mso-level-number-position:left;
margin-left:21.6pt;
text-indent:-21.6pt;}
[at] list l1:level2
{mso-level-text:"%1\.%2";
mso-level-tab-stop:28.8pt;
mso-level-number-position:left;
margin-left:28.8pt;
text-indent:-28.8pt;}
[at] list l1:level3
{mso-level-style-link:"Heading 3";
mso-level-text:"%1\.%2\.%3";
mso-level-tab-stop:36.0pt;
mso-level-number-position:left;
margin-left:36.0pt;
text-indent:-36.0pt;}
[at] list l1:level4
{mso-level-text:"%1\.%2\.%3\.%4";
mso-level-tab-stop:43.2pt;
mso-level-number-position:left;
margin-left:43.2pt;
text-indent:-43.2pt;}
[at] list l1:level5
{mso-level-text:"%1\.%2\.%3\.%4\.%5";
mso-level-tab-stop:50.4pt;
mso-level-number-position:left;
margin-left:50.4pt;
text-indent:-50.4pt;}
[at] list l1:level6
{mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6";
mso-level-tab-stop:57.6pt;
mso-level-number-position:left;
margin-left:57.6pt;
text-indent:-57.6pt;}
[at] list l1:level7
{mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.%7";
mso-level-tab-stop:64.8pt;
mso-level-number-position:left;
margin-left:64.8pt;
text-indent:-64.8pt;}
[at] list l1:level8
{mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.%7\.%8";
mso-level-tab-stop:72.0pt;
mso-level-number-position:left;
margin-left:72.0pt;
text-indent:-72.0pt;}
[at] list l1:level9
{mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.%7\.%8\.%9";
mso-level-tab-stop:79.2pt;
mso-level-number-position:left;
margin-left:79.2pt;
text-indent:-79.2pt;}
[at] list l2
{mso-list-id:1371955692;
mso-list-type:hybrid;
mso-list-template-ids:-884693448 1393615342 67895321 67895323 67895311 =
67895321 67895323 67895311 67895321 67895323;}
[at] list l2:level1
{mso-level-tab-stop:53.0pt;
mso-level-number-position:left;
margin-left:53.0pt;
text-indent:-18.0pt;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
-->
</style>

</head>

<body lang=3DFR link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Hello,<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>I have a problem restoring a database. I have made a =
dump of
a schema, with no error messages. When I restore my dump I do not get =
any error
messages either. But when I look into my schema I see that I have less =
tables
than before. I don’t even know how to debug this =
problem !<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Best regards,<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Baubak Gandomi<o:p></o:p></span></font></p>

</div>

</body>

</html>

------_=_NextPart_001_01CA72A6.137EE339--
Baubak Gandomi [ Di, 01 Dezember 2009 17:48 ] [ ID #2024479 ]

Re: pg_restore does not restore all tables

You could start by saying what version of postgres, on what OS, and
posting your backup and restore commands with any output, error or
otherwise, that they produce.



--
Ian.


On Tue, Dec 1, 2009 at 4:48 PM, Baubak Gandomi
<b.gandomi [at] castsoftware.com> wrote:
> Hello,
>
>
>
> I have a problem restoring a database. I have made a dump of a schema, wi=
th
> no error messages. When I restore my dump I do not get any error messages
> either. But when I look into my schema I see that I have less tables than
> before. I don=92t even know how to debug this problem=A0!
>
>
>
> Best regards,
>
>
>
> Baubak Gandomi

--
Sent via pgsql-admin mailing list (pgsql-admin [at] postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Ian Lea [ Di, 01 Dezember 2009 18:30 ] [ ID #2024480 ]

Re: pg_restore does not restore all tables

Hi

The logs that you attach do show an error:

pg_restore: [programme d'archivage (db)] could not execute query: ERROR: s=
chema
"bga_3122" already exists
Command was:
CREATE SCHEMA bga_3122;

so maybe you need to run the restore with --clean which will drop
database objects before recreating them, although I'm not sure that
will cause the schema to be dropped.

Are you sure that you attached the correct logs? The dump is to
bga_3103__c_cmd_00.backup but the restore is from
bga_3122__c_cmd.backup. And I can't see the csv_java_files stuff you
mention in the restore log

....
pg_restore: cr=E9ation de TABLE keysana
pg_restore: cr=E9ation de TABLE objobj
pg_restore: cr=E9ation de VIEW csv_java_files
pg_restore: cr=E9ation de VIEW csv_java_properties
pg_restore: cr=E9ation de VIEW csv_javadoc
pg_restore: cr=E9ation de TABLE keygrp
pg_restore: cr=E9ation de VIEW csv_library_objects
....

Hope that helps.


--
Ian.


2009/12/2 Baubak Gandomi <b.gandomi [at] castsoftware.com>:
> Thanks, I didn't even know where to start:
>
> The Postgre Version : 8.4.1
> The host OS is : MS Windows 2003 SP2
> The postgre vesrion on the client side is : 8.4.1
> The client OS is : Windows XP
>
> Command line for the backup: pg_dump --host=3DHOST1 --port=3D2278 --usern=
ame=3Dpostgre --schema=3DmySchema --format=3Dcustom --verbose --file=3DmyFi=
le.backup postgres
> Command line for the restore: pg_restore --host=3DHOST1 --port=3D2278 --d=
bname=3Dpostgres
> --username=3Dpostgre --format=3Dcustom --verbose =A0myFile.backup
>
> I have digged in a little bit more and have dicovered the followiing. In =
the log of the restore process:
>
> ----- snip ------
> pg_restore: cr=E9ation de TABLE objobj
> pg_restore: cr=E9ation de VIEW csv_java_files
> pg_restore: cr=E9ation de VIEW csv_java_properties
> pg_restore: cr=E9ation de VIEW csv_javadoc
> pg_restore: cr=E9ation de TABLE keygrp
> ----- snip ------
>
> The table is restored successfully, but none of the objects that follow t=
he table "objobj" are restored (roughly 400 tables and 80 views). I.e it se=
ems that the view "csv_java_files" causes the problem.
>
> If we look at the code we can see that it looks like:
>
> CREATE OR REPLACE VIEW mySchema.csv_java_files AS
> =A0SELECT keysana.idkey AS object_id, substr(keysana.keynamana::text, myS=
chema.instr(keysana.keynamana, '\'::character varying, (-1)) + 1) AS object=
_name, keysana.keynamana AS object_path, keypar.idkey AS package_id, objpro=
..idpro AS application_id
> =A0 FROM mySchema.keypar, mySchema.objobj, mySchema.objpro, mySchema.keys=
ana
> =A0WHERE keysana.keyclass =3D 5170 AND keysana.idkey =3D objpro.idobj AND=
objpro.prop =3D 0 AND objobj.idobj1 =3D keysana.idkey AND objobj.prop =3D =
2 AND keypar.idkey =3D objobj.idobj2 AND keypar.idparent =3D objpro.idpro;
>
> My first thought was a dependency problem, but I am able to manually crea=
te the view.
>
> This causes me to wonder about the following:
> - Why does the pg_restore fail to restore at just this view?
> - If there is an error why isn't there a corresponding message? The log s=
imply continues as if it were still restoring objects.
>
> I hope this gives you more to go on. I have included the log of the pg_du=
mp and restore.
>
> Best regards:
>
> Baubak
>
>
>
> -----Original Message-----
> From: Ian Lea [mailto:ian.lea [at] gmail.com]
> Sent: mardi 1 d=E9cembre 2009 18:31
> To: Baubak Gandomi
> Cc: pgsql-admin [at] postgresql.org
> Subject: Re: [ADMIN] pg_restore does not restore all tables
>
> You could start by saying what version of postgres, on what OS, and
> posting your backup and restore commands with any output, error or
> otherwise, that they produce.
>
>
>
> --
> Ian.
>
>
> On Tue, Dec 1, 2009 at 4:48 PM, Baubak Gandomi
> <b.gandomi [at] castsoftware.com> wrote:
>> Hello,
>>
>>
>>
>> I have a problem restoring a database. I have made a dump of a schema, w=
ith
>> no error messages. When I restore my dump I do not get any error messages
>> either. But when I look into my schema I see that I have less tables than
>> before. I don't even know how to debug this problem=A0!
>>
>>
>>
>> Best regards,
>>
>>
>>
>> Baubak Gandomi
>

--
Sent via pgsql-admin mailing list (pgsql-admin [at] postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Ian Lea [ Mi, 02 Dezember 2009 12:47 ] [ ID #2024585 ]
Datenbanken » gmane.comp.db.postgresql.admin » pg_restore does not restore all tables

Vorheriges Thema: question about vacuum and index bloat
Nächstes Thema: Restore SQL_ASCII backup...