I have a doubt about `update_sequence` method in `trac.db.postgres_backend`
[1]_. In there I notice that `column` argument value defaults to `'id'`. It
is expanded to build sequence name in SQL query definition but it is hard
coded inside `MAX(id)` . Should it be transformed into `MAX(%s)` so as to
insert the value supplied in `column` arg?
Besides after reviewing SQL in the logs as reported in #704 I notice that
with PostgreSQL the translated query looks like this :
{{{#!sql
INSERT INTO ticket
(summary,reporter,owner,description,type,status,priority,product,milestone,component,version,resolution,time,changetime,
product) VALUES (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,'test')
}}}
whereas for SQLite there's an extra sub-query for product-specific ticket
ID seq
{{{#!sql
INSERT INTO ticket
(summary,reporter,owner,description,type,status,priority,product,milestone,component,version,resolution,time,changetime,
product, id) VALUES
(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,'w',COALESCE((SELECT MAX(id) FROM
(SELECT * FROM ticket WHERE product='w')
AS subquery), 0)+1)
}}}
I'm using the same Python virtual env ffor both ... so I wonder how does
this work for PostgreSQL ? Is it a bug ?
.. [1]
https://issues.apache.org/bloodhound/browser/trunk/trac/trac/db/postgres_backend.py#L256
--
Regards,
Olemis - @olemislc