On 12.04.2016 19:45, David G. Johnston
wrote:
I know that we can always write some wrappers etc, etc. This approach would failed if your do_some_date_based_stuff have no date args and contains calls say to now()(or other time function what possible can have fix value ) inside it. Also wrappers lead to multiple code base,yours client side code needs to know what function we should use - test or production. Also with your approach application server needs to know its working mode test / prod You always should keep in mind that your application may run in test mode (future/past time) and maintain this code. While with my proposal you can always use some time function(now or localtimestamp or whatever) which you can freeze at anytime on DB level, not operation system(using some 3rd libs) or application(using wrappers and other hacks). -- Alex Ignatov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company |