Re: Does Type Have = Operator?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David E(dot) Wheeler" <david(at)justatheory(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Does Type Have = Operator?
Date: 2016-05-11 01:14:17
Message-ID: 27888.1462929257@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"David E. Wheeler" <david(at)justatheory(dot)com> writes:
> pgTAP has a function that compares two values of a given type, which it uses for comparing column defaults. It looks like this:

> 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2016-05-11 01:16:17 Re: Does Type Have = Operator?
Previous Message Tom Lane 2016-05-11 01:06:45 Re: HeapTupleSatisfiesToast() busted? (was atomic pin/unpin causing errors)