Index: contrib/seg/segparse.y
===================================================================
RCS file: /home/cvsmirror/pgsql/contrib/seg/segparse.y,v
retrieving revision 1.14
diff -c -r1.14 segparse.y
*** contrib/seg/segparse.y	14 Sep 2004 04:21:38 -0000	1.14
--- contrib/seg/segparse.y	19 Oct 2004 15:16:56 -0000
***************
*** 2,7 ****
--- 2,9 ----
  #define YYPARSE_PARAM result  /* need this to pass a pointer (void *) to yyparse */
    
  #include "postgres.h"
+ #include "fmgr.h"
+ #include "utils/builtins.h"
  
  #include <math.h>
  
***************
*** 129,149 ****
  %%
  
  
! float seg_atof ( char *value ) {
    float result;
!   char *buf = (char *) palloc(256);
! 
!   errno = 0;
!   sscanf(value, "%f", &result);
! 
!   if ( errno ) {
!     snprintf(buf, 256, "numeric value %s unrepresentable", value);
!     ereport(ERROR,
! 		    (errcode(ERRCODE_SYNTAX_ERROR),
! 		     errmsg("syntax error"),
! 		     errdetail("%s", buf)));
!   }
  
    return result;
  }
  
--- 131,143 ----
  %%
  
  
! float seg_atof ( char *value ) 
! {
    float result;
!   Datum datum;
  
+   datum = DirectFunctionCall1(float4in, CStringGetDatum(value));
+   result = DatumGetFloat4(datum);
    return result;
  }
  
Index: contrib/seg/expected/seg.out
===================================================================
RCS file: /home/cvsmirror/pgsql/contrib/seg/expected/seg.out,v
retrieving revision 1.9
diff -c -r1.9 seg.out
*** contrib/seg/expected/seg.out	14 Sep 2003 02:18:49 -0000	1.9
--- contrib/seg/expected/seg.out	19 Oct 2004 15:22:30 -0000
***************
*** 418,425 ****
  ERROR:  bad seg representation
  DETAIL:  syntax error at or near "e"
  SELECT '1e700'::seg AS seg;
! ERROR:  syntax error
! DETAIL:  numeric value 1e700 unrepresentable
  --
  -- testing the  operators
  --
--- 418,424 ----
  ERROR:  bad seg representation
  DETAIL:  syntax error at or near "e"
  SELECT '1e700'::seg AS seg;
! ERROR:  "1e700" is out of range for type real
  --
  -- testing the  operators
  --
