Re: Converting sql anywhere to postgres

Поиск
Список
Период
Сортировка
Искать
От
Guyren Howe
Тема
Re: Converting sql anywhere to postgres
Дата
Msg-id
c1a8ee64-711b-407a-b119-918a91d0bbfa@Spark
Ответ на
Converting sql anywhere to postgres (Russell Rose | Passfield Data Systems)
Список
Дерево обсуждения
Re: Converting sql anywhere to postgres Russell Rose | Passfield Data Systems <russellrose@passfield.co.uk>
Re: Converting sql anywhere to postgres Guyren Howe <guyren@gmail.com>
Re: Converting sql anywhere to postgres Rob Sargent <robjsargent@gmail.com>
Re: Converting sql anywhere to postgres Adrian Klaver <adrian.klaver@aklaver.com>
Re: Converting sql anywhere to postgres Rob Sargent <robjsargent@gmail.com>
Re: Converting sql anywhere to postgres Adrian Klaver <adrian.klaver@aklaver.com>
I’m fairly confident you can do this using a Rule. It would even be fairly simple.

Be careful, though: Rules are Postgres’ biggest potential foot gun.

Guyren G Howe
On Aug 15, 2023 at 08:05 -0700, Russell Rose | Passfield Data Systems <russellrose@passfield.co.uk>, wrote:

Hi there

 

I am trying to convert a SQL Anywhere database to postgres. Within SQL anywhere a field can have a default value of ‘last user’. This means that when you perform an update on a table, if the field is not explicitly set then the current user is used. So for instance if I have a field called mod_user in a table, but when I do an update on the table and do not set mod_user then SQL Anywhere sets the field to current_uer. I have tried to replicate this using a postgres trigger in the before update. However, if I do not set the value then it automatically picks up the value that was already in the field. Is there a way to tell the difference between me setting the value to the same as the previous value and postgres automatically picking it up.

 

If the field myfield contains the word ‘me’. Can I tell the difference between:

Update table1 set field1=’something’,myfield=’me’

And

Update table1 set field1=’something’

 

В списке pgsql-general по дате отправления
От: Adrian Klaver
Дата:
От: Andreas Joseph Krogh
Дата:
FAQ