\n Column | Type | Modifiers \n------------------------------+---------+----------------------------------------------------------------\n cv_entry_id | bigint | not null default nextval('cv_entry_cv_entry_id_seq'::regclass)\noriginal_book_id | bigint | \n
with constraint:
"translation_references_book" FOREIGN KEY (original_book_id) REFERENCES cv_entry(cv_entry_id) DEFERRABLE
I'm inside a transaction, I insert a record for the translation before inserting the record for the book and I get a constraint violation. I thought deferred constraints were not to be checked until commit?
I have executed 'set constraints all deferred'.
For now I've dropped that particular constraint and checked it with
select original_book_id from cv_entry where original_book_id is not null and original_book_id not in (select cv_entry_id from cv_entry);
it comes out clean - so this looks like a (VERY ANNOYING) but in PG's constraints checking - I have version 8.1.
Or am I missing something?