Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
test
drop table if exists institution_abilities; drop table if exists user_specific_abilities; CREATE TABLE institution_abilities ( bill_pay boolean NOT NULL, payee_edit boolean, payee_deletion boolean ); CREATE TABLE user_specific_abilities ( bill_pay boolean, payee_edit boolean, payee_deletion boolean ); UPDATE user_specific_abilities SET payee_edit = bill_pay, payee_deletion = bill_pay; UPDATE institution_abilities SET payee_edit = bill_pay, payee_deletion = bill_pay; CREATE OR REPLACE function use_bill_pay_as_payee_abilities() RETURNS trigger language plpgsql AS $$ BEGIN new.payee_edit := new.bill_pay; new.payee_deletion := new.bill_pay; return new; END $$; create trigger institution_abilities_bill_pay_as_payee_abilities before insert or update on institution_abilities for each row execute procedure use_bill_pay_as_payee_abilities(); create trigger user_specific_abilities_bill_pay_as_payee_abilities before insert or update on user_specific_abilities for each row execute procedure use_bill_pay_as_payee_abilities(); insert into user_specific_abilities (bill_pay, payee_edit, payee_deletion) values (true, false, false); select * from user_specific_abilities;
run
|
edit
|
history
|
help
0
Return IDs where there are exactly 3 occurrences
Recursive inefficiency
OLA
remove properties from jsonb using function jsonb_set of PostgreSQL
PostreSQL: warehouse table
Sush_post1
funkcia_transakcie
Query integer in text field - Seemingly doesn't work as expected
SQL - Social Network Analysis by Patrick Lin
Ass2 q2