Re: Converting sql anywhere to postgres - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Converting sql anywhere to postgres
Date
Msg-id 7de51aeb-600d-3375-ad65-6249f8e8f8a9@aklaver.com
Whole thread Raw
In response to Re: Converting sql anywhere to postgres  (Rob Sargent <robjsargent@gmail.com>)
Responses Re: Converting sql anywhere to postgres
List pgsql-general
On 8/16/23 12:01, Rob Sargent wrote:
> On 8/16/23 12:30, Guyren Howe wrote:
>> 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
>>>
> If the original value in the user column is "me", what is the difference 
> between "set other_column = some_value, user = 'me'" and "set 
> other_column = some_value" at the business level?

Affirmation that the user updating the record explicitly set the user value.

-- 
Adrian Klaver
adrian.klaver@aklaver.com




pgsql-general by date:

Previous
From: Rob Sargent
Date:
Subject: Re: Converting sql anywhere to postgres
Next
From: Ron
Date:
Subject: Re: Creating a TABLESPACE