[OpenSIPS-Users] is this a bug? acc module setting empty string for unset fields
Podrigal, Aron
aronp at guaranteedplus.com
Mon May 10 20:26:31 EST 2021
Hi Liviu,
I have had the same issue for a long time. I opened a github issue/request
for this [1].
Using integer columns has benefit for me since I am using extra fields for
stats and I am doing arithmetic on them. Casting those text columns to
integers is not efficient. With the empty strings it creates even a bigger
issue, that I cannot cast them at all and end up with inefficient CASE
WHEN field = '' THEN NULL ELSE field::int END.
Also, I use other datatypes in postgres like inet for source / dest ip
and empty strings are invalid for those datatypes.
[1] https://github.com/OpenSIPS/opensips/issues/2205
On Mon, May 10, 2021 at 11:25 AM Liviu Chircu <liviu at opensips.org> wrote:
> On 10.05.2021 19:19, Kingsley Tart wrote:
> > I could do, but I was hoping to avoid that as it feels like bad
> > practice and it's inefficient - more of a workaround than a proper fix.
>
> Speaking for myself, I don't think I've ever seen a non-VARCHAR custom
> accounting column with the "acc" module. Also, if you think about it,
> writing the 1 integer value requires only 25% of the space if you're
> writing "1" instead of 1. So, YMMV with regards to efficiency, we're
> talking bits and pieces of data here, as the fields themselves are not
> that large, it's their sheer number required in the CDRs that's often
> problematic.
>
> --
> Liviu Chircu
> www.twitter.com/liviuchircu | www.opensips-solutions.com
> OpenSIPS eBootcamp 2021 | www.opensips.org/training
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
--
-
Aron Podrigal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20210510/e686c396/attachment.html>
More information about the Users
mailing list