simply defer all, only way to do well with partitions
This commit is contained in:
parent
80fc8231ad
commit
476ae53808
@ -8055,22 +8055,7 @@ postgres_start_deferred_wire_out (void *cls)
|
|||||||
struct PostgresClosure *pg = cls;
|
struct PostgresClosure *pg = cls;
|
||||||
struct GNUNET_PQ_ExecuteStatement es[] = {
|
struct GNUNET_PQ_ExecuteStatement es[] = {
|
||||||
GNUNET_PQ_make_execute ("START TRANSACTION ISOLATION LEVEL READ COMMITTED"),
|
GNUNET_PQ_make_execute ("START TRANSACTION ISOLATION LEVEL READ COMMITTED"),
|
||||||
GNUNET_PQ_make_execute ("DO $$"
|
GNUNET_PQ_make_execute ("SET CONSTRAINTS ALL DEFERRED;"),
|
||||||
"BEGIN"
|
|
||||||
" IF EXISTS ("
|
|
||||||
" SELECT 1"
|
|
||||||
" FROM information_Schema.constraint_column_usage"
|
|
||||||
" WHERE table_name='wire_out'"
|
|
||||||
" AND constraint_name='wire_out_ref')"
|
|
||||||
" THEN "
|
|
||||||
" SET CONSTRAINTS wire_out_ref DEFERRED;"
|
|
||||||
" END IF;"
|
|
||||||
"END $$"),
|
|
||||||
// FIXME: above logic is better as it tests that the constraint
|
|
||||||
// is actually applicable; but maybe we want to drop the constraint
|
|
||||||
// entirely once do_gc() is fixed to do without it?
|
|
||||||
// GNUNET_PQ_make_execute ("CALL defer_wire_out()"),
|
|
||||||
// GNUNET_PQ_make_execute ("SET CONSTRAINTS wire_out_ref DEFERRED;"),
|
|
||||||
GNUNET_PQ_EXECUTE_STATEMENT_END
|
GNUNET_PQ_EXECUTE_STATEMENT_END
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user