Re: dump using copy failed

From: Ankur Kaushik <ankurkaushik(at)gmail(dot)com>
To: Raghavendra <raghavendra(dot)rao(at)enterprisedb(dot)com>
Cc: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: dump using copy failed
Date: 2015-06-26 09:31:03
Message-ID: CALXoLqz_CA6J0DDk_fmYLAUzJSxbGvXcWP4wAZa-1aLy+2cjpw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

PostgreSQL version 9.4

Both server is centos 6.6

Dump file is attached . which I am facing error to restore

On Fri, Jun 26, 2015 at 2:17 PM, Raghavendra <
raghavendra(dot)rao(at)enterprisedb(dot)com> wrote:

> On Wed, Jun 24, 2015 at 1:33 PM, Ankur Kaushik <ankurkaushik(at)gmail(dot)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
>>
>>
> AFAIK, your command is clean and it should work. So, I gave try at my end
> it worked well without --insert option in pg_dump..
>
> -bash-4.2$ pg_dump -U postgres -n public postgres -c -t foo | gzip -9 >
> foo_table.gz
> Password:
>
> -bash-4.2$ gunzip < foo_table.gz | PGPASSWORD="edb" psql -U postgres -h
> 172.24.35.71 postgres
> SET
> SET
> SET
> DROP TABLE
> SET
> SET
> SET
> CREATE TABLE
> ALTER TABLE
> COPY 295
>
>
>> I am Getting Below Error
>>
>> ======
>> ERROR: syntax error at or near "&#"
>> LINE 1: &#2361;
>>
>> invalid command \N
>> =======
>>
>>
> ​Can you tell the two machines operating system which you are exchanging
> the data ?​
> ​
>
>
> 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 ',' ?
>>
>
> There's no delimiter option in pg_dump utility command. If you are looking
> for delimited data, then you can directly use COPY command on the table.
> ​
> ---
> Regards,
> Raghavendra
> EnterpriseDB Corporation
> Blog: http://raghavt.blogspot.com/
>

Attachment Content-Type Size
bus_stop_42.dump.gz application/x-gzip 20.4 KB

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Burgholzer, Robert (DEQ) 2015-06-26 11:03:01 Re: select query of mysql to postgres
Previous Message Raghavendra 2015-06-26 08:47:59 Re: dump using copy failed