Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dEgoS-0002AC-KB for pgsql-hackers@arkaria.postgresql.org; Sat, 27 May 2017 18:51:44 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dEgoS-00014Q-6o for pgsql-hackers@arkaria.postgresql.org; Sat, 27 May 2017 18:51:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dEgmr-0003Z1-3Y for pgsql-hackers@postgresql.org; Sat, 27 May 2017 18:50:05 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dEgmn-0000hE-AZ for pgsql-hackers@postgresql.org; Sat, 27 May 2017 18:50:04 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id C1E99207DC; Sat, 27 May 2017 14:49:59 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute7.internal (MEProxy); Sat, 27 May 2017 14:49:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=d2FAKE5/csrDlu5fvcQ2s7hWnKuMSVe5HMqc1HJ2T2o=; b=q4glVv39 xmPn99pNLBNSU4Sb5st53HxYlGDKEO57e9LC7FF/HJcIDT7RYS5MqF5Yx9eC4ijX d9b4uEfxYH+i8h0ElCseTRvGBM8KK67v5nlYa0uxG9Bq9mbBMgVg/22alMgtxsAN xVL8NnMrls45d23w2ol/+1T1ZHVLELCIaJ/VPzm/u6ZBN3jFJRPqGYlpOIGg8AK4 VafF1G6nSbHnHY5xjH8tDmzAXqwkAWFluaXAGlMSPyEL7uVboDaIVYjv6mtiWPFv rT/H0mY1yQF4S68eZTsXGabwh9IShW4sLcGoTY4FNnHrV+/FV+MLTaFtxKrvhCzm AQCEfgjhY4oMaA== X-ME-Sender: X-Sasl-enc: 8pjjiqkJDDpo17xM/bD3Z2IMy65r3oCxUXB9Kjr8bqxo 1495910999 Received: from april.local (c-73-13-66-39.hsd1.pa.comcast.net [73.13.66.39]) by mail.messagingengine.com (Postfix) with ESMTPA id 81C907E0EE; Sat, 27 May 2017 14:49:59 -0400 (EDT) From: Peter Eisentraut Subject: Re: Surjective functional indexes To: Konstantin Knizhnik , PostgreSQL Hackers References: <4d9928ee-a9e6-15f9-9c82-5981f13ffca6@postgrespro.ru> Organization: 2ndQuadrant Message-ID: Date: Sat, 27 May 2017 14:50:03 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <4d9928ee-a9e6-15f9-9c82-5981f13ffca6@postgrespro.ru> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org 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. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers