Confusion over Copy.c/Count rows from file patch

Started by mike gabout 22 years ago2 messageshackers
Jump to latest
#1mike g
mike@thegodshalls.com

Hi,

I am trying to revise my patch for counting the number of rows inserted
when using a COPY statement.

I set it up a printf to see the results in the log file.

When I execute a COPY the first time it reports 0 rows inserted(but
actually inserts all rows). If I execute again it reports the number of
rows + 1. Execute a third time and the number of rows are reported +
1(same result as 2nd run). All three tests were done against the same
file.

If there is a simple explanation to why ProcessUtility is not called the
first time COPY is executed and it is from then on it could help me a
lot.

Attachments:

copy2.patchtext/x-patch; charset=; name=copy2.patchDownload+21-5
utility.patchtext/x-patch; charset=; name=utility.patchDownload+4-3
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: mike g (#1)
Re: Confusion over Copy.c/Count rows from file patch

mike g <mike@thegodshalls.com> writes:

If there is a simple explanation to why ProcessUtility is not called the
first time COPY is executed and it is from then on it could help me a
lot.

CreateCommandTag is called before the query is executed, I believe.

regards, tom lane

PS: if you want useful comments on diffs, you should try to avoid having
half the diff consist of bogus changes in whitespace.