Re: Multiple result sets

From: "Adam Rich" <adam(dot)r(at)sbcglobal(dot)net>
To: "'Clodoaldo'" <clodoaldo(dot)pinto(dot)neto(at)gmail(dot)com>, "'PostgreSQL - General ML'" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Multiple result sets
Date: 2008-06-01 18:51:41
Message-ID: 03bd01c8c418$87dc4c80$9794e580$@r@sbcglobal.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


> I need that 5 queries, fired from the same ajax request to a web
> python application, see the same database snapshot. The driver is
> psycopg2.
>
> Since postgresql 8.2 functions can't return multiple result sets what
> would be the best aproach?
>

You want to set your transaction isolation to "Serializable".
Then execute your 5 queries via the same connection, and the same
Transaction.

You can do that with this command:

BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Clodoaldo 2008-06-01 20:12:35 Re: Multiple result sets
Previous Message Tom Lane 2008-06-01 18:50:55 Re: Multiple result sets