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 1qWLIA-002x7y-GG for pgsql-general@arkaria.postgresql.org; Wed, 16 Aug 2023 18:30:50 +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 1qWLI8-008b47-MC for pgsql-general@arkaria.postgresql.org; Wed, 16 Aug 2023 18:30:48 +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 1qWLI8-008b3z-9V for pgsql-general@lists.postgresql.org; Wed, 16 Aug 2023 18:30:48 +0000 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qWLI3-000WDB-Bs for pgsql-general@lists.postgresql.org; Wed, 16 Aug 2023 18:30:47 +0000 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-68896d7eb1eso301455b3a.3 for ; Wed, 16 Aug 2023 11:30:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692210640; x=1692815440; h=mime-version:subject:references:in-reply-to:message-id:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=jeh3ntzD379xRerc40wJzHCP9kIluHUqh1J7l1Y1zNM=; b=AEgqI0kyZRI+XncsoLwwr9ioORG+2bNZvd7WjoHgBESmzfZlkmKqEcQSBd4kKvZ/ye wcFPgsZSrJ8WNY55H0yZ17aHPypQ2uUofakLg65Rcbv0TH2sy48ByKJp1dD49TESw20L DO65ThWokYykm/nQNGdWVQ0v7SQoBjMk8IcnTOPsnV0842olLIqEBPD2aVKII20uWA/s 8fSTSYcj0ZKzz1dv5qj12lpKhDJuK++rELf3icbSWMdRXUGk8wbakSFuSesFEls/mfT/ +EUB3+RjxBHwDUU8Qc+ZEijgpIZ0Flco8GTM8a+RJGOyO8CWaobtLKInrAHdvccihTPQ 5f/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692210640; x=1692815440; h=mime-version:subject:references:in-reply-to:message-id:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jeh3ntzD379xRerc40wJzHCP9kIluHUqh1J7l1Y1zNM=; b=W/nx7ZA2TpS9WAf4/fHDK/QsmG/pdw2qNKVhvfk787XI0ws8kvgdgtXqRUqaKBJID6 bEtSWZ4/XlDkDRvRvl97h6eIWcFCdJ+kRUhlnk2Gf66gDOntG8+oYId+LPP6POBvOKxQ MGTZdTgAl79U2Q1D6kqHSqpX6ZMjCybmXOyh6DheJHW5ydDpXIcnYmFz2eR2hlUO7sdO s5VQeCrmtgyis0l+crRD1VWcTmYHHM4HlMV79BRpkQbVeQVt8BjHm4Na1oYJSgahH6IR Svl9yxgaaTTLEBtymXT1LY26HFKtgfEnIXxB3i8xPs6c1/GNLkDajqZ3uzj59qQW5eAV ZIaA== X-Gm-Message-State: AOJu0Yw74hPHNZM/QyxixiOk+9dqwZqd2NysaJJKMb7c4iIq/PeVWW7i K8u3uKmH6G+7zTWHx8BCB+lPaLgiOIYobw== X-Google-Smtp-Source: AGHT+IGRdu5KTEZZBDkf/1im8PVKGnJRN0irgjf6Rhb95ghP7Cb+4l07eSlGIU818dpfI9Vi1ejCTQ== X-Received: by 2002:a05:6a00:24c6:b0:687:3e8f:2211 with SMTP id d6-20020a056a0024c600b006873e8f2211mr3263162pfv.34.1692210640115; Wed, 16 Aug 2023 11:30:40 -0700 (PDT) Received: from [2600:8801:8600:631:b2:c70c:100:0] ([2600:8801:8600:631::e]) by smtp.gmail.com with ESMTPSA id u20-20020a62ed14000000b006870b923fb3sm11327103pfh.52.2023.08.16.11.30.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Aug 2023 11:30:39 -0700 (PDT) Date: Wed, 16 Aug 2023 11:30:19 -0700 From: Guyren Howe To: "=?utf-8?Q?pgsql-general=40lists.postgresql.org?=" , =?utf-8?Q?Russell_Rose_=7C_Passfield_Data_Systems?= Message-ID: <3fa3d5c7-67b5-444e-9bbd-4e1a8d7f549a@Spark> In-Reply-To: References: Subject: Re: Converting sql anywhere to postgres X-Readdle-Message-ID: 3fa3d5c7-67b5-444e-9bbd-4e1a8d7f549a@Spark MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="64dd15cd_4268e950_10fcd" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --64dd15cd_4268e950_10fcd Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline =46or some reason, I was thinking the rule could see just the fields from= the command, but you=E2=80=99re right; a rule won=E2=80=99t work. Sorry.= Guyren G Howe On Aug 15, 2023 at 23:22 -0700, Russell Rose =7C Passfield Data Systems <= russellrose=40passfield.co.uk>, wrote: > I have just had a quick look at rules and I am not sure how it can be d= one. Rules still use the concept of NEW and OLD. If my original row has '= myfield' set to 'me' then I don't think I can tell the difference between= : > > Update mytable set afield=3D'something' > and > Update mytable set afield=3D'something',myfield=3D'me' > > Within the rule I think NEW.myfield will be set to 'me' in both cases. = Please can you explain how I can tell the difference between the two upda= te statements > --64dd15cd_4268e950_10fcd Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
=46or some reason, I was thinking the rule could se= e just the fields from the command, but you=E2=80=99re right; a rule won=E2= =80=99t work. Sorry.

Guyren G Howe
On Aug 15, 2023 at 23:22 -0700, Rus= sell Rose =7C Passfield Data Systems <russellrose=40passfield.co.uk>= ;, wrote:
I have just had a quick look at rules and I am not sure how it = can be done. Rules still use the concept of NEW and OLD. If my original r= ow has 'myfield' set to 'me' then I don't think I can tell the difference= between:

Update mytable set afield=3D'something'
and
Update mytable set afield=3D'something',myfield=3D'me'

Within the rule I think NEW.myfield will be set to 'me' in both cases. Pl= ease can you explain how I can tell the difference between the two update= statements

--64dd15cd_4268e950_10fcd--