如何使用“raise info”函数在 plpgSQL 中打印日期时间戳信息,以便在 Redshift 环境中进行调试

问题描述 投票:0回答:1

在T-SQL中,可以使用以下语句来调试脚本—— 打印 'variable1 = ' + cast(getdate() as varchar)。

如何在 Redshift 环境中的 plpgSQL 中执行相同的操作?我使用 DBeaver 作为我的 sql IDE。我尝试了以下方法—— 引发信息 'variable1 = %', getdate() 但它不起作用。请问有什么想法吗?

引发信息“现在时间是%”,getdate();

引发信息“现在时间是%”,时间戳;

timestamp amazon-redshift plpgsql dbeaver
1个回答
0
投票
t :=current_timestamp;
raise info 'time now is %', t ;

上面的代码有效;但我想知道如何在“raise info”行中不使用变量的情况下打印时间戳

© www.soinside.com 2019 - 2024. All rights reserved.