Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2004
    Posts
    38

    Unanswered: psql does not copy data????

    Hi,

    I backuped my database with pg_dump and i wanted to restore my database with psql -d mydb -f my.out -u
    But it creates tables and other database objects except "DATA"s
    I looked up my.out and i can see "copy" sections and my datas in file.But it does not copy data to my database?
    Why? I almost lost my mind!!!

    Analyzer

  2. #2
    Join Date
    Mar 2004
    Posts
    110
    If you use pg_dump you have to tell it to dump it with data, with OID etc.

    and to restore a db.. you have to do so with pg_restore.
    An example could be:

    $ pg_restore --clean -d movies movies.bak

    check the postgres docs for the exact switches/syntax

    Ed

  3. #3
    Join Date
    Apr 2004
    Posts
    38
    @Edje,

    Thank youfor your reply but my dump file is created with pg_dump and it dumped with data.I can see COPY sections and my data, but i can not restore my database back.
    pg_restore is a arhiver program that docs says, so i can not use it with my plain text dump.

    Analyzer

  4. #4
    Join Date
    Sep 2001
    Location
    Vienna
    Posts
    400

    psql

    this command is right
    psql -d [database] -f [filename]
    http://www.postgresql.org
    --Postgresql is the only kind of thing--

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •