Sorry, in oversimplifying for clarity I was making it more unclear!

Whenever I write a function, I like to write a quick ad hoc test to go with it in the comments. It means I can also test combinations of functions together quickly, without having to build other functions first, and gives anyone reading the function a quick idea of the type of inputs/outputs they might see. I've mostly worked with SQL Server, and with that I can write statements that might need to be within a function in ad hoc fashion.

A common example is when I write an insert statement that returns the primary key of the inserted row. I'd like to capture that in a variable and run it through other functions. To be able to declare variables outside a function would be helpful in this respect.

It's just a quick way to an easy test, in my view, but if it's not possible then that's ok, I'll just write full blown test functions from the start.


Regards,
Iain

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to