Casting Smallint To Boolean In PostgreSQL


Answer :

CREATE OR REPLACE FUNCTION boolean1(i smallint) RETURNS boolean AS $$     BEGIN             RETURN (i::smallint)::int::bool;     END; $$ LANGUAGE plpgsql;  CREATE CAST (smallint AS boolean) WITH FUNCTION boolean1(smallint) AS ASSIGNMENT; 

Comments

Popular posts from this blog

Chemistry - Bond Angles In NH3 And NCl3

AspenTech InfoPlus 21 - How To Connect And Query Data

C/C++ Why To Use Unsigned Char For Binary Data?