Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jiHc3-0001wH-QN for pgsql-general@arkaria.postgresql.org; Mon, 08 Jun 2020 13:14:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jiHc2-0001fW-Mb for pgsql-general@arkaria.postgresql.org; Mon, 08 Jun 2020 13:14:50 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jiHc1-0001fO-O1 for pgsql-general@lists.postgresql.org; Mon, 08 Jun 2020 13:14:50 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jiHby-0001Vj-9z for pgsql-general@lists.postgresql.org; Mon, 08 Jun 2020 13:14:48 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 68CCD6DB; Mon, 8 Jun 2020 09:14:44 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 08 Jun 2020 09:14:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=I qu7aiM+YIroLiBUczEaHqVF6BtuL5ajSQhwxWWP93U=; b=BM7h5ZRD3GV/pBglx qPdFhKI2fdL7jf5/gP4kUtagIKzAiHbN70CBUbI0dvc4n+e3Y8E8/qXN2crIJbBw MdUZbBoQebZRy+kpVPwZU/SmQDF/o0xXnSR43U3ohn7sT+80Bwx4UrMlR/vdvvYh VAB5qIuN0OaNIc3B7pwWPBWkLAq+S4AfP+NUkhJ8wiU3s4pymKArVWqDM+J6qzI5 QC9wu5LV/NyFwNL2LxPG1cspIHmzMaKw5rHyeMpMX2/FtDKv+T9XnxBqBh0VndNw YJaQkxhZovM576uQhmAX78TrB2TzUV3zXFMcNjRWa+18sBFWpJYYURqq8J0Gm6dU Po/bg== 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-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=Iqu7aiM+YIroLiBUczEaHqVF6BtuL5ajSQhwxWWP9 3U=; b=SSypmWheBzjUiYhmrz8vVSt+43tOUKOTDYpS779Dv0eaO5WVTnFSM4sRO ihH+N09oH76gK5InwsaYYhwHjDm/bp1UTqjHdRqKnt5bQvMUq2EJkNxi3DX90S1Z ttZ1wuyKxaJskJwWHFaBIZmezyWEj1RuZ3KiPKlFTWqZBN+7dWkqBYvPv0ee8wBe 5yA//lqL/tFUI+IY8nd9nPqwZJVG9nccxoluHlrHQ5N6KATBwTRW37WGZxyhGzm5 U96sSFHj+MY0T8X/B38AuZXyo5UsBSoDpksgw3A1nEx9pB3E5mquXvUGPVPVLFtc iE2VLjlJW/KXYXV9+oCpIOIYDDaOA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudehvddgtdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhffkffgfgggjtgfgsehtke ertddtfeejnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhk lhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecuggftrfgrthhtvghrnhephfeuudeute fftdfhuefhffehhfffueekfeelleeltdegveekteevtdffhfelteevnecuffhomhgrihhn pehsthgrtghkohhvvghrfhhlohifrdgtohhmnecukfhppeejhedrudejvddrhedrvdefud enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughr ihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Received: from [192.168.1.3] (75-172-5-231.tukw.qwest.net [75.172.5.231]) by mail.messagingengine.com (Postfix) with ESMTPA id 251CE3280059; Mon, 8 Jun 2020 09:14:43 -0400 (EDT) Subject: Re: "INSERT ON CONFLICT UPDATE" - Use of indexes ? To: Laura Smith , postgre References: From: Adrian Klaver Message-ID: Date: Mon, 8 Jun 2020 06:14:42 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 6/8/20 5:42 AM, Laura Smith wrote: > Hi, > > What'st the current state of play with indexes and ON CONFLICT ?  The docs seem to vaguely suggest it is possible, but this SO question (https://stackoverflow.com/questions/38945027/) seems to suggest it is not. > > I've got a unique named index on a table (i.e. "create unique index xyz...") but I cannot seem to be able to refer to it in a function ? > ON CONFLICT (index_name) .... : does not work > ON CONFLICT ON CONSTRAINT index_name....: does not work > The above is going to need more information: 1) Table definition. 2) Actual index definition 3) Complete ON CONFLICT definition 4) Error message returned. -- Adrian Klaver adrian.klaver@aklaver.com