Weird behaviour after update from 12.2 to 12.3 version
От | Andrii Palko |
---|---|
Тема | Weird behaviour after update from 12.2 to 12.3 version |
Дата | |
Msg-id | CADdKkPmg-Hr+OxR7MV3Zwb5a_MSDgEqP1+fPfgSbK5Yf1mdPrg@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: Weird behaviour after update from 12.2 to 12.3 version
|
Список | pgsql-bugs |
Hello.
I've experienced strange behaviour after update minor version of postgres. Tested on Ubuntu 18.04.
I have update query with CTE using for merge 2 similar rows by particular columns, so it should get newer information from the new row and update the older row with this information. After the older row is updated with new data I delete a new row. So basically this is for updating information but saving old IDs.
This is my query:
As I understand such breaking changes shouldn't be in the minor version update, so it looks strange for me, also I didn't find anything about it in releases notes.
Hope it does make sense to you, let me know if you need anything more from me.
Thank you for your time, I'm looking forward to hearing from you,
Andrii Palko
I've experienced strange behaviour after update minor version of postgres. Tested on Ubuntu 18.04.
I have update query with CTE using for merge 2 similar rows by particular columns, so it should get newer information from the new row and update the older row with this information. After the older row is updated with new data I delete a new row. So basically this is for updating information but saving old IDs.
This is my query:
WITH nextRow AS (Update to version 12.3 broke this query. In 12.2 it works as expected but in version 12.3 it works conversely. It updates the newer row by information from the old row.
SELECT *
FROM product_attribute_options
ORDER BY id DESC
)
UPDATE product_attribute_options
SET cost_type_id = nextRow.cost_type_id,
price = nextRow.price,
price_function = nextRow.price_function,
width = nextRow.width,
height = nextRow.height,
show_on_frontend = nextRow.show_on_frontend,
show_on_backend = nextRow.show_on_backend,
label = nextRow.label,
updated_at = now()
FROM nextRow
WHERE product_attribute_options.product_attribute_id = nextRow.product_attribute_id
AND product_attribute_options.name = nextRow.name
AND product_attribute_options.deleted_at IS NULL
AND nextRow.deleted_at IS NULL;
As I understand such breaking changes shouldn't be in the minor version update, so it looks strange for me, also I didn't find anything about it in releases notes.
Hope it does make sense to you, let me know if you need anything more from me.
Thank you for your time, I'm looking forward to hearing from you,
Andrii Palko
В списке pgsql-bugs по дате отправления: