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

This commit is contained in:
Robins Tharakan
2016-12-03 21:43:59 +00:00
parent 4b1eda6b58
commit 596a2079ec

View File

@ -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)