Make things play nice with PostgreSQL, tested with 9.1.1 and 9.2

This commit is contained in:
Samuel J. Greear
2011-11-01 00:00:27 -06:00
parent 84e7416789
commit 051946c9ce
2 changed files with 11 additions and 3 deletions

View File

@ -199,7 +199,6 @@ int pgsql_drv_init(void)
int pgsql_drv_describe(drv_caps_t *caps)
{
PGconn *con;
(void)table_name; /* unused */
*caps = pgsql_drv_caps;

View File

@ -32,6 +32,16 @@ pad CHAR(60) DEFAULT '' NOT NULL,
) /*! ENGINE = ]] .. mysql_table_engine ..
" MAX_ROWS = " .. myisam_max_rows .. " */"
elseif (db_driver == "pgsql") then
query = [[
CREATE TABLE sbtest]] .. i .. [[ (
id SERIAL NOT NULL,
k INTEGER DEFAULT '0' NOT NULL,
c CHAR(120) DEFAULT '' NOT NULL,
pad CHAR(60) DEFAULT '' NOT NULL,
]] .. index_name .. [[ (id)
) ]]
elseif (db_driver == "drizzle") then
query = [[
CREATE TABLE sbtest (
@ -48,8 +58,7 @@ pad CHAR(60) DEFAULT '' NOT NULL,
db_query(query)
db_query("CREATE INDEX k on sbtest" .. i .. "(k)")
db_query("CREATE INDEX k_" .. i .. " on sbtest" .. i .. "(k)")
print("Inserting " .. oltp_table_size .. " records into 'sbtest" .. i .. "'")