"David E. Wheeler" <david@justatheory.com> writes:
> pgTAP has a function that compares two values of a given type, which it uses for comparing column defaults. It looks
likethis:
> CREATE OR REPLACE FUNCTION _def_is( TEXT, TEXT, anyelement, TEXT )
> RETURNS TEXT AS $$
Given that you're coercing both one input value and the result to text,
I don't understand why you don't just compare the text representations.
I'm also not very clear on what you mean by "comparing column defaults".
A column default is an expression (in the general case anyway), not just
a value of the type.
Maybe if you'd shown us the is() function, as well as a typical usage
of _def_is(), this would be less opaque.
regards, tom lane