If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > PostgreSQL > postgres copy

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-07-11, 02:19
kirangentlebreeze kirangentlebreeze is offline
Registered User
 
Join Date: Oct 2010
Posts: 4
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 02:28.
Reply With Quote
  #2 (permalink)  
Old 04-07-11, 02:27
shammat shammat is offline
Registered User
 
Join Date: Nov 2003
Posts: 2,408
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
\.
Reply With Quote
Reply

Tags
postgres, postgres copy

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On