delete_subst.sql 1.48 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 ('subst', 'osc', 'skrs')));
DELETE FROM odsylacze
WHERE l_id_od IN (SELECT
                      id
                  FROM leksemy
                  WHERE ("leksemy"."slownik" = 'Morfologik' AND
                         leksemy.pos IN ('subst', 'osc', 'skrs')));
DELETE FROM odmieniasie
WHERE l_id IN (SELECT
                   id
               FROM leksemy
               WHERE ("leksemy"."slownik" = 'Morfologik' AND
                      leksemy.pos IN ('subst', 'osc', 'skrs')));
DELETE FROM leksemy_w_slownikach
WHERE l_id IN (SELECT
                   id
               FROM leksemy
               WHERE leksemy.pos IN ('subst', 'osc', 'skrs') AND
                     slownik = 'Morfologik');
DELETE FROM leksemy_w_slownikach
WHERE l_id IN (SELECT
                   id
               FROM leksemy
               WHERE leksemy.pos IN ('subst', 'osc', 'skrs')) AND
      slownik = 'Morfologik';
DELETE FROM kwalifikatory_leksemow
WHERE lexeme_id IN (SELECT
                        id
                    FROM leksemy
                    WHERE leksemy.pos IN ('subst', 'osc', 'skrs') AND
                          slownik = 'Morfologik');
DELETE FROM "leksemy"
WHERE ("leksemy"."slownik" = 'Morfologik' AND
       leksemy.pos IN ('subst', 'osc', 'skrs'));