如何在 PostgreSQL 事务中获得实时? [英] How to get a real time within PostgreSQL transaction?

查看:34
本文介绍了如何在 PostgreSQL 事务中获得实时?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我所知 now() 在整个 PostgreSQL 事务期间返回相同的时间?但是如何获得真实时间?

As far as I understand now() returns the same time during the whole PostgreSQL transaction? But how to get real time?

另外,我有兴趣是否有任何配置参数来限制事务的持续时间,以便在此期间到期后事务将立即失败或以其他方式禁止以下查询?

Also, I am interested if there any configuration parameter to limit duration of transaction, so that after this period expiration transaction would immediately fail or somehow else prohibit following queries?

推荐答案

Timeofday()

可能对你有用.

这篇关于如何在 PostgreSQL 事务中获得实时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆