Re: Bug#425027: I need to know if using MySQL or pgsql for my score board patch and pgsql
Thomas Goirand <
thomas@...>
2007-05-25 15:46:08 GMT
James Cloos wrote:
> The original, mysql-specific query he used is:
>
> ,----
> | insert ignore into %s (domain,vhost,month,year,count_impressions)
> | values ('%s','%s','%s','%s','0')
> `----
>
> I discovered that this works on postgres, w/o having to change any of
> the rest of his patch:
>
> ,----
> | begin;insert into %s (domain,vhost,month,year,count_impressions)
> | values ('%s','%s',%s,%s,0);commit
> `----
>
> Ie, s/insert ignore/insert/ and wrap in a transaction.
Hi!
I tried to to this with the MySQL backend driver, and unfortunately,
mod_log_sql was returning an error in the apache error.log. I was
surprised about it as the MySQL documentation said that it should work.
> Also, you may want to use global_config.driver->insert() instead of
> using safe_sql_insert() to execute the insert. I've not investigated
> the differences, so I cannot be sure, though.
The advantage of safe_sql_insert() is that when it fails, the query goes
in a preserve file. Later, when the insert works again, then this file
(Continue reading)