From 58de066045684ef40800f1d7320cc7af0ceff330 Mon Sep 17 00:00:00 2001 From: Nuno Faria Date: Tue, 24 Aug 2021 17:45:34 +0100 Subject: [PATCH] Fix force_pk in PostgreSQL --- tpcc_common.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tpcc_common.lua b/tpcc_common.lua index 0db7ab0..2a3e715 100644 --- a/tpcc_common.lua +++ b/tpcc_common.lua @@ -222,7 +222,11 @@ function create_tables(drv, con, table_num) local hist_auto_inc="" local hist_pk="" if sysbench.opt.force_pk == 1 then - hist_auto_inc="id int NOT NULL AUTO_INCREMENT," + if drv:name() == "pgsql" then + hist_auto_inc="id serial NOT NULL," + else + hist_auto_inc="id int NOT NULL AUTO_INCREMENT," + end hist_pk=",PRIMARY KEY(id)" end query = string.format([[