Content-Length: 258566 | pFad | http://github.com/postgrespro/postgres_cluster/commit/cab19af9fb573f87b713b604a99799a6a242668b

E7 Fix psql's counting of script file line numbers during COPY. · postgrespro/postgres_cluster@cab19af · GitHub
Skip to content

Commit cab19af

Browse files
committed
Fix psql's counting of script file line numbers during COPY.
handleCopyIn incremented pset.lineno for each line of COPY data read from a file. This is correct when reading from the current script file (i.e., we are doing COPY FROM STDIN followed by in-line data), but it's wrong if the data is coming from some other file. Per bug #6083 from Steve Haslam. Back-patch to all supported versions.
1 parent cd34647 commit cab19af

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/bin/psql/copy.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,8 @@ handleCopyIn(PGconn *conn, FILE *copystream, bool isbinary)
586586
}
587587
}
588588

589-
pset.lineno++;
589+
if (copystream == pset.cur_cmd_source)
590+
pset.lineno++;
590591
}
591592
}
592593

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/cab19af9fb573f87b713b604a99799a6a242668b

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy