converting numeric to string in postgres code - Mailing list pgsql-hackers

From Szymon Guz
Subject converting numeric to string in postgres code
Date
Msg-id CAFjNrYttKC4N7S4G1pvOcwonUumiLKAkBGWkkdwYAkN8vAA=0w@mail.gmail.com
Whole thread Raw
Responses Re: converting numeric to string in postgres code  (Pavel Stehule <pavel.stehule@gmail.com>)
List 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

pgsql-hackers by date:

Previous
From: Maciej Gajewski
Date:
Subject: Re: Unsigned integer types
Next
From: Pavel Stehule
Date:
Subject: Re: converting numeric to string in postgres code