#!/usr/bin/python

import time
import psycopg2

x = psycopg2.connect("port=5433 host=/tmp dbname=postgres")
c = x.cursor()

c.execute("SELECT pg_backend_pid();")
print "started as pid: %i" % c.fetchall()[0][0]

print "waiting 5s to start"
time.sleep(5)

for i in xrange(50000):
    c.execute("SAVEPOINT f_%i;" % i);

#Acquire a transaction id
c.execute("INSERT INTO tstack VALUES(1)");

