Re: RfD: more powerful "any" types

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: RfD: more powerful "any" types
Дата
Msg-id 20090909114722.GA4132@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: RfD: more powerful "any" types  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: RfD: more powerful "any" types  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
Peter Eisentraut wrote:
> On Tue, 2009-09-08 at 10:23 -0700, David E. Wheeler wrote:
> > On Sep 8, 2009, at 10:15 AM, Tom Lane wrote:
> > 
> > >>     arg_a IS DISTINCT FROM arg_b
> > >
> > > Surely you'd want arg_a and arg_b constrained to the same type,
> > > otherwise there is no certainty that that means anything at all.
> > 
> > Yes, for the purposes of pgTAP perhaps so. Then it's on the user to do  
> > the cast, because she decides that the cast is appropriate. Otherwise,  
> > as I said, perhaps it'd be too magical.
> 
> That's beginning to sound a bit like a generics feature.  E.g.,
> 
> CREATE FUNCTION the_same<T>(arg_a T, arg_b T) RETURNS bool AS $$
> SELECT arg_a IS DISTINCT FROM arg_b;
> $$;

Well, you can write that one with anyelement already.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: COALESCE and NULLIF semantics
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Elementary dependency look-up