<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Jon,<div class=""><br class=""></div><div class="">I’m not sure what would get my branch accepted. Henning mentioned on 9/16/2020 that the .sql files are generated from XML/XLST scripts, I have found: <a href="https://github.com/kamailio/kamailio/tree/5.4/doc/stylesheets/dbschema" class="">https://github.com/kamailio/kamailio/tree/5.4/doc/stylesheets/dbschema</a> which was updated just 3 days ago. However, I don’t understand how this is used to generate the .sql files for Postgres. I’m also confused as to why the .sql files are checked into the repository if they’re generated? Henning, can you point me in the right direction?</div><div class=""><br class=""></div><div class="">That being said, this is what’s <a href="https://github.com/kamailio/kamailio/compare/5.4...reperio:cockroachdb-compat?expand=1" class="">changed in the branch</a>:</div><div class=""><br class=""></div><div class="">kamdbctl.pgsql</div><div class=""><br class=""></div><div class="">- I’ve updated the psql command for my preferences regarding output</div><div class="">- I’ve made the function checking more verbose</div><div class="">- I’ve added the gen_random_uuid() function (by adding pgcrypto to Postgres, it’s native in CockroachDB), this isn’t required, but we are using UUID for usrloc in production</div><div class="">- I’ve updated the GRANT commands so they’re compatible with both Postgres and CockroachDB</div><div class=""><br class=""></div><div class="">Some things to note:</div><div class=""><br class=""></div><div class="">- concat() is native to CockroachDB, so the CREATE FUNCTION is only necessary for Postgres</div><div class="">- rand() is the native function name in MySQL, but random() is the function name in Postgres and CockroachDB. This is where I’m most concerned because the file says it’s used in the lcr module, but I cannot find where it is used. Does anyone know how to ascertain this? Anyways, they’re the same function, so it’s a little silly to require a CREATE FUNCTION duplicating the exact functionality of an existing native function.</div><div class=""><br class=""></div><div class="">The rest of the changes have to do with modifying the create statements to not use SERIAL, but use the more verbose SEQUENCE + nextval(). It’s identical in practice, so there’s 0 risk there.</div><div class=""><br class=""></div><div class="">I think overall risk is low for the branch, as the branch only changes the utility that creates the DBs. As for production use, it’s worked great for us, there have been no issues.</div><div class=""><br class=""></div><div class="">~Noah</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 18, 2021, at 2:45 PM, Jonathan Hunter <<a href="mailto:hunterj91@hotmail.com" class="">hunterj91@hotmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Hi Noah,</div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Hope you are well?</div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">I work as a consultant for a company in the UK, and I am building a new hosted telephony platform for them in docker initially, and as we are deploying across multiple servers they want to use cockroachdb to allow easy management of a cluster environment.</div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">I could see from your posts you got it working using your own branch, and I wondered what changes you made to make things work correctly and what would be needed to get the kamailio dev’s to accept it into the main stream of code? (Happy to help here where I can).</div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Unless you will maintain your branch forever<span class="Apple-converted-space"> </span><span style="font-family: "Segoe UI Emoji", sans-serif;" class="">😊</span><span class="Apple-converted-space"> </span>Or are the changes small so its not too much of a concern? I just want to assess the risk really, and like you I think mainly we will just be using userloc and dispatcher for DB interaction so its positive to hear they work fine. We would also be using rtpengine, routing data will be done via API so that should be fine. FYI Id like to run kamailio 5.4 initially.</div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">I see your comments about table creation (in previous posts), that is the initial problem I am seeing when trying to use postgres based commands direct from a pgdump to create the kamailio database structure, does your branch contain all the creation scripts for the db/tables that I can use for testing?</div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Thanks again in advance for the response!</div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Jon</div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Sent from<span class="Apple-converted-space"> </span><a href="https://go.microsoft.com/fwlink/?LinkId=550986" style="color: blue; text-decoration: underline;" class="">Mail</a><span class="Apple-converted-space"> </span>for Windows 10</div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(225, 225, 225); padding: 3pt 0cm 0cm;" class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; border: none; padding: 0cm;" class=""><b class="">From:<span class="Apple-converted-space"> </span></b><a href="mailto:hw@skalatan.de" style="color: blue; text-decoration: underline;" class="">Henning Westerholt</a><br class=""><b class="">Sent:<span class="Apple-converted-space"> </span></b>17 February 2021 16:18<br class=""><b class="">To:<span class="Apple-converted-space"> </span></b><a href="mailto:sr-users@lists.kamailio.org" style="color: blue; text-decoration: underline;" class="">Kamailio (SER) - Users Mailing List</a><br class=""><b class="">Cc:<span class="Apple-converted-space"> </span></b><a href="mailto:hunterj91@hotmail.com" style="color: blue; text-decoration: underline;" class="">Jonathan Hunter</a>;<span class="Apple-converted-space"> </span><a href="mailto:noahmehl@gmail.com" style="color: blue; text-decoration: underline;" class="">Noah Mehl</a><br class=""><b class="">Subject:<span class="Apple-converted-space"> </span></b>RE: Cockroachdb and kamailio 5.4</div></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="DE" class="">Hi Jonathan,<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="DE" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">no – I do not think that there has been more work done so far, apart from the discussion that you referenced below.<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">If you are also interested in getting this forward, why not reaching out to the other guy starting this discussion earlier? Just to see if you can maybe join forces to get something of this work into a pull request for review and later a possible merge into our code base.<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">Cheers,<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">Henning<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">--<span class="Apple-converted-space"> </span><o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">Henning Westerholt –<span class="Apple-converted-space"> </span></span><span lang="DE" class=""><a href="https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fskalatan.de%2Fblog%2F&data=04%7C01%7C%7C548d23e7d9544667296a08d8d35fb5d3%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637491755307382972%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=WVL5vzihg1kUYxeDwnDwHPksVaf0EaM6ANXuBBBthZE%3D&reserved=0" style="color: blue; text-decoration: underline;" class=""><span lang="EN-GB" style="color: rgb(5, 99, 193);" class="">https://skalatan.de/blog/</span></a></span><span class=""><o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">Kamailio services –<span class="Apple-converted-space"> </span></span><span lang="DE" class=""><a href="https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgilawa.com%2F&data=04%7C01%7C%7C548d23e7d9544667296a08d8d35fb5d3%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637491755307392967%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Zkxs8506K%2FpvHX%2FPcHEj3fyYBei%2BnpuzPmpHdtkFfn4%3D&reserved=0" style="color: blue; text-decoration: underline;" class=""><span lang="EN-GB" style="color: rgb(5, 99, 193);" class="">https://gilawa.com</span></a></span><span class=""><o:p class=""></o:p></span></div></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div><div class=""><div style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(225, 225, 225); padding: 3pt 0cm 0cm;" class=""><div style="margin: 0cm 0cm 0cm 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span lang="DE" class="">From:</span></b><span lang="DE" class=""><span class="Apple-converted-space"> </span>sr-users <<a href="mailto:sr-users-bounces@lists.kamailio.org" class="">sr-users-bounces@lists.kamailio.org</a>><span class="Apple-converted-space"> </span><b class="">On Behalf Of<span class="Apple-converted-space"> </span></b>Jonathan Hunter<br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>Wednesday, February 17, 2021 1:59 PM<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span>Kamailio (SER) - Users Mailing List <<a href="mailto:sr-users@lists.kamailio.org" class="">sr-users@lists.kamailio.org</a>><br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>[SR-Users] Cockroachdb and kamailio 5.4<o:p class=""></o:p></span></div></div></div><div style="margin: 0cm 0cm 0cm 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="DE" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0cm 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Hi Guys,<o:p class=""></o:p></div><div style="margin: 0cm 0cm 0cm 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0cm 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Hope all are well?<o:p class=""></o:p></div><div style="margin: 0cm 0cm 0cm 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0cm 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">We are looking to implement kamailio with cockroachdb due to the advantages it gives us in terms of postgres management and clustering.<o:p class=""></o:p></div><div style="margin: 0cm 0cm 0cm 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0cm 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">I can see from a previous string<span class="Apple-converted-space"> </span><a href="https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fsip-router.1086192.n5.nabble.com%2FCockroachDB-and-Kamailio-td189233.html&data=04%7C01%7C%7C548d23e7d9544667296a08d8d35fb5d3%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637491755307392967%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8E15g5pgP%2BpY%2BgEz%2FtP%2BaLcv6r4s60hCwk5MV0yGn4I%3D&reserved=0" style="color: blue; text-decoration: underline;" class="">http://sip-router.1086192.n5.nabble.com/CockroachDB-and-Kamailio-td189233.html</a><span class="Apple-converted-space"> </span>that someone has attempted this and even created their own branch.<o:p class=""></o:p></div><div style="margin: 0cm 0cm 0cm 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0cm 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Has any further work been done on this, and if so has anyone got any advice/tips relating to it? As I am nervous about potentially using a branch and not a general release of kamailio moving forwards.<o:p class=""></o:p></div><div style="margin: 0cm 0cm 0cm 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0cm 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">I appreciate you cant support all database types but I would just be interested to hear people’s thoughts on the topic.<o:p class=""></o:p></div><div style="margin: 0cm 0cm 0cm 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0cm 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Many thanks!<o:p class=""></o:p></div><div style="margin: 0cm 0cm 0cm 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0cm 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Jon<o:p class=""></o:p></div><div style="margin: 0cm 0cm 0cm 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0cm 35.4pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Sent from<span class="Apple-converted-space"> </span><a href="https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgo.microsoft.com%2Ffwlink%2F%3FLinkId%3D550986&data=04%7C01%7C%7C548d23e7d9544667296a08d8d35fb5d3%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637491755307402965%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=tCO%2FU3IF9d01%2Fwc7APzZZvr2kcFiqIsZox3p%2BjwegyM%3D&reserved=0" style="color: blue; text-decoration: underline;" class="">Mail</a><span class="Apple-converted-space"> </span>for Windows 10</div></div></div></blockquote></div><br class=""></div></body></html>