Re: Transform_Null_Equals does not work in Functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Daniel Schuchardt <d(dot)schuchardt(at)prodat-sql(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Transform_Null_Equals does not work in Functions
Date: 2010-07-06 15:39:53
Message-ID: 29012.1278430793@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Daniel Schuchardt <d(dot)schuchardt(at)prodat-sql(dot)de> writes:
> CREATE OR REPLACE FUNCTION show_transform_problem(with_transform BOOL)
> RETURNS BOOL AS $$
> DECLARE result BOOL;
> BEGIN
> IF with_transform THEN
> SET transform_null_equals TO ON;
> END IF;
> RESULT:=NULL=1;
> SET transform_null_equals TO OFF;
> RETURN result;
> END $$ LANGUAGE plpgsql;

That isn't going to work unless you EXECUTE the target statement, so
that it's re-parsed from scratch every time.

It's highly unlikely that transform_null_equals will solve your problem
anyway. Find a more standards-compliant way.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2010-07-06 15:50:08 Re: moderninzing/upgrading mail list format
Previous Message Vick Khera 2010-07-06 15:36:28 Re: ERROR: canceling statement due to statement timeout