Re: Surjective functional indexes

From: Christoph Berg <myon(at)debian(dot)org>
To: Konstantin Knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Surjective functional indexes
Date: 2017-05-29 17:21:07
Message-ID: 20170529172106.u45bgmmswiumnfms@msg.df7cb.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Re: Konstantin Knizhnik 2017-05-29 <592BBD90(dot)3060104(at)postgrespro(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-05-29 18:25:01 Re: fix side-effect in get_qual_for_list()
Previous Message Michael Paquier 2017-05-29 17:05:14 Re: pg_resetwal is broken if run from v10 against older version of PG data directory