converting datum to numeric

From: Szymon Guz <mabewlun(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: converting datum to numeric
Date: 2013-06-25 06:32:10
Message-ID: CAFjNrYv7_bBWHz8cAXAmeLGw9zJoiWqVp2W8BU4Tz5ivGxeuWQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,
I've got a couple of questions.

I was using numeric_out like this:

DatumGetCString(DirectFunctionCall1(numeric_out, d));

Why do I have to use DirectFunctionCall1 instead of calling numeric_out?

I was suggested to use numeric_send instead of numeric_out, however when
changing the function names in the above example, the whole expression
returns 8. Always 8. I check with:

char *x = DatumGetCString(DirectFunctionCall1(numeric_send, d));
PLy_elog(NOTICE, x).

And my main question: is there any documentation about those internal
functions, which use and when etc?

thanks
Szymon

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2013-06-25 06:33:05 Re: [RFC] Minmax indexes
Previous Message Hari Babu 2013-06-25 06:28:55 Re: fixing pg_ctl with relative paths