Hi,
2007-04-15 11:23:06 CEST ERROR: no se puede truncar una tabla
referida en una llave foránea
2007-04-15 11:23:06 CEST DETALLE: La tabla «galeria_galeria» hace
referencia a «galeria_album».
2007-04-15 11:23:06 CEST HINT: Trunque la tabla «galeria_galeria» al
mismo tiempo, o utilice TRUNCATE ... CASCADE.
PostgreSQL is telling you that the table galeria_album which you are trying
to TRUNCATE is being referred by some row/s on the table galeria_galeria. In
your MySQL setup that could mean that those rows did not exist or that MySQL
simply did not care about the foreign key (which is possible).
As the error message says you should truncate both tables at once or specify
the keyword CASCADE at the end of the TRUNCATE sequence which would make
postgresql delete the refered galeria_galeria objects that would end with
broken foreign relations.
If you plan to use MySQL again you should take special care on data
integrity. PostgreSQL does not have a bug on this it simply throws an error
before allowing you data to be corrupted ;)
Cheers,
Marc
On 4/15/07, aaloy <[EMAIL PROTECTED]> wrote:
>
>
> 2007/4/15, Grupo Django <[EMAIL PROTECTED]>:
> >
> > This is the postgrelog:
> > 2007-04-15 11:23:06 CEST ERROR: no se puede truncar una tabla
> > referida en una llave foránea
> > 2007-04-15 11:23:06 CEST DETALLE: La tabla «galeria_galeria» hace
> > referencia a «galeria_album».
> > 2007-04-15 11:23:06 CEST HINT: Trunque la tabla «galeria_galeria» al
> > mismo tiempo, o utilice TRUNCATE ... CASCADE.
> > 2007-04-15 11:23:06 CEST SENTENCIA: TRUNCATE TABLE galeria_album
> > 2007-04-15 11:23:06 CEST ERROR: transacción abortada, las consultas
> > serán ignoradas hasta el fin de bloque de transacción
> > 2007-04-15 11:23:06 CEST SENTENCIA: INSERT INTO
> > galeria_album(nombre,path) VALUES('Galeria','media/fotos/')
> > 2007-04-15 11:23:06 CEST ERROR: inserción o actualización en la tabla
> > «galeria_album» viola la llave foránea «padre_id_refs_id_8fc3037»
> > 2007-04-15 11:23:06 CEST DETALLE: La llave (padre_id)=(0) no está
> > presente en la tabla «galeria_album».
> > 2007-04-15 11:23:06 CEST SENTENCIA: END
> > 2007-04-15 11:23:38 CEST ERROR: no se puede truncar una tabla
> > referida en una llave foránea
> > 2007-04-15 11:23:38 CEST DETALLE: La tabla «galeria_galeria» hace
> > referencia a «galeria_album».
> > 2007-04-15 11:23:38 CEST HINT: Trunque la tabla «galeria_galeria» al
> > mismo tiempo, o utilice TRUNCATE ... CASCADE.
> > 2007-04-15 11:23:38 CEST SENTENCIA: TRUNCATE TABLE galeria_album
> > 2007-04-15 11:23:38 CEST ERROR: transacción abortada, las consultas
> > serán ignoradas hasta el fin de bloque de transacción
> > 2007-04-15 11:23:38 CEST SENTENCIA: INSERT INTO
> > galeria_album(nombre,path) VALUES('Galeria','media/fotos/')
> >
> > I'm gonna check what you said about referential integrity. I'll post
> > again if I solve it and if I don't.
> >
> >
>
> Hello!
>
> I would start looking at:
>
> > 2007-04-15 11:23:06 CEST ERROR: no se puede truncar una tabla
> > referida en una llave foránea
> > 2007-04-15 11:23:06 CEST DETALLE: La tabla «galeria_galeria» hace
> > referencia a «galeria_album».
>
> As the previous posts said the problem is not Django related but
> database related. Perhaps different length in the keys?
>
> Best regards,
>
> --
> Antoni Aloy López
> Binissalem - Mallorca
> http://apsl.net
> Soci de Bulma - http://www.bulma.cat
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [EMAIL PROTECTED]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---