delete_v.sql 1.56 KB
SELECT
    set_config('var.user_id', '0', FALSE);
DELETE FROM odsylacze
WHERE l_id_do IN (SELECT
                      id
                  FROM leksemy
                  WHERE ("leksemy"."slownik" = 'Morfologik' AND
                         pos IN ('v', 'ger', 'pact', 'ppas', 'appas')));
DELETE FROM odsylacze
WHERE l_id_od IN (SELECT
                      id
                  FROM leksemy
                  WHERE ("leksemy"."slownik" = 'Morfologik' AND
                         pos IN ('v', 'ger', 'pact', 'ppas', 'appas')));
DELETE FROM odmieniasie
WHERE l_id IN (SELECT
                   id
               FROM leksemy
               WHERE ("leksemy"."slownik" = 'Morfologik' AND
                      leksemy.pos IN ('v', 'ger', 'pact', 'ppas', 'appas')));
DELETE FROM leksemy_w_slownikach
WHERE l_id IN (SELECT
                   id
               FROM leksemy
               WHERE leksemy.pos IN ('v', 'ger', 'pact', 'ppas', 'appas') AND
                     slownik = 'Morfologik');
DELETE FROM leksemy_w_slownikach
WHERE l_id IN (SELECT
                   id
               FROM leksemy
               WHERE leksemy.pos IN ('v', 'ger', 'pact', 'ppas', 'appas')) AND
      slownik = 'Morfologik';
DELETE FROM kwalifikatory_leksemow
WHERE lexeme_id IN (SELECT
                        id
                    FROM leksemy
                    WHERE leksemy.pos IN ('v', 'ger', 'pact', 'ppas', 'appas')
                          AND slownik = 'Morfologik');
DELETE FROM "leksemy"
WHERE ("leksemy"."slownik" = 'Morfologik' AND
       leksemy.pos IN ('v', 'ger', 'pact', 'ppas', 'appas'));