From: Guyren Howe <guyren@gmail.com>
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
To: Russell Rose | Passfield Data Systems <russellrose@passfield.co.uk>
Subject: Re: Converting sql anywhere to postgres
Date: Wed, 16 Aug 2023 11:30:19 -0700
Message-ID: <3fa3d5c7-67b5-444e-9bbd-4e1a8d7f549a@Spark> (raw)
In-Reply-To: <VI1P191MB0638DF6A32205FA51983F92AF215A@VI1P191MB0638.EURP191.PROD.OUTLOOK.COM>
References: <VI1P191MB0638DF6A32205FA51983F92AF215A@VI1P191MB0638.EURP191.PROD.OUTLOOK.COM>
For some reason, I was thinking the rule could see just the fields from the command, but you’re right; a rule won’t work. Sorry.
Guyren G Howe
On Aug 15, 2023 at 23:22 -0700, Russell Rose | Passfield Data Systems <russellrose@passfield.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 row has 'myfield' set to 'me' then I don't think I can tell the difference between:
>
> Update mytable set afield='something'
> and
> Update mytable set afield='something',myfield='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 update statements
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: guyren@gmail.com, russellrose@passfield.co.uk
Subject: Re: Converting sql anywhere to postgres
In-Reply-To: <3fa3d5c7-67b5-444e-9bbd-4e1a8d7f549a@Spark>
References: <VI1P191MB0638DF6A32205FA51983F92AF215A@VI1P191MB0638.EURP191.PROD.OUTLOOK.COM> <3fa3d5c7-67b5-444e-9bbd-4e1a8d7f549a@Spark>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox