Results 1 to 2 of 2

Thread: postgres copy

  1. #1
    Join Date
    Oct 2010
    Posts
    4

    Unanswered: postgres copy

    i am using copy statement like this

    copy mytable(xx,xx,xxx) from stdin with DELIMITER '|';
    x|xx|xxxx
    \.
    copy mytable(xx,xx,xxx) from stdin with DELIMITER '|';
    1|11|1111
    \.
    copy mytable(xx,xx,xxx) from stdin with DELIMITER '|';
    1|22|222222
    \.

    after every record i am specifying an end marker
    is there any possibility to have only one end marker i.e at the end of last record like this


    copy mytable(xx,xx,xxx) from stdin with DELIMITER '|';
    x|xx|xxxx

    copy mytable(xx,xx,xxx) from stdin with DELIMITER '|';
    1|11|1111

    copy mytable(xx,xx,xxx) from stdin with DELIMITER '|';
    1|22|222222
    \.

    if i use only one end-copy-marker i.e at the end of lat record
    i am getting an error like this
    "invalid input syntax for integer"" "
    CONTEXT:copy mytable,line 2,coloumn x:" "

    help me solving this problem
    Last edited by kirangentlebreeze; 04-07-11 at 03:28.

  2. #2
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    You only need one copy statement
    Code:
    copy mytable(xx,xx,xxx) from stdin with DELIMITER '|';
    x|xx|xxxx
    1|11|1111
    1|22|222222
    \.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •