delete_ndm.sql 2.04 KB
SELECT
    set_config('var.user_id', '0', FALSE);
DELETE FROM odsylacze
WHERE l_id_od IN (SELECT
                      id
                  FROM leksemy
                  WHERE ("leksemy"."slownik" = 'Morfologik' AND pos IN
                                                                ('adv', 'advcom', 'conj', 'burk', 'interj', 'prep', 'qub', 'comp', 'advndm')));
DELETE FROM odsylacze
WHERE l_id_do IN (SELECT
                      id
                  FROM leksemy
                  WHERE ("leksemy"."slownik" = 'Morfologik' AND pos IN
                                                                ('adv', 'advcom', 'conj', 'burk', 'interj', 'prep', 'qub', 'comp', 'advndm')));
DELETE FROM odmieniasie
WHERE l_id IN (SELECT
                   id
               FROM leksemy
               WHERE ("leksemy"."slownik" = 'Morfologik' AND leksemy.pos IN
                                                             ('adv', 'advcom', 'conj', 'burk', 'interj', 'prep', 'qub', 'comp', 'advndm')));
DELETE FROM leksemy_w_slownikach
WHERE l_id IN (SELECT
                   id
               FROM leksemy
               WHERE leksemy.pos IN
                     ('adv', 'advcom', 'conj', 'burk', 'interj', 'prep', 'qub', 'comp', 'advndm')
                     AND slownik = 'Morfologik');
DELETE FROM leksemy_w_slownikach
WHERE l_id IN (SELECT
                   id
               FROM leksemy
               WHERE leksemy.pos IN
                     ('adv', 'advcom', 'conj', 'burk', 'interj', 'prep', 'qub', 'comp', 'advndm'))
      AND slownik = 'Morfologik';
DELETE FROM kwalifikatory_leksemow
WHERE lexeme_id IN (SELECT
                        id
                    FROM leksemy
                    WHERE leksemy.pos IN
                          ('adv', 'advcom', 'conj', 'burk', 'interj', 'prep', 'qub', 'comp', 'advndm')
                          AND slownik = 'Morfologik');
DELETE FROM "leksemy"
WHERE ("leksemy"."slownik" = 'Morfologik' AND leksemy.pos IN
                                              ('adv', 'advcom', 'conj', 'burk', 'interj', 'prep', 'qub', 'comp', 'advndm'));