converting numeric to string in postgres code

From: Szymon Guz <mabewlun(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: converting numeric to string in postgres code
Date: 2013-05-28 10:02:18
Message-ID: CAFjNrYttKC4N7S4G1pvOcwonUumiLKAkBGWkkdwYAkN8vAA=0w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,
while hacking on some Postgres code I've found a problem.

I need to convert numeric to string. I've got datum with numeric inside, so
I'm getting it like:

Numeric *numeric = DatumGetNumeric(d);

but later I need to have string (most probably: const char *). I've found a
couple of different ways for doing that, but I'm not aware of side effects.

Which function/macro should I use?

thanks,
Szymon

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2013-05-28 10:07:07 Re: converting numeric to string in postgres code
Previous Message Maciej Gajewski 2013-05-28 09:17:42 Re: Unsigned integer types