Search Postgresql Archives

Re: Re : Re : Re : Re : Select in temporary table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1 Apr 2010, at 10:47, Sylvain Lara wrote:
> De : jose javier parra sanchez <jojapasa@xxxxxxxxx>
> Cc : pgsql-general@xxxxxxxxxxxxxx
> Envoyé le : Jeu 1 avril 2010, 9 h 26 min 27 s
> Objet : Re: Re : Re : Re :  Select in temporary table
> 
> Not sure about how de C# driver you use to connect, but if you have
> multiple connections, then you have multiple sessions.
> 
> -----------------------------------------------
> 
> I've got multiple connections, but when selecting data in my temp table (when it works, once, twice, three times and more before the error), I've got my data when selecting into the temp table.
> 
> Whereas if I connect the same base, at the same time, from another client, it doesn't display the same data, which is correct for me.
> 
> Each client has it's own temporary table data.
> 
> But my problem is that this temporary table is randomly accessible by the same client.
> And it's seems that if I wait a moment between two executions (I put a breakpoint and browse my NpgSQLConnection object), I can access my temp table without any problem...


Sounds like there's a connection pooler in there somewhere and you sometimes get a different connection than the one your temp table lives in. Only the connection that created the temp table will be able to see it.

Other possibilities I can think of:

Are you rolling back the transaction with which you created the temp table? In that case the temp table is gone after you rolled back, so if later code is trying to access it it won't find it.

Is your client multi-threaded? Is it possible that you're trying to access the temp table from another thread before it finished creating?
That's probably not the case, or you'd either need to serialize your database access to be able to use the same connection - in which case this situation can't occur - or you're using multiple parallel connections from the same client and we're back at the multiple-connection answer. If you'd be using one connection in parallel threads without serializing them then you're having more serious issues to deal with...

It's most probably a problem in your client or your connection library, other people are using temp tables without a problem. Temp tables are not exactly a new feature either.

Alban Hertroys

PS. Considering the way you quote your mails you seem to have an absolutely terrible mail client. If you have a choice, consider getting something decent.

--
Screwing up is an excellent way to attach something to the ceiling.


!DSPAM:737,4bb46f1610411569890503!



-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux