If the COPY command fails does it identify the offending row?

After reading the manual and the wiki I assume that there is no way to
tell copy to start with the Nth record in the input file. Is that
correct? It seems like such an obvious feature I was surprised not to
find it. Thanks.

Bill

Search Discussions

  • Jeff Davis at Feb 18, 2009 at 7:51 pm

    On Wed, 2009-02-18 at 11:56 -0700, Bill Todd wrote:
    If the COPY command fails does it identify the offending row?
    Yes, it tries to identify the failing row in the error message.
    After reading the manual and the wiki I assume that there is no way to
    tell copy to start with the Nth record in the input file. Is that
    correct? It seems like such an obvious feature I was surprised not to
    find it. Thanks.
    That's correct.

    There are a lot of features that people could find useful: various
    formats and various manipulations of the data before it's processed. If
    all of those features were implemented, COPY would start to look more
    like perl.

    In general, it's best to preprocess the data yourself and pipe the
    result to a "COPY ... FROM STDIN" command. That way you can actually use
    perl if you want to.

    Regards,
    Jeff Davis
  • Adrian Klaver at Feb 18, 2009 at 8:15 pm

    On Wednesday 18 February 2009 10:56:45 am Bill Todd wrote:
    If the COPY command fails does it identify the offending row?

    After reading the manual and the wiki I assume that there is no way to
    tell copy to start with the Nth record in the input file. Is that
    correct? It seems like such an obvious feature I was surprised not to
    find it. Thanks.

    Bill
    Take a look at:
    http://pgfoundry.org/projects/pgloader/

    It offers what you are looking for.

    --
    Adrian Klaver
    aklaver@comcast.net
  • Bill Todd at Feb 18, 2009 at 8:40 pm

    Adrian Klaver wrote:
    On Wednesday 18 February 2009 10:56:45 am Bill Todd wrote:

    If the COPY command fails does it identify the offending row?

    After reading the manual and the wiki I assume that there is no way to
    tell copy to start with the Nth record in the input file. Is that
    correct? It seems like such an obvious feature I was surprised not to
    find it. Thanks.

    Bill
    Take a look at:
    http://pgfoundry.org/projects/pgloader/

    It offers what you are looking for.
    Thanks for the suggestion but pgloader appears to be a Linux only
    solution and my environment is Windows. The other problem is that there
    is no documentation that I could find (other than a PDF made from slides).

    Bill
  • Tony Caduto at Feb 18, 2009 at 10:00 pm

    Bill Todd wrote:
    Thanks for the suggestion but pgloader appears to be a Linux only
    solution and my environment is Windows. The other problem is that
    there is no documentation that I could find (other than a PDF made
    from slides).

    Bill
    Bill,
    pgloader is a Python app, It should work on win32 as well.


    Later,

    Tony Caduto
    AM Software Design
    htpp://www.amsoftwaredesign.com
    Home of Lightning Admin for PostgreSQL
  • Adrian Klaver at Feb 18, 2009 at 10:23 pm

    On Wednesday 18 February 2009 2:00:19 pm Tony Caduto wrote:
    Bill Todd wrote:
    Thanks for the suggestion but pgloader appears to be a Linux only
    solution and my environment is Windows. The other problem is that
    there is no documentation that I could find (other than a PDF made
    from slides).

    Bill
    Bill,
    pgloader is a Python app, It should work on win32 as well.


    Later,

    Tony Caduto
    AM Software Design
    htpp://www.amsoftwaredesign.com
    Home of Lightning Admin for PostgreSQL
    Documentation:
    http://pgloader.projects.postgresql.org/

    --
    Adrian Klaver
    aklaver@comcast.net

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-general @
categoriespostgresql
postedFeb 18, '09 at 6:57p
activeFeb 18, '09 at 10:23p
posts6
users4
websitepostgresql.org
irc#postgresql

People

Translate

site design / logo © 2022 Grokbase