Is it possible to use the trigger function of PostgreSQL to say "Do not UPDATE when the data of a certain column of a certain table is 1"?
If possible, please tell us the specific implementation.
CREATE TABLE id_list ( id );
# SELECT id FROM id_list; id ------- 1 2 3
[What I want to achieve]
If id is 1, do not update the data
# UPDATE id_list SET id = 4 WHERE id = 1; # SELECT id FROM id_list; id ------- 1 ← Not updated if id is 1 2 3
# UPDATE id_list SET id = 4 WHERE id = 2; # SELECT id FROM id_list; id ------- 1 4 ← Updated if id is 4 3
Answer # 1
There is a function you want. Please use it after confirming the operation properly.
... But even with these types of triggers, it is possible to interrupt the entire operation by raising an error.
- error occurred in postgresql trigger function and stored procedure
- function - is it possible to use subtotal and importrange together?
- about void update function in c #
- c # - update characters in postgresql
- c # - [visual studio] is it possible to jump to the function loaded by dll import?
- c ++ - is it possible to use a function within a function?
- postgresql - can't make login function well with ruby on rails
- postgresql - i want to join another table with postgres and update it
- i want to update the db value in postgresql
- is it possible to execute the function called by passing the function name as an argument in python3?
- perl - when using update with postgresql, setting integer column ='' results in an error
- postgresql - no method error with tagged function
- python - is it possible to implement a function such as "if you interrupt deep learning at any stage, save the learning sta
- vbscript - is it possible to use the datediff function to find the number of days from the start date to the end date (with a ra
- about the sequence function of postgresql
- how to implement "like function" in servlet, java, postgresql?
- python - you may need to restart the kernel to use updated packages error
- php - coincheck api authentication doesn't work
- php - i would like to introduce the coincheck api so that i can make payments with bitcoin on my ec site
- [php] i want to get account information using coincheck api
- the emulator process for avd pixel_2_api_29 was killed occurred when the android studio emulator was started, so i would like to
- i want to call a child component method from a parent in vuejs
- python 3x - typeerror: 'method' object is not subscriptable
- dart - flutter: the instance member'stars' can't be accessed in an initializer error
- xcode - pod install [!] no `podfile 'found in the project directory