Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix force_pk in PostgreSQL #41

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nuno-faria
Copy link

The current implementation of the auto incremented primary key in the History table uses id int NOT NULL AUTO_INCREMENT for all database engines. However, the correct code for PostgreSQL should be id serial NOT NULL, as can be confirmed in the docs.

Currently, the prepare results in the following error:

FATAL: PQexec() failed: 7 syntax error at or near "AUTO_INCREMENT"
FATAL: failed query was:        create table IF NOT EXISTS history1 (
        id int NOT NULL AUTO_INCREMENT,
        h_c_id int,
        h_c_d_id smallint,
        h_c_w_id smallint,
        h_d_id smallint,
        h_w_id smallint,
        h_date timestamp,
        h_amount decimal(6,2),
        h_data varchar(24) ,PRIMARY KEY(id)
        )
FATAL: `sysbench.cmdline.call_command' function failed: ./tpcc_common.lua:242: SQL error, errno = 0, state = '42601': syntax error at or near "AUTO_INCREMENT"

This commit fixes this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant