I'm using pgAdmin III 1.8.4 and finding it a harsh mistress.
When writing stored procedures (functions), there's no query compilation. So I have no idea if my function will work until I call it.
How do other people work around this deficiency? (Other than getting it right first time :p)
To start the function editor, navigate to the desired function in the schema browser, select the 'Source Code' tab and click on the 'Edit In Function Editor' button. Alternatively, you can right-click on the function in the schema browser and select 'Edit In Function Editor'.
PostgreSQL does not support true stored procedures (multiple result sets, autonomous transactions, and all that) though, only sql-callable user-defined functions.
A dollar sign ($) followed by digits is used to represent a positional parameter in the body of a function definition or a prepared statement. In other contexts the dollar sign may be part of an identifier or a dollar-quoted string constant.
EnterpriceDB
includes PL/PGSQL Debugger which you can use to step through the code.
Write a unit test for it. Granted this won't give you debugging capability, but you should ideally have a unit test suite (and an integration test suite) that you run against your code that proves that it works... and that lets you know when something breaks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With