MYSQL Trigger Causing Lock
I have a trigger on a mysql table that inserts into another table (see trigger below). It would appear this trigger is causing a lock on the other table that is then preventing other inserts into the same table that…
I have a trigger on a mysql table that inserts into another table (see trigger below). It would appear this trigger is causing a lock on the other table that is then preventing other inserts into the same table that…
I have a PostgreSQL trigger that fires after an INSERT on the auth.users table, calling a function handle_new_user() which, in turn, calls insert_into_profiles() to add user data to another table. The insert_into_profiles function is defined as follows: CREATE OR REPLACE…
I am creating a database that holds information for tests, test questions, and the questions on each test. I have 3 tables: problem, test, & question_list. problem holds the information for a question, test holds the information for a test,…
I'm trying to figure out a way to list all numbers between two columns (INT) and join them in a third column where all numbers are seperated. Eg. Column A Column B Column C 100 105 100;101;102;103;104;105 10 14 10;11;12;13;14…
I want to use a trigger in Postgresql to "delete" data from specific columns (set to NULL), when a other column in the same relation is updated. This could look like this in the trigger function: IF OLD.column_1 IS DISTINCT…
I need to create a PostgreSQL PL/pgSQL code capable of simulating a simple transfer of money from one account to another. So here is my code: DROP TABLE clients, accounts, transactions; CREATE TABLE IF NOT EXISTS clients ( id int…
I have a spreadsheet that multiple people have access to edit. As part of the spreadsheet, I have a script that copies some data from one sheet to another when a checkbox on that row is set to true to…
I am pretty new to this topic. So i have this table: Table "public.client" Column | Type | Collation | Nullable | Default --------------------------+-------------------+-----------+----------+--------- contact_phone | character(11) | | not null | status | character(11) | | not null |…
Is there a way to iterate through individual fields of OLD records in a Postgres plpgsql trigger? I want to write a trigger function that logs all the changes that were made to the particular fields of a record. For…
I create one trigger from Mysql and my targer is when has update value of filed extpoint2 trigger will update value of filed left_coin and set value of this to: left_coin + ( new.extpoint2 - old.extpoint2 ); and this is…