Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rjn4R-007rs2-Ce for pgsql-general@arkaria.postgresql.org; Mon, 11 Mar 2024 21:20:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rjn4P-001Id1-Sp for pgsql-general@arkaria.postgresql.org; Mon, 11 Mar 2024 21:20:30 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rjn4O-001Ict-1t for pgsql-general@lists.postgresql.org; Mon, 11 Mar 2024 21:20:30 +0000 Received: from wfout8-smtp.messagingengine.com ([64.147.123.151]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rjn4F-0040sq-Vr for pgsql-general@lists.postgresql.org; Mon, 11 Mar 2024 21:20:27 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfout.west.internal (Postfix) with ESMTP id 9C3BA1C000D0; Mon, 11 Mar 2024 17:20:18 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 11 Mar 2024 17:20:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1710192018; x=1710278418; bh=zQ/fzgTZKQx/I51brXZ/BppxlmyV9j2S02m/oK8VbqY=; b= LNMu19guerBXvwenN3Pn8Y8p9LuZLG3GLHZEAfi2iSkYApoHfX/ADIgszyeKjufP /WgEkROmUl3UESgnmc54P+2J6s/HvnuPZohW73FDQCwgjfUSQdIJx8D5BcU/8QFA +p9pizEMwDecfbXq961MONI5w2jBSx/mBZ38navlswxFMU1Sh45Omm6BXg2YrCyA 11vVZMLHhCzykmhB2bhSFBHXcrgYWBFzW/DTDkKhQT8WqUmlpImbpsjOXoa+YgoT yVrTbb0Rg8x4gOttXQ3wSCNe9tgFn00F4T+y/IRwPzLB3txBgHkrYwY147z9t9BC IBjngftLMVEwi1zjj3HPOg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1710192018; x= 1710278418; bh=zQ/fzgTZKQx/I51brXZ/BppxlmyV9j2S02m/oK8VbqY=; b=C plj07qphxOShgFSndZ9p/4biSHkXUnRg/oF4lBo2YLJThgn1Jtiv8RxxTN4l3Mwx wkywoSa6chBGile1bdx0g84gr5qxxX1G2rym47IEvlQJU6d80rG1PyTcRZLIw8CX rIIOUdPKyNUKh+NvQ8lChUvrMp7zEJbyzxa/1NmxfasEqei373wWrkMTSpcLUFIy bbK+dWrAhAtq5/85bHmyRzWq1j26/cEvGeIyo8/vwsAU8+uYBpGdhfCwvubQHClL 55HbGvQQjHPGKVRlM3S1TQv3YYZomIZ58EOl0izVHCCP087BfA3EoqMtWquCZF6J d5Ur8FIqUySEozYq1KUXQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrjedugddugeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthekredttddvjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpeffleegieefgfevudehtdfhkeeutdffjeevgeffgeej vedthefgudeiteefheejheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 11 Mar 2024 17:20:17 -0400 (EDT) Message-ID: <18e5f2bb-ef4c-432b-9ad9-0514b7abb832@aklaver.com> Date: Mon, 11 Mar 2024 14:20:16 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: merge with view To: Lorusso Domenico , pgsql-general@lists.postgresql.org References: Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 3/11/24 13:25, Lorusso Domenico wrote: > Hello guys, > Merge isn't work on view; anyone know why? > I mean, merge could be performed in many way, but essentially is: > > * join sets > * if matched update or delete > * if not matched insert > > it doesn't seem to be relevant if set is a table or a view. > > Moreover also "insert + on conflict" doesn't work with view (in my case > is a view on a single table with an instead of trigger) Reply with: Postgres version View definition Example Merge query. Definition of doesn't work, with actual complete error message. > > There is a way to workaround to this issue? > > -- > Domenico L. > > per stupire mezz'ora basta un libro di storia, > io cercai di imparare la Treccani a memoria... [F.d.A.] -- Adrian Klaver adrian.klaver@aklaver.com