converting datum to numeric - Mailing list pgsql-hackers

From Szymon Guz
Subject converting datum to numeric
Date
Msg-id CAFjNrYv7_bBWHz8cAXAmeLGw9zJoiWqVp2W8BU4Tz5ivGxeuWQ@mail.gmail.com
Whole thread Raw
Responses Re: converting datum to numeric  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
<div dir="ltr">Hi,<div style="style">I've got a couple of questions.</div><div style="style"><br /></div><div
style="style">Iwas using numeric_out like this:</div><div style="style"><br /></div><div
style="style">DatumGetCString(DirectFunctionCall1(numeric_out,d));<br /></div><div style="style"><br /></div><div
style="style">Whydo I have to use DirectFunctionCall1 instead of calling numeric_out?</div><div style="style"><br
/></div><divstyle="style"><br /></div><div style="style">I was suggested to use numeric_send instead of numeric_out,
howeverwhen changing the function names in the above example, the whole expression returns 8. Always 8. I check
with:</div><divstyle="style"><br /></div><div style="style">char *x = DatumGetCString(DirectFunctionCall1(numeric_send,
d));<br/></div><div style="style">PLy_elog(NOTICE, x).</div><div style="style"><br /></div><div style="style"><br
/></div><divstyle="style">And my main question: is there any documentation about those internal functions, which use
andwhen etc?</div><div style="style"><br /></div><div style="style">thanks</div><div style="style">Szymon</div></div> 

pgsql-hackers by date:

Previous
From: Hari Babu
Date:
Subject: Re: fixing pg_ctl with relative paths
Next
From: Simon Riggs
Date:
Subject: Re: [RFC] Minmax indexes