I send my request again. I try to use a legacy database with Web2py and keep the name of my PK field as they were... I did exactly as Tim Michelsen propose here : http://groups.google.com/group/web2py/browse_thread/thread/eed21229883b5a1a. The problem is that Web2py return error cause of missing sequence definition. Web2py ask for a sequence name like "table_id_seq". But since the sequence created by Postgres is "table_idfieldname_seq" Web2py is raising error. When I change the sequence name for "table_id_seq" I can insert data in table...
What should I do? I would let the sequences names generated by Postgres as they are because my PK are set to "serial" type field and if I backup my database and recreate it, the wrong names of PK sequence will be recreate and I will have to manually modify them again. Thanks Jonhy ---------- Forwarded message ---------- From: Jean Guy <jean...@gmail.com> Date: 2010/5/18 Subject: legacy database id field and sequence To: web2py@googlegroups.com Hi, I found this information about legacy database and the id field name : http://groups.google.com/group/web2py/browse_thread/thread/eed21229883b5a1a That seems to work quite well except for one thing... Web2py seems to want a different sequence name. By default PostgreSQL gives sequence name base on the PK field and table name... PostgreSQL sequence name = tablename_pkfieldname_seq Web2py ask me for : PKFIELD_seq Does I have to rename my sequence (that work so far on both side : Postgres and Web2py) or it is a web2py problem... Not sure, maybe I can change the way PostgreSQL give sequence, but I think it is correct, because it makes sure that there is not two sequences of the same name in case PK name is use twice in differents tables. What to do? Jonhy