Remove A Column But Fail To Import

From: <cnliou(at)eurosport(dot)com>
To: <pgsql-bugs(at)postgresql(dot)org>
Subject: Remove A Column But Fail To Import
Date: 2002-08-23 03:50:52
Message-ID: 200208230350.3437@th00.opsion.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-bugs by date

  From Date Subject
Next Message s mahendran 2002-08-23 09:43:51 regarding postgres
Previous Message Tom Lane 2002-08-22 15:13:02 Re: Bug #744: initdb --pwprompt=????