<div dir="ltr">Hi Liviu,<div><br></div><div>I have had the same issue for a long time. I opened a github issue/request for this [1].</div><div>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.</div><div><br></div><div>Also, I use other datatypes in postgres like inet for source / dest ip and empty strings are invalid for those datatypes.</div><div><br></div><div><br></div><div>[1] <a href="https://github.com/OpenSIPS/opensips/issues/2205">https://github.com/OpenSIPS/opensips/issues/2205</a><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, May 10, 2021 at 11:25 AM Liviu Chircu <<a href="mailto:liviu@opensips.org">liviu@opensips.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 10.05.2021 19:19, Kingsley Tart wrote:<br>
> I could do, but I was hoping to avoid that as it feels like bad<br>
> practice and it's inefficient - more of a workaround than a proper fix.<br>
<br>
Speaking for myself, I don't think I've ever seen a non-VARCHAR custom <br>
accounting column with the "acc" module. Also, if you think about it, <br>
writing the 1 integer value requires only 25% of the space if you're <br>
writing "1" instead of 1. So, YMMV with regards to efficiency, we're <br>
talking bits and pieces of data here, as the fields themselves are not <br>
that large, it's their sheer number required in the CDRs that's often <br>
problematic.<br>
<br>
-- <br>
Liviu Chircu<br>
<a href="http://www.twitter.com/liviuchircu" rel="noreferrer" target="_blank">www.twitter.com/liviuchircu</a> | <a href="http://www.opensips-solutions.com" rel="noreferrer" target="_blank">www.opensips-solutions.com</a><br>
OpenSIPS eBootcamp 2021 | <a href="http://www.opensips.org/training" rel="noreferrer" target="_blank">www.opensips.org/training</a><br>
<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><br><div>-</div><div><span style="font-size:12.8px">Aron Podrigal</span><br></div><div><span style="font-size:12.8px"><br></span></div></div></div></div></div></div>