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

Re: Common question: what's wrong

From: John DeSoi <desoi(at)pgedit(dot)com>
To: przygoda(at)klub(dot)chip(dot)pl
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Common question: what's wrong
Date: 2005-01-15 13:37:57
Message-ID: AA981ABA-66FA-11D9-8B4B-000A95B03262@pgedit.com (view raw or flat)
Thread:
Lists: pgsql-novice
On Jan 13, 2005, at 8:32 AM, przygoda(at)klub(dot)chip(dot)pl wrote:

> 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;


I don't know if this will solve it, but the value assignment should use 
":=" not "="


John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


In response to

pgsql-novice by date

Next:From: Terry Lee TuckerDate: 2005-01-15 13:55:59
Subject: Re: Common question: what's wrong
Previous:From: sarlav kumarDate: 2005-01-14 20:32:30
Subject: Re: SQL from shell script

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