In T-SQL, one can use the following statement to debug a script -- Print 'variable1 = ' + cast(getdate() as varchar).

How to do the same thing in a plpgSQL in a redshift environment? I am using DBeaver as my sql IDE. I tried the following -- raise info 'variable1 = %', getdate() and it did not work. Any ideas, please?

raise info 'time now is %', getdate();

raise info 'time now is %', timestamp;

1

There are 1 best solutions below

1
Simon Gu On
t :=current_timestamp;
raise info 'time now is %', t ;

The above code works; but I am wondering how to print a timestamp without using a variable in the "raise info" line