Re: [web2py] SQlite to Postgres insert problems
Be carefull that imported records will get a fresh new id and because of that you may get that error. ;) Em 18/11/2015 15:35, "Carla Raquel" escreveu: > I'm having some troubles importing from csv files while using a Postgres > connection, when a table has one or more references to other tables like so: > > db.define_table('Extension', > Field('Person',db.auth_user), > Field('Supervisor',db.auth_user), > Field('Number','integer'), > Field('Description','text') > > > > I have created this and the auth_user table on Postgres and imported the > auth_user contents from the csv file with no problems. I also have no > problems importing to other tables that have no external references. I have > the following error: ('Error', '23503','insert or update on table > "extensao" violates foreign key constraint "extension_person_fkey"'). Any > ideas? > > -- > Resources: > - http://web2py.com > - http://web2py.com/book (Documentation) > - http://github.com/web2py/web2py (Source code) > - https://code.google.com/p/web2py/issues/list (Report Issues) > --- > You received this message because you are subscribed to the Google Groups > "web2py-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to web2py+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] SQlite to Postgres insert problems
I'm having some troubles importing from csv files while using a Postgres connection, when a table has one or more references to other tables like so: db.define_table('Extension', Field('Person',db.auth_user), Field('Supervisor',db.auth_user), Field('Number','integer'), Field('Description','text') I have created this and the auth_user table on Postgres and imported the auth_user contents from the csv file with no problems. I also have no problems importing to other tables that have no external references. I have the following error: ('Error', '23503','insert or update on table "extensao" violates foreign key constraint "extension_person_fkey"'). Any ideas? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] sqlite to postgres
Hi! I was using sqlite as my database for a few projects, but decided to go to postgres. While to web2py going from one to another is pretty much a connection string that you'll change, there's still one problem remaining. How do I get the data that was on my app (on the sqlite database). On a small application, I managed to do that by exporting a csv file on the old app and importing it on the new one. And that's it. But I have another app that has quite a few tables now... wich means that I'd have to copy several cvs and import them. Question is: isn't there an easier way to do it? (to backup a sqlite database and restore it as postgres in one piece?) If there isn't, that means that worst case scenario, I'll have to export/import csv's corresponding to my tables. I can do that... but there really isn't another way ? Thanks! -- []'s Marco Tulio