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 1scmTV-00AQua-0Z for pgsql-general@arkaria.postgresql.org; Sat, 10 Aug 2024 13:49:41 +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 1scmTT-008qbv-7x for pgsql-general@arkaria.postgresql.org; Sat, 10 Aug 2024 13:49:39 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1scmTS-008qbn-Ss for pgsql-general@lists.postgresql.org; Sat, 10 Aug 2024 13:49:38 +0000 Received: from mail-oi1-x22e.google.com ([2607:f8b0:4864:20::22e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1scmTN-0048Ve-Fk for pgsql-general@lists.postgresql.org; Sat, 10 Aug 2024 13:49:38 +0000 Received: by mail-oi1-x22e.google.com with SMTP id 5614622812f47-3db19caec60so2056502b6e.1 for ; Sat, 10 Aug 2024 06:49:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723297771; x=1723902571; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=wwduGoU3fhq1aYGNttzz/tLt0x5Ilpv+D7pEbHhOle4=; b=YI1ad/ikK7u9sYnfnvhAps4eQBN4LFtzyyAxQKLdW46I0UmRndqQz63AfxRHuzD7kO Y2GWQZfESJVgO2t7fSipZqsC2ZAHNRBajYIkx8T4R2h0I8fw/EPLI21x1ofZ8+8xCh6U ZT6p2Y9+jnJjvildvx1FELNd0LQnqg6sljDQisV4We1Ts6dlX16yRFFZlTp+wefzv9GA z7mp1lF6BjRdpWWGAxs/nF0zC7t72JRj5LrDAJfsgYDDINVbX5DiPbofVn3snSH1MsN0 ZG/TvS/Lb1vFg049hdEliV/jVwdtxBQvSXAuO6zd086GxGt2eXATHK/zrbhw+0YZS+bX zPUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723297771; x=1723902571; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wwduGoU3fhq1aYGNttzz/tLt0x5Ilpv+D7pEbHhOle4=; b=IFI07q1SxViVTKBYeabydfV79Hc1bp+CNrRd5EOgJCTCY/2TcwKzwHyKV4CbtVIhQ8 dlo3FN73HvPBemJTFR4urv5sumysrRIBoyeTuCb3wWdXLLxCYYXG6U/i0VasAtL883D4 rTwzZPkypD+hCXfGWkB1zO21csfvk4t+tZfp1DdwBRmm6IdoyqzyRcZtkDUOyWmpNRyY Q9gc8CnpaDcvdO+ZhkMSZHQ1/+YgHhjqdroHcXqcEJaV4ZdQyzpZiEqTnBOmMQYY6r3H 2wFF2frgvLPVW2Ufe/qi9QgzcxZ2bmfAwAIsyfqpuGjghRvP14kY2kIYzQ9ZSJOL3kGN 5y9Q== X-Forwarded-Encrypted: i=1; AJvYcCUTOrcv7qO57ZyppbzHxNZlxkVfo+2owq397kqSlW22rxshSMTW/m9Yu1ziX78FLM/epsrLop/YujnPp1eoI6TihTPU/6R2QBw/LL+JrnvAq9bA X-Gm-Message-State: AOJu0YwhrnB/Iv3RyD41J+PL5L69LfCcB7PD+dw8zioX3WRev03HOH1G qv4Ou10hByp5A9GZ/MaFuB5Ga4+jeZQVT2BkD0MD7kkRwQFVbk/xJwQAZb8fsfAEGQCcyV/NKz5 q30jUxMKv/DdO1ajZ7wiQz4vhjO0= X-Google-Smtp-Source: AGHT+IG80f8o8zbBAVpVsK1PZ6G+crGBz8jFtShKb4Njis6UOR6rfGILgcFV62kbf8ZyvNZePG3JUHYPNYYdMBdu56M= X-Received: by 2002:a05:6830:6608:b0:700:d3b7:4ede with SMTP id 46e09a7af769-70b74874137mr6475048a34.27.1723297771114; Sat, 10 Aug 2024 06:49:31 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a8a:e86:0:b0:557:c384:fb61 with HTTP; Sat, 10 Aug 2024 06:49:30 -0700 (PDT) In-Reply-To: References: <37e09717-f121-4192-b152-18df17713414@aklaver.com> From: "David G. Johnston" Date: Sat, 10 Aug 2024 06:49:30 -0700 Message-ID: Subject: Re: Insert works but fails for merge To: yudhi s Cc: Adrian Klaver , pgsql-general Content-Type: multipart/alternative; boundary="0000000000007d5676061f548769" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000007d5676061f548769 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Saturday, August 10, 2024, yudhi s wrote: > > In our case , we were using this merge query in application code(in Java) > as a framework to dynamically take these values as bind values and do the > merge of input data/message. > I=E2=80=99d do most anything before resorting to dynamic SQL. Usually one = can simply write: values ($1::timestamptz) without resorting to a catalog lookup. Or maybe write a function to do the merge. Or maybe insert to a temporary table then merge that. David J. --0000000000007d5676061f548769 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Saturday, August 10, 2024, yudhi s <learnerdatabase99@gmail.com> wrote:

In our case , we were using this merge query in applicatio= n code(in Java) as a framework to dynamically take these values as bind val= ues and do the merge of input data/message.=C2=A0

I=E2=80=99d do most anything before resorting to d= ynamic SQL.=C2=A0 Usually one can simply write: =C2=A0values ($1::timestamp= tz) without resorting to a catalog lookup.

Or mayb= e write a function to do the merge.=C2=A0 Or maybe insert to a temporary ta= ble then merge that.

David J.

--0000000000007d5676061f548769--