copytest.sql

text/x-sql

Filename: copytest.sql
Type: text/x-sql
Part: 1
Message: COPY with hints, rebirth
\timing on
\! pgbench -i -s 5
\copy pgbench_accounts to '/tmp/accounts.dat'
BEGIN;
drop table if exists acctest;
create table acctest (like pgbench_accounts);
\copy acctest FROM '/tmp/accounts.dat'
select * from acctest limit 1;
commit;

select * from acctest limit 1;
SELECT count(*) FROm acctest;
SELECT count(*) FROm acctest;
SELECT count(*) FROm acctest;