Common question: what's wrong - Mailing list pgsql-novice

From przygoda@klub.chip.pl
Subject Common question: what's wrong
Date
Msg-id 55972.213.77.90.234.1105623174.squirrel@klub.chip.pl
Whole thread Raw
Responses Re: Common question: what's wrong  (John DeSoi <desoi@pgedit.com>)
Re: Common question: what's wrong  (Terry Lee Tucker <terry@esc1.com>)
List pgsql-novice
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

pgsql-novice by date:

Previous
From: sarlav kumar
Date:
Subject: Re: SQL from shell script
Next
From: Christopher Browne
Date:
Subject: Re: postgresql or mysql or oracle?