I am making a change on New Relic side. You can't do what you are doing as that then will cause wrong thing to happen for when New Relic not used.
So am changing things to accommodate for what psycopg2 interprets as default argument. The issue hasn't come up before because Web2Py is the only framework so far that doesn't actually use parameter substitution all the time. That Web2Py creates expanded SQL could actually be a problem because it will completely defeat a cache we use to avoid having to parse operation/table information out of queries all the time. It relies on parameterised SQL being the norm to gain efficiencies. For Web2Py the parse has to be done on pretty well every SQL as all will be unique and the overhead is not insignificant. So, performance may be impacted and memory overhead may also be a lot larger than other frameworks. We may have to completely disable the cache if know Web2Py is used to avoid memory overhead issues, We will not be able to solve the performance overhead issue because of how Web2Py doesn't use parameterised SQL however. Worst case the agent simply may not be able to be used with Web2Py because of this for certain types of database usage. Graham