Thanks for the discussion. Per your suggestions, I changed the check for default partition OID to an assert instead of the 'if' condition, and removed the code that attempted vainly to verify the constraint when attaching a foreign table as a partition. And pushed.
I think we're done here, so marked the Open Item as fixed. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services