database in a single query ?
Which tool? Is a stored procedure Acceptable. But you must loop over all the tables involved. (information_schrema.tables) and then ALTER TABLE <tbl> DISABLE TRIGGER ALL; select FORMAT('ALTER TABLE %I.%I DISABLE TRIGGER all;',table_schema,table_name) as cmd from i nformation_schema.tables limit 4; And as a pseudo function: DO $$ DECLARE cur_tables CURSOR FOR select FORMAT('ALTER TABLE %I.%I DISABLE TRIGGER all;',table_schema,table_name) as cmd from information_schema.tables limit 4; BEGIN FOR cval in cur_tables LOOP RAISE NOTICE 'EXECUTE(%);', cval.cmd; -- EXECUTE cval.cmd; -- The Real Command END LOOP; END; $$; But be careful, get the schema_name filtered down to your tables.
Ir you want this for your session you can use session_replication_role = replica
Don't want to loop through tables.
Can you please elaborate
Please read his answer more carefully, not just the first two lines 😁
I did read it . Its done in loop in procedure . I m searching for a straight SQL query that can be fired via php . But seems there is no provision for the same
Well, it's a shame. Of course, remove the "limit 4" from the SQL to test it.
There's not a one query thing available to ruine your data integrity by disabling all triggers. Make a procedure of the code @CaptainKirkFan published and than it's one stupid query to run from your php source code. Or change the session as Marcos showed you. If you don't want to handles databases, write your data to files.
Yeah got it . Thanks everyone
Обсуждают сегодня