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 1kvf8U-0004CU-1H for pgsql-general@arkaria.postgresql.org; Sat, 02 Jan 2021 11:31:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kvf7v-0005ea-Ca for pgsql-general@arkaria.postgresql.org; Sat, 02 Jan 2021 11:31:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kvf7v-0005eT-2X for pgsql-general@lists.postgresql.org; Sat, 02 Jan 2021 11:31:19 +0000 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kvf7o-0007Kz-C0 for pgsql-general@lists.postgresql.org; Sat, 02 Jan 2021 11:31:17 +0000 Received: by mail-ej1-x629.google.com with SMTP id t16so684332ejf.13 for ; Sat, 02 Jan 2021 03:31:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ur/CsOAp/zMUn2NT2MU0GbTbUs/RoXBYQn0p3UiJ17Y=; b=EZo/2hsxSxuHB4gWBDzNrTuHykaoLA8x2YrIx6B5+vidyqxGjfyb79GSMBY6oop7L7 qRwjgrxXD45wwpojfxtFOD/qHceDwqJhcjm5nTVbNrKtcvG43ZG1MGxqImgPdQU06Z+7 rh5FPUU9DiCvGv+qQ6gELZFvUbYZmUKr0HsB7BLqb+JjWaetugl+LK2U/51XSsywWI6Z SUJ8jgr96BfoKvPADha8ds+rrkJjme013/c2/rwOzlNBkCufx/cg5U/ec+5ShB7HJCuX pyJnxzA042W3JS7fC/nOQKgjecoEItdd9dE+rdn2afMx54jtDTaDCNIqPpU7pyYiPZSH Q95A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ur/CsOAp/zMUn2NT2MU0GbTbUs/RoXBYQn0p3UiJ17Y=; b=KFPeWacrgGA3yHt839H3E8gnVTTM4VhNPiDae3PnTOe4VmuFsfKOYv7fd+wZOYbtTU XGKlvfoHVY3C/5huH5uauOgfPMBo/B9O95fesSQiVWZaieoJAE+g4z9VreuQni6D6yJb fMAVyfQTTLmXqXCsorKuB4wiVQpkCLCw5PUA+CCW+kNfiB2F0gXUhtOPcjSS3VXwr9gE hUJj2vQ/dLyq7CZjg2zcBjBowkBekhtxgMqUs4iBtZRq/vQVwhkxbQMNEUEe2bHEC3/K QCPfKYqKkVs9ipVw7rx2xEUXgj+ps6TW/EJK3UbGeGi+ggohAkI0SHtlEULvMTuBE+Qa sjMg== X-Gm-Message-State: AOAM53350rctmXqnzg9MX+VcAxw1u7ibkQ4G0daFvKcNEfPT1yHt8nLK OULq+uKHWB94pjF1RwJkQZs= X-Google-Smtp-Source: ABdhPJwj1DCEd6CEPDL+o/xAHe4u/nxaOyzb6uizq31DtGBlnnWs++gcEPLniL1k6hQDmRr52gqYPA== X-Received: by 2002:a17:906:5f92:: with SMTP id a18mr61955504eju.126.1609587071712; Sat, 02 Jan 2021 03:31:11 -0800 (PST) Received: from hollewijn.internal (217-19-30-105.dsl.cambrium.nl. [217.19.30.105]) by smtp.gmail.com with ESMTPSA id n17sm21615404ejh.49.2021.01.02.03.31.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 02 Jan 2021 03:31:10 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\)) Subject: Re: Trigger with conditional predicates From: Alban Hertroys In-Reply-To: Date: Sat, 2 Jan 2021 12:31:09 +0100 Cc: "pgsql-general@lists.postgresql.org" Content-Transfer-Encoding: quoted-printable Message-Id: <47B9A4A8-9A09-4801-989B-AE2C657443DC@gmail.com> References: To: Dirk Mika X-Mailer: Apple Mail (2.3445.104.17) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > On 1 Jan 2021, at 16:56, Dirk Mika wrote: >=20 > Hi all and a happy new Year! >=20 > We have an Oracle schema that is to be converted to PostgreSQL, where = conditional predicates are used in some triggers. >=20 > In particular, columns are populated with values if they are not = specified in the update statement which is used. > Usually with an expression like this: >=20 > IF NOT UPDATING('IS_CANCELED') > THEN > :new.is_canceled :=3D ...; > END IF; >=20 > I have not found anything similar in PostgreSQL. What is the common = approach to this problem? >=20 > BR > Dirk Can't you use column defaults to handle these cases? Alban Hertroys -- There is always an exception to always.