Re: [GENERAL] [PERFORM] Very slow inner join query Unacceptable latency.

2013-05-23 Thread Scott Marlowe
Looking at the execution plan makes me wonder what your work_mem is set to. Try cranking it up to test and lowering random_page_cost: set work_mem='500MB'; set random_page_cost=1.2; explain analyze select ... and see what you get. -- Sent via pgsql-general mailing list (pgsql-general@postgres

Re: [GENERAL] There are many processes created and died frequently during PostgreSQl idle

2013-05-23 Thread Jov
the process you see may be autovacuum worker process,you can tune the log_autovacuum_min_duration to log the autovacuum activities and check if the pids match http://www.postgresql.org/docs/9.2/static/runtime-config-autovacuum.html 2013/5/24 高健 > Hello all: > > I found that during postgresql

Re: [GENERAL] [PERFORM] Very slow inner join query Unacceptable latency.

2013-05-23 Thread Amit Kapila
On Thursday, May 23, 2013 10:51 PM fburgess wrote: > serverdb=# set enable_hashjoin=off; > SET > serverdb=# explain select count(*) as y0_ from SARS_ACTS this_ inner join > SARS_ACTS_RUN tr1_ on this_.SARS_RUN_ID=tr1_.ID where tr1.ALGORITHM='SMAT'; >

Re: [GENERAL] Success stories of PostgreSQL implementations in different companies

2013-05-23 Thread Nathan Clayton
On Thu, May 23, 2013 at 2:51 PM, Steve Crawford < scrawf...@pinpointresearch.com> wrote: > On 05/23/2013 02:36 PM, Oscar Calderon wrote: > >> Hi, this question isn't technical, but is very important for me to know. >> Currently, here in El Salvador our company brings PostgreSQL support, but >> Ora

Re: [GENERAL] Success stories of PostgreSQL implementations in different companies

2013-05-23 Thread Mike Christensen
On Thu, May 23, 2013 at 2:51 PM, Steve Crawford < scrawf...@pinpointresearch.com> wrote: > On 05/23/2013 02:36 PM, Oscar Calderon wrote: > >> Hi, this question isn't technical, but is very important for me to know. >> Currently, here in El Salvador our company brings PostgreSQL support, but >> Ora

[GENERAL] There are many processes created and died frequently during PostgreSQl idle

2013-05-23 Thread 高健
Hello all: I found that during postgresql running, there are so many processes being created and then died. I am interested in the reason. Here is the detail: I installed from postgresql-9.2.1.tar.bz2. I put some debug code in fd.c 's PathNameOpenFile function: fprintf(stderr,"+++While Calling

Re: [GENERAL] New role, no database

2013-05-23 Thread Scott Marlowe
On Thu, May 23, 2013 at 3:38 PM, Melvin Call wrote: > On 5/23/13, Scott Marlowe wrote: >> On Thu, May 23, 2013 at 3:01 PM, Melvin Call >> wrote: >>> Hello, >>> >>> I have a question for which I am unable to find an answer in the >>> documentation, if y'all don't mind, I will ask here and hope fo

Re: [GENERAL] Find all the the SELECT statements that occured

2013-05-23 Thread Sergey Konoplev
On Thu, May 23, 2013 at 2:37 PM, Nik Tek wrote: > I have a question on how to find all the SELECT statements that have > occurred in the database. I don't want any DML(Insert/Update/Delete) > statements to be captured. This is for knowing how many selects statements > occur within the database in

Re: [GENERAL] [PERFORM] Very slow inner join query Unacceptable latency.

2013-05-23 Thread Jaime Casanova
On Thu, May 23, 2013 at 12:21 PM, wrote: > > But what negative impact is disabling hash joins? > doing it just for a single query, could be a tool for solving particular problems. setting it in postgresql.conf, therefore affecting all queries, is like using a hammer to change tv channel... it wi

Re: [GENERAL] Success stories of PostgreSQL implementations in different companies

2013-05-23 Thread Steve Crawford
On 05/23/2013 02:36 PM, Oscar Calderon wrote: Hi, this question isn't technical, but is very important for me to know. Currently, here in El Salvador our company brings PostgreSQL support, but Oracle and SQL Server are more popular here. Even with that, some clients are being encouraged to cha

Re: [GENERAL] Find all the the SELECT statements that occured

2013-05-23 Thread Steve Crawford
On 05/23/2013 02:37 PM, Nik Tek wrote: Hi, I have a question on how to find all the SELECT statements that have occurred in the database. I don't want any DML(Insert/Update/Delete) statements to be captured. This is for knowing how many selects statements occur within the database in an 1 hou

Re: [GENERAL] New role, no database

2013-05-23 Thread Melvin Call
On 5/23/13, Scott Marlowe wrote: > On Thu, May 23, 2013 at 3:01 PM, Melvin Call > wrote: >> Hello, >> >> I have a question for which I am unable to find an answer in the >> documentation, if y'all don't mind, I will ask here and hope for an >> answer. >> >> After installing PostgreSQL and logging

[GENERAL] Find all the the SELECT statements that occured

2013-05-23 Thread Nik Tek
Hi, I have a question on how to find all the SELECT statements that have occurred in the database. I don't want any DML(Insert/Update/Delete) statements to be captured. This is for knowing how many selects statements occur within the database in an 1 hour interval or on a average. Would this simp

[GENERAL] Success stories of PostgreSQL implementations in different companies

2013-05-23 Thread Oscar Calderon
Hi, this question isn't technical, but is very important for me to know. Currently, here in El Salvador our company brings PostgreSQL support, but Oracle and SQL Server are more popular here. Even with that, some clients are being encouraged to change to PostgreSQL to lower their companies costs i

Re: [GENERAL] New role, no database

2013-05-23 Thread Melvin Call
That works like a charm. Thanks Alvaro! On 5/23/13, Alvaro Herrera wrote: > Melvin Call escribió: >> Hello, >> >> I have a question for which I am unable to find an answer in the >> documentation, if y'all don't mind, I will ask here and hope for an >> answer. >> >> After installing PostgreSQL an

Re: [GENERAL] New role, no database

2013-05-23 Thread Scott Marlowe
On Thu, May 23, 2013 at 3:01 PM, Melvin Call wrote: > Hello, > > I have a question for which I am unable to find an answer in the > documentation, if y'all don't mind, I will ask here and hope for an > answer. > > After installing PostgreSQL and logging in as the admin user of > postgres, I have c

Re: [GENERAL] New role, no database

2013-05-23 Thread Alvaro Herrera
Melvin Call escribió: > Hello, > > I have a question for which I am unable to find an answer in the > documentation, if y'all don't mind, I will ask here and hope for an > answer. > > After installing PostgreSQL and logging in as the admin user of > postgres, I have created a new user with the CR

[GENERAL] New role, no database

2013-05-23 Thread Melvin Call
Hello, I have a question for which I am unable to find an answer in the documentation, if y'all don't mind, I will ask here and hope for an answer. After installing PostgreSQL and logging in as the admin user of postgres, I have created a new user with the CREATEDB privilege. How does that user l

Re: [GENERAL] Temp tables

2013-05-23 Thread Tom Lane
Steve Crawford writes: > On 05/23/2013 12:24 AM, Pascal Tufenkji wrote: >> When I type the following, the database gives me an error: >> dragon=# CREATE TEMP TABLE _parcours (id int); >> ERROR: type "_parcours" already exists Perhaps you have a type or temp table named "parcours"? If so, "_parc

Re: [GENERAL] Temp tables

2013-05-23 Thread Steve Crawford
On 05/23/2013 12:24 AM, Pascal Tufenkji wrote: Hi, To enhance the performance of the queries, I use temp tables in my website reports. It seems that a temp table has not been dropped automatically in a certain session, and now the report is giving an error since the temp table already exis

[GENERAL] Temp tables

2013-05-23 Thread Pascal Tufenkji
Hi, To enhance the performance of the queries, I use temp tables in my website reports. It seems that a temp table has not been dropped automatically in a certain session, and now the report is giving an error since the temp table already exists ?! When I type the following, the database g

Re: [ODBC] [GENERAL] ODBC constructs

2013-05-23 Thread Dev Kumkar
On Wed, May 22, 2013 at 6:06 PM, Dev Kumkar wrote: > On Wed, May 22, 2013 at 4:10 PM, Devrim GÜNDÜZ wrote: > >> >> Yes, or, as mentioned before, you can simply download the RPM directly >> from the repo. >> > Thanks Devrim! > > Installed postgres-92 server from > postgresql92-server-9.2.4-1PGDG.

Re: [GENERAL] Rule for all the tables in a schema

2013-05-23 Thread Sajeev Mayandi
Thanks. I am using 9.2. So will use serge's method. On 5/22/13 11:53 PM, "Sergey Konoplev" wrote: >On Wed, May 22, 2013 at 11:49 PM, Chris Travers >wrote: >> For pre-9.0, just explicitly create, run, and drop a pl/pgsql function. >> Much easier than a shell script. > >+1, good point. > >-- >Ki

Re: [GENERAL] What is a DO block for?

2013-05-23 Thread Joshua D. Drake
On 05/23/2013 05:58 AM, Rob Richardson wrote: Greetings! Another post on this list suggested using a DO block if the user's Postgres version is 9.0 or later. The documentation for the DO block says what it is, but not what it is for. The only benefit I could see for it is allowing the use

Re: [GENERAL] [PERFORM] Very slow inner join query Unacceptable latency.

2013-05-23 Thread fburgess
serverdb=# set enable_hashjoin=off;SETserverdb=# explain select count(*) as y0_ from SARS_ACTS this_ inner join SARS_ACTS_RUN tr1_ on this_.SARS_RUN_ID=tr1_.ID where tr1.ALGORITHM='SMAT';    QUERY PLAN--

Re: [GENERAL] seeming overflow during avg() of intervals without errors/warnings

2013-05-23 Thread Vick Khera
On Wed, May 15, 2013 at 10:50 AM, Tom Lane wrote: > Somebody ought to fix that. > > A larger question is whether it'd be worth the trouble for interval > avg() to use some wider internal representation so it could avoid > the overflow. Given the lack of prior complaints I'm inclined to > suspect

Re: [GENERAL] Foreign Key violated

2013-05-23 Thread Serge Fonville
Hi, I'm not sure if I understand your issue, but could you output SELECT COUNT(*) FROM rmas WHERE id = 1008122437 AND status = 'r'; HTH Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server

Re: [GENERAL] Foreign Key violated

2013-05-23 Thread Thom Brown
On 23 May 2013 10:15, Keith Fiske wrote: > Client reported an issue where it appears a foreign key has been violated > > prod=#\d rma_items > [snip] > rma_items_rma_id_status_fk" FOREIGN KEY (rma_id, rma_status) REFERENCES > rmas(id, status) ON UPDATE CASCADE ON DELETE CASCADE > > prod=# select i.

Re: [GENERAL] update ARRAY of COMPOSITE TYPE of text

2013-05-23 Thread Tom Lane
Wojciech Skaba writes: > UPDATE directory SET faxes = ARRAY[ROW('11', '222', '333'), ROW('44', > '555', '666')] WHERE id = 1; > has failed: (You will need to rewrite or cast the expression) with arrow > pointing to ARRAY. > Does anybody know how to overcome it? Just like it says, cast the

[GENERAL] Foreign Key violated

2013-05-23 Thread Keith Fiske
Client reported an issue where it appears a foreign key has been violated prod=#\d rma_items [snip] rma_items_rma_id_status_fk" FOREIGN KEY (rma_id, rma_status) REFERENCES rmas(id, status) ON UPDATE CASCADE ON DELETE CASCADE prod=# select i.rma_id, i.rma_status, r.id, r.status from rmas r join rm

Re: [GENERAL] Contents of data/base/ and no corresponding entry in pg_database

2013-05-23 Thread Tom Lane
=?UTF-8?Q?Kjetil_J=C3=B8rgensen?= writes: > from reading > http://www.postgresql.org/docs/9.2/static/storage-file-layout.html the > directories under $PG_DATADIR/data/base should correspond to an actual > database. I've however found a few directories in $PG_DATADIR/data/base > where select datnam

Re: [ODBC] [GENERAL] ODBC constructs

2013-05-23 Thread Dev Kumkar
On Tue, May 21, 2013 at 11:28 PM, Dev Kumkar wrote: > On Tue, May 21, 2013 at 10:49 PM, John R Pierce wrote: > >> its looking for the RPM installed packages it was linked against. its not >> looking to see if any same named files just happen to be on your system. > > > Oh, got it. So the only way

Re: [ODBC] [GENERAL] ODBC constructs

2013-05-23 Thread Dev Kumkar
On Tue, May 21, 2013 at 7:25 PM, Dann Corbit wrote: > >> > > I do not know if you have 64 bit or 32 bit Linux and if it is Redhat or > Mandrake or whatever. > > To be clear: > > The PostgreSQL distribution allows you to download the PostgreSQL ODBC > driver. The PostgreSQL ODBC driver i

Re: [GENERAL] data file corruption

2013-05-23 Thread Tom Lane
PG User writes: > ... Later we found that invalid header is actually valid header for other > table's data file. So somehow data of one table got inserted into another > and both tables have different # of attributes. Can this be possible? Any > hardware issue can cause this? There are (at least)

Re: [GENERAL] What is a DO block for?

2013-05-23 Thread salah jubeh
I find the do block a nice enhancement;  for example, it allows me to do many administration tasks quickly without adding a procedure to the database. Imagine that I need to truncate all the tables in a schema for development purposes in order to fill it with test data.   I could do like this D

Re: [GENERAL] What is a DO block for?

2013-05-23 Thread Chris Travers
On Thu, May 23, 2013 at 5:58 AM, Rob Richardson wrote: > Greetings! > > Another post on this list suggested using a DO block if the user's > Postgres version is 9.0 or later. The documentation for the DO block says > what it is, but not what it is for. The only benefit I could see for it is > al

[GENERAL] What is a DO block for?

2013-05-23 Thread Rob Richardson
Greetings! Another post on this list suggested using a DO block if the user's Postgres version is 9.0 or later. The documentation for the DO block says what it is, but not what it is for. The only benefit I could see for it is allowing the use of locally defined variables. I'm sure there's m

Re: [GENERAL] VACUUM FULL freezes

2013-05-23 Thread Chris Ernst
On 05/22/2013 08:49 AM, RDNikeAir wrote: > I have a database that is on a RAID5 machine that is almost out of memory > (277GB of 330GB used). I have deleted some data and run the VACUUM FULL > command, but after a few hours gave me the error message "Server closed the > connection unexpectedly. Th

[GENERAL]- pgaql long value corrupted using htons

2013-05-23 Thread Neeraj Rai
1. I am having trouble writing long values via c interface .testlibqp-dt.c  is attached. . 2 is being inserted as 8589934592. qsf=> select * from t1;    curdate   |  strf  |        intf        |         tm_new         | txnid  ++++-

[GENERAL] update ARRAY of COMPOSITE TYPE of text

2013-05-23 Thread Wojciech Skaba
I did: CREATE TYPE telephone AS ( area text, number text, ext text ); Then: CREATE TABLE directory ( id integer, tel telephone, faxes telephone[] ); After some data has been entered, I tried: UPDATE directory SET tel = ROW('11', '222', '333') WHERE id = 1; UPDATE directory SET faxes[1] =

Re: [GENERAL] [pgeu-general] Replication failover

2013-05-23 Thread Heikki Linnakangas
On 23.05.2013 03:55, TJ wrote: We have a few different sets of servers with different versions. 9.0.4 9.1.4 9.2.3 I recently tried to fail-over a set of 9.2.3 servers and server4 did notice the timeline change but did not start following it. We do not have the recovery_target_timeline set in th

Re: [GENERAL] [pgeu-general] Replication failover

2013-05-23 Thread TJ
We have a few different sets of servers with different versions. 9.0.4 9.1.4 9.2.3 I recently tried to fail-over a set of 9.2.3 servers and server4 did notice the timeline change but did not start following it. We do not have the recovery_target_timeline set in the recovery.conf ATM we are n