Search Postgresql Archives

Re: dollar-quoting trouble

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Karsten Hilbert wrote:
> Hi all,
> 
> I can't spot the trouble with this function definition:
> 
> create function dem.trf_null_empty_title()
> 	returns trigger
> 	language plpgsql
> 	as $null_empty_title$
> begin
> 	if (NEW.title is null) then
> 		return NEW;
> 	end if;
> 
> 	if trim(NEW.title) <> '' then
> 		return NEW;
> 	end if;
> 
> 	NEW.title := NULL;
> 	return NEW;
> end;
> $null_empty_title$;

Works for me ...

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux