Re: Proposal: ON UPDATE REMOVE foreign key action

From: Kirill Berezin <enelar(at)exsul(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Kirill Berezin <enelar(at)exsul(dot)net>, Vitaly Burovoy <vitaly(dot)burovoy(at)gmail(dot)com>, Pantelis Theodosiou <ypercube(at)gmail(dot)com>
Subject: Re: Proposal: ON UPDATE REMOVE foreign key action
Date: 2016-10-04 15:25:46
Message-ID: CAAObgf8CGnjbGjJBCKvkG2xPU4e8G9f+D7fO4Zx2ButwwJLdng@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Disclaimer: sorry, i dont understand, should i reply to each of you
personally, or just answer to channel. Some feedbacks were sended in
personal, and some include channel copy.

Thanks for responses, you understand it correctly.

When i said "anybody", i mean inclusive owner himself. For example cookie
poisoning.
There is no "another" session, technically. They similar to the server,
they even can have same IP.
Yes, we can't prevent it with CSRF cookies, but it is not the point of
current conversation.

I can make business logic outside table: make extra query. Im just dont
like how it looks from perspective of encapsulation.
Each table should describe itself, like object in OOP language. With SQL
constructions or triggers/constraits.

Second part of my use case is data cache. When user update
version(generation), cache should be flushed. As easy example: imagine i am
fetching currency value. And till end of the day, i am honor current
course. (Or any other information, that has certain origin checkpoints).
When i am updating origin state (current day, server version, ip address,
neural network generation), i am have to invalidate all previous data.

Like i am calculating digits of the square root, of some number. The more i
spend time, the closer my approx value to irrational result. But when
original value has changed - all previous data does not make sense. I am
flushing it and starting from digit 1.

This is allegorical examples to my real-world cases. I may try imagine some
hypothetical situations, when this functionality more welcomed. But, i am
respect reasons why do not apply this proposal. If my update didn't shift
the balance, its ok. on update trigger is not such painful.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2016-10-04 15:29:46 Re: proposal: psql \setfileref
Previous Message Robert Haas 2016-10-04 15:20:18 Re: pgsql: Extend framework from commit 53be0b1ad to report latch waits.