[GRASS5] data type numeric and DBMI

Radim Blazek blazek at itc.it
Mon May 30 04:20:50 EDT 2005


Martin Landa wrote:
> Hi all,
> 
> I have a small problem with importing data in Czech cadastral
> data exchange format. It is ASCII file which contains
> table description and data records.
> 
> For example:
> 
> &BSOBR;ID N30;STAV_DAT N2;KATUZE_KOD N6;CISLO_ZPMZ N5;CISLO_TL N4;CISLO_BODU N12;UPLNE_CISLO N12;SOURADNICE_Y N10.2;SOURADNICE_X N10.2;KODCHB_KOD N2
> &DSOBR;311040708;0;654299;1427;;1;1014270001;650451.45;1069791.42;4
> 
> I have two ideas how to work with numeric types:
> 
> a) int/bigint
> 	<N10 -> integer
> 	>N9  -> bigint
> 
> b) as numeric
> 	N2 -> numeric (2,0)
> 
> The problems:
> 
> a) GRASS DBMI doesn't support the data type bigint.
>    Solution: to add this support for relevant drivers (pg,...)

The problem is that it isn't enough to change just a driver, the changes 
must be done in the DBMI library (dbValue structure and data types) and 
that would break compatibility.
Also i don't know how to work with 8 bytes integer in ANSI C, AFAIK C 
guarantees only that char is 1 byte.

> b) All numerics are determined as *double*.
>    Solution: numeric(x,0) -> DB_C_TYPE_INT
> 	     numeric(x,y) -> DB_C_TYPE_TYPE_DOUBLE

Can you send a patch? In fact, I don't see any function in pg library 
which returns 'y'.

Radim

> I am not sure, what is better. However, the numeric type
> is very slow compared to the floating-point types.
> 
> Any ideas?
> 
> Thanks, 
> 	Martin
> 
> --
> Martin Landa <landa at gama.fsv.cvut.cz> * http://gama.fsv.cvut.cz/~landa *
> CTU Prague, Faculty of Civil Engineering, Czech Republic
> 
> _______________________________________________
> grass5 mailing list
> grass5 at grass.itc.it
> http://grass.itc.it/mailman/listinfo/grass5




More information about the grass-dev mailing list