diff -dcrpN pgsql.orig/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c pgsql/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c
*** pgsql.orig/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c	2010-02-04 14:49:15.000000000 +0100
--- pgsql/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c	2010-02-04 15:47:10.000000000 +0100
***************
*** 9,14 ****
--- 9,15 ----
  #line 1 "nan_test.pgc"
  #include <stdio.h>
  #include <stdlib.h>
+ #include <float.h>
  #include <math.h>
  #include <float.h>
  #include <pgtypes_numeric.h>
***************
*** 22,28 ****
  
  
  
! #line 8 "nan_test.pgc"
  
  
  int
--- 23,29 ----
  
  
  
! #line 9 "nan_test.pgc"
  
  
  int
*************** main(void)
*** 34,87 ****
  		
  		
  	
! #line 14 "nan_test.pgc"
   int id ;
   
! #line 15 "nan_test.pgc"
   double d ;
   
! #line 16 "nan_test.pgc"
   numeric * num ;
   
! #line 17 "nan_test.pgc"
   char val [ 16 ] ;
  /* exec sql end declare section */
! #line 18 "nan_test.pgc"
  
  
  	ECPGdebug(1, stderr);
  	/* exec sql whenever sqlerror  do sqlprint ( ) ; */
! #line 21 "nan_test.pgc"
  
  
  	{ ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0); 
! #line 23 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 23 "nan_test.pgc"
  
  
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table nantest1 ( id int4 , d float8 )", ECPGt_EOIT, ECPGt_EORT);
! #line 25 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 25 "nan_test.pgc"
  
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest1 ( id , d ) values ( 1 , 'nan' :: float8 ) , ( 2 , 'infinity' :: float8 ) , ( 3 , '-infinity' :: float8 )", ECPGt_EOIT, ECPGt_EORT);
! #line 26 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 26 "nan_test.pgc"
  
  
  	/* declare cur cursor for select id , d , d from nantest1 */
! #line 28 "nan_test.pgc"
  
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur cursor for select id , d , d from nantest1", ECPGt_EOIT, ECPGt_EORT);
! #line 29 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 29 "nan_test.pgc"
  
  	while (1)
  	{
--- 35,88 ----
  		
  		
  	
! #line 15 "nan_test.pgc"
   int id ;
   
! #line 16 "nan_test.pgc"
   double d ;
   
! #line 17 "nan_test.pgc"
   numeric * num ;
   
! #line 18 "nan_test.pgc"
   char val [ 16 ] ;
  /* exec sql end declare section */
! #line 19 "nan_test.pgc"
  
  
  	ECPGdebug(1, stderr);
  	/* exec sql whenever sqlerror  do sqlprint ( ) ; */
! #line 22 "nan_test.pgc"
  
  
  	{ ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0); 
! #line 24 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 24 "nan_test.pgc"
  
  
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table nantest1 ( id int4 , d float8 )", ECPGt_EOIT, ECPGt_EORT);
! #line 26 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 26 "nan_test.pgc"
  
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest1 ( id , d ) values ( 1 , 'nan' :: float8 ) , ( 2 , 'infinity' :: float8 ) , ( 3 , '-infinity' :: float8 )", ECPGt_EOIT, ECPGt_EORT);
! #line 27 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 27 "nan_test.pgc"
  
  
  	/* declare cur cursor for select id , d , d from nantest1 */
! #line 29 "nan_test.pgc"
  
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur cursor for select id , d , d from nantest1", ECPGt_EOIT, ECPGt_EORT);
! #line 30 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 30 "nan_test.pgc"
  
  	while (1)
  	{
*************** if (sqlca.sqlcode < 0) sqlprint ( );}
*** 92,101 ****
  	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
  	ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char), 
  	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
! #line 32 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 32 "nan_test.pgc"
  
  		if (sqlca.sqlcode)
  			break;
--- 93,102 ----
  	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
  	ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char), 
  	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
! #line 33 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 33 "nan_test.pgc"
  
  		if (sqlca.sqlcode)
  			break;
*************** if (sqlca.sqlcode < 0) sqlprint ( );}
*** 109,142 ****
  	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
  	ECPGt_double,&(d),(long)1,(long)1,sizeof(double), 
  	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
! #line 40 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 40 "nan_test.pgc"
  
  		{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest1 ( id , d ) values ( $1  + 6 , $2  )", 
  	ECPGt_int,&(id),(long)1,(long)1,sizeof(int), 
  	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
  	ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char), 
  	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
! #line 41 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 41 "nan_test.pgc"
  
  	}
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur", ECPGt_EOIT, ECPGt_EORT);
! #line 43 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 43 "nan_test.pgc"
  
  
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur cursor for select id , d , d from nantest1", ECPGt_EOIT, ECPGt_EORT);
! #line 45 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 45 "nan_test.pgc"
  
  	while (1)
  	{
--- 110,143 ----
  	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
  	ECPGt_double,&(d),(long)1,(long)1,sizeof(double), 
  	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
! #line 41 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 41 "nan_test.pgc"
  
  		{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest1 ( id , d ) values ( $1  + 6 , $2  )", 
  	ECPGt_int,&(id),(long)1,(long)1,sizeof(int), 
  	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
  	ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char), 
  	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
! #line 42 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 42 "nan_test.pgc"
  
  	}
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur", ECPGt_EOIT, ECPGt_EORT);
! #line 44 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 44 "nan_test.pgc"
  
  
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur cursor for select id , d , d from nantest1", ECPGt_EOIT, ECPGt_EORT);
! #line 46 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 46 "nan_test.pgc"
  
  	while (1)
  	{
*************** if (sqlca.sqlcode < 0) sqlprint ( );}
*** 147,156 ****
  	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
  	ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char), 
  	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
! #line 48 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 48 "nan_test.pgc"
  
  		if (sqlca.sqlcode)
  			break;
--- 148,157 ----
  	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
  	ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char), 
  	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
! #line 49 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 49 "nan_test.pgc"
  
  		if (sqlca.sqlcode)
  			break;
*************** if (sqlca.sqlcode < 0) sqlprint ( );}
*** 160,184 ****
  			printf("%d  NaN '%s'\n", id, val);
  	}
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur", ECPGt_EOIT, ECPGt_EORT);
! #line 56 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 56 "nan_test.pgc"
  
  
  	num = PGTYPESnumeric_new();
  
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table nantest2 ( id int4 , d numeric )", ECPGt_EOIT, ECPGt_EORT);
! #line 60 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 60 "nan_test.pgc"
  
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest2 ( id , d ) values ( 4 , 'nan' :: numeric )", ECPGt_EOIT, ECPGt_EORT);
! #line 61 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 61 "nan_test.pgc"
  
  
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select id , d , d from nantest2 where id = 4", ECPGt_EOIT, 
--- 161,185 ----
  			printf("%d  NaN '%s'\n", id, val);
  	}
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur", ECPGt_EOIT, ECPGt_EORT);
! #line 57 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 57 "nan_test.pgc"
  
  
  	num = PGTYPESnumeric_new();
  
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table nantest2 ( id int4 , d numeric )", ECPGt_EOIT, ECPGt_EORT);
! #line 61 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 61 "nan_test.pgc"
  
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest2 ( id , d ) values ( 4 , 'nan' :: numeric )", ECPGt_EOIT, ECPGt_EORT);
! #line 62 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 62 "nan_test.pgc"
  
  
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select id , d , d from nantest2 where id = 4", ECPGt_EOIT, 
*************** if (sqlca.sqlcode < 0) sqlprint ( );}
*** 188,197 ****
  	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
  	ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char), 
  	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
! #line 63 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 63 "nan_test.pgc"
  
  
  	printf("%d %s '%s'\n", id, (num->sign == NUMERIC_NAN ? "NaN" : "not NaN"), val);
--- 189,198 ----
  	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
  	ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char), 
  	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
! #line 64 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 64 "nan_test.pgc"
  
  
  	printf("%d %s '%s'\n", id, (num->sign == NUMERIC_NAN ? "NaN" : "not NaN"), val);
*************** if (sqlca.sqlcode < 0) sqlprint ( );}
*** 199,226 ****
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest2 ( id , d ) values ( 5 , $1  )", 
  	ECPGt_numeric,&(num),(long)1,(long)0,sizeof(numeric), 
  	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
! #line 67 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 67 "nan_test.pgc"
  
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest2 ( id , d ) values ( 6 , $1  )", 
  	ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char), 
  	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
! #line 68 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 68 "nan_test.pgc"
  
  
  	/* declare cur1 cursor for select id , d , d from nantest2 */
! #line 70 "nan_test.pgc"
  
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur1 cursor for select id , d , d from nantest2", ECPGt_EOIT, ECPGt_EORT);
! #line 71 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 71 "nan_test.pgc"
  
  	while (1)
  	{
--- 200,227 ----
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest2 ( id , d ) values ( 5 , $1  )", 
  	ECPGt_numeric,&(num),(long)1,(long)0,sizeof(numeric), 
  	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
! #line 68 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 68 "nan_test.pgc"
  
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest2 ( id , d ) values ( 6 , $1  )", 
  	ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char), 
  	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
! #line 69 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 69 "nan_test.pgc"
  
  
  	/* declare cur1 cursor for select id , d , d from nantest2 */
! #line 71 "nan_test.pgc"
  
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur1 cursor for select id , d , d from nantest2", ECPGt_EOIT, ECPGt_EORT);
! #line 72 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 72 "nan_test.pgc"
  
  	while (1)
  	{
*************** if (sqlca.sqlcode < 0) sqlprint ( );}
*** 231,263 ****
  	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
  	ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char), 
  	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
! #line 74 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 74 "nan_test.pgc"
  
  		if (sqlca.sqlcode)
  			break;
  		printf("%d %s '%s'\n", id, (num->sign == NUMERIC_NAN ? "NaN" : "not NaN"), val);
  	}
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur1", ECPGt_EOIT, ECPGt_EORT);
! #line 79 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 79 "nan_test.pgc"
  
  
  	{ ECPGtrans(__LINE__, NULL, "rollback");
! #line 81 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 81 "nan_test.pgc"
  
  	{ ECPGdisconnect(__LINE__, "CURRENT");
! #line 82 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 82 "nan_test.pgc"
  
  
  	return (0);
--- 232,264 ----
  	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, 
  	ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char), 
  	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
! #line 75 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 75 "nan_test.pgc"
  
  		if (sqlca.sqlcode)
  			break;
  		printf("%d %s '%s'\n", id, (num->sign == NUMERIC_NAN ? "NaN" : "not NaN"), val);
  	}
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur1", ECPGt_EOIT, ECPGt_EORT);
! #line 80 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 80 "nan_test.pgc"
  
  
  	{ ECPGtrans(__LINE__, NULL, "rollback");
! #line 82 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 82 "nan_test.pgc"
  
  	{ ECPGdisconnect(__LINE__, "CURRENT");
! #line 83 "nan_test.pgc"
  
  if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 83 "nan_test.pgc"
  
  
  	return (0);
diff -dcrpN pgsql.orig/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.stderr pgsql/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.stderr
*** pgsql.orig/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.stderr	2010-02-04 14:49:15.000000000 +0100
--- pgsql/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.stderr	2010-02-04 15:47:09.000000000 +0100
***************
*** 2,48 ****
  [NO_PID]: sqlca: code: 0, state: 00000
  [NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>  
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 25: query: create table nantest1 ( id int4 , d float8 ); with 0 parameter(s) on connection regress1
! [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 25: using PQexec
! [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 25: OK: CREATE TABLE
! [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 26: query: insert into nantest1 ( id , d ) values ( 1 , 'nan' :: float8 ) , ( 2 , 'infinity' :: float8 ) , ( 3 , '-infinity' :: float8 ); with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
  [NO_PID]: ecpg_execute on line 26: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 26: OK: INSERT 0 3
! [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 29: query: declare cur cursor for select id , d , d from nantest1; with 0 parameter(s) on connection regress1
! [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 29: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 29: OK: DECLARE CURSOR
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 32: query: fetch from cur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 32: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 32: correctly got 1 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 32: RESULT: 1 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 32: RESULT: NaN offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 32: RESULT: NaN offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 40: query: insert into nantest1 ( id , d ) values ( $1  + 3 , $2  ); with 2 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 40: using PQexecParams
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: free_params on line 40: parameter 1 = 1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: free_params on line 40: parameter 2 = NaN
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 40: OK: INSERT 0 1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 41: query: insert into nantest1 ( id , d ) values ( $1  + 6 , $2  ); with 2 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
  [NO_PID]: ecpg_execute on line 41: using PQexecParams
  [NO_PID]: sqlca: code: 0, state: 00000
--- 2,38 ----
  [NO_PID]: sqlca: code: 0, state: 00000
  [NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>  
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 26: query: create table nantest1 ( id int4 , d float8 ); with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
  [NO_PID]: ecpg_execute on line 26: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 26: OK: CREATE TABLE
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 27: query: insert into nantest1 ( id , d ) values ( 1 , 'nan' :: float8 ) , ( 2 , 'infinity' :: float8 ) , ( 3 , '-infinity' :: float8 ); with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 27: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 27: OK: INSERT 0 3
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 30: query: declare cur cursor for select id , d , d from nantest1; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 30: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 30: OK: DECLARE CURSOR
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 33: query: fetch from cur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 33: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 33: correctly got 1 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 33: RESULT: 1 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 33: RESULT: NaN offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 33: RESULT: NaN offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 41: query: insert into nantest1 ( id , d ) values ( $1  + 3 , $2  ); with 2 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
  [NO_PID]: ecpg_execute on line 41: using PQexecParams
  [NO_PID]: sqlca: code: 0, state: 00000
***************
*** 52,80 ****
  [NO_PID]: sqlca: code: 0, state: 00000
  [NO_PID]: ecpg_execute on line 41: OK: INSERT 0 1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 32: query: fetch from cur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 32: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 32: correctly got 1 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 32: RESULT: 2 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 32: RESULT: Infinity offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 32: RESULT: Infinity offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 40: query: insert into nantest1 ( id , d ) values ( $1  + 3 , $2  ); with 2 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 40: using PQexecParams
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: free_params on line 40: parameter 1 = 2
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: free_params on line 40: parameter 2 = Infinity
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 40: OK: INSERT 0 1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 41: query: insert into nantest1 ( id , d ) values ( $1  + 6 , $2  ); with 2 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
  [NO_PID]: ecpg_execute on line 41: using PQexecParams
  [NO_PID]: sqlca: code: 0, state: 00000
--- 42,70 ----
  [NO_PID]: sqlca: code: 0, state: 00000
  [NO_PID]: ecpg_execute on line 41: OK: INSERT 0 1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 42: query: insert into nantest1 ( id , d ) values ( $1  + 6 , $2  ); with 2 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 42: using PQexecParams
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: free_params on line 42: parameter 1 = 1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: free_params on line 42: parameter 2 = NaN
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 42: OK: INSERT 0 1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 33: query: fetch from cur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 33: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 33: correctly got 1 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 33: RESULT: 2 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 33: RESULT: Infinity offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 33: RESULT: Infinity offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 41: query: insert into nantest1 ( id , d ) values ( $1  + 3 , $2  ); with 2 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
  [NO_PID]: ecpg_execute on line 41: using PQexecParams
  [NO_PID]: sqlca: code: 0, state: 00000
***************
*** 84,112 ****
  [NO_PID]: sqlca: code: 0, state: 00000
  [NO_PID]: ecpg_execute on line 41: OK: INSERT 0 1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 32: query: fetch from cur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 32: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 32: correctly got 1 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 32: RESULT: 3 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 32: RESULT: -Infinity offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 32: RESULT: -Infinity offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 40: query: insert into nantest1 ( id , d ) values ( $1  + 3 , $2  ); with 2 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 40: using PQexecParams
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: free_params on line 40: parameter 1 = 3
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: free_params on line 40: parameter 2 = -Infinity
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 40: OK: INSERT 0 1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 41: query: insert into nantest1 ( id , d ) values ( $1  + 6 , $2  ); with 2 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
  [NO_PID]: ecpg_execute on line 41: using PQexecParams
  [NO_PID]: sqlca: code: 0, state: 00000
--- 74,102 ----
  [NO_PID]: sqlca: code: 0, state: 00000
  [NO_PID]: ecpg_execute on line 41: OK: INSERT 0 1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 42: query: insert into nantest1 ( id , d ) values ( $1  + 6 , $2  ); with 2 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 42: using PQexecParams
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: free_params on line 42: parameter 1 = 2
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: free_params on line 42: parameter 2 = Infinity
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 42: OK: INSERT 0 1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 33: query: fetch from cur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 33: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 33: correctly got 1 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 33: RESULT: 3 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 33: RESULT: -Infinity offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 33: RESULT: -Infinity offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 41: query: insert into nantest1 ( id , d ) values ( $1  + 3 , $2  ); with 2 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
  [NO_PID]: ecpg_execute on line 41: using PQexecParams
  [NO_PID]: sqlca: code: 0, state: 00000
***************
*** 116,296 ****
  [NO_PID]: sqlca: code: 0, state: 00000
  [NO_PID]: ecpg_execute on line 41: OK: INSERT 0 1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 32: query: fetch from cur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 32: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 32: correctly got 0 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: raising sqlcode 100 on line 32: no data found on line 32
! [NO_PID]: sqlca: code: 100, state: 02000
! [NO_PID]: ecpg_execute on line 43: query: close cur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 43: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 43: OK: CLOSE CURSOR
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 45: query: declare cur cursor for select id , d , d from nantest1; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 45: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 45: OK: DECLARE CURSOR
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: query: fetch from cur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: correctly got 1 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: 1 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: NaN offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: NaN offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: query: fetch from cur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: correctly got 1 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: 2 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: Infinity offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: Infinity offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: query: fetch from cur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: correctly got 1 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: 3 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: -Infinity offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: -Infinity offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: query: fetch from cur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: correctly got 1 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: 4 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: NaN offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: NaN offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: query: fetch from cur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: correctly got 1 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: 7 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: NaN offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: NaN offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: query: fetch from cur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: correctly got 1 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: 5 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: Infinity offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: Infinity offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: query: fetch from cur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: correctly got 1 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: 8 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: Infinity offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: Infinity offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: query: fetch from cur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: correctly got 1 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: 6 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: -Infinity offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: -Infinity offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: query: fetch from cur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: correctly got 1 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: 9 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: -Infinity offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: -Infinity offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: query: fetch from cur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: correctly got 0 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: raising sqlcode 100 on line 48: no data found on line 48
! [NO_PID]: sqlca: code: 100, state: 02000
! [NO_PID]: ecpg_execute on line 56: query: close cur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 56: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 56: OK: CLOSE CURSOR
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 60: query: create table nantest2 ( id int4 , d numeric ); with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 60: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 60: OK: CREATE TABLE
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 61: query: insert into nantest2 ( id , d ) values ( 4 , 'nan' :: numeric ); with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 61: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 61: OK: INSERT 0 1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 63: query: select id , d , d from nantest2 where id = 4; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 63: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 63: correctly got 1 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 63: RESULT: 4 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 63: RESULT: NaN offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 63: RESULT: NaN offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 67: query: insert into nantest2 ( id , d ) values ( 5 , $1  ); with 1 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 67: using PQexecParams
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: free_params on line 67: parameter 1 = NaN
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 67: OK: INSERT 0 1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 68: query: insert into nantest2 ( id , d ) values ( 6 , $1  ); with 1 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
  [NO_PID]: ecpg_execute on line 68: using PQexecParams
  [NO_PID]: sqlca: code: 0, state: 00000
--- 106,288 ----
  [NO_PID]: sqlca: code: 0, state: 00000
  [NO_PID]: ecpg_execute on line 41: OK: INSERT 0 1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 42: query: insert into nantest1 ( id , d ) values ( $1  + 6 , $2  ); with 2 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 42: using PQexecParams
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: free_params on line 42: parameter 1 = 3
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: free_params on line 42: parameter 2 = -Infinity
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 42: OK: INSERT 0 1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 33: query: fetch from cur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 33: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 33: correctly got 0 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: raising sqlcode 100 on line 33: no data found on line 33
! [NO_PID]: sqlca: code: 100, state: 02000
! [NO_PID]: ecpg_execute on line 44: query: close cur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 44: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 44: OK: CLOSE CURSOR
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 46: query: declare cur cursor for select id , d , d from nantest1; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 46: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 46: OK: DECLARE CURSOR
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: query: fetch from cur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: correctly got 1 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: 1 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: NaN offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: NaN offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: query: fetch from cur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: correctly got 1 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: 2 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: Infinity offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: Infinity offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: query: fetch from cur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: correctly got 1 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: 3 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: -Infinity offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: -Infinity offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: query: fetch from cur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: correctly got 1 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: 4 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: NaN offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: NaN offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: query: fetch from cur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: correctly got 1 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: 7 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: NaN offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: NaN offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: query: fetch from cur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: correctly got 1 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: 5 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: Infinity offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: Infinity offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: query: fetch from cur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: correctly got 1 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: 8 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: Infinity offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: Infinity offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: query: fetch from cur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: correctly got 1 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: 6 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: -Infinity offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: -Infinity offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: query: fetch from cur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: correctly got 1 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: 9 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: -Infinity offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: -Infinity offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: query: fetch from cur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: correctly got 0 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: raising sqlcode 100 on line 49: no data found on line 49
! [NO_PID]: sqlca: code: 100, state: 02000
! [NO_PID]: ecpg_execute on line 57: query: close cur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 57: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 57: OK: CLOSE CURSOR
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 61: query: create table nantest2 ( id int4 , d numeric ); with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 61: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 61: OK: CREATE TABLE
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 62: query: insert into nantest2 ( id , d ) values ( 4 , 'nan' :: numeric ); with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 62: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 62: OK: INSERT 0 1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 64: query: select id , d , d from nantest2 where id = 4; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 64: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 64: correctly got 1 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 64: RESULT: 4 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 64: RESULT: NaN offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 64: RESULT: NaN offset: -1; array: no
! [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 68: query: insert into nantest2 ( id , d ) values ( 5 , $1  ); with 1 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
  [NO_PID]: ecpg_execute on line 68: using PQexecParams
  [NO_PID]: sqlca: code: 0, state: 00000
***************
*** 298,360 ****
  [NO_PID]: sqlca: code: 0, state: 00000
  [NO_PID]: ecpg_execute on line 68: OK: INSERT 0 1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 71: query: declare cur1 cursor for select id , d , d from nantest2; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 71: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 71: OK: DECLARE CURSOR
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 74: query: fetch from cur1; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 74: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 74: correctly got 1 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 74: RESULT: 4 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 74: RESULT: NaN offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 74: RESULT: NaN offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 74: query: fetch from cur1; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 74: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 74: correctly got 1 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 74: RESULT: 5 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 74: RESULT: NaN offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 74: RESULT: NaN offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 74: query: fetch from cur1; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 74: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 74: correctly got 1 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 74: RESULT: 6 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 74: RESULT: NaN offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 74: RESULT: NaN offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 74: query: fetch from cur1; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 74: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 74: correctly got 0 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: raising sqlcode 100 on line 74: no data found on line 74
  [NO_PID]: sqlca: code: 100, state: 02000
! [NO_PID]: ecpg_execute on line 79: query: close cur1; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 79: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 79: OK: CLOSE CURSOR
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ECPGtrans on line 81: action "rollback"; connection "regress1"
  [NO_PID]: sqlca: code: 0, state: 00000
  [NO_PID]: ecpg_finish: connection regress1 closed
  [NO_PID]: sqlca: code: 0, state: 00000
--- 290,360 ----
  [NO_PID]: sqlca: code: 0, state: 00000
  [NO_PID]: ecpg_execute on line 68: OK: INSERT 0 1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 69: query: insert into nantest2 ( id , d ) values ( 6 , $1  ); with 1 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 69: using PQexecParams
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: free_params on line 69: parameter 1 = NaN
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 69: OK: INSERT 0 1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 72: query: declare cur1 cursor for select id , d , d from nantest2; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 72: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 72: OK: DECLARE CURSOR
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 75: query: fetch from cur1; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 75: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 75: correctly got 1 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 75: RESULT: 4 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 75: RESULT: NaN offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 75: RESULT: NaN offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 75: query: fetch from cur1; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 75: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 75: correctly got 1 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 75: RESULT: 5 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 75: RESULT: NaN offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 75: RESULT: NaN offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 75: query: fetch from cur1; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 75: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 75: correctly got 1 tuples with 3 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 75: RESULT: 6 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 75: RESULT: NaN offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 75: RESULT: NaN offset: -1; array: no
! [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 75: query: fetch from cur1; with 0 parameter(s) on connection regress1
! [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 75: using PQexec
! [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 75: correctly got 0 tuples with 3 fields
! [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: raising sqlcode 100 on line 75: no data found on line 75
  [NO_PID]: sqlca: code: 100, state: 02000
! [NO_PID]: ecpg_execute on line 80: query: close cur1; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 80: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 80: OK: CLOSE CURSOR
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ECPGtrans on line 82: action "rollback"; connection "regress1"
  [NO_PID]: sqlca: code: 0, state: 00000
  [NO_PID]: ecpg_finish: connection regress1 closed
  [NO_PID]: sqlca: code: 0, state: 00000
diff -dcrpN pgsql.orig/src/interfaces/ecpg/test/expected/preproc-outofscope.c pgsql/src/interfaces/ecpg/test/expected/preproc-outofscope.c
*** pgsql.orig/src/interfaces/ecpg/test/expected/preproc-outofscope.c	2010-02-02 17:34:42.000000000 +0100
--- pgsql/src/interfaces/ecpg/test/expected/preproc-outofscope.c	2010-02-04 15:38:20.000000000 +0100
***************
*** 11,16 ****
--- 11,17 ----
  #include <stdlib.h>
  #include <string.h>
  #include <limits.h>
+ #include <pgtypes_numeric.h>
  
  
  #line 1 "regression.h"
***************
*** 20,99 ****
  
  
  
! #line 6 "outofscope.pgc"
! 
! 
! 
! #line 1 "pgtypes_numeric.h"
! #ifndef PGTYPES_NUMERIC
! #define PGTYPES_NUMERIC
! 
! #define NUMERIC_POS						0x0000
! #define NUMERIC_NEG						0x4000
! #define NUMERIC_NAN						0xC000
! #define NUMERIC_NULL						0xF000
! #define NUMERIC_MAX_PRECISION			1000
! #define NUMERIC_MAX_DISPLAY_SCALE		NUMERIC_MAX_PRECISION
! #define NUMERIC_MIN_DISPLAY_SCALE		0
! #define NUMERIC_MIN_SIG_DIGITS			16
! 
! #define DECSIZE 30
! 
! typedef unsigned char NumericDigit;
! typedef struct
! {
! 	int			ndigits;		/* number of digits in digits[] - can be 0! */
! 	int			weight;			/* weight of first digit */
! 	int			rscale;			/* result scale */
! 	int			dscale;			/* display scale */
! 	int			sign;			/* NUMERIC_POS, NUMERIC_NEG, or NUMERIC_NAN */
! 	NumericDigit *buf;			/* start of alloc'd space for digits[] */
! 	NumericDigit *digits;		/* decimal digits */
! } numeric;
! 
! typedef struct
! {
! 	int			ndigits;		/* number of digits in digits[] - can be 0! */
! 	int			weight;			/* weight of first digit */
! 	int			rscale;			/* result scale */
! 	int			dscale;			/* display scale */
! 	int			sign;			/* NUMERIC_POS, NUMERIC_NEG, or NUMERIC_NAN */
! 	NumericDigit digits[DECSIZE];		/* decimal digits */
! } decimal;
! 
! #ifdef __cplusplus
! extern		"C"
! {
! #endif
! 
! numeric    *PGTYPESnumeric_new(void);
! decimal    *PGTYPESdecimal_new(void);
! void		PGTYPESnumeric_free(numeric *);
! void		PGTYPESdecimal_free(decimal *);
! numeric    *PGTYPESnumeric_from_asc(char *, char **);
! char	   *PGTYPESnumeric_to_asc(numeric *, int);
! int			PGTYPESnumeric_add(numeric *, numeric *, numeric *);
! int			PGTYPESnumeric_sub(numeric *, numeric *, numeric *);
! int			PGTYPESnumeric_mul(numeric *, numeric *, numeric *);
! int			PGTYPESnumeric_div(numeric *, numeric *, numeric *);
! int			PGTYPESnumeric_cmp(numeric *, numeric *);
! int			PGTYPESnumeric_from_int(signed int, numeric *);
! int			PGTYPESnumeric_from_long(signed long int, numeric *);
! int			PGTYPESnumeric_copy(numeric *, numeric *);
! int			PGTYPESnumeric_from_double(double, numeric *);
! int			PGTYPESnumeric_to_double(numeric *, double *);
! int			PGTYPESnumeric_to_int(numeric *, int *);
! int			PGTYPESnumeric_to_long(numeric *, long *);
! int			PGTYPESnumeric_to_decimal(numeric *, decimal *);
! int			PGTYPESnumeric_from_decimal(decimal *, numeric *);
! 
! #ifdef __cplusplus
! }
! #endif
! 
! #endif   /* PGTYPES_NUMERIC */
! 
! #line 8 "outofscope.pgc"
  
  
  /* exec sql begin declare section */
--- 21,27 ----
  
  
  
! #line 7 "outofscope.pgc"
  
  
  /* exec sql begin declare section */
*************** int			PGTYPESnumeric_from_decimal(decima
*** 124,130 ****
  #line 18 "struct.h"
  
  
! #line 11 "outofscope.pgc"
  
  struct mytype { 
  #line 3 "struct.h"
--- 52,58 ----
  #line 18 "struct.h"
  
  
! #line 10 "outofscope.pgc"
  
  struct mytype { 
  #line 3 "struct.h"
*************** struct mytype { 
*** 157,167 ****
  #line 16 "struct.h"
   int c ;
   } ;/* exec sql end declare section */
! #line 12 "outofscope.pgc"
  
  
  /* exec sql whenever sqlerror  stop ; */
! #line 14 "outofscope.pgc"
  
  
  /* Functions for test 1 */
--- 85,95 ----
  #line 16 "struct.h"
   int c ;
   } ;/* exec sql end declare section */
! #line 11 "outofscope.pgc"
  
  
  /* exec sql whenever sqlerror  stop ; */
! #line 13 "outofscope.pgc"
  
  
  /* Functions for test 1 */
*************** get_var1(MYTYPE **myvar0, MYNULLTYPE **m
*** 173,185 ****
  			  
  		  
  	
! #line 22 "outofscope.pgc"
   MYTYPE * myvar = malloc ( sizeof ( MYTYPE ) ) ;
   
! #line 23 "outofscope.pgc"
   MYNULLTYPE * mynullvar = malloc ( sizeof ( MYNULLTYPE ) ) ;
  /* exec sql end declare section */
! #line 24 "outofscope.pgc"
  
  
  	/* Test DECLARE ... SELECT ... INTO with pointers */
--- 101,113 ----
  			  
  		  
  	
! #line 21 "outofscope.pgc"
   MYTYPE * myvar = malloc ( sizeof ( MYTYPE ) ) ;
   
! #line 22 "outofscope.pgc"
   MYNULLTYPE * mynullvar = malloc ( sizeof ( MYNULLTYPE ) ) ;
  /* exec sql end declare section */
! #line 23 "outofscope.pgc"
  
  
  	/* Test DECLARE ... SELECT ... INTO with pointers */
*************** get_var1(MYTYPE **myvar0, MYNULLTYPE **m
*** 187,193 ****
  	ECPGset_var( 0, ( myvar ), __LINE__);\
   ECPGset_var( 1, ( mynullvar ), __LINE__);\
   /* declare mycur cursor for select * from a1 */
! #line 28 "outofscope.pgc"
  
  
  	if (sqlca.sqlcode != 0)
--- 115,121 ----
  	ECPGset_var( 0, ( myvar ), __LINE__);\
   ECPGset_var( 1, ( mynullvar ), __LINE__);\
   /* declare mycur cursor for select * from a1 */
! #line 27 "outofscope.pgc"
  
  
  	if (sqlca.sqlcode != 0)
*************** open_cur1(void)
*** 211,220 ****
  	ECPGt_int,&((*( MYNULLTYPE  *)(ECPGget_var( 1))).d2),(long)1,(long)1,sizeof(int), 
  	ECPGt_char,&((*( MYTYPE  *)(ECPGget_var( 0))).c),(long)30,(long)1,(30)*sizeof(char), 
  	ECPGt_int,&((*( MYNULLTYPE  *)(ECPGget_var( 1))).c),(long)1,(long)1,sizeof(int), ECPGt_EORT);
! #line 40 "outofscope.pgc"
  
  if (sqlca.sqlcode < 0) exit (1);}
! #line 40 "outofscope.pgc"
  
  
  	if (sqlca.sqlcode != 0)
--- 139,148 ----
  	ECPGt_int,&((*( MYNULLTYPE  *)(ECPGget_var( 1))).d2),(long)1,(long)1,sizeof(int), 
  	ECPGt_char,&((*( MYTYPE  *)(ECPGget_var( 0))).c),(long)30,(long)1,(30)*sizeof(char), 
  	ECPGt_int,&((*( MYNULLTYPE  *)(ECPGget_var( 1))).c),(long)1,(long)1,sizeof(int), ECPGt_EORT);
! #line 39 "outofscope.pgc"
  
  if (sqlca.sqlcode < 0) exit (1);}
! #line 39 "outofscope.pgc"
  
  
  	if (sqlca.sqlcode != 0)
*************** get_record1(void)
*** 235,244 ****
  	ECPGt_int,&((*( MYNULLTYPE  *)(ECPGget_var( 1))).d2),(long)1,(long)1,sizeof(int), 
  	ECPGt_char,&((*( MYTYPE  *)(ECPGget_var( 0))).c),(long)30,(long)1,(30)*sizeof(char), 
  	ECPGt_int,&((*( MYNULLTYPE  *)(ECPGget_var( 1))).c),(long)1,(long)1,sizeof(int), ECPGt_EORT);
! #line 49 "outofscope.pgc"
  
  if (sqlca.sqlcode < 0) exit (1);}
! #line 49 "outofscope.pgc"
  
  
  	if (sqlca.sqlcode != 0 && sqlca.sqlcode != ECPG_NOT_FOUND)
--- 163,172 ----
  	ECPGt_int,&((*( MYNULLTYPE  *)(ECPGget_var( 1))).d2),(long)1,(long)1,sizeof(int), 
  	ECPGt_char,&((*( MYTYPE  *)(ECPGget_var( 0))).c),(long)30,(long)1,(30)*sizeof(char), 
  	ECPGt_int,&((*( MYNULLTYPE  *)(ECPGget_var( 1))).c),(long)1,(long)1,sizeof(int), ECPGt_EORT);
! #line 48 "outofscope.pgc"
  
  if (sqlca.sqlcode < 0) exit (1);}
! #line 48 "outofscope.pgc"
  
  
  	if (sqlca.sqlcode != 0 && sqlca.sqlcode != ECPG_NOT_FOUND)
*************** static void
*** 249,258 ****
  close_cur1(void)
  {
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close mycur", ECPGt_EOIT, ECPGt_EORT);
! #line 58 "outofscope.pgc"
  
  if (sqlca.sqlcode < 0) exit (1);}
! #line 58 "outofscope.pgc"
  
  
  	if (sqlca.sqlcode != 0)
--- 177,186 ----
  close_cur1(void)
  {
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close mycur", ECPGt_EOIT, ECPGt_EORT);
! #line 57 "outofscope.pgc"
  
  if (sqlca.sqlcode < 0) exit (1);}
! #line 57 "outofscope.pgc"
  
  
  	if (sqlca.sqlcode != 0)
*************** main (void)
*** 271,324 ****
  
  	strcpy(msg, "connect");
  	{ ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0); 
! #line 75 "outofscope.pgc"
  
  if (sqlca.sqlcode < 0) exit (1);}
! #line 75 "outofscope.pgc"
  
  
  	strcpy(msg, "set");
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "set datestyle to iso", ECPGt_EOIT, ECPGt_EORT);
! #line 78 "outofscope.pgc"
  
  if (sqlca.sqlcode < 0) exit (1);}
! #line 78 "outofscope.pgc"
  
  
  	strcpy(msg, "create");
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table a1 ( id serial primary key , t text , d1 numeric , d2 float8 , c character ( 10 ) )", ECPGt_EOIT, ECPGt_EORT);
! #line 81 "outofscope.pgc"
  
  if (sqlca.sqlcode < 0) exit (1);}
! #line 81 "outofscope.pgc"
  
  
  	strcpy(msg, "insert");
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into a1 ( id , t , d1 , d2 , c ) values ( default , 'a' , 1.0 , 2 , 'a' )", ECPGt_EOIT, ECPGt_EORT);
! #line 84 "outofscope.pgc"
  
  if (sqlca.sqlcode < 0) exit (1);}
! #line 84 "outofscope.pgc"
  
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into a1 ( id , t , d1 , d2 , c ) values ( default , null , null , null , null )", ECPGt_EOIT, ECPGt_EORT);
! #line 85 "outofscope.pgc"
  
  if (sqlca.sqlcode < 0) exit (1);}
! #line 85 "outofscope.pgc"
  
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into a1 ( id , t , d1 , d2 , c ) values ( default , 'b' , 2.0 , 3 , 'b' )", ECPGt_EOIT, ECPGt_EORT);
! #line 86 "outofscope.pgc"
  
  if (sqlca.sqlcode < 0) exit (1);}
! #line 86 "outofscope.pgc"
  
  
  	strcpy(msg, "commit");
  	{ ECPGtrans(__LINE__, NULL, "commit");
! #line 89 "outofscope.pgc"
  
  if (sqlca.sqlcode < 0) exit (1);}
! #line 89 "outofscope.pgc"
  
  
  	/* Test out-of-scope DECLARE/OPEN/FETCH/CLOSE */
--- 199,252 ----
  
  	strcpy(msg, "connect");
  	{ ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0); 
! #line 74 "outofscope.pgc"
  
  if (sqlca.sqlcode < 0) exit (1);}
! #line 74 "outofscope.pgc"
  
  
  	strcpy(msg, "set");
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "set datestyle to iso", ECPGt_EOIT, ECPGt_EORT);
! #line 77 "outofscope.pgc"
  
  if (sqlca.sqlcode < 0) exit (1);}
! #line 77 "outofscope.pgc"
  
  
  	strcpy(msg, "create");
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table a1 ( id serial primary key , t text , d1 numeric , d2 float8 , c character ( 10 ) )", ECPGt_EOIT, ECPGt_EORT);
! #line 80 "outofscope.pgc"
  
  if (sqlca.sqlcode < 0) exit (1);}
! #line 80 "outofscope.pgc"
  
  
  	strcpy(msg, "insert");
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into a1 ( id , t , d1 , d2 , c ) values ( default , 'a' , 1.0 , 2 , 'a' )", ECPGt_EOIT, ECPGt_EORT);
! #line 83 "outofscope.pgc"
  
  if (sqlca.sqlcode < 0) exit (1);}
! #line 83 "outofscope.pgc"
  
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into a1 ( id , t , d1 , d2 , c ) values ( default , null , null , null , null )", ECPGt_EOIT, ECPGt_EORT);
! #line 84 "outofscope.pgc"
  
  if (sqlca.sqlcode < 0) exit (1);}
! #line 84 "outofscope.pgc"
  
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into a1 ( id , t , d1 , d2 , c ) values ( default , 'b' , 2.0 , 3 , 'b' )", ECPGt_EOIT, ECPGt_EORT);
! #line 85 "outofscope.pgc"
  
  if (sqlca.sqlcode < 0) exit (1);}
! #line 85 "outofscope.pgc"
  
  
  	strcpy(msg, "commit");
  	{ ECPGtrans(__LINE__, NULL, "commit");
! #line 88 "outofscope.pgc"
  
  if (sqlca.sqlcode < 0) exit (1);}
! #line 88 "outofscope.pgc"
  
  
  	/* Test out-of-scope DECLARE/OPEN/FETCH/CLOSE */
*************** if (sqlca.sqlcode < 0) exit (1);}
*** 327,333 ****
  	open_cur1();
  
  	/* exec sql whenever not found  break ; */
! #line 96 "outofscope.pgc"
  
  
  	while (1)
--- 255,261 ----
  	open_cur1();
  
  	/* exec sql whenever not found  break ; */
! #line 95 "outofscope.pgc"
  
  
  	while (1)
*************** if (sqlca.sqlcode < 0) exit (1);}
*** 348,373 ****
  
  	strcpy(msg, "drop");
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "drop table a1", ECPGt_EOIT, ECPGt_EORT);
! #line 115 "outofscope.pgc"
  
  if (sqlca.sqlcode < 0) exit (1);}
! #line 115 "outofscope.pgc"
  
  
  	strcpy(msg, "commit");
  	{ ECPGtrans(__LINE__, NULL, "commit");
! #line 118 "outofscope.pgc"
  
  if (sqlca.sqlcode < 0) exit (1);}
! #line 118 "outofscope.pgc"
  
  
  	strcpy(msg, "disconnect"); 
  	{ ECPGdisconnect(__LINE__, "CURRENT");
! #line 121 "outofscope.pgc"
  
  if (sqlca.sqlcode < 0) exit (1);}
! #line 121 "outofscope.pgc"
  
  
  	return (0);
--- 276,301 ----
  
  	strcpy(msg, "drop");
  	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "drop table a1", ECPGt_EOIT, ECPGt_EORT);
! #line 114 "outofscope.pgc"
  
  if (sqlca.sqlcode < 0) exit (1);}
! #line 114 "outofscope.pgc"
  
  
  	strcpy(msg, "commit");
  	{ ECPGtrans(__LINE__, NULL, "commit");
! #line 117 "outofscope.pgc"
  
  if (sqlca.sqlcode < 0) exit (1);}
! #line 117 "outofscope.pgc"
  
  
  	strcpy(msg, "disconnect"); 
  	{ ECPGdisconnect(__LINE__, "CURRENT");
! #line 120 "outofscope.pgc"
  
  if (sqlca.sqlcode < 0) exit (1);}
! #line 120 "outofscope.pgc"
  
  
  	return (0);
diff -dcrpN pgsql.orig/src/interfaces/ecpg/test/expected/preproc-outofscope.stderr pgsql/src/interfaces/ecpg/test/expected/preproc-outofscope.stderr
*** pgsql.orig/src/interfaces/ecpg/test/expected/preproc-outofscope.stderr	2010-02-04 11:10:03.000000000 +0100
--- pgsql/src/interfaces/ecpg/test/expected/preproc-outofscope.stderr	2010-02-04 15:47:10.000000000 +0100
***************
*** 2,114 ****
  [NO_PID]: sqlca: code: 0, state: 00000
  [NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>  
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 78: query: set datestyle to iso; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 78: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 78: OK: SET
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 81: query: create table a1 ( id serial primary key , t text , d1 numeric , d2 float8 , c character ( 10 ) ); with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 81: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 81: OK: CREATE TABLE
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 84: query: insert into a1 ( id , t , d1 , d2 , c ) values ( default , 'a' , 1.0 , 2 , 'a' ); with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
  [NO_PID]: ecpg_execute on line 84: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
  [NO_PID]: ecpg_execute on line 84: OK: INSERT 0 1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 85: query: insert into a1 ( id , t , d1 , d2 , c ) values ( default , null , null , null , null ); with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
  [NO_PID]: ecpg_execute on line 85: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
  [NO_PID]: ecpg_execute on line 85: OK: INSERT 0 1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 86: query: insert into a1 ( id , t , d1 , d2 , c ) values ( default , 'b' , 2.0 , 3 , 'b' ); with 0 parameter(s) on connection regress1
! [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 86: using PQexec
! [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 86: OK: INSERT 0 1
! [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ECPGtrans on line 89: action "commit"; connection "regress1"
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 40: query: declare mycur cursor for select * from a1; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 40: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 40: OK: DECLARE CURSOR
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: query: fetch mycur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: correctly got 1 tuples with 5 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: 1 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: a offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: 1.0 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: 2 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: a          offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: query: fetch mycur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: correctly got 1 tuples with 5 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: 2 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT:  offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT:  offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT:  offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT:  offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: query: fetch mycur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: correctly got 1 tuples with 5 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: 3 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: b offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: 2.0 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: 3 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: b          offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: query: fetch mycur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: correctly got 0 tuples with 5 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: raising sqlcode 100 on line 49: no data found on line 49
  [NO_PID]: sqlca: code: 100, state: 02000
! [NO_PID]: ecpg_execute on line 58: query: close mycur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 58: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 58: OK: CLOSE CURSOR
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 115: query: drop table a1; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 115: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 115: OK: DROP TABLE
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ECPGtrans on line 118: action "commit"; connection "regress1"
  [NO_PID]: sqlca: code: 0, state: 00000
  [NO_PID]: ecpg_finish: connection regress1 closed
  [NO_PID]: sqlca: code: 0, state: 00000
--- 2,114 ----
  [NO_PID]: sqlca: code: 0, state: 00000
  [NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>  
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 77: query: set datestyle to iso; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 77: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 77: OK: SET
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 80: query: create table a1 ( id serial primary key , t text , d1 numeric , d2 float8 , c character ( 10 ) ); with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 80: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 80: OK: CREATE TABLE
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 83: query: insert into a1 ( id , t , d1 , d2 , c ) values ( default , 'a' , 1.0 , 2 , 'a' ); with 0 parameter(s) on connection regress1
! [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 83: using PQexec
! [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 83: OK: INSERT 0 1
! [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 84: query: insert into a1 ( id , t , d1 , d2 , c ) values ( default , null , null , null , null ); with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
  [NO_PID]: ecpg_execute on line 84: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
  [NO_PID]: ecpg_execute on line 84: OK: INSERT 0 1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 85: query: insert into a1 ( id , t , d1 , d2 , c ) values ( default , 'b' , 2.0 , 3 , 'b' ); with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
  [NO_PID]: ecpg_execute on line 85: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
  [NO_PID]: ecpg_execute on line 85: OK: INSERT 0 1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ECPGtrans on line 88: action "commit"; connection "regress1"
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 39: query: declare mycur cursor for select * from a1; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 39: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 39: OK: DECLARE CURSOR
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: query: fetch mycur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: correctly got 1 tuples with 5 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: 1 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: a offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: 1.0 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: 2 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: a          offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: query: fetch mycur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: correctly got 1 tuples with 5 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: 2 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT:  offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT:  offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT:  offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT:  offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: query: fetch mycur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: correctly got 1 tuples with 5 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: 3 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: b offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: 2.0 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: 3 offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: b          offset: -1; array: no
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: query: fetch mycur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: correctly got 0 tuples with 5 fields
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: raising sqlcode 100 on line 48: no data found on line 48
  [NO_PID]: sqlca: code: 100, state: 02000
! [NO_PID]: ecpg_execute on line 57: query: close mycur; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 57: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 57: OK: CLOSE CURSOR
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 114: query: drop table a1; with 0 parameter(s) on connection regress1
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 114: using PQexec
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 114: OK: DROP TABLE
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ECPGtrans on line 117: action "commit"; connection "regress1"
  [NO_PID]: sqlca: code: 0, state: 00000
  [NO_PID]: ecpg_finish: connection regress1 closed
  [NO_PID]: sqlca: code: 0, state: 00000
diff -dcrpN pgsql.orig/src/interfaces/ecpg/test/expected/sql-sqlda.c pgsql/src/interfaces/ecpg/test/expected/sql-sqlda.c
*** pgsql.orig/src/interfaces/ecpg/test/expected/sql-sqlda.c	2010-02-02 17:34:42.000000000 +0100
--- pgsql/src/interfaces/ecpg/test/expected/sql-sqlda.c	2010-02-04 15:38:20.000000000 +0100
***************
*** 10,15 ****
--- 10,16 ----
  #include <stdlib.h>
  #include <string.h>
  #include <limits.h>
+ #include <pgtypes_numeric.h>
  
  
  #line 1 "regression.h"
***************
*** 19,25 ****
  
  
  
! #line 5 "sqlda.pgc"
  
  
  
--- 20,26 ----
  
  
  
! #line 6 "sqlda.pgc"
  
  
  
*************** typedef struct sqlda_struct	sqlda_t;
*** 43,120 ****
  
  #endif /* ECPG_SQLDA_H */
  
- #line 7 "sqlda.pgc"
- 
- 
- #line 1 "pgtypes_numeric.h"
- #ifndef PGTYPES_NUMERIC
- #define PGTYPES_NUMERIC
- 
- #define NUMERIC_POS						0x0000
- #define NUMERIC_NEG						0x4000
- #define NUMERIC_NAN						0xC000
- #define NUMERIC_NULL						0xF000
- #define NUMERIC_MAX_PRECISION			1000
- #define NUMERIC_MAX_DISPLAY_SCALE		NUMERIC_MAX_PRECISION
- #define NUMERIC_MIN_DISPLAY_SCALE		0
- #define NUMERIC_MIN_SIG_DIGITS			16
- 
- #define DECSIZE 30
- 
- typedef unsigned char NumericDigit;
- typedef struct
- {
- 	int			ndigits;		/* number of digits in digits[] - can be 0! */
- 	int			weight;			/* weight of first digit */
- 	int			rscale;			/* result scale */
- 	int			dscale;			/* display scale */
- 	int			sign;			/* NUMERIC_POS, NUMERIC_NEG, or NUMERIC_NAN */
- 	NumericDigit *buf;			/* start of alloc'd space for digits[] */
- 	NumericDigit *digits;		/* decimal digits */
- } numeric;
- 
- typedef struct
- {
- 	int			ndigits;		/* number of digits in digits[] - can be 0! */
- 	int			weight;			/* weight of first digit */
- 	int			rscale;			/* result scale */
- 	int			dscale;			/* display scale */
- 	int			sign;			/* NUMERIC_POS, NUMERIC_NEG, or NUMERIC_NAN */
- 	NumericDigit digits[DECSIZE];		/* decimal digits */
- } decimal;
- 
- #ifdef __cplusplus
- extern		"C"
- {
- #endif
- 
- numeric    *PGTYPESnumeric_new(void);
- decimal    *PGTYPESdecimal_new(void);
- void		PGTYPESnumeric_free(numeric *);
- void		PGTYPESdecimal_free(decimal *);
- numeric    *PGTYPESnumeric_from_asc(char *, char **);
- char	   *PGTYPESnumeric_to_asc(numeric *, int);
- int			PGTYPESnumeric_add(numeric *, numeric *, numeric *);
- int			PGTYPESnumeric_sub(numeric *, numeric *, numeric *);
- int			PGTYPESnumeric_mul(numeric *, numeric *, numeric *);
- int			PGTYPESnumeric_div(numeric *, numeric *, numeric *);
- int			PGTYPESnumeric_cmp(numeric *, numeric *);
- int			PGTYPESnumeric_from_int(signed int, numeric *);
- int			PGTYPESnumeric_from_long(signed long int, numeric *);
- int			PGTYPESnumeric_copy(numeric *, numeric *);
- int			PGTYPESnumeric_from_double(double, numeric *);
- int			PGTYPESnumeric_to_double(numeric *, double *);
- int			PGTYPESnumeric_to_int(numeric *, int *);
- int			PGTYPESnumeric_to_long(numeric *, long *);
- int			PGTYPESnumeric_to_decimal(numeric *, decimal *);
- int			PGTYPESnumeric_from_decimal(decimal *, numeric *);
- 
- #ifdef __cplusplus
- }
- #endif
- 
- #endif   /* PGTYPES_NUMERIC */
- 
  #line 8 "sqlda.pgc"
  
  
--- 44,49 ----
diff -dcrpN pgsql.orig/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc pgsql/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc
*** pgsql.orig/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc	2010-02-04 14:49:15.000000000 +0100
--- pgsql/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc	2010-02-04 15:38:20.000000000 +0100
***************
*** 1,5 ****
--- 1,6 ----
  #include <stdio.h>
  #include <stdlib.h>
+ #include <float.h>
  #include <math.h>
  #include <float.h>
  #include <pgtypes_numeric.h>
diff -dcrpN pgsql.orig/src/interfaces/ecpg/test/preproc/outofscope.pgc pgsql/src/interfaces/ecpg/test/preproc/outofscope.pgc
*** pgsql.orig/src/interfaces/ecpg/test/preproc/outofscope.pgc	2010-01-29 17:35:57.000000000 +0100
--- pgsql/src/interfaces/ecpg/test/preproc/outofscope.pgc	2010-02-04 15:38:20.000000000 +0100
***************
*** 2,12 ****
  #include <stdlib.h>
  #include <string.h>
  #include <limits.h>
  
  exec sql include ../regression;
  
- exec sql include pgtypes_numeric.h;
- 
  exec sql begin declare section;
  exec sql include struct.h;
  exec sql end declare section;
--- 2,11 ----
  #include <stdlib.h>
  #include <string.h>
  #include <limits.h>
+ #include <pgtypes_numeric.h>
  
  exec sql include ../regression;
  
  exec sql begin declare section;
  exec sql include struct.h;
  exec sql end declare section;
diff -dcrpN pgsql.orig/src/interfaces/ecpg/test/sql/sqlda.pgc pgsql/src/interfaces/ecpg/test/sql/sqlda.pgc
*** pgsql.orig/src/interfaces/ecpg/test/sql/sqlda.pgc	2010-01-06 19:06:46.000000000 +0100
--- pgsql/src/interfaces/ecpg/test/sql/sqlda.pgc	2010-02-04 15:38:20.000000000 +0100
***************
*** 1,11 ****
  #include <stdlib.h>
  #include <string.h>
  #include <limits.h>
  
  exec sql include ../regression;
  
  exec sql include sqlda.h;
- exec sql include pgtypes_numeric.h;
  
  exec sql whenever sqlerror stop;
  
--- 1,11 ----
  #include <stdlib.h>
  #include <string.h>
  #include <limits.h>
+ #include <pgtypes_numeric.h>
  
  exec sql include ../regression;
  
  exec sql include sqlda.h;
  
  exec sql whenever sqlerror stop;
  
