Thread: Problem in "Set search path"
Hi,
I am using postgresql 9.0.3. In my application I change often schema name using set search path. Some times schema name set correctly. But some time it does not set correctly and it takes the schema previously I set. Is any possibilities to happen like this?
Thank You.
On Thu, Mar 21, 2013 at 11:33 PM, Kalai R <softlinne.kv@gmail.com> wrote: > Hi, > > I am using postgresql 9.0.3. In my application I change often schema > name using set search path. Some times schema name set correctly. But some > time it does not set correctly and it takes the schema previously I set. Is > any possibilities to happen like this? If you roll back the transaction in which you set it, it isn't set, but if you commit that transaction, it'll stay set for future transactions. At least, that's been my experience. ChrisA
Hello 2013/3/21 Kalai R <softlinne.kv@gmail.com>: > Hi, > > I am using postgresql 9.0.3. In my application I change often schema > name using set search path. Some times schema name set correctly. But some > time it does not set correctly and it takes the schema previously I set. Is > any possibilities to happen like this? yes, it is possible - if you use prepared statement. Regards Pavel Stehule > Thank You. >
Hi,
Thanks for ur suggestions. I create connection from my .net application and set search path by single query. After set search path I call psql function from my .net application using the same connection. In this case some time search path set but some times not. I didn't use prepare statement.
Regards
kalai
On Thu, Mar 21, 2013 at 6:09 PM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
Hello
2013/3/21 Kalai R <softlinne.kv@gmail.com>:yes, it is possible - if you use prepared statement.> Hi,
>
> I am using postgresql 9.0.3. In my application I change often schema
> name using set search path. Some times schema name set correctly. But some
> time it does not set correctly and it takes the schema previously I set. Is
> any possibilities to happen like this?
Regards
Pavel Stehule
> Thank You.
>
On 03/21/2013 08:59 AM, Kalai R wrote: > Hi, > Thanks for ur suggestions. I create connection from my .net > application and set search path by single query. After set search path I > call psql function from my .net application using the same connection. > In this case some time search path set but some times not. I didn't use > prepare statement. Might try temporarily turning up the logging in postgresql.conf to 'all' and see what is actually being done on the server. > Regards > kalai -- Adrian Klaver adrian.klaver@gmail.com
On 21 March 2013 16:59, Kalai R <softlinne.kv@gmail.com> wrote:
Is that the same connection object in ,NET or the same connection to a connection pool or the same database connection? That's not necessarily the same.
If you can't see the forest for the trees,
Cut the trees and you'll see there is no forest.
Hi,Thanks for ur suggestions. I create connection from my .net application and set search path by single query. After set search path I call psql function from my .net application using the same connection. In this case some time search path set but some times not. I didn't use prepare statement.
Do you still have this problem if you set the search_path at the start of your transaction?
Did you know you can set a search_path on user (role) objects and on database objects in the database? That might just take out your need to specify it in your ,NET application.
-- If you can't see the forest for the trees,
Cut the trees and you'll see there is no forest.
---------- Forwarded message ----------
From: Kalai R <softlinne.kv@gmail.com>
Date: Fri, Mar 22, 2013 at 9:36 AM
Subject: Re: [GENERAL] Problem in "Set search path"
To: Alban Hertroys <haramrae@gmail.com>
From: Kalai R <softlinne.kv@gmail.com>
Date: Fri, Mar 22, 2013 at 9:36 AM
Subject: Re: [GENERAL] Problem in "Set search path"
To: Alban Hertroys <haramrae@gmail.com>
Hi,
Is that the same connection object in ,NET or the same connection to a connection pool or the same database connection? That's not necessarily the same.
I use the same npgsql connection object in .net
Might try temporarily turning up the logging in postgresql.conf to 'all' and see what is actually being done on the server.
Did you know you can set a search_path on user (role) objects and on database objects in the database? That might just take out your need to specify it in your ,NET application.
I try to find out my problem by your ideas. Thanks guys.Regards
Kalai
Did you try to set the search_path in the connection string? This way you won't need to set the search_path manually. Npgsql will take care of it to you.
I hope it helps.
On Fri, Mar 22, 2013 at 1:07 AM, Kalai R <softlinne.kv@gmail.com> wrote:
---------- Forwarded message ----------
From: Kalai R <softlinne.kv@gmail.com>
Date: Fri, Mar 22, 2013 at 9:36 AM
Subject: Re: [GENERAL] Problem in "Set search path"
To: Alban Hertroys <haramrae@gmail.com>Hi,Is that the same connection object in ,NET or the same connection to a connection pool or the same database connection? That's not necessarily the same.I use the same npgsql connection object in .netMight try temporarily turning up the logging in postgresql.conf to 'all' and see what is actually being done on the server.I try to find out my problem by your ideas. Thanks guys.Did you know you can set a search_path on user (role) objects and on database objects in the database? That might just take out your need to specify it in your ,NET application.RegardsKalai
Regards,
Francisco Figueiredo Jr.
Npgsql Lead Developer
http://www.npgsql.org
http://gplus.to/franciscojunior
http://fxjr.blogspot.com
http://twitter.com/franciscojunior