Re: Getting a primitive numeric value from "DatumGetNumeric"?

Поиск
Список
Период
Сортировка
От Demitri Muna
Тема Re: Getting a primitive numeric value from "DatumGetNumeric"?
Дата
Msg-id 19E43B98-06A3-4D78-9F86-B69D12D4BAFD@demitri.com
обсуждение исходный текст
Ответ на Re: Getting a primitive numeric value from "DatumGetNumeric"?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Getting a primitive numeric value from "DatumGetNumeric"?
Список pgsql-general
Hi Tom,

On Feb 20, 2018, at 10:54 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Well, the implicit coercions work in your favor in this particular case.

Ah, I wasn’t aware of implicit coercion. Yes, that solves the problem perfectly, thanks.

Out of curiosity, how does one read a numeric type from within a C extension (i.e. get a number value out of the Datum
type)?I ask as I was unable to find an example and there are a few open questions on Stack Overflow (e.g.
https://stackoverflow.com/questions/12588554/postgres-c-function-passing-returning-numerics).

Thanks,
Demitri



В списке pgsql-general по дате отправления:

Предыдущее
От: Ken Tanzer
Дата:
Сообщение: Re: Given a set of daterange, finding the continuous range thatincludes a particular date
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Given a set of daterange, finding the continuous range thatincludes a particular date