Remove A Column But Fail To Import - Mailing list pgsql-bugs

From
Subject Remove A Column But Fail To Import
Date
Msg-id 200208230350.3437@th00.opsion.fr
Whole thread Raw
List pgsql-bugs
Hi!

This problem happens to v7.2.1 in Linux.

I drop a table column by editing table structure in
exported file(by pg_dump).
This table contains 27811 rows in exported file.
Now I do:

pgsql MyDatabase<ExportedDatabase

It stops at:

NOTICE:  copy: line 296, CopyReadNewline: extra
fields ignored

The CPU is idling.

Now I use vi to delete the exported table rows from
MyExportedDatabase so that:

in ExportedDatabase:

COPY "MyTable" FROM stdin;
\.

in ExportedTable:

COPY "MyTable" FROM stdin;
....
....
(27811 rows)
\.

Now I import the database again:

pgsql MyDatabase<ExportedDatabase

This is ok. Then,

psql MyDatabase <MyTable

The result is the same - it stops at row 296.

The following procedure finally works.

in ExportedDatabase:

COPY "MyTable" FROM stdin;
\.

in ExportedTable:

....
....
(27811 rows)

psql MyDatabase<ExportedDatabase
psql MyDatabase
(Then, in psql prompt, type "copy MyTable from
'/tmp/MyTable'")

I once suspected that some characters in
ExportedDatabase confues pgsql.  However, it proves
this assumption being not true because importing
database from ExportedDatabase works just fine if I
don't remove that last unwanted table column.

Regards,

CN

--------------------------------------------------------
You too can have your own email address from Eurosport.
http://www.eurosport.com

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Bug #744: initdb --pwprompt=????
Next
From: pgsql-bugs@postgresql.org
Date:
Subject: Bug #745: PL/Perl function fails if not called first, under solaris