what's wrong with this? create type tSession as ( ty_found boolean, ty_Session char(32) ); create or replace function GetSessionID( integer ) returns tSession as ' declare thisSession tSession; begin --HERE!!! thisSession := ( ''t'', md5( now( ) || rand( ) ) ); return thisSession; end; ' language plpgsql; thx ---------------------------(end of broadcast)--------------------------- TIP 7: don't forget to increase your free space map settings