On Mon, Oct 28, 2013 at 6:54 PM, Olemis Lang <[email protected]> wrote:
> 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?

Nice catch! I guess the field passed as a parameter should be used in
MAX as well.

> I'm using the same Python virtual env for both ... so I wonder how does
> this work for PostgreSQL ? Is it a bug ?

Postgres does auto increments with sequences. We create two sequences,
one for uid and one for id, so both of them are incremented and filled
in on the server. Sqlite on the other hand only support one auto
increment field so id field needs to be incremented manually.


Anze

Reply via email to