---    ALTER TABLE public._klapky

DO
$$
DECLARE velkost INTEGER;
BEGIN
IF EXISTS (SELECT numeric_precision FROM information_schema.columns WHERE table_schema='public' and table_name='_klapky' and column_name='velk_klp') THEN
	SELECT numeric_precision INTO  velkost FROM information_schema.columns WHERE table_schema='public' and table_name='_klapky' and column_name='velk_klp';
	IF velkost=1 THEN
			ALTER TABLE public._klapky ALTER COLUMN velk_klp TYPE numeric (2, 0);
	END IF;
END IF;
END
$$

