PipeTarget.ToStringBuilder() empty sometimes #203
fredatgithub
started this conversation in
General
Replies: 2 comments
-
Not really. You can try to do the same thing with
These are output streams, so the flush would have to be done on |
Beta Was this translation helpful? Give feedback.
0 replies
-
ok I will try this |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
This is a question:
I created a pipe target to a string builder and sometimes it has dat and sometimes it doesn't for the same CliWrap command.
Here is my code:
I tried ExecuteAsync() and ExecuteBufferedAsync() and I have the same problem.
My ExecuteInsertFileName variable is a cmd file with the following code:
psql -a -b -d "dbname='dbname1' user='username1' password='password1' host='hostname1'" -f copyTemp.sql --log-file=result-insertion.log
copyTemp.sql is a file with the following code:
\set ON_ERROR_STOP true \copy tablename1 (column1, column2, column3) from 'C:\data.csv' WITH CSV HEADER DELIMITER ';'
I am inserting a data.csv file into a PostgreSQL database.
It works fine except that the result-insertion.log file has sometimes the correct result of the insert, for example
******** REQUEST *********
COPY tablename1 (column1, column2, column3 ) FROM STDIN WITH CSV HEADER DELIMITER ';'
COPY 3
and sometimes the file has only one line:
COPY 1
without the request so I wonder why the request was not written despite the stdErrBuffer variable is empty.
and sometimes the file is empty so I don't know how many records were inserted despite the stdErrBuffer variable is empty.
Do you know why the behavior of the stdOutBuffer variable is different for the same command?
Do you know if there is a stream flush method or something similar to be done after the execute async?
Beta Was this translation helpful? Give feedback.
All reactions