---    Rozšírenie stlpca DRUH v tabuľke BUFFER a BUFFERZAD
----    slovenskaverzi XX a=.T.       ----

DO
$$
BEGIN
IF EXISTS (SELECT table_name FROM information_schema.tables WHERE table_schema='food600' and table_name='buffer') THEN
	IF  EXISTS (SELECT column_name FROM information_schema.columns WHERE table_schema='food600' and table_name='buffer' and column_name='druh' and character_maximum_length=10) THEN
		ALTER TABLE food600.buffer ALTER COLUMN druh TYPE character(30) COLLATE pg_catalog."default";
	END IF;
END IF;


IF EXISTS (SELECT table_name FROM information_schema.tables WHERE table_schema='food600' and table_name='bufferzad') THEN
	IF  EXISTS (SELECT column_name FROM information_schema.columns WHERE table_schema='food600' and table_name='bufferzad' and column_name='druh' and character_maximum_length=10) THEN
		ALTER TABLE food600.bufferzad ALTER COLUMN druh TYPE character(30) COLLATE pg_catalog."default";
	END IF;
END IF;

END
$$
