Re: dump using copy failed - Mailing list pgsql-admin

From Ankur Kaushik
Subject Re: dump using copy failed
Date
Msg-id CALXoLqwwReSZW4cER3UzRhdPgr2=6oM9-ZKpF-YHW7RYN4onxw@mail.gmail.com
Whole thread Raw
In response to Re: dump using copy failed  (naveen kumar <mnaveendba2@gmail.com>)
List pgsql-admin


Still getting error ,

The problem is while taking dump the fields are Tab delimited , Due to this while restoring column is mismatch .

When I use --insert with pg_dump this works fine , But not with "copy" command 

Is there a way in pg_dump so that I can take dump using some other delimited instead of Tab delimited .?

Regards
Ankur


On Thu, Jun 25, 2015 at 8:54 PM, naveen kumar <mnaveendba2@gmail.com> wrote:
/pg_dump -U postgres -h <source host> $srcdb | /usr/local/pgsql/bin/psql -p $port -U postgres -h <destination host > $destinationdb

It will help you, i guess.

thanks,

Thanks & Regards,
M Naveen Kuamr,
PostgreSQL Database Administrator, 
Mobile Number: +91 7755929449. 

On Wed, Jun 24, 2015 at 1:33 PM, Ankur Kaushik <ankurkaushik@gmail.com> wrote:

Hi ,

When Using pg_dump

Master Database

pg_dump -U postgres -n public  $Source_db -c -t $2 | gzip -9 > $db_path/$2_$1.dump.gz



dumping Other server Database

Using Restore Command

gunzip < $DB_PATH/$2_$1.dump.gz | PGPASSWORD="postgres" psql -U postgres -h 10.20.41.182 db1

I am Getting Below Error

======
ERROR:  syntax error at or near "&#"
LINE 1: &#2361;

invalid command \N
=======



When I use --insert with pg_dump this works fine and restore the data Properly but insert is slow also there is no batch insert in postgresql.


What I concern using "copy in pg_dump" the field are separated in TAB delimited  can we explicitily ask pg_dump for fiield-terminated by ','  ?


pgsql-admin by date:

Previous
From: Keith
Date:
Subject: Re: database must be vacuumed with transactions
Next
From: Ankur Kaushik
Date:
Subject: select query of mysql to postgres