Re: [HACKERS] Surjective functional indexes - Mailing list pgsql-hackers

From Christoph Berg
Subject Re: [HACKERS] Surjective functional indexes
Date
Msg-id 20170529172106.u45bgmmswiumnfms@msg.df7cb.de
Whole thread Raw
In response to Re: [HACKERS] Surjective functional indexes  (Konstantin Knizhnik <k.knizhnik@postgrespro.ru>)
Responses Re: [HACKERS] Surjective functional indexes  ("Sven R. Kunze" <srkunze@mail.de>)
Re: [HACKERS] Surjective functional indexes  (Konstantin Knizhnik <k.knizhnik@postgrespro.ru>)
List pgsql-hackers
Re: Konstantin Knizhnik 2017-05-29 <592BBD90.3060104@postgrespro.ru>
> On 05/27/2017 09:50 PM, Peter Eisentraut wrote:
> > On 5/25/17 12:30, Konstantin Knizhnik wrote:
> > > Functions like (info->>'name') are named "surjective" ni mathematics.
> > A surjective function is one where each value in the output type can be
> > obtained by some input value.  That's not what you are after here.  The
> > behavior you are describing is a not-injective function.
> > 
> > I think you are right that in practice most functions are not injective.
> >   But I think there is still quite some difference between a function
> > like the one you showed that selects a component from a composite data
> > structure and, for example, round(), where in practice any update is
> > likely to change the result of the function.
> > 
> Thank you, I will rename "surjective" parameter to "injective" with "false" as default value.

I think the term you were looking for is "projection".

https://en.wikipedia.org/wiki/Projection_(set_theory)

Christoph



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [HACKERS] pg_resetwal is broken if run from v10 against olderversion of PG data directory
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] fix side-effect in get_qual_for_list()