[GENERAL] Problem in "Set search path"

2013-03-21 Thread Kalai R
-- Forwarded message -- From: Kalai R Date: Fri, Mar 22, 2013 at 9:36 AM Subject: Re: [GENERAL] Problem in "Set search path" To: Alban Hertroys 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

Re: [GENERAL] streaming replication question

2013-03-21 Thread Roberto Scattini
On Thursday, March 21, 2013, wd wrote: > You can combine warm standby and streaming, we do this in our product database. > When the standby is to far from the master, the slave will try to use restore_command to restore the database(warm standby), when the standby catch up the master, the steaming

Re: [GENERAL] streaming replication question

2013-03-21 Thread wd
You can combine warm standby and streaming, we do this in our product database. When the standby is to far from the master, the slave will try to use restore_command to restore the database(warm standby), when the standby catch up the master, the steaming will working again. BTW: we use ominipitr.

Re: [GENERAL] regexp_replace failing on 9.0.4

2013-03-21 Thread Rob Sargent
On 03/21/2013 06:25 PM, Tom Lane wrote: Rob Sargent writes: For fun I decided to install 9.2 and thought I would try my luck there. Here's was I saw (apologies for the wide output). << simple update in place>> update cms.segment_data set text = regexp_replace(text,'(^.*)ns/acres/pathology

Re: [GENERAL] regexp_replace failing on 9.0.4

2013-03-21 Thread Tom Lane
Rob Sargent writes: > For fun I decided to install 9.2 and thought I would try my luck there. > Here's was I saw (apologies for the wide output). > << simple update in place>> > update cms.segment_data > set text = regexp_replace(text,'(^.*)ns/acres/pathology/dx/1.5(.*$)', > E'\\1ns/acres/pat

Re: [GENERAL] Bad plan on a huge table query

2013-03-21 Thread Jeff Janes
On Thu, Mar 21, 2013 at 12:30 PM, Daniel Cristian Cruz < danielcrist...@gmail.com> wrote: > > >> Are you using autovacuum? If so, you probably need to tune it more >> aggressively. For the short term, running an ANALYSE on those tables should >> at least get you more accurate query plans. >> > > I

Re: [GENERAL] regexp_replace failing on 9.0.4

2013-03-21 Thread Rob Sargent
On 03/18/2013 02:40 PM, Tom Lane wrote: Rob Sargent writes: On 03/18/2013 01:19 PM, Tom Lane wrote: Rob Sargent writes: On our 9.0.4[1] server my regexp_replace is a no-op, but on the 9.0.3[2] test machine and my 9.1.2[3] dev box all is fine AFAICS from the commit logs, there were no chan

Re: [GENERAL] Bad plan on a huge table query

2013-03-21 Thread Daniel Cristian Cruz
Ooops, no query... Now it goes (Jeff, types in each line): SELECT aluno_mensal.id_matricula, --integer aluno_mensal.id_turma, --integer aluno_mensal.turma, --text aluno_mensal.id_produto_educacao, --integer aluno_mensal.produto_educacao, --text aluno_mensal.unidade, --text aluno_mensal.unid

Re: [GENERAL] Bad plan on a huge table query

2013-03-21 Thread Daniel Cristian Cruz
2013/3/21 Alban Hertroys > On Mar 20, 2013, at 22:36, Daniel Cristian Cruz > wrote: > > Hi, > > I'm trying to figure out why does the planner found 1 row estimate using > nested loops over a big table. There is no return from it: > > http://explain.depesz.com/s/GRs > > > That plan contains no ac

Re: [GENERAL] Bad plan on a huge table query

2013-03-21 Thread Jeff Janes
On Thu, Mar 21, 2013 at 10:53 AM, Daniel Cristian Cruz < danielcrist...@gmail.com> wrote: > And now, it runs, at least: > > http://explain.depesz.com/s/GDJn > > No one could send a guess on it? > Without showing either the query, or the definition of the tables, you are not giving us much to go o

Re: [GENERAL] streaming replication question

2013-03-21 Thread Roberto Scattini
On Thu, Mar 21, 2013 at 3:45 PM, Roberto Scattini < roberto.scatt...@gmail.com> wrote: > > i mean, i can have both configurations enabled? >> >> > no, i think my setup, with this config, is just doing warm standby. but > the streaming replication was working before adding archive_command to > mast

Re: [GENERAL] Bad plan on a huge table query

2013-03-21 Thread Alban Hertroys
On Mar 20, 2013, at 22:36, Daniel Cristian Cruz wrote: > Hi, > > I'm trying to figure out why does the planner found 1 row estimate using > nested loops over a big table. There is no return from it: > > http://explain.depesz.com/s/GRs That plan contains no actual statistics, which makes it d

Re: [GENERAL] streaming replication question

2013-03-21 Thread Roberto Scattini
On Thu, Mar 21, 2013 at 3:32 PM, Roberto Scattini < roberto.scatt...@gmail.com> wrote: > hi list, > > i'm installing a streaming replication master-slave setup in ubuntu 12.04 > LTS, with postgresql 9.1 > > the tutorials and the documentation are a very good start point, but i > have one question

[GENERAL] streaming replication question

2013-03-21 Thread Roberto Scattini
hi list, i'm installing a streaming replication master-slave setup in ubuntu 12.04 LTS, with postgresql 9.1 the tutorials and the documentation are a very good start point, but i have one question related to some fine grained configurations. it is said that i should stop the master db in order t

Re: [GENERAL] Bad plan on a huge table query

2013-03-21 Thread Daniel Cristian Cruz
And now, it runs, at least: http://explain.depesz.com/s/GDJn No one could send a guess on it? 2013/3/21 Daniel Cristian Cruz > I've reduced default_statistics_target to 200, and saw less nested loops. > > I'm trying some changes to the query, but no better results. > > The table presenca has

Re: [GENERAL] Problem in "Set search path"

2013-03-21 Thread Alban Hertroys
On 21 March 2013 16:59, 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

Re: [GENERAL] Problem in "Set search path"

2013-03-21 Thread Adrian Klaver
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

Re: [GENERAL] Problem in "Set search path"

2013-03-21 Thread Kalai R
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.

Re: [GENERAL] State of the art re: group default privileges

2013-03-21 Thread Michael Orlitzky
On 03/21/2013 11:34 AM, Adrian Klaver wrote: > On 03/21/2013 07:52 AM, Michael Orlitzky wrote: >> On 03/21/2013 10:39 AM, Adrian Klaver wrote: This won't fly unfortunately. It's a shared host, and the "developers" are a mixed bag of our employees, consultants, and the customer's >>>

Re: [GENERAL] State of the art re: group default privileges

2013-03-21 Thread Adrian Klaver
On 03/21/2013 07:52 AM, Michael Orlitzky wrote: On 03/21/2013 10:39 AM, Adrian Klaver wrote: This won't fly unfortunately. It's a shared host, and the "developers" are a mixed bag of our employees, consultants, and the customer's employees. Do not follow. The set role= is put on a login role.

Re: [GENERAL] State of the art re: group default privileges

2013-03-21 Thread Michael Orlitzky
On 03/21/2013 10:39 AM, Adrian Klaver wrote: >> >> This won't fly unfortunately. It's a shared host, and the "developers" >> are a mixed bag of our employees, consultants, and the customer's employees. > > Do not follow. The set role= is put on a login role. It will only work > on those databases

[GENERAL] Bad plan on a huge table query

2013-03-21 Thread Daniel Cristian Cruz
Hi, I'm trying to figure out why does the planner found 1 row estimate using nested loops over a big table. There is no return from it: http://explain.depesz.com/s/GRs It returns if disable nested loops, but the plan still poor: http://explain.depesz.com/s/fMY I'm using PostgreSQL 9.2.3, defau

Re: [GENERAL] How to join table to itself N times?

2013-03-21 Thread David Johnston
Matt Wilson wrote > I got this table right now: > > select * from market_segment_dimension_values ; > +--+---+ > | market_segment_dimension | value | > +--+---+ > | geography| north | > | geogra

Re: [GENERAL] State of the art re: group default privileges

2013-03-21 Thread Adrian Klaver
On 03/20/2013 08:57 PM, Michael Orlitzky wrote: On 03/20/2013 08:05 PM, Adrian Klaver wrote: Not sure why everything being owned by dev_user is a problem, you said the developers don't care about permissions or want to deal with them so why does it matter what role their objects get created as?

Re: [GENERAL] Bad plan on a huge table query

2013-03-21 Thread Daniel Cristian Cruz
I've reduced default_statistics_target to 200, and saw less nested loops. I'm trying some changes to the query, but no better results. The table presenca has 26 million rows. The table aula_confirmacao has 840 thousand rows. 2013/3/21 Daniel Cristian Cruz > Hi, > > I'm trying to figure out wh

Re: [GENERAL] Problem in "Set search path"

2013-03-21 Thread Pavel Stehule
Hello 2013/3/21 Kalai R : > 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 li

Re: [GENERAL] Problem in "Set search path"

2013-03-21 Thread Chris Angelico
On Thu, Mar 21, 2013 at 11:33 PM, Kalai R 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 pos

[GENERAL] Problem in "Set search path"

2013-03-21 Thread Kalai R
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.

Re: [GENERAL] Bad plan on a huge table query

2013-03-21 Thread Daniel Cristian Cruz
Hi, I'm trying to figure out why does the planner found 1 row estimate using nested loops over a big table. There is no return from it: http://explain.depesz.com/s/GRs It returns if disable nested loops, but the plan still poor: http://explain.depesz.com/s/fMY I'm using PostgreSQL 9.2.3, defau