Thread: testing PL/pgsql functions

testing PL/pgsql functions

From
Richard Emberson
Date:
I am in the process of designing a bunch of tables and PL/pgsql
functions. What I would
like is to write some 'unit' level tests with some postgresql friendly
test harness.

For example, I might use the tcl procedural language and tcl's expect
test extension
to write expect scripts that call my pgsql functions. Or I might use the
Java JUnit
test harness and JDBC to write tests that call my functions.

Any advice?
Anyone done this already and have some 'lessons learned'?
Is there a built in test harness for pgsql functions?

Richard


Re: testing PL/pgsql functions

From
Doug McNaught
Date:
Richard Emberson <emberson@phc.net> writes:

> Anyone done this already and have some 'lessons learned'?
> Is there a built in test harness for pgsql functions?

Take a look at the extensive regression test harness that comes with
the PG source.  You should be able to extend it for your tests.

-Doug
--
Let us cross over the river, and rest under the shade of the trees.
   --T. J. Jackson, 1863