giri
giri

Reputation: 31

Testing stored procedures

How to test procedures with record type parameters.I have a procedure which takes test_ap ,basic and user_name as inputs.where test_ap is of record/row type,basic record array type and user_name charater varying.

I need to test the procedure in pgadmin.

test_client(test_ap test_base, basic test_base_detail[], user_name character varying)

Any suggestions plz.

Upvotes: 3

Views: 4065

Answers (2)

Kent Fredric
Kent Fredric

Reputation: 57354

If you want to do full comprehensive testing of your stored procedures etc, pgTAP comes highly recommended.

Otherwise, for a homebrew result, you might want to create a schema full of test data and expected output, and then run a select query on the test data and compare the output ( using SQL of course ) to the expected output.

But really, if you're wanting more than just a one-off "ok, it works" test, you probably should go with the pgTAP solution. Fully fledged database consistency checks ==> win.

Upvotes: 2

Kuberchaun
Kuberchaun

Reputation: 30324

Not sure why you have to test it from pgadmin. Doesn't let you scale out to automated testing. Can you use psql or pick your language tool(Java, Ruby, Perl, Python..) to create a test bed that would allow you to do this testing?

Upvotes: 1

Related Questions