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 1spA0k-00H54j-IN for pgsql-general@arkaria.postgresql.org; Fri, 13 Sep 2024 17:23:11 +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 1spA0j-007tdb-1i for pgsql-general@arkaria.postgresql.org; Fri, 13 Sep 2024 17:23:09 +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 1spA0i-007tdJ-MI for pgsql-general@lists.postgresql.org; Fri, 13 Sep 2024 17:23:08 +0000 Received: from mail-qt1-x829.google.com ([2607:f8b0:4864:20::829]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1spA0f-000zto-UK for pgsql-general@lists.postgresql.org; Fri, 13 Sep 2024 17:23:07 +0000 Received: by mail-qt1-x829.google.com with SMTP id d75a77b69052e-4582f9abb43so17134241cf.2 for ; Fri, 13 Sep 2024 10:23:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726248185; x=1726852985; darn=lists.postgresql.org; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:from:to:cc:subject:date:message-id :reply-to; bh=HZTVNwiTjIXmw8y065ysIPYg1W0+H4ByqzxTVBKhUyc=; b=idqNljwMoHYNQ2RE/x7pAmseGHsfB9mUlzlFqXfl4lJSm2M/xRyudEDi/KN6knjqvW AoFq92QH+jxI7XBIOU3K5QAt1SPA7eCLNNCP9PgbT1RFqADZGhqF0meNp5enYKNJzLBO pucZis8V3B48t/WCzgBnIUU6HCpGMOusqfah8Ax1zA8sZiL2qDS+qlEHT17SY7+sUc+X j8ion5UyZo6WbTEgdwIJoUrl9U8U5n6ItV9WMK2976NeNh1alCCjw1BUNnV3I/T9ZxCc DIz/kQD5HyfBn4V35zA9e0noq7wqSoF+gIPEzBCGXMGHHpg5nNn3PIgQESaHxxb0LLHa MCNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726248185; x=1726852985; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HZTVNwiTjIXmw8y065ysIPYg1W0+H4ByqzxTVBKhUyc=; b=er9T5TnStAaDT0N16PwF92HImVvjsACWF291CVivtR+w1nKXWRkvX3Iu77OSTmEkk7 2E+cOSyiJ1u1mKvORg8OYlyLur3AQGGX0xQDrn1uuEnO59ssUfC5iHvyHPauCXghILJR HbazBcxCsIPBQl4N9zQWlgu0JGkbPvWLv0setzBi266/AeXOoW8H2TCGNvk6AkQcFJwp s4NcgxHHK0zugIm5GGuKqPghNwl2/n1Ag1Qemafx4D2Ow9wg/E+wcjonLQ/29dBgzSxk OG2UsMGlndRCskwa92n6CzhIIfEtRoMTDfpCMJJ7yHa22Fr8cc0hOSpzuUyZc4xH/RTk nvKQ== X-Forwarded-Encrypted: i=1; AJvYcCXP4EDyninVCE0nz4v1NEQKV1r6rC8Z1WRijJ9B+U8AZ2nDM5LT/DYRADEccJ6f0MzfFKaH9Y1RNKh2Nw6r@lists.postgresql.org X-Gm-Message-State: AOJu0YznRwJfSLG15znWz0QUaq/stPh3njHoDQf5tVPbGeBy1gf6PgGP U51dHqirXRPoh5r5SyoBPUsppRMnemvLc2F+PJmr2bzK2f062WT8 X-Google-Smtp-Source: AGHT+IEOoq4u9ootIKJP7MWKSb9LDDw/wL11J4prFZk7G6hV5nhpU4WcUC0q+RJpLLPLqL1y6KSWjg== X-Received: by 2002:ac8:5f91:0:b0:458:3b68:ce39 with SMTP id d75a77b69052e-458602bf784mr97563751cf.9.1726248185014; Fri, 13 Sep 2024 10:23:05 -0700 (PDT) Received: from smtpclient.apple ([2603:7081:3d00:f9:383d:1e9d:cff2:8ff9]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-45822d435cfsm67599391cf.0.2024.09.13.10.23.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 13 Sep 2024 10:23:04 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Rob Sargent Mime-Version: 1.0 (1.0) Subject: Re: Manual query vs trigger during data load Date: Fri, 13 Sep 2024 13:22:53 -0400 Message-Id: References: <67f2a664-b480-40ea-892d-2ab2147ad390@aklaver.com> Cc: Juan Rodrigo Alejandro Burgos Mella , yudhi s , pgsql-general In-Reply-To: <67f2a664-b480-40ea-892d-2ab2147ad390@aklaver.com> To: Adrian Klaver X-Mailer: iPhone Mail (21G93) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Sep 13, 2024, at 10:57=E2=80=AFAM, Adrian Klaver wrote: >=20 > =EF=BB=BFOn 9/13/24 07:50, Adrian Klaver wrote: >>> On 9/13/24 02:58, Juan Rodrigo Alejandro Burgos Mella wrote: >>> Hello, I find it unlikely that the trigger will work properly, since the= reserved fields of the OLD subset have no value in an INSERT >> I'm not seeing that the OP is asking for OLD.* values, they are just look= ing to include the result of a lookup on another table in the INSERT. >=20 > My mistake I see the OLD reference now. >=20 >>>=20 Personally I would cache the lookup on the java side a send the correct valu= e to a simple insert statement >=20 >=20 >=20