views:

39

answers:

2

Hi ,

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.

A: 

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?

StarShip3000
A: 

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

http://pgtap.projects.postgresql.org/

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.

Kent Fredric