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

Are Regular VACUUM ANALYZE Still Recommended Under 9.1?

Change The Font Size Of Visual Studio Solution Explorer