Re: [web2py] Re: postgresql error ... class 'psycopg2.ProgrammingError'(relation auth_user already exists)
I have the same problem, already found the solution?TRACEBACK 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. Traceback (most recent call last): File c:\web2py\gluon\restricted.py, line 188, in restricted exec ccode in environment File c:/web2py/applications/demanda/models/db.py http://127.0.0.1:8000/admin/default/edit/demanda/models/db.py, line 39, in module auth.define_tables() # creates all needed tables File c:\web2py\gluon\tools.py, line 1177, in define_tables format='%(first_name)s %(last_name)s (%(id)s)') File c:\web2py\gluon\dal.py, line 3490, in define_table polymodel=polymodel) File c:\web2py\gluon\dal.py, line 531, in create_table self.create_sequence_and_triggers(query,table) File c:\web2py\gluon\dal.py, line 1513, in create_sequence_and_triggers self.execute('CREATE SEQUENCE %s;' % sequence_name) File c:\web2py\gluon\dal.py, line 1079, in execute return self.log_execute(*a, **b) File c:\web2py\gluon\dal.py, line 1076, in log_execute return self.cursor.execute(*a,**b) ProgrammingError: ERRO: relação auth_user_id_seq já existe 2011/2/6 Massimo Di Pierro massimo.dipie...@gmail.com The least comment in the issue thread says it is fixed after deleting the pyc. Is that not correct? On Feb 6, 7:26 am, Tom Atkins minkto...@gmail.com wrote: Thanks for looking into this Massimo. I just pulled the most recent version and still get the same error as originally described. I added a comment here: http://code.google.com/p/web2py/issues/detail?id=173can=1sort=-id http://code.google.com/p/web2py/issues/detail?id=173can=1sort=-idLet me know if you need any more info. I definitely have the latest version. On 4 February 2011 19:49, Massimo Di Pierro massimo.dipie...@gmail.com wrote: This is a trunk bug. The problem does should be there in stable. I will fix this tonight. On Feb 4, 12:50 pm, Tom Atkins minkto...@gmail.com wrote: On 4 February 2011 14:33, Massimo Di Pierro massimo.dipie...@gmail.com wrote: You are using web2py trunk right? Yes - just a clean version of web2py pulled by Hg from Google code. Did you set a sequence_name manually? No (not even sure what sequence_name is!) - I tried another app of my own and get the same result. -- Ovidio Marinho Falcao Neto ovidio...@gmail.com Tecnologia da Informaçao Casa Civil do Governador 83 3214 7885 - 88269088 Paraiba
Re: [web2py] Re: postgresql error ... class 'psycopg2.ProgrammingError'(relation auth_user already exists)
Here if I create a new db postgres does not create the tables,already in the database sqlite, normally creates. 2011/2/4 Massimo Di Pierro massimo.dipie...@gmail.com You are using web2py trunk right? Did you set a sequence_name manually? On Feb 4, 7:22 am, Tom Atkins minkto...@gmail.com wrote: I am getting the same error as reported by Carlos and cannot fix it. I have just set up a new server (Ubuntu 10.04 - postgres 8.4, Python 2.6.5) and have web2py trunk up and running fine. I have an unmodified 'welcome' app which runs perfectly with sqlite. I then delete all the files in databases, cache and sessions. Next I create a postgresql database and grant permissions to the appropriate user. I have double checked this and the user can create tables on the database. Next change the connection details in the welcome app db.py to: db = DAL('postgres://myuser:mypasswordlocalhost/mydb') Then visit the URL and I get the ticket below. Any help gratefully appreciated. (I had this running fine on a previous server) Traceback (most recent call last): File /home/www-data/web2py/gluon/restricted.py, line 188, in restricted exec ccode in environment File /home/www-data/web2py/applications/welcome/models/db.py, line 32, in module auth.define_tables() # creates all needed tables File /home/www-data/web2py/gluon/tools.py, line 1177, in define_tables format='%(first_name)s %(last_name)s (%(id)s)') File /home/www-data/web2py/gluon/dal.py, line 3489, in define_table polymodel=polymodel) File /home/www-data/web2py/gluon/dal.py, line 531, in create_table self.create_sequence_and_triggers(query,table) File /home/www-data/web2py/gluon/dal.py, line 1512, in create_sequence_and_triggers self.execute('CREATE SEQUENCE %s;' % sequence_name) File /home/www-data/web2py/gluon/dal.py, line 1078, in execute return self.log_execute(*a, **b) File /home/www-data/web2py/gluon/dal.py, line 1075, in log_execute return self.cursor.execute(*a,**b) ProgrammingError: relation auth_user_id_seq already exists ERROR SNAPSHOT class 'psycopg2.ProgrammingError'(relation auth_user_id_seq already exists Frames File /home/www-data/web2py/gluon/restricted.py in restricted at line 188 code arguments variables File /home/www-data/web2py/applications/welcome/models/db.py in module at line 32 code arguments variables File /home/www-data/web2py/gluon/tools.py in define_tables at line 1177 code arguments variables File /home/www-data/web2py/gluon/dal.py in define_table at line 3489 code arguments variables File /home/www-data/web2py/gluon/dal.py in create_table at line 531 code arguments variables File /home/www-data/web2py/gluon/dal.py in create_sequence_and_triggers at line 1512 code arguments variables File /home/www-data/web2py/gluon/dal.py in execute at line 1078 code arguments variables File /home/www-data/web2py/gluon/dal.py in log_execute at line 1075 code arguments variables Function argument list (self=gluon.dal.PostgreSQLAdapter object, *a=('CREATE SEQUENCE auth_user_id_Seq;',), **b={}) Code listing 1070. 1071. 1072. 1073. 1074. 1075. 1076. 1077. 1078. 1079. def create_sequence_and_triggers(self, query, table, **args): self.execute(query) def log_execute(self,*a,**b): self.db._lastsql = a[0] return self.cursor.execute(*a,**b) def execute(self,*a,**b): return self.log_execute(*a, **b) Variables a('CREATE SEQUENCE auth_user_id_Seq;',) self.cursorcursor object at 0xba1152cc; closed: 0 selfgluon.dal.PostgreSQLAdapter object b{} self.cursor.executebuilt-in method execute of psycopg2._psycopg.cursor object -- Ovidio Marinho Falcao Neto ovidio...@gmail.com Tecnologia da Informaçao Casa Civil do Governador 83 3214 7885 - 88269088 Paraiba
Re: [web2py] Re: postgresql error ... class 'psycopg2.ProgrammingError'(relation auth_user already exists)
On 6 February 2011 15:51, Massimo Di Pierro massimo.dipie...@gmail.comwrote: The least comment in the issue thread says it is fixed after deleting the pyc. Is that not correct? Yes - fixed after dal.pyc was recreated with new version.
Re: [web2py] Re: postgresql error ... class 'psycopg2.ProgrammingError'(relation auth_user already exists)
Thanks for looking into this Massimo. I just pulled the most recent version and still get the same error as originally described. I added a comment here: http://code.google.com/p/web2py/issues/detail?id=173can=1sort=-id http://code.google.com/p/web2py/issues/detail?id=173can=1sort=-idLet me know if you need any more info. I definitely have the latest version. On 4 February 2011 19:49, Massimo Di Pierro massimo.dipie...@gmail.comwrote: This is a trunk bug. The problem does should be there in stable. I will fix this tonight. On Feb 4, 12:50 pm, Tom Atkins minkto...@gmail.com wrote: On 4 February 2011 14:33, Massimo Di Pierro massimo.dipie...@gmail.com wrote: You are using web2py trunk right? Yes - just a clean version of web2py pulled by Hg from Google code. Did you set a sequence_name manually? No (not even sure what sequence_name is!) - I tried another app of my own and get the same result.
Re: [web2py] Re: postgresql error ... class 'psycopg2.ProgrammingError'(relation auth_user already exists)
here I also have this same problem. I also still have problems with the ID in version 191.6. Ouvir Ler foneticamente Dicionário - Ver dicionário detalhadohttp://www.google.com.br/dictionary?source=translationhl=pt-BRq=langpair= Traduza qualquer site - Yomuiri Onlinehttp://translate.google.com.br/?hl=pt-BRsl=jatl=pt-BRsugg=whints=trueq=http://www.yomiuri.co.jp/ -Japão - Telegraph.co.ukhttp://translate.google.com.br/?hl=pt-BRsl=entl=pt-BRsugg=whints=trueq=http://www.telegraph.co.uk/ -Reino Unido - BBC Newshttp://translate.google.com.br/?hl=pt-BRsl=entl=pt-BRsugg=whints=trueq=http://news.bbc.co.uk -Reino Unido - News.dehttp://translate.google.com.br/?hl=pt-BRsl=detl=pt-BRsugg=whints=trueq=http://www.news.de/ -Alemanha - Guardian.co.ukhttp://translate.google.com.br/?hl=pt-BRsl=entl=pt-BRsugg=whints=trueq=http://www.guardian.co.uk/ -Reino Unido - Sueddeutsche.dehttp://translate.google.com.br/?hl=pt-BRsl=detl=pt-BRsugg=whints=trueq=http://www.sueddeutsche.de/ -Alemanha - The White Househttp://translate.google.com.br/?hl=pt-BRsl=entl=pt-BRsugg=whints=trueq=http://www.whitehouse.gov/ -Estados Unidos - Xinhua Nethttp://translate.google.com.br/?hl=pt-BRsl=zh-CNtl=pt-BRsugg=whints=trueq=http://xinhuanet.com/ -China - Ellehttp://translate.google.com.br/?hl=pt-BRsl=frtl=pt-BRsugg=whints=trueq=http://www.elle.fr/elle/ -França - Zamalek Fanshttp://translate.google.com.br/?hl=pt-BRsl=artl=pt-BRsugg=whints=trueq=http://www.zamalekfans.com/ -árabe - Machu Picchuhttp://translate.google.com.br/?hl=pt-BRsl=estl=pt-BRsugg=whints=trueq=http://machupicchu.perucultural.org.pe/ -espanhol - Bild.dehttp://translate.google.com.br/?hl=pt-BRsl=detl=pt-BRsugg=whints=trueq=http://www.bild.de/ -Alemanha Fazer mais com o Google Tradutor - http://www.google.com.br/url?source=transpromors=rshpq=http://translate.google.com.br/about/intl/pt-BR_ALL/tour.html%23search-sushi *Pesquise as melhores receitas de sushi em japonês!* Descubra o poder da Pesquisa traduzidahttp://www.google.com.br/url?source=transpromors=rshpq=http://translate.google.com.br/about/intl/pt-BR_ALL/tour.html%23search-sushido Google. - http://www.google.com.br/url?source=transpromors=rshpq=http://translate.google.com/globalmarketfinder/index.html%3Flocale%3Dpt_BR *Estabeleça sua empresa globalmente.* Anuncie em vários idiomas usando o Google Global Market Finderhttp://www.google.com.br/url?source=transpromors=rshpq=http://translate.google.com/globalmarketfinder/index.html%3Flocale%3Dpt_BR . - http://www.google.com.br/url?source=transpromors=rshpq=http://www.google.com/ig/adde%3Fmoduleurl%3Dwww.google.com/ig/modules/dictionary.xml%26hl%3Dpt-BR%26mkhp%3D1%26source%3Dem_tl *Traduza agora.* Traduza textos direto da sua página inicial do iGooglehttp://www.google.com.br/url?source=transpromors=rshpq=http://www.google.com/ig/adde%3Fmoduleurl%3Dwww.google.com/ig/modules/dictionary.xml%26hl%3Dpt-BR%26mkhp%3D1%26source%3Dem_tl . - http://www.google.com.br/url?source=transpromors=rshpq=http://translate.google.com.br/about/intl/pt-BR_ALL/tour.html%23communicate *Mantenha contato com seus amigos virtuais de Paris.* Ative a tradução automática de e-mails e bate-papos no Gmailhttp://www.google.com.br/url?source=transpromors=rshpq=http://translate.google.com.br/about/intl/pt-BR_ALL/tour.html%23communicate . 2011/2/4 Massimo Di Pierro massimo.dipie...@gmail.com This is a trunk bug. The problem does should be there in stable. I will fix this tonight. On Feb 4, 12:50 pm, Tom Atkins minkto...@gmail.com wrote: On 4 February 2011 14:33, Massimo Di Pierro massimo.dipie...@gmail.com wrote: You are using web2py trunk right? Yes - just a clean version of web2py pulled by Hg from Google code. Did you set a sequence_name manually? No (not even sure what sequence_name is!) - I tried another app of my own and get the same result. -- Ovidio Marinho Falcao Neto ovidio...@gmail.com Tecnologia da Informaçao Casa Civil do Governador 83 3214 7885 - 88269088 Paraiba
Re: [web2py] Re: postgresql error ... class 'psycopg2.ProgrammingError'(relation auth_user already exists)
Oops - sorry, ignore my last message. I had an old version of dal.pyc... removed that and restarted web2py and everything is working great. Many thanks. On 6 February 2011 13:26, Tom Atkins minkto...@gmail.com wrote: Thanks for looking into this Massimo. I just pulled the most recent version and still get the same error as originally described. I added a comment here: http://code.google.com/p/web2py/issues/detail?id=173can=1sort=-id http://code.google.com/p/web2py/issues/detail?id=173can=1sort=-idLet me know if you need any more info. I definitely have the latest version. On 4 February 2011 19:49, Massimo Di Pierro massimo.dipie...@gmail.comwrote: This is a trunk bug. The problem does should be there in stable. I will fix this tonight. On Feb 4, 12:50 pm, Tom Atkins minkto...@gmail.com wrote: On 4 February 2011 14:33, Massimo Di Pierro massimo.dipie...@gmail.com wrote: You are using web2py trunk right? Yes - just a clean version of web2py pulled by Hg from Google code. Did you set a sequence_name manually? No (not even sure what sequence_name is!) - I tried another app of my own and get the same result.
Re: [web2py] Re: postgresql error ... class 'psycopg2.ProgrammingError'(relation auth_user already exists)
On 4 February 2011 14:33, Massimo Di Pierro massimo.dipie...@gmail.comwrote: You are using web2py trunk right? Yes - just a clean version of web2py pulled by Hg from Google code. Did you set a sequence_name manually? No (not even sure what sequence_name is!) - I tried another app of my own and get the same result.
Re: [web2py] Re: postgresql error ... class 'psycopg2.ProgrammingError'(relation auth_user already exists)
On 18 November 2010 14:03, mdipierro mdipie...@cs.depaul.edu wrote: This is a reasonable error now. when you change a field type (but not the name) web2py tries to convert the data. In this case postgres fails because it does not know how to convert dates to integers. You have to do it in multiple steps: - remove the field from define_table - run appadmin once (field will be dropped) - add the field again with same name and different type - run appadmin once (new field will be created) web2py will not try to attepmt to post the data in the column and it will be lost, but no error. Thanks. Regards Johann -- May grace and peace be yours in abundance through the full knowledge of God and of Jesus our Lord! His divine power has given us everything we need for life and godliness through the full knowledge of the one who called us by his own glory and excellence. 2 Pet. 1:2b,3a
Re: [web2py] Re: postgresql error ... class 'psycopg2.ProgrammingError'(relation auth_user already exists)
On 16 November 2010 21:48, Carlos carlosgali...@gmail.com wrote: Johann, please send the files when you get this error too. It happened just now again. I have changed the type of a field from 'date' to 'integer' (I want None or year) and the following typical error occured: Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. Traceback (most recent call last): File /home/js/web2py/gluon/restricted.py, line 188, in restricted exec ccode in environment File /home/js/web2py/applications/kb/models/kb5.py http://localhost:8000/admin/default/edit/kb/models/kb5.py, line 229, in module signature) File /home/js/web2py/gluon/sql.py, line 1378, in define_table t._create(migrate=migrate, fake_migrate=fake_migrate) File /home/js/web2py/gluon/sql.py, line 1874, in _create fake_migrate=fake_migrate) File /home/js/web2py/gluon/sql.py, line 1947, in _migrate self._db._execute(sub_query) File /home/js/web2py/gluon/sql.py, line 1033, in lambda self._execute = lambda *a, **b: self._cursor.execute(*a, **b) ProgrammingError: column datum__tmp is of type integer but expression is of type date LINE 1: UPDATE outeur_instansie SET datum__tmp=datum; ^ HINT: You will need to rewrite or cast the expression. Error snapshot [image: help] Detailed traceback description class 'psycopg2.ProgrammingError'(column datum__tmp is of type integer but expression is of type date LINE 1: UPDATE outeur_instansie SET datum__tmp=datum; ^ HINT: You will need to rewrite or cast the expression. ) Regards Johann -- May grace and peace be yours in abundance through the full knowledge of God and of Jesus our Lord! His divine power has given us everything we need for life and godliness through the full knowledge of the one who called us by his own glory and excellence. 2 Pet. 1:2b,3a
Re: [web2py] Re: postgresql error ... class 'psycopg2.ProgrammingError'(relation auth_user already exists)
On 13 November 2010 20:44, Carlos carlosgali...@gmail.com wrote: Hi Massimo, I did not delete anything when this problem appeared, I just switched from sqlite to postresql in the DAL. Should I worry about this problem appearing again (in my local machine or in a production environment)?. I have seen this several times when I change definitions of tables using Postgresql as backend. What I normally do in such sitations is to export the database table to a csv-file through Web2py or if that is not possible using either the commandline or PGAdminIII, drop the table and remove the table's entry in web2py/applications/myapp/databases. Web2py will then recreate the table and you can import the csv-file. If the latter was created with outside web2py, you will have to edit the column headers before importing it. I am not sure whether this is good practice but this has saved me some frustrations. Regards Johann -- May grace and peace be yours in abundance through the full knowledge of God and of Jesus our Lord! His divine power has given us everything we need for life and godliness through the full knowledge of the one who called us by his own glory and excellence. 2 Pet. 1:2b,3a
Re: [web2py] Re: postgresql error ... class 'psycopg2.ProgrammingError'(relation auth_user already exists)
On 15 November 2010 18:17, Carlos carlosgali...@gmail.com wrote: From what Johann said, I understood the table definitions were changed in web2py (using postgresql as the backend), not in postgresql directly ... or did I misunderstand it?. Yes, that is what I meant. Regards Johann -- May grace and peace be yours in abundance through the full knowledge of God and of Jesus our Lord! His divine power has given us everything we need for life and godliness through the full knowledge of the one who called us by his own glory and excellence. 2 Pet. 1:2b,3a