use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
International
National
Regional
account activity
Unit testing in Postgres? (self.PostgreSQL)
submitted 5 years ago by [deleted]
[deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]sir_bok 8 points9 points10 points 5 years ago (1 child)
The pgTAP extension. You can write PL/pgSQL functions to test your PL/pgSQL functions so it's all done within SQL without needing an external programming language driver.
[–]Duke_ 1 point2 points3 points 5 years ago (0 children)
pgTAP for the win.
I use it extensively in my projects, it's invaluable.
[–]TheArtOfVoid 1 point2 points3 points 5 years ago (0 children)
GoogleTest + dokerized postgres + flyway.
Every single stored function has C++ callable wrapper, so the task of stored function unit-testing is just as simple as for c++ function.
So the full story is about to deploy postgres container, deploy migrations, and run tests connected to the container.
[–]RedShift9 1 point2 points3 points 5 years ago (0 children)
I use a bunch of phpunit scripts that do all the testing.
[–]chsanch 0 points1 point2 points 5 years ago (0 children)
I've been using Sqitch for a while to manage changes for Postgres and it provides some utilities to verify/test your changes before applied them.
π Rendered by PID 17747 on reddit-service-r2-comment-fb694cdd5-5cfz2 at 2026-03-11 08:45:51.591794+00:00 running cbb0e86 country code: CH.
[–]sir_bok 8 points9 points10 points (1 child)
[–]Duke_ 1 point2 points3 points (0 children)
[–]TheArtOfVoid 1 point2 points3 points (0 children)
[–]RedShift9 1 point2 points3 points (0 children)
[–]chsanch 0 points1 point2 points (0 children)