Skip site navigation (1) Skip section navigation (2)

Re: database copy and move

From: bangh <banghe(at)baileylink(dot)net>
To: Todd Turner <tjturner(at)chpc(dot)utah(dot)edu>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: database copy and move
Date: 2000-05-03 17:23:40
Message-ID: 3910609B.E7ED94A6@baileylink.net (view raw or flat)
Thread:
Lists: pgsql-admin
You need to use pg_dump.

pg_dump old_db_name > old.dump

Then send old.dump to the machine you want, and use commands on that
machine:
createDB new_db_name
cat old.dump | psql new_db_name

Note: new_db_name can be the same as old_db_name here.

--
Banghe

Todd Turner wrote:

> Hello;
>
> http://www.postgresql.org/doxlist.html noticed there isn't any info in
> copy the postgres data - database directory and files and setting up
> the same database on another machine.  I've tried using createdb then
> pgaccess to import tables.  Using psql the tables are found but the
> data isn't.
>
> When importing a table I'm getting the error Error executing query.
>
> Copy subreservation From "subreservation1'
>
> PostgresSQL error message:
> Error: CopyFrom: Fail to add null value in not null attribute username
>
> PostgresSQL
> status:PGRES_FATAL_ERR
> OR
>
> Also ERROR: Bad int8 external representation for another copy and
> somtimes I'm getting you can not copy a duplicate value into a
> duplicate key message.
>
> I'd appreciate if someone could turn me on to why I'm getting these
> messages and possibly how you can move a database to another machine.
>
> tjt:
>
> --
> ===========================================
> Todd Turner - tjturner(at)chpc(dot)utah(dot)edu
> (801 - 585-1266)
> Center for High Performance Computing
> University of Utah
> ===========================================
>
>

In response to

Responses

pgsql-admin by date

Next:From: Todd J. TurnerDate: 2000-05-03 17:26:58
Subject: Re: database copy and move
Previous:From: Todd TurnerDate: 2000-05-03 16:32:57
Subject: database copy and move

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group