Re: Visibility of temporary database objects

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: Allan Kamau <kamauallan(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Visibility of temporary database objects
Date: 2009-12-14 13:05:16
Message-ID: 4B26380C.2010002@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 14/12/2009 4:35 PM, Allan Kamau wrote:

> and I am calling this function in
> from a threaded application which could use the same connection in
> more than one thread(is this possible/or even safe).

No!

Admittedly it depends on the client interface/driver, but at least for
direct psql, PgODBC and PgJDBC it is _not_ safe to use a single
PostgreSQL connection from more than one thread. Use multiple
connections, or properly control access to the connection so that only
one thread will be doing work on it at a time. Even then, you can't have
multiple queries in flight on a single connection.

--
Craig Ringer

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Fred Janon 2009-12-14 13:50:26 pgAdmin III: timestamp displayed in what time zone?
Previous Message Phoenix Kiula 2009-12-14 12:21:08 Re: How to remove non-UTF values from a table?