copy command verbose

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bob Powell

    copy command verbose

    To whom it may concern:

    Does anyone know if it is possible to make the COPY command in postgres
    verbose. It would be very helpful if an error would generate when
    something goes wrong with a COPY. In the case of an extraneous comma
    or quote, it would identify the offending record. Thanks

    Bob Powell


    ---------------------------(end of broadcast)---------------------------
    TIP 1: subscribe and unsubscribe commands go to majordomo@postg resql.org

  • Tom Lane

    #2
    Re: copy command verbose

    "Bob Powell" <Bob@hotchkiss. org> writes:[color=blue]
    > Does anyone know if it is possible to make the COPY command in postgres
    > verbose.[/color]

    What PG version are you using? Do you consider 7.4's reporting
    inadequate, and if so what would you change?

    regression=# create table foo(f1 text, f2 int);
    CREATE TABLE
    regression=# copy foo from stdin;
    Enter data to be copied followed by a newline.
    End with a backslash and a period on a line by itself.[color=blue][color=green]
    >> 1 2
    >> foo bar
    >> \.[/color][/color]
    ERROR: invalid input syntax for integer: "bar"
    CONTEXT: COPY foo, line 2, column f2: "bar"
    regression=#

    regards, tom lane

    ---------------------------(end of broadcast)---------------------------
    TIP 6: Have you searched our list archives?



    Comment

    Working...