Re: IntegrityError: duplicate key violates unique constraint

2008-04-01 Thread makebelieve
The problem there was that much of the data I was importing came from the site's old MySQL database from before I started using PostGIS and GeoDjango. Does anyone know if there's a way to tell Postgresql to automatically detect what's in the table and resequence? On Mar 28, 1:17 pm, "Brian

Re: IntegrityError: duplicate key violates unique constraint

2008-03-31 Thread makebelieve
Yes, of course there is a constraint there: the primary key, which of course I don't want to remove. Marty's solution was it. Thanks for the assistance. On Mar 28, 12:50 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On Fri, Mar 28, 2008 at 2:35 PM, makebelieve <[EMAIL PROTECTED]> wrote: > >

Re: IntegrityError: duplicate key violates unique constraint

2008-03-31 Thread makebelieve
You, my friend, rule. That's exactly what I needed to do. I've just recently moved from MySQL and am at the point in which I appreciate Postgresql's strictness, but I am still getting used to it. On Mar 28, 12:57 pm, "Marty Alchin" <[EMAIL PROTECTED]> wrote: > Given that you say you're working

Re: IntegrityError: duplicate key violates unique constraint

2008-03-28 Thread Brian Armstrong
Also, if you have access to the old DB still, consider exporting the entire thing out again. Make sure that you include the structural part as well as the data itself. It should export it directly as a series of SQL statements. A complete dump will provide information about the sequences.

Re: IntegrityError: duplicate key violates unique constraint

2008-03-28 Thread Marty Alchin
Given that you say you're working with PG Navicat, I assume you're using Postgresql as your database. Postgresql has a concept of sequences, which it uses to generate IDs for auto-generated fields like Django's AutoField. I think what you've done, by copying data in directly, is created records

Re: IntegrityError: duplicate key violates unique constraint

2008-03-28 Thread James Bennett
On Fri, Mar 28, 2008 at 2:35 PM, makebelieve <[EMAIL PROTECTED]> wrote: > I haven't added any unique contraints. It really seems as though > django doesn't know > about my existing data. If I obliterate the old data everything works > fine, but > that's not a possibility. At the database

Re: IntegrityError: duplicate key violates unique constraint

2008-03-28 Thread makebelieve
I haven't added any unique contraints. It really seems as though django doesn't know about my existing data. If I obliterate the old data everything works fine, but that's not a possibility. On Mar 28, 12:13 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On Fri, Mar 28, 2008 at 2:10 PM,

Re: IntegrityError: duplicate key violates unique constraint

2008-03-28 Thread James Bennett
On Fri, Mar 28, 2008 at 2:10 PM, makebelieve <[EMAIL PROTECTED]> wrote: > Saving some of my objects work, but only because early IDs have been > removed > so it isn't trying to insert an object with an existing ID. It sounds like you have a unique constraint in the DB that you haven't told

Re: IntegrityError: duplicate key violates unique constraint

2008-03-28 Thread makebelieve
ng in old data I need > > Now when I try to create a new object in the admin interface I keep > getting: > > IntegrityError: duplicate key violates unique constraint > "app_table_pkey" > > It's like it doesn't know all those records are there and is trying to >

IntegrityError: duplicate key violates unique constraint

2008-03-27 Thread makebelieve
: IntegrityError: duplicate key violates unique constraint "app_table_pkey" It's like it doesn't know all those records are there and is trying to save over them. Can someone please tell me how to fix this? Thank you. --~--~-~--~~~---~--~~ You received this message b