database-trigger Questions

2

I would like to use postgres_fdw and house a FOREIGN TABLE in my database. Is it possible to define a trigger on the local server for this FOREIGN TABLE that recognizes an INSERT event on the remot...
Barbour asked 5/6, 2019 at 17:49

2

In my MySQL database I have some triggers ON DELETE and ON INSERT. Sometimes I need to disable some triggers, and I have to DROP e.g. DROP TRIGGER IF EXISTS hostgroup_before_insert // and reins...
Toxoplasmosis asked 28/11, 2012 at 5:2

2

I have a trigger, but I need to associate with all tables of the my postgres. Is there a command like this below? CREATE TRIGGER delete_data_alldb BEFORE DELETE ON ALL DATABASE FOR EACH ROW EXECUT...
Erbes asked 16/4, 2015 at 12:54

7

Solved

I want to "create or replace" a trigger for a postgres table. However, there is not such sql expression. I see that I can do a "DROP TRIGGER IF EXISTS" first (http://www.postgresql.org/docs/9.5/st...
Bartholomeo asked 10/3, 2016 at 21:11

2

Solved

I want to create a trigger which counts rows and updates a field in an other table. My current solution works for INSERT statements but failes when I DELETE a row. My current function: CREATE OR R...
Larisalarissa asked 21/6, 2018 at 7:24

2

Solved

I installed postgresql and postgresql-plpython-10 (using apt) on a new machine running Ubuntu server 18.04 and I have reinstated a Postgresql database (extracted using pg_dumpall) from another mach...
Salo asked 8/8, 2019 at 23:17

2

I have a table with a trigger that updates a "modified" timestamp whenever the record changes. I did it with a BEFORE trigger: CREATE OR REPLACE FUNCTION update_modified() RETURNS trigger AS $$ B...

2

Solved

Is it possible to create a SQL trigger with Entity Framework Core. Maybe by using instruction in protected override void OnModelCreating(DbModelBuilder dbModelBuilder) { } Or simply by executi...
Victual asked 25/3, 2019 at 10:46

1

Solved

I have a table with a "currency" column. I'd like to prevent further insertion of certain currencies, without removing the existing ones. Initially I was thinking of a validation trigger....
Sexivalent asked 18/7, 2020 at 11:59

1

Solved

I have the following query: INSERT INTO LOAN (MemberSSN, VolumeID, LoanDate) OUTPUT inserted.MemberSSN, inserted.VolumeID, inserted.LoanDate VALUES ('488-40-', 2, GETUTCDATE()) I want a trigge...
Kop asked 26/5, 2020 at 15:30

3

Solved

Using Orcale SQL developer I want to map out a relationship between an employee and manager. However, a manager can only supervise a maximum of 3 employees. Above I have an employee table with M...
Turgot asked 24/11, 2019 at 12:58

3

Solved

I have the following table Data --Table name ID -- Identity column PCode -- Postal Code I created the following trigger: CREATE TRIGGER Trig ON Data FOR INSERT AS BEGIN Select * from inserte...
Onrush asked 13/11, 2016 at 16:57

2

I want to call rest api in a POST method from a stored procedure or trigger in mysql server on windows. How do I perform this solely with MySQL?
Seeker asked 7/11, 2016 at 16:46

6

Solved

Here's what I'm trying to do: When there's a new INSERT into the table ACCOUNTS, I need to update the row in ACCOUNTS where pk = NEW.edit_on by setting status='E' to denote that the particular (ol...
Spiccato asked 13/10, 2012 at 22:50

1

Solved

Is there a way to get the JSON of the only modified fields? Now I use the following trigger but the entire line is printed in the changelog. Example tables: TABLE tbl_changelog ( tbl TEXT, op ...
Shulamith asked 26/4, 2019 at 21:40

1

Solved

Using SQL Server 2012, is it possible to have nested triggers enabled at the server/database level but to disable nesting on one specific table/trigger?
Sum asked 22/4, 2014 at 16:13

2

I would like to create my first trigger on my PostgreSQL database but I got a syntax error. The trigger should be able to delete each row from token_jwt_usertoken table where date_information is i...
Lockman asked 7/2, 2019 at 16:3

1

Solved

I would like to call multiple procedures from a trigger in postgres. CREATE TRIGGER fn_trigger_notify_ev AFTER INSERT ON public.event_notifications FOR EACH ROW EXECUTE PROCEDURE public.notify_eve...
Dinh asked 5/1, 2019 at 8:13

2

Solved

I have a table with two data columns: col1 and col2. Col1 is text field and col2 is time. Col1 is required, col2 is not, so it should have a default value of null. I use pgAdmin, which is completel...
Barfuss asked 30/12, 2018 at 0:22

1

Solved

Please help with my understanding of how triggers and locks can interact I bulk load records to a table with statements something like this….. BEGIN; INSERT INTO table_a VALUES (record1) , (recor...
Kashmiri asked 1/11, 2018 at 21:42

2

i have two tables users and products and the association between them is that User has many products. I want to store the count of products in the users table and it should be updated at every inse...
Matadi asked 19/4, 2018 at 16:3

5

Solved

I have a trigger function for a table test which has the following code snippet: IF TG_OP='UPDATE' THEN IF OLD.locked > 0 AND ( OLD.org_id <> NEW.org_id OR OLD.document_code <> N...
Poleyn asked 21/6, 2010 at 10:12

5

I have a problem or misunderstanding with Postgre trigger -> perform notify -> capture into PHP flow. My Platform is PHP(5.6) in centos with Postgres. I have to add trigger with notifications t...
Arvind asked 9/5, 2014 at 18:49

3

Solved

This is an simplification of actual scenario; where is see missing records on Table B. Say there are two db tables A ; B. There is an on insert trigger on Table A;which do an insert to Table B (...
Estivation asked 21/11, 2017 at 8:0

4

There are two servers. The first is ERP system on production. The second one is the BI server for heavy analytical queries. We update the BI server on a daily basis via backups. However, it's not e...
Desmarais asked 10/10, 2017 at 7:4

© 2022 - 2024 — McMap. All rights reserved.