近期使用了一个非法的日期,导致存储过程ERROR,两个小时的工作白等了。

--20160430
_dateid integer; 
_tmpdate integer;

select to_char(to_timestamp(_dateid::text,'yyyyMMdd'),'yyyyMMdd')::integer into _tmpdate ;
if ( _tmpdate != _dateid ) then
  --raise notice 'dateid is invalid';
   return false;
end if;

 

相关文章: