From 8bb975b8f2b31b8114a4b4e60a6a8db1b8abdcc2 Mon Sep 17 00:00:00 2001 From: Jeff Lounsbury Date: Sat, 15 Feb 2003 00:27:14 +0000 Subject: [PATCH] added more type checking into the create table statment. Now uses int8, and numeric types if the columns definitions are too big git-svn-id: http://svn.osgeo.org/postgis/trunk@243 b70326c6-7e19-0410-871a-916f4a2858ee --- loader/shp2pgsql.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/loader/shp2pgsql.c b/loader/shp2pgsql.c index f44399fa9..40079aba0 100644 --- a/loader/shp2pgsql.c +++ b/loader/shp2pgsql.c @@ -4,6 +4,10 @@ * Author: Jeff Lounsbury, jeffloun@refractions.net * * $Log$ + * Revision 1.31 2003/02/15 00:27:14 jeffloun + * added more type checking into the create table statment. + * Now uses int8, and numeric types if the columns definitions are too big + * * Revision 1.30 2003/02/14 20:07:26 jeffloun * changed the PIP function to loop from i=0 to 1 18 ){ + printf ("numeric(%d,0)",field_width); + }else if( field_width > 9){ + printf ("int8"); + }else{ + printf ("int4"); + } }else if(type == FTDouble){ - printf ("float8"); + if( field_width > 18 ){ + printf ("numeric(%d,%d)",field_width, field_precision); + }else{ + printf ("float8"); + } }else{ printf ("Invalid type in DBF file"); } -- 2.40.0