Thread: copy notice

copy notice

From
muratmy@hotmail.com (my)
Date:
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 ?

Re: copy notice

From
jtp
Date:

Personal experience says one of your fields in that line has a control
character or quite possibly a | itself.  causing copy to read that field
as more than one field.   Check those lines for odd characters.

The rows will load succesfully, but will truncate whatever it thinks is
'extra'.  You should to edit those specific lines and get rid of
whatever's cuasing that error in order to claim everything is imported the
way your pipe delimitted file suggests it should be.

.jtp

> 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)
>


Re: copy notice

From
Oliver Elphick
Date:
On Thu, 2002-02-21 at 10:54, my 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 ?

You have probably managed to escape the new line at the end of that
particular line in the input file, so that it is tagging the first part
of line 21580 onto the end of the last field.  The rest of line 21580
gets thrown away.

--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C

     "My sheep hear my voice, and I know them, and they
      follow me; And I give unto them eternal life; and they
      shall never perish, neither shall any man pluck them
      out of my hand."          John 10:27,28


Re: copy notice

From
Jeff Eckermann
Date:
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

Re: copy notice

From
Pam Wampler
Date:
Do you have an extra delimiter at the end of the record?

-----Original Message-----
From: muratmy@hotmail.com [mailto:muratmy@hotmail.com]
Sent: Thursday, February 21, 2002 5:55 AM
To: pgsql-general@postgresql.org
Subject: [GENERAL] copy notice


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)