Search Postgresql Archives

Transform_Null_Equals does not work in Functions

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

 



Hy Group,

we use:
 PostgreSQL 9.0alpha4, compiled by Visual C++ build 1400, 32-bit

and i tried to set Transform_null_equals in a Trigger to avoid a complex If Statement with many Coalesce, but it didnt work. You can try it easily with that example:


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;


SUNFLOWER=# SELECT show_transform_problem(false);
 show_transform_problem
------------------------

(1 row)


SUNFLOWER=# SELECT show_transform_problem(true);
 show_transform_problem
------------------------

(1 row)


SUNFLOWER=# SET transform_null_equals TO ON;
SET
SUNFLOWER=# SELECT null=1;
 ?column?
----------
 f
(1 row)


--

Daniel Schuchardt
Softwareentwicklung

http://www.prodat-sql.de


[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