You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cur.execute("COPY table(field1, field2) FROM LOCAL STDIN DELIMITER ','", copy_stdin=sys.stdin)
486
+
print("Rows loaded:", cur.fetchall())
487
+
488
+
# Copy from local stdin (compound statements)
489
+
withopen('f1.csv', 'r') as fs1, open('f2.csv', 'r') as fs2:
490
+
cur.execute("COPY tlb1(field1, field2) FROM LOCAL STDIN DELIMITER ',';"
491
+
"COPY tlb2(field1, field2) FROM LOCAL STDIN DELIMITER ',';",
492
+
copy_stdin=[fs1, fs2], buffer_size=65536)
493
+
print("Rows loaded 1:", cur.fetchall())
494
+
cur.nextset()
495
+
print("Rows loaded 2:", cur.fetchall())
496
+
```
497
+
When connection option `disable_copy_local` set to True, disables COPY LOCAL operations, including copying data from local files/stdin and using local files to store data and exceptions. You can use this property to prevent users from writing to and copying from files on a Vertica host, including an MC host. Note that this property doesn't apply to `Cursor.copy()`.
498
+
499
+
The data for copying from/writing to local files is streamed in chunks of `buffer_size` bytes, which defaults to 128 * 2 ** 10.
500
+
501
+
When executing "COPY FROM LOCAL STDIN", `copy_stdin` should be a file-like object or a list of file-like objects (specifically, any object with a `read()` method).
0 commit comments