Re: Does Type Have = Operator? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Does Type Have = Operator?
Date
Msg-id 27888.1462929257@sss.pgh.pa.us
Whole thread Raw
In response to Does Type Have = Operator?  ("David E. Wheeler" <david@justatheory.com>)
Responses Re: Does Type Have = Operator?  ("David E. Wheeler" <david@justatheory.com>)
List pgsql-hackers
"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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: HeapTupleSatisfiesToast() busted? (was atomic pin/unpin causing errors)
Next
From: "David G. Johnston"
Date:
Subject: Re: Does Type Have = Operator?