Re: COPY statement REAL vs VARCHAR precision issue - Mailing list pgsql-general

From Raymond O'Donnell
Subject Re: COPY statement REAL vs VARCHAR precision issue
Date
Msg-id 4D543FEF.5030904@iol.ie
Whole thread Raw
In response to COPY statement REAL vs VARCHAR precision issue  (Samuel Gilbert <samuel.gilbert@ec.gc.ca>)
List pgsql-general
On 10/02/2011 17:13, Samuel Gilbert wrote:
> Hello all,
>
>    I'm using a COPY statement to load data into a PostGIS.  The issue I am
> facing is that if I define fields with the REAL type, the COPY will only
> preserve 4 decimals which is not sufficient for my application.

If you use NUMERIC, you can define the precision you need, and be sure
of accurate calculations:

http://www.postgresql.org/docs/9.0/static/datatype-numeric.html#DATATYPE-NUMERIC-DECIMAL

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie

pgsql-general by date:

Previous
From: Scott Ribe
Date:
Subject: finding bogus UTF-8
Next
From: Royce Ausburn
Date:
Subject: Schema version control