Skip site navigation (1) Skip section navigation (2)

Re: double and numeric conversion

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Theo Schlossnagle <jesus(at)omniti(dot)com>
Cc: PostgreSQL-development Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: double and numeric conversion
Date: 2010-03-01 20:58:44
Message-ID: 4B8C2A84.5070506@dunslane.net (view raw or flat)
Thread:
Lists: pgsql-hackers

Theo Schlossnagle wrote:
> Hello all,
>
> I'm writing some extension and I have a hot code path that has a lot of double (C type) data and needs to output NUMERIC tuple data.  The current methods I can find in the code to convert sprintf the double to a buffer and then invoke the numeric_in function on them.  I've profile my stuff and I'm spending (wasting) all my time in that conversion.  Is there a more efficient method of converting a double into a postgres numeric value?
>
>
>   


float8_numeric() ? Although it uses sprintf too, by the look of it.

cheers

andrew

In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2010-03-01 21:29:56
Subject: Re: function side effects
Previous:From: Pavel StehuleDate: 2010-03-01 20:51:25
Subject: Re: Plans for 9.1, Grouping Sets, disabling multiqueries, contrib module for string, plpgpsm, preload dictionaries

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group