According to the documentation, the NO COMMIT option of the COPY command "Prevents the COPY statement from committing its transaction automatically when it finishes copying data."
However, that's not the case if the AUTOCOMMIT variable is set to 'on'...
Example:
I have a table named JULES that I will load 3 records into using the COPY command with the NO COMMIT option after setting the AUTOCOMMIT variable to 'on'...
Code: Select all
dbadmin=> \echo :AUTOCOMMIT
off
dbadmin=> \! cat /usr/home/dbadmin/j.txt
1
2
3
dbadmin=> SELECT * FROM jules;
c
---
(0 rows)
dbadmin=> \set AUTOCOMMIT on
dbadmin=> \echo :AUTOCOMMIT
on
dbadmin=> COPY jules FROM '/usr/home/dbadmin/j.txt' NO COMMIT;
Rows Loaded
-------------
3
(1 row)
dbadmin=> SELECT * FROM jules;
c
---
3
1
2
(3 rows)
Code: Select all
dbadmin=> \q
bash-3.2$ vsql
SET
Welcome to vsql, the Vertica Analytic Database interactive terminal.
Type: \h or \? for help with vsql commands
\g or terminate with semicolon to execute query
\q to quit
dbadmin=>
Code: Select all
dbadmin=> SELECT * FROM jules;
c
---
3
1
2
(3 rows)