Skip to content

[Enhancement]: counter_agg() support for 64bit numeric typesย #893

@Xeitor

Description

@Xeitor

I was looking into counter_agg() function to work with some 64bit SNMP counters.

the current function the signature is:
counter_agg(ts TIMESTAMPTZ,value DOUBLE PRECISION[, bounds TSTZRANGE]) RETURNS CounterSummary

since the counter are unsigned 64bit integers I wanted to use Postgres's Arbitrary Precision Numbers: NUMERIC(precision, scale) with precision: 20 and scale: 0.

would it be possible to add support for this numeric type in counter_agg()?

from the docs:

##### ยน Note that the `value` is currently only accepted as a `DOUBLE PRECISION` number as most people use that for counters, even though other numeric types (ie `BIGINT`) might sometimes be more intuitive. If you store a value as a different numeric type you can cast to `DOUBLE PRECISION` on input to the function.

docs say that I can cast to double precision upon function input, what will happen with very large numbers?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions