Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group