Search Postgresql Archives

Long running INSERT+SELECT query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

We're trying to populate a table with aggregated data from other tables. For that we're running a huge INSERT+SELECT query which joins several tables, aggregates values, and then inserts the results into another table. The problem we're facing is that while the query is running , some records in tables referenced by the results table may be deleted, which causes the following error:

ERROR:  insert or update on table "..." violates foreign key constraint "..."
DETAIL:  Key (...)=(...) is not present in table "...".

Who do we make sure that such aggregating query would not fail?

Regards,
Vitaliy






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux