From 596a2079ecd43f03293ce39701375f06c5337279 Mon Sep 17 00:00:00 2001 From: Robins Tharakan Date: Sat, 3 Dec 2016 21:43:59 +0000 Subject: [PATCH] Bulk Insert works for postgres. Unlike MySQL, PostgreSQL doesn't take UNSIGNED integers. We could move this to BIGINT as well, but since this is a performance benchmark and since not many would reach the 2Billion mark, think we should be okay with INTEGER for now --- sysbench/tests/db/bulk_insert.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sysbench/tests/db/bulk_insert.lua b/sysbench/tests/db/bulk_insert.lua index 7989625..cfdc208 100644 --- a/sysbench/tests/db/bulk_insert.lua +++ b/sysbench/tests/db/bulk_insert.lua @@ -10,6 +10,18 @@ function prepare() db_connect() for i = 0,num_threads-1 do + + if (db_driver == "pgsql") then + + db_query([[ +CREATE TABLE IF NOT EXISTS sbtest]] .. i .. [[ ( +id INTEGER NOT NULL, +k INTEGER DEFAULT '0' NOT NULL, +PRIMARY KEY (id) +)]]) + + else + db_query([[ CREATE TABLE IF NOT EXISTS sbtest]] .. i .. [[ ( id INTEGER UNSIGNED NOT NULL, @@ -17,7 +29,10 @@ k INTEGER UNSIGNED DEFAULT '0' NOT NULL, PRIMARY KEY (id) ) ENGINE = InnoDB ]]) + end + + end --for end function event(thread_id)