Re: [GENERAL] copymanager question

2014-09-04 Thread Craig Ringer
On 09/02/2014 06:20 PM, swaroop wrote: > To summarize - how do i replace the input strings in java (data is streamed > in and i do a copy to postgres) > so that CSV copy does not fail. > a. words with comma > b. words with double quotes in them > c. words with \ (backslash) Don't write the escapin

Re: [GENERAL] copymanager question

2014-09-03 Thread swaroop
hi david, Thanks for all the help . following those steps helped. -- View this message in context: http://postgresql.1045698.n5.nabble.com/copymanager-question-tp5817197p5817425.html Sent from the PostgreSQL - general mailing list archive at Nabble.com. -- Sent via pgsql-general mailing

Re: [GENERAL] copymanager question

2014-09-02 Thread Adrian Klaver
On 09/02/2014 03:20 AM, swaroop wrote: one more - i also need to insert useragent strings which have all sorts of characters in them eg Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.29 Safari/525.13 Here there is a comma which causes the co

Re: [GENERAL] copymanager question

2014-09-02 Thread Adrian Klaver
On 09/02/2014 01:28 AM, swaroop wrote: Thanks for getting back. So just to confirm if a string value , we need to take care off it ourselves by escaping any special character and quote (single, double) ? I am not exactly sure off the escaping part for each of the characters - have read that for

Re: [GENERAL] copymanager question

2014-09-02 Thread swaroop
Thanks for getting back. So just to confirm if a string value , we need to take care off it ourselves by escaping any special character and quote (single, double) ? I am not exactly sure off the escaping part for each of the characters - have read that for single quotes, we need to add one more

Re: [GENERAL] copymanager question

2014-09-02 Thread swaroop
one more - i also need to insert useragent strings which have all sorts of characters in them eg Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.29 Safari/525.13 Here there is a comma which causes the copy to fail. Other words do not have comma

Re: [GENERAL] copymanager question

2014-09-02 Thread David G Johnston
swaroop wrote > one more - i also need to insert useragent strings which have all sorts of > characters in them eg > Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, > like Gecko) Chrome/0.2.149.29 Safari/525.13 > > Here there is a comma which causes the copy to fail. Oth

Re: [GENERAL] copymanager question

2014-09-01 Thread Craig Ringer
On 09/01/2014 11:24 PM, swaroop wrote: > Basically i am looking for the same robustness of preparedstmt@setString > > Can i use functions like quote_literal ? Any help is very much appreciated. You don't need to. Feed the data in as-is. So long as it's valid CSV (for CSV-format COPY) or meets the

Re: [GENERAL] copymanager question

2014-09-01 Thread David G Johnston
swaroop wrote > Hello all > > I am using cm instead of preparedstmts for faster inserts . But have a > question on inserting > values which have quotes in them (maybe single or double). Using > preparedstmts, we know > its safe to do so by calling setString. Is it possible to do the same here > a

[GENERAL] copymanager question

2014-09-01 Thread swaroop
Hello all I am using cm instead of preparedstmts for faster inserts . But have a question on inserting values which have quotes in them (maybe single or double). Using preparedstmts, we know its safe to do so by calling setString. Is it possible to do the same here as i do not want to blindly sin