Re: copy notice - Mailing list pgsql-general

From Jeff Eckermann
Subject Re: copy notice
Date
Msg-id 20020221213157.63783.qmail@web20802.mail.yahoo.com
Whole thread Raw
In response to copy notice  (muratmy@hotmail.com (my))
List pgsql-general
Probably because you have a '|' following your last
field in your text file, which leads COPY to think
that there is another (empty) field following that.
I suggest that you check this out, and make sure that
the data in the table is really what you expect.

If you were to (for example) have a '|' before the
first field, COPY would assume an empty field ahead of
that.  The result would be that all of your fields are
offset to the right, with the final one dropped
altogether.  Not a good result!  Alternatively, if you
have '|' characters embedded in your data, they will
be treated as field separators, with a similar result
for that row.

In either case you would be warned by the notice that
you saw in this case.  Either that, or an error due to
some datatype mismatch between the table column and
the data that is being imported to it.

--- my <muratmy@hotmail.com> wrote:
> Hi ,
> I load a | delimited text file into a table using
> the following command :
> copy table_name from
> '/usr/local/pgsql/table_name.dat' using delimiters
> '|';
>
> and get this notice for each row :
>
> NOTICE:  copy: line 21579, CopyReadNewline: extra
> fields ignored
>
> but the rows are loaded succesfully, why do I get
> this notice ?
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 2: you can get off all lists at once with the
> unregister command
>     (send "unregister YourEmailAddressHere" to
majordomo@postgresql.org)


__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

pgsql-general by date:

Previous
From: Holger Marzen
Date:
Subject: Re: Perl or PHP DB Access?
Next
From: Doug McNaught
Date:
Subject: Re: SQL: Are the "" around table & coloumnames necessary?