title: Deferrable check constraint in PostgreSQL
body: <p>I have function checking mandatory participation as follows:</p>
  
  <pre><code>CREATE FUNCTION member_in_has_address()
  RETURNS BOOLEAN AS $$
  BEGIN
  RETURN EXISTS (SELECT *
         FROM address a, member_details b
         WHERE b.member_id = a.member_id);
  END;
  $$  LANGUAGE plpgsql;
  </code></pre>
  
  <p>Then called from CHECK constraint</p>
  
  <pre><code>ALTER TABLE member_details
   ADD CONSTRAINT member_in_has_address_check
    CHECK (member_in_has_address());
  </code></pre>
  
  <p>To create deferable constraint in Standard SQL it would be:</p>
  
  <pre><code>ALTER TABLE member_details
   ADD CONSTRAINT member_in_has_address_check
    INITIALLY DEFERRED
    CHECK (member_in_has_address()); 
  </code></pre>
  
  <p>How can I do the same in PostgreSQL? </p>