<p>I want to automate tests on my web application, and it uses postgresql. Does anyone know how define a restore point on a postgresql database and restore to an earlier state?
I heard something about point in time recovery, but i dont if this is what i need.</p>

<p>Thanks in advance</p>

I use
SQL Alchemy
with cPython (I don't know if it'll work with IronPython though).  It'll be pretty familiar to you if you've used Hibernate/nHibernate.  If that's a bit too verbose for you, you can use
Elixir
, which is a thin layer on top of SQL Alchemy.  To use either one of those, you'll need
pyodbc
, but that's a pretty simple install.
Of course, if you want to write straight SQL and not use an ORM, you just need pyodbc.