Fix for postgres 6.4 to support int64 on FreeBSD

Поиск
Список
Период
Сортировка
От Dave Bodenstab
Тема Fix for postgres 6.4 to support int64 on FreeBSD
Дата
Msg-id a1a68e9cb9dee63eba481d61e8a45a47
обсуждение исходный текст
Список pgsql-bugs
The configure script for postgres 6.4 fails to determine that
``long long'' works for FreeBSD.  FreeBSD (I'm running the
2.2.5 release) uses "%qd" as the printf format for 64-bit ints.

  [BTW, why not test for GCC first?  Since a great many platforms
   use GCC, and GCC supports long long, why not use the logic:

      if using GCC
         int64 is supported
      else
         ... the stuff you do now in configure ...

  This way you wouldn't have to come up with so many specific
  tests for various operating systems.]

It also looks like a test for HAVE_LONG_LONG_INT was missing
in src/backend/port/snprintf.c.

I've included the patches below.  BTW, you don't supply the
acconfig.h file that is required to regenerate config.h.in
with autoheader -- I had to patch config.h.in.  I'm no
autoconf expert, so I assume that there is an easier way
to do this.

With these patches (and the password fixes from the FreeBSD
port from www.freebsd.org), postgres 6.4 works for me and the
regression tests all pass except for minor formatting and
numeric precision differences for geometry and float8.

Here's the regress.out:
<<<
    =============== running regression queries...         =================
    boolean .. ok
    char .. ok
    name .. ok
    varchar .. ok
    text .. ok
    strings .. ok
    int2 .. ok
    int4 .. ok
    int8 .. ok
    oid .. ok
    float4 .. ok
    float8 .. failed
    numerology .. ok
    point .. ok
    lseg .. ok
    box .. ok
    path .. ok
    polygon .. ok
    circle .. ok
    geometry .. failed
    timespan .. ok
    datetime .. ok
    reltime .. ok
    abstime .. ok
    tinterval .. ok
    horology .. ok
    inet .. ok
    comments .. ok
    opr_sanity .. ok
    create_function_1 .. ok
    create_type .. ok
    create_table .. ok
    create_function_2 .. ok
    constraints .. ok
    triggers .. ok
    copy .. ok
    create_misc .. ok
    create_aggregate .. ok
    create_operator .. ok
    create_view .. ok
    create_index .. ok
    sanity_check .. ok
    errors .. ok
    select .. ok
    select_into .. ok
    select_distinct .. ok
    select_distinct_on .. ok
    select_implicit .. ok
    select_having .. ok
    subselect .. ok
    union .. ok
    aggregates .. ok
    transactions .. ok
    random .. ok
    portals .. ok
    misc .. ok
    arrays .. ok
    btree_index .. ok
    hash_index .. ok
    select_views .. ok
    alter_table .. ok
    portals_p2 .. ok
    rules .. ok
    install_plpgsql .. ok
    plpgsql .. ok
>>>>

I've also included the output of a ``diff -c -wb expected results''

Dave Bodenstab
imdave@mcs.net


The patches...
- ---------------------------------------------------------
- --- src/configure.in.orig    Sun Nov  1 23:30:10 1998
+++ src/configure.in    Sat Nov 14 16:41:58 1998
@@ -680,6 +680,43 @@
     AC_MSG_RESULT(no),
     AC_MSG_RESULT(assuming not on target machine))

+AC_MSG_CHECKING(whether 'long long' is 64 bits)
+AC_TRY_RUN([#include <stdio.h>
+typedef long long int64;
+#define INT64_FORMAT "%qd"
+
+int64 a = 20000001;
+int64 b = 40000005;
+
+int does_int64_work()
+{
+  int64 c,d,e;
+  char buf[100];
+
+  if (sizeof(int64) != 8)
+    return 0;            /* doesn't look like the right size */
+
+  /* we do perfunctory checks on multiply, divide, sprintf, sscanf */
+  c = a * b;
+  sprintf(buf, INT64_FORMAT, c);
+  if (strcmp(buf, "800000140000005") != 0)
+    return 0;            /* either multiply or sprintf is busted */
+  if (sscanf(buf, INT64_FORMAT, &d) != 1)
+    return 0;
+  if (d != c)
+    return 0;
+  e = d / b;
+  if (e != a)
+    return 0;
+  return 1;
+}
+main() {
+  exit(! does_int64_work());
+}],
+    [AC_DEFINE(HAVE_QUAD_INT_64) AC_MSG_RESULT(yes)],
+    AC_MSG_RESULT(no),
+    AC_MSG_RESULT(assuming not on target machine))
+
 dnl Checks for library functions.
 AC_FUNC_MEMCMP
 AC_TYPE_SIGNAL
- --- src/include/config.h.in.orig    Tue Oct 13 15:44:45 1998
+++ src/include/config.h.in    Sat Nov 14 16:47:08 1998
@@ -260,6 +260,9 @@
 /* Set to 1 if type "long long int" works and is 64 bits */
 #undef HAVE_LONG_LONG_INT_64

+/* Set to 1 if type "long long" works and is 64 bits */
+#undef HAVE_QUAD_INT_64
+
 /* Define as the base type of the last arg to accept */
 #undef SOCKET_SIZE_TYPE

- --- src/include/utils/int8.h.orig    Fri Sep 11 12:16:11 1998
+++ src/include/utils/int8.h    Sat Nov 14 16:51:07 1998
@@ -35,11 +35,18 @@

 #define INT64_FORMAT "%lld"
 #else
+#ifdef HAVE_QUAD_INT_64
+/* We have working support for "long long", use that */
+typedef long long int64;
+
+#define INT64_FORMAT "%qd"
+#else
 /* Won't actually work, but fall back to long int so that int8.c compiles */
 typedef long int int64;

 #define INT64_FORMAT "%ld"
 #define INT64_IS_BUSTED
+#endif
 #endif
 #endif

- --- src/backend/port/snprintf.c.orig    Wed Oct  7 19:34:47 1998
+++ src/backend/port/snprintf.c    Sat Nov 14 16:58:51 1998
@@ -49,7 +49,7 @@
 #include <sys/param.h>

 /* IRIX doesn't do 'long long' in va_arg(), so use a typedef */
- -#ifdef HAVE_LONG_INT_64
+#if defined(HAVE_LONG_INT_64) || defined(HAVE_LONG_LONG_INT) || defined(HAVE_QUAD_INT_64)
 typedef long long long_long;
 #endif

- ---------------------------------------------------------


The diff of expected vs. results
- ---------------------------------------------------------
*** expected/float8.out    Tue Sep 22 11:52:56 1998
- --- results/float8.out    Sat Nov 14 17:45:55 1998
***************
*** 187,195 ****
     SET f1 = FLOAT8_TBL.f1 * '-1'
     WHERE FLOAT8_TBL.f1 > '0.0';
  QUERY: SELECT '' AS bad, f.f1 * '1e200' from FLOAT8_TBL f;
! ERROR:  Bad float8 input format -- overflow
  QUERY: SELECT '' AS bad, f.f1 ^ '1e200' from FLOAT8_TBL f;
! ERROR:  pow() result is out of range
  QUERY: SELECT '' AS bad, (; (f.f1)) from FLOAT8_TBL f where f.f1 = '0.0' ;
  ERROR:  can't take log of zero
  QUERY: SELECT '' AS bad, (; (f.f1)) from FLOAT8_TBL f where f.f1 < '0.0' ;
- --- 187,195 ----
     SET f1 = FLOAT8_TBL.f1 * '-1'
     WHERE FLOAT8_TBL.f1 > '0.0';
  QUERY: SELECT '' AS bad, f.f1 * '1e200' from FLOAT8_TBL f;
! ERROR:  floating point exception! The last floating point operation either exceeded legal ranges or was a divide by
zero
  QUERY: SELECT '' AS bad, f.f1 ^ '1e200' from FLOAT8_TBL f;
! ERROR:  Bad float8 input format -- overflow
  QUERY: SELECT '' AS bad, (; (f.f1)) from FLOAT8_TBL f where f.f1 = '0.0' ;
  ERROR:  can't take log of zero
  QUERY: SELECT '' AS bad, (; (f.f1)) from FLOAT8_TBL f where f.f1 < '0.0' ;
***************
*** 221,229 ****
  QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
  ERROR:  Bad float8 input format '-10e400'
  QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
- - ERROR:  Bad float8 input format '10e-400'
  QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
- - ERROR:  Bad float8 input format '-10e-400'
  QUERY: DELETE FROM FLOAT8_TBL;
  QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('0.0');
  QUERY: INSERT INTO FLOAT8_TBL(f1) VALUES ('-34.84');
- --- 221,227 ----

*** expected/geometry.out    Fri May 29 08:22:41 1998
- --- results/geometry.out    Sat Nov 14 17:46:08 1998
***************
*** 99,105 ****
        |(5.1,34.5)|[(1,2),(3,4)]                |(3,4)
        |(-5,-12)  |[(1,2),(3,4)]                |(1,2)
        |(10,10)   |[(1,2),(3,4)]                |(3,4)
!       |(0,0)     |[(0,0),(6,6)]                |(-0,0)
        |(-10,0)   |[(0,0),(6,6)]                |(0,0)
        |(-3,4)    |[(0,0),(6,6)]                |(0.5,0.5)
        |(5.1,34.5)|[(0,0),(6,6)]                |(6,6)
- --- 99,105 ----
        |(5.1,34.5)|[(1,2),(3,4)]                |(3,4)
        |(-5,-12)  |[(1,2),(3,4)]                |(1,2)
        |(10,10)   |[(1,2),(3,4)]                |(3,4)
!       |(0,0)     |[(0,0),(6,6)]                |(0,0)
        |(-10,0)   |[(0,0),(6,6)]                |(0,0)
        |(-3,4)    |[(0,0),(6,6)]                |(0.5,0.5)
        |(5.1,34.5)|[(0,0),(6,6)]                |(6,6)
***************
*** 112,118 ****
        |(-5,-12)  |[(10,-10),(-3,-4)]           |(-1.60487804878049,-4.64390243902439)
        |(10,10)   |[(10,-10),(-3,-4)]           |(2.39024390243902,-6.48780487804878)
        |(0,0)     |[(-1000000,200),(300000,-40)]|(0.0028402365895872,15.384614860264)
!       |(-10,0)   |[(-1000000,200),(300000,-40)]|(-9.99715942258202,15.3864610140473)
        |(-3,4)    |[(-1000000,200),(300000,-40)]|(-2.99789812267519,15.3851688427303)
        |(5.1,34.5)|[(-1000000,200),(300000,-40)]|(5.09647083221496,15.3836744976925)
        |(-5,-12)  |[(-1000000,200),(300000,-40)]|(-4.99494420845634,15.3855375281616)
- --- 112,118 ----
        |(-5,-12)  |[(10,-10),(-3,-4)]           |(-1.60487804878049,-4.64390243902439)
        |(10,10)   |[(10,-10),(-3,-4)]           |(2.39024390243902,-6.48780487804878)
        |(0,0)     |[(-1000000,200),(300000,-40)]|(0.0028402365895872,15.384614860264)
!       |(-10,0)   |[(-1000000,200),(300000,-40)]|(-9.99715942258202,15.3864610140472)
        |(-3,4)    |[(-1000000,200),(300000,-40)]|(-2.99789812267519,15.3851688427303)
        |(5.1,34.5)|[(-1000000,200),(300000,-40)]|(5.09647083221496,15.3836744976925)
        |(-5,-12)  |[(-1000000,200),(300000,-40)]|(-4.99494420845634,15.3855375281616)
***************
*** 129,139 ****
  six|box
  ---+--------------------------------------------------------------------------
     |(2.12132034355964,2.12132034355964),(-2.12132034355964,-2.12132034355964)
!    |(71.7106781186548,72.7106781186548),(-69.7106781186548,-68.7106781186548)
!    |(4.53553390593274,6.53553390593274),(-2.53553390593274,-0.535533905932738)
!    |(3.12132034355964,4.12132034355964),(-1.12132034355964,-0.121320343559643)
     |(107.071067811865,207.071067811865),(92.9289321881345,192.928932188135)
!    |(170.710678118655,70.7106781186548),(29.2893218813452,-70.7106781186548)
  (6 rows)

  QUERY: SELECT '' AS twentyfour, b.f1 + p.f1 AS translation
- --- 129,139 ----
  six|box
  ---+--------------------------------------------------------------------------
     |(2.12132034355964,2.12132034355964),(-2.12132034355964,-2.12132034355964)
!    |(71.7106781186547,72.7106781186547),(-69.7106781186547,-68.7106781186547)
!    |(4.53553390593274,6.53553390593274),(-2.53553390593274,-0.535533905932737)
!    |(3.12132034355964,4.12132034355964),(-1.12132034355964,-0.121320343559642)
     |(107.071067811865,207.071067811865),(92.9289321881345,192.928932188135)
!    |(170.710678118655,70.7106781186547),(29.2893218813453,-70.7106781186547)
  (6 rows)

  QUERY: SELECT '' AS twentyfour, b.f1 + p.f1 AS translation
***************
*** 204,214 ****
            |(0,0),(0,0)
            |(0,0),(0,0)
            |(0,0),(0,0)
!           |(-0,0),(-20,-20)
            |(-10,-10),(-30,-30)
            |(-25,-25),(-25,-35)
            |(-30,-30),(-30,-30)
!           |(-0,2),(-14,0)
            |(-7,3),(-21,1)
            |(-17.5,2.5),(-21.5,-0.5)
            |(-21,3),(-21,3)
- --- 204,214 ----
            |(0,0),(0,0)
            |(0,0),(0,0)
            |(0,0),(0,0)
!           |(0,0),(-20,-20)
            |(-10,-10),(-30,-30)
            |(-25,-25),(-25,-35)
            |(-30,-30),(-30,-30)
!           |(0,2),(-14,0)
            |(-7,3),(-21,1)
            |(-17.5,2.5),(-21.5,-0.5)
            |(-21,3),(-21,3)
***************
*** 216,222 ****
            |(-29.4,118.8),(-88.2,39.6)
            |(-73.5,104.1),(-108,99)
            |(-88.2,118.8),(-88.2,118.8)
!           |(14,-0),(0,-34)
            |(21,-17),(7,-51)
            |(29.5,-42.5),(17.5,-47.5)
            |(21,-51),(21,-51)
- --- 216,222 ----
            |(-29.4,118.8),(-88.2,39.6)
            |(-73.5,104.1),(-108,99)
            |(-88.2,118.8),(-88.2,118.8)
!           |(14,0),(0,-34)
            |(21,-17),(7,-51)
            |(29.5,-42.5),(17.5,-47.5)
            |(21,-51),(21,-51)
***************
*** 231,241 ****
     WHERE (p.f1 <-> '(0,0)'::point) >= 1;
  twenty|rotation
  ------+---------------------------------------------------------------------------------
!       |(0,-0),(-0.2,-0.2)
        |(-0.1,-0.1),(-0.3,-0.3)
        |(-0.25,-0.25),(-0.25,-0.35)
        |(-0.3,-0.3),(-0.3,-0.3)
!       |(0.08,-0),(0,-0.56)
        |(0.12,-0.28),(0.04,-0.84)
        |(0.26,-0.7),(0.1,-0.82)
        |(0.12,-0.84),(0.12,-0.84)
- --- 231,241 ----
     WHERE (p.f1 <-> '(0,0)'::point) >= 1;
  twenty|rotation
  ------+---------------------------------------------------------------------------------
!       |(0,0),(-0.2,-0.2)
        |(-0.1,-0.1),(-0.3,-0.3)
        |(-0.25,-0.25),(-0.25,-0.35)
        |(-0.3,-0.3),(-0.3,-0.3)
!       |(0.08,0),(0,-0.56)
        |(0.12,-0.28),(0.04,-0.84)
        |(0.26,-0.7),(0.1,-0.82)
        |(0.12,-0.84),(0.12,-0.84)
***************
*** 243,249 ****
        |(0.0976764836465887,-0.0241724631246608),(0.0325588278821962,-0.0725173893739825)
        |(0.109762715208919,-0.0562379754328844),(0.0813970697054906,-0.0604311578116521)
        |(0.0976764836465887,-0.0725173893739825),(0.0976764836465887,-0.0725173893739825)
!       |(-0,0.0828402366863905),(-0.201183431952663,0)
        |(-0.100591715976331,0.124260355029586),(-0.301775147928994,0.0414201183431953)
        |(-0.251479289940828,0.103550295857988),(-0.322485207100592,0.0739644970414201)
        |(-0.301775147928994,0.124260355029586),(-0.301775147928994,0.124260355029586)
- --- 243,249 ----
        |(0.0976764836465887,-0.0241724631246608),(0.0325588278821962,-0.0725173893739825)
        |(0.109762715208919,-0.0562379754328844),(0.0813970697054906,-0.0604311578116521)
        |(0.0976764836465887,-0.0725173893739825),(0.0976764836465887,-0.0725173893739825)
!       |(0,0.0828402366863905),(-0.201183431952663,0)
        |(-0.100591715976331,0.124260355029586),(-0.301775147928994,0.0414201183431953)
        |(-0.251479289940828,0.103550295857988),(-0.322485207100592,0.0739644970414201)
        |(-0.301775147928994,0.124260355029586),(-0.301775147928994,0.124260355029586)
***************
*** 409,433 ****
  QUERY: SELECT '' AS six, polygon(f1)
     FROM CIRCLE_TBL;
  six|polygon

                                         
!
---+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
!
|((-3,0),(-2.59807621135332,1.5),(-1.5,2.59807621135332),(-1.83690953073357e-16,3),(1.5,2.59807621135332),(2.59807621135332,1.5),(3,3.67381906146713e-16),(2.59807621135332,-1.5),(1.5,-2.59807621135332),(5.5107285922007e-16,-3),(-1.5,-2.59807621135332),(-2.59807621135332,-1.5))
!
|((-99,2),(-85.6025403784439,52),(-49,88.6025403784439),(0.999999999999994,102),(51,88.6025403784439),(87.6025403784439,52),(101,2.00000000000001),(87.6025403784439,-48),(51,-84.6025403784438),(1.00000000000002,-98),(-49,-84.6025403784439),(-85.6025403784438,-48))
            
!
|((-4,3),(-3.33012701892219,5.5),(-1.5,7.33012701892219),(1,8),(3.5,7.33012701892219),(5.33012701892219,5.5),(6,3),(5.33012701892219,0.500000000000001),(3.5,-1.33012701892219),(1,-2),(-1.5,-1.33012701892219),(-3.33012701892219,0.499999999999998))
                              
!
|((-2,2),(-1.59807621135332,3.5),(-0.5,4.59807621135332),(1,5),(2.5,4.59807621135332),(3.59807621135332,3.5),(4,2),(3.59807621135332,0.500000000000001),(2.5,-0.598076211353315),(1,-1),(-0.5,-0.598076211353316),(-1.59807621135332,0.499999999999999))
                            
!
|((90,200),(91.3397459621556,205),(95,208.660254037844),(100,210),(105,208.660254037844),(108.660254037844,205),(110,200),(108.660254037844,195),(105,191.339745962156),(100,190),(95,191.339745962156),(91.3397459621556,195))
                                                     
!
|((0,0),(13.3974596215561,50),(50,86.6025403784439),(100,100),(150,86.6025403784439),(186.602540378444,50),(200,1.22460635382238e-14),(186.602540378444,-50),(150,-86.6025403784438),(100,-100),(50,-86.6025403784439),(13.3974596215562,-50))
                                      
  (6 rows)

  QUERY: SELECT '' AS six, polygon(8, f1)
     FROM CIRCLE_TBL;
  six|polygon
                                                                                                                      
!
---+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
!
|((-3,0),(-2.12132034355964,2.12132034355964),(-1.83690953073357e-16,3),(2.12132034355964,2.12132034355964),(3,3.67381906146713e-16),(2.12132034355964,-2.12132034355964),(5.5107285922007e-16,-3),(-2.12132034355964,-2.12132034355964))
!
|((-99,2),(-69.7106781186548,72.7106781186548),(0.999999999999994,102),(71.7106781186547,72.7106781186548),(101,2.00000000000001),(71.7106781186548,-68.7106781186547),(1.00000000000002,-98),(-69.7106781186547,-68.7106781186548))
    
!
|((-4,3),(-2.53553390593274,6.53553390593274),(1,8),(4.53553390593274,6.53553390593274),(6,3),(4.53553390593274,-0.535533905932737),(1,-2),(-2.53553390593274,-0.535533905932738))
                                                      
!
|((-2,2),(-1.12132034355964,4.12132034355964),(1,5),(3.12132034355964,4.12132034355964),(4,2),(3.12132034355964,-0.121320343559642),(1,-1),(-1.12132034355964,-0.121320343559643))
                                                      
!
|((90,200),(92.9289321881345,207.071067811865),(100,210),(107.071067811865,207.071067811865),(110,200),(107.071067811865,192.928932188135),(100,190),(92.9289321881345,192.928932188135))
                                               
!
|((0,0),(29.2893218813452,70.7106781186548),(100,100),(170.710678118655,70.7106781186548),(200,1.22460635382238e-14),(170.710678118655,-70.7106781186547),(100,-100),(29.2893218813453,-70.7106781186548))
                              
  (6 rows)

  QUERY: SELECT '' AS six, circle(f1, 50.0)
- --- 409,433 ----
  QUERY: SELECT '' AS six, polygon(f1)
     FROM CIRCLE_TBL;
  six|polygon


                       
!
---+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
!
|((-3,0),(-2.59807621135076,1.50000000000442),(-1.49999999999116,2.59807621135842),(1.53102359078377e-11,3),(1.50000000001768,2.59807621134311),(2.59807621136607,1.4999999999779),(3,-3.06204718156754e-11),(2.59807621133545,-1.50000000003094),(1.49999999996464,-2.59807621137373),(-4.59307077235131e-11,-3),(-1.5000000000442,-2.5980762113278),(-2.59807621138138,-1.49999999995138))
!
|((-99,2),(-85.6025403783588,52.0000000001473),(-48.9999999997054,88.602540378614),(1.00000000051034,102),(51.0000000005893,88.6025403781036),(87.6025403788692,51.9999999992634),(101,1.99999999897932),(87.6025403778485,-48.0000000010313),(50.9999999988214,-84.6025403791243),(0.999999998468976,-98),(-49.0000000014732,-84.6025403775933),(-85.6025403793795,-47.9999999983795))
    
!
|((-4,3),(-3.33012701891794,5.50000000000737),(-1.49999999998527,7.3301270189307),(1.00000000002552,8),(3.50000000002946,7.33012701890518),(5.33012701894346,5.49999999996317),(6,2.99999999994897),(5.33012701889242,0.499999999948437),(3.49999999994107,-1.33012701895622),(0.999999999923449,-2),(-1.50000000007366,-1.33012701887967),(-3.33012701896897,0.500000000081028))
          
!
|((-2,2),(-1.59807621135076,3.50000000000442),(-0.499999999991161,4.59807621135842),(1.00000000001531,5),(2.50000000001768,4.59807621134311),(3.59807621136607,3.4999999999779),(4,1.99999999996938),(3.59807621133545,0.499999999969062),(2.49999999996464,-0.598076211373729),(0.999999999954069,-1),(-0.500000000044197,-0.598076211327799),(-1.59807621138138,0.500000000048616))
      
!
|((90,200),(91.3397459621641,205.000000000015),(95.0000000000295,208.660254037861),(100.000000000051,210),(105.000000000059,208.66025403781),(108.660254037887,204.999999999926),(110,199.999999999898),(108.660254037785,194.999999999897),(104.999999999882,191.339745962088),(99.9999999998469,190),(94.9999999998527,191.339745962241),(91.3397459620621,195.000000000162))
            
!
|((0,0),(13.3974596216412,50.0000000001473),(50.0000000002946,86.602540378614),(100.00000000051,100),(150.000000000589,86.6025403781036),(186.602540378869,49.9999999992634),(200,-1.02068239385585e-09),(186.602540377848,-50.0000000010313),(149.999999998821,-86.6025403791243),(99.999999998469,-100),(49.9999999985268,-86.6025403775933),(13.3974596206205,-49.9999999983795))
       
  (6 rows)

  QUERY: SELECT '' AS six, polygon(8, f1)
     FROM CIRCLE_TBL;
  six|polygon
                                                                                                                       
!
---+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
!
|((-3,0),(-2.12132034355423,2.12132034356506),(1.53102359078377e-11,3),(2.12132034357588,2.1213203435434),(3,-3.06204718156754e-11),(2.12132034353258,-2.12132034358671),(-4.59307077235131e-11,-3),(-2.12132034359753,-2.12132034352175))
!
|((-99,2),(-69.7106781184743,72.7106781188352),(1.00000000051034,102),(71.710678119196,72.7106781181134),(101,1.99999999897932),(71.7106781177526,-68.7106781195569),(0.999999998468976,-98),(-69.7106781199178,-68.7106781173917))
      
!
|((-4,3),(-2.53553390592372,6.53553390594176),(1.00000000002552,8),(4.5355339059598,6.53553390590567),(6,2.99999999994897),(4.53553390588763,-0.535533905977846),(0.999999999923449,-2),(-2.53553390599589,-0.535533905869586))
          
!
|((-2,2),(-1.12132034355423,4.12132034356506),(1.00000000001531,5),(3.12132034357588,4.1213203435434),(4,1.99999999996938),(3.12132034353258,-0.121320343586707),(0.999999999954069,-1),(-1.12132034359753,-0.121320343521752))
          
!
|((90,200),(92.9289321881526,207.071067811884),(100.000000000051,210),(107.07106781192,207.071067811811),(110,199.999999999898),(107.071067811775,192.928932188044),(99.9999999998469,190),(92.9289321880082,192.928932188261))
          
!
|((0,0),(29.2893218815257,70.7106781188352),(100.00000000051,100),(170.710678119196,70.7106781181134),(200,-1.02068239385585e-09),(170.710678117753,-70.7106781195569),(99.999999998469,-100),(29.2893218800822,-70.7106781173917))
      
  (6 rows)

  QUERY: SELECT '' AS six, circle(f1, 50.0)
***************
*** 466,476 ****
     WHERE (p1.f1 <-> c1.f1) > 0
     ORDER BY distance, circle, point using <<;
  twentyfour|circle        |point     |         distance
! ----------+--------------+----------+-----------------
!           |<(100,0),100> |(5.1,34.5)|0.976531926977964
            |<(1,2),3>     |(-3,4)    | 1.47213595499958
            |<(0,0),3>     |(-3,4)    |                2
!           |<(100,0),100> |(-3,4)    | 3.07764064044151
            |<(100,0),100> |(-5,-12)  | 5.68348972285122
            |<(1,3),5>     |(-10,0)   | 6.40175425099138
            |<(1,3),5>     |(10,10)   | 6.40175425099138
- --- 466,476 ----
     WHERE (p1.f1 <-> c1.f1) > 0
     ORDER BY distance, circle, point using <<;
  twentyfour|circle        |point     |        distance
! ----------+--------------+----------+----------------
!           |<(100,0),100> |(5.1,34.5)|0.97653192697797
            |<(1,2),3>     |(-3,4)    |1.47213595499958
            |<(0,0),3>     |(-3,4)    |               2
!           |<(100,0),100> |(-3,4)    |3.07764064044152
            |<(100,0),100> |(-5,-12)  |5.68348972285122
            |<(1,3),5>     |(-10,0)   |6.40175425099138
            |<(1,3),5>     |(10,10)   |6.40175425099138
***************
*** 482,488 ****
            |<(0,0),3>     |(10,10)   |  11.142135623731
            |<(1,3),5>     |(-5,-12)  | 11.1554944214035
            |<(1,2),3>     |(-5,-12)  | 12.2315462117278
!           |<(1,3),5>     |(5.1,34.5)| 26.7657047773224
            |<(1,2),3>     |(5.1,34.5)|  29.757594539282
            |<(0,0),3>     |(5.1,34.5)| 31.8749193547455
            |<(100,200),10>|(5.1,34.5)| 180.778038568384
- --- 482,488 ----
            |<(0,0),3>     |(10,10)   | 11.142135623731
            |<(1,3),5>     |(-5,-12)  |11.1554944214035
            |<(1,2),3>     |(-5,-12)  |12.2315462117278
!           |<(1,3),5>     |(5.1,34.5)|26.7657047773223
            |<(1,2),3>     |(5.1,34.5)| 29.757594539282
            |<(0,0),3>     |(5.1,34.5)|31.8749193547455
            |<(100,200),10>|(5.1,34.5)|180.778038568384

*** expected/int2.out    Sun Jan  4 21:35:35 1998
- --- results/int2.out    Sat Nov 14 17:45:48 1998
***************
*** 7,13 ****
  QUERY: INSERT INTO INT2_TBL(f1) VALUES ('32767');
  QUERY: INSERT INTO INT2_TBL(f1) VALUES ('-32767');
  QUERY: INSERT INTO INT2_TBL(f1) VALUES ('100000');
! ERROR:  pg_atoi: error reading "100000": Math result not representable
  QUERY: INSERT INTO INT2_TBL(f1) VALUES ('asdf');
  ERROR:  pg_atoi: error in "asdf": can't parse "asdf"
  QUERY: SELECT '' AS five, INT2_TBL.*;
- --- 7,13 ----
  QUERY: INSERT INTO INT2_TBL(f1) VALUES ('32767');
  QUERY: INSERT INTO INT2_TBL(f1) VALUES ('-32767');
  QUERY: INSERT INTO INT2_TBL(f1) VALUES ('100000');
! ERROR:  pg_atoi: error reading "100000": Result too large
  QUERY: INSERT INTO INT2_TBL(f1) VALUES ('asdf');
  ERROR:  pg_atoi: error in "asdf": can't parse "asdf"
  QUERY: SELECT '' AS five, INT2_TBL.*;

*** expected/int4.out    Sun Jan  4 21:35:36 1998
- --- results/int4.out    Sat Nov 14 17:45:49 1998
***************
*** 7,13 ****
  QUERY: INSERT INTO INT4_TBL(f1) VALUES ('2147483647');
  QUERY: INSERT INTO INT4_TBL(f1) VALUES ('-2147483647');
  QUERY: INSERT INTO INT4_TBL(f1) VALUES ('1000000000000');
! ERROR:  pg_atoi: error reading "1000000000000": Math result not representable
  QUERY: INSERT INTO INT4_TBL(f1) VALUES ('asdf');
  ERROR:  pg_atoi: error in "asdf": can't parse "asdf"
  QUERY: SELECT '' AS five, INT4_TBL.*;
- --- 7,13 ----
  QUERY: INSERT INTO INT4_TBL(f1) VALUES ('2147483647');
  QUERY: INSERT INTO INT4_TBL(f1) VALUES ('-2147483647');
  QUERY: INSERT INTO INT4_TBL(f1) VALUES ('1000000000000');
! ERROR:  pg_atoi: error reading "1000000000000": Result too large
  QUERY: INSERT INTO INT4_TBL(f1) VALUES ('asdf');
  ERROR:  pg_atoi: error in "asdf": can't parse "asdf"
  QUERY: SELECT '' AS five, INT4_TBL.*;
- ---------------------------------------------------------

В списке pgsql-bugs по дате отправления: