This is a trigger function:
CREATE FUNCTION public.trigger_null2default() RETURNS trigger AS 'BEGIN
IF TG_RELNAME = ''g_oferty'' THEN
IF NEW.id_oferta ISNULL THEN
NEW.id_oferta = DEFAULT ;
END IF;
END IF;
RETURN NEW;
END;' LANGUAGE 'plpgsql' IMMUTABLE;
There is an error near DEFAULT when firing trigger (on insert)
How can I set defaults without doing INSERT INTO 'g_oferta' (DEFAULT, NEW...?
Martin