Let A be a weak Heyting algebra and let a, b ∈ A. We give a description for the congruence generated by the pair (a, b), and we use it in order to give a necessary and sufficient condition for a function f : Ak → A to be compatible with every congruence of A. We also find conditions on a not necessarily polynomial function g(a, b) in A that imply that the function a → min{b ∈ A : g(a, b) ≤ b} is compatible when defined.