Common question: what's wrong

From: przygoda(at)klub(dot)chip(dot)pl
To: pgsql-novice(at)postgresql(dot)org
Subject: Common question: what's wrong
Date: 2005-01-13 13:32:54
Message-ID: 55972.213.77.90.234.1105623174.squirrel@klub.chip.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Lawrence Moran 2005-01-13 13:35:57 Copying a database
Previous Message Devrim GUNDUZ 2005-01-13 08:33:49 Re: rescue databases after upgrade?