On Wed, 13 Mar 2002 bombadil@wanadoo.es wrote:
> Database has more tables (obviously), but I supose it is enought with
> these.
>
> When I try next query:
>
> # update gasto SET importe = round(importe,2);
>
> I get error:
>
> ERROR: <unnamed> referential integrity violation - key
> referenced from gasto not found in aviso
>
> I supose this error means that there is a reference in field "aviso"
> of table "gasto" to inexistent "n�mero" from "aviso" (data was
> imported with copy from other database).
>
> If it is so, then inserting data again in table "gasto" with inserts
> instead of copy sould fix situation, revoking inserts that woldn't
> comply with referential integrity rules.
>
> I have do it so:
>
> pg_dump -a -d -f foo.sql -t gasto database
>
> and after truncate data:
>
> psql database -f foo.sql
>
> Then, when I try my query again, I get same error. Have you any idea
> of actual problem? Where am I wrong in my asumptions?.
Can you distill an example case with test data (or real data if it's not
something that needs to be secured)? I see you're using inheritance
in your layout and I know that has some issues if you're referencing to
something that is inherited, but I'm not sure what's going on precisely.