In Microsoft SQL Server, to test something like this in the query window:
select * from Users where LastName = @lastname
I can add this bef
I config postgres to log all the commands, and copy the command from the log file, so all the parameters are already replaced with the value, and test the command in the query window.
May not be the best approach, but it is easy and works for me