Re: Abbreviated keys for Numeric

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Abbreviated keys for Numeric
Дата
Msg-id 5410.1428088014@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Abbreviated keys for Numeric  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Abbreviated keys for Numeric  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Fri, Apr 3, 2015 at 1:39 PM, Andrew Gierth
> <andrew@tao11.riddles.org.uk> wrote:
>> If you're determined to go this route - over my protest - then you need
>> to do something like define a NumericAbbrevGetDatum(x) macro and use it
>> in place of the Int64GetDatum / Int32GetDatum ones for both NAN and the
>> return from numeric_abbrev_convert_var.

> Patch for that attached.

FWIW, I think it's sensible to define NumericAbbrevGetDatum and the
converse, but I'd suggest you just do it like

#define NumericAbbrevGetDatum(X) Int64GetDatum(X)
or
#define NumericAbbrevGetDatum(X) Int32GetDatum(X)

I'm not especially a fan of reaching inside the GetDatum macros when
you don't have to.  And the code that's calling these certainly knows
that it's supplying an int64 or int32 respectively.
        regards, tom lane



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Abbreviated keys for Numeric
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Abbreviated keys for Numeric