Search Postgresql Archives

Re: pg_restore: custom archiver unexpected end of file , ERROR: missing data for column

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Now you can edit the dump and attempt to restore it until it succeeds
> on a different system, after which you know for certain that your data
> matches at least your integrity constraints.
>
> That makes sense to me, thanks ....Is there is an easier or better way
> to edit the binary dump file? Like how I can I fix a certain row or a
> column of pg_dump -Fc file? .... I am sorry I have never done this
> before....please give a clue on how I can do it.


You can think of the binary dump as a 'frozen' version of your database.
Generally you restore to another database, but it is also possible to
restore to a text file:

http://www.postgresql.org/docs/9.3/interactive/app-pgrestore.html

So if you use:

-f filename
--file=filename

     Specify output file for generated script, or for the listing when used
with -l. Default is the standard output.


instead of a database name you will create a text version of the database
dump. A word of caution, the text based version will be considerably bigger
than the binary compressed version. As I recall you said the database in
question is large so you might not want to convert the whole thing. The same
switches apply to restoring to a file that work with restoring to a
database. So it is possible to select one or more tables and/or data and
restore that only. The text file that is generated can then be inspected.
What cannot be done is after making changes is reincorporating back into the
binary dump. What you do after making the changes depends on the
relationships between the changed tables and the other tables in the
database. That would require more information.

Another thought. Since pg_dump uses COPY(unless you specify INSERTs) you
might want to look at the COPY command and see if that is a better way of
seeing what is being retrieved from the table:

http://www.postgresql.org/docs/9.3/interactive/sql-copy.html

IMPORTANT:
"
COPY with a file name instructs the PostgreSQL server to directly read from
or write to a file. The file must be accessible to the server and the name
must be specified from the viewpoint of the server. When PROGRAM is
specified, the server executes the given command, and reads from its
standard input, or writes to its standard output. The command must be
specified from the viewpoint of the server, and be executable by the
postgres user. When STDIN or STDOUT is specified, data is transmitted via
the connection between the client and the server"


With COPY you can use a query so it is possible to restrict the data you
retrieve to a subset of the total.


Many Thanks, I think I will begin with pg_dump that uses INTERTS and see
what I get.




Hi all, Latest thing I picked now is that the disc is broken. It has Input
/Output Errors. We are going to try an land the file to a remote server when
dumping the database.




>
>
>
>
>



-- 
Adrian Klaver
adrian.klaver@xxxxxxxxxxx


CONFIDENTIALITY NOTICE
The contents of and attachments to this e-mail are intended for the addressee only, and may contain the confidential
information of Argility (Proprietary) Limited and/or its subsidiaries. Any review, use or dissemination thereof by anyone
other than the intended addressee is prohibited.If you are not the intended addressee please notify the writer immediately
and destroy the e-mail. Argility (Proprietary) Limited and its subsidiaries distance themselves from and accept no liability
for unauthorised use of their e-mail facilities or e-mails sent other than strictly for business purposes.




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux