Re: [SQL] prepared statements

2011-12-07 Thread Pavel Stehule
Hello 2011/12/8 Vad N : > > Hi. > > How can i pass a set of values to prepared statement? > > example > I have a prepared query: > select * from users in ( $1 ) > > i would like to pass: 1,2,3,4 and get: > > select * from users in ( 1,2,3,4 ) > > Any ideas? use a array parameter, please regards

[SQL] Question on imports with foreign keys

2011-12-07 Thread Andreas
Hi, suppose you need to import a csv with standard ciolums like name, adress, phone, ... and some additional text columns that need to be split off into referenced tables. Those lookup-tables will only be needed for a project with limited life time so I create a schema that might be called "

[SQL] prepared statements

2011-12-07 Thread Vad N
Hi. How can i pass a set of values to prepared statement? example I have a prepared query: select * from users in ( $1 ) i would like to pass: 1,2,3,4 and get: select * from users in ( 1,2,3,4 ) Any ideas?

[SQL] Re: Re: [SQL] No response from the backend

2011-12-07 Thread feng.zhou
Thanks, I will try it 2011-12-08 feng.zhou 发件人: Craig Ringer 发送时间: 2011-12-08 11:49:33 收件人: feng.zhou 抄送: pgsql-sql 主题: Re: [SQL] No response from the backend On 12/08/2011 09:38 AM, feng.zhou wrote: Thanks for your answer. The client and server run on the same machine(Windows7).

Re: [SQL] No response from the backend

2011-12-07 Thread Craig Ringer
On 12/08/2011 09:38 AM, feng.zhou wrote: Thanks for your answer. The client and server run on the same machine(Windows7). They are connected by ODBC.The client accesses server by call ODBC API.Connection and query timeout don't be set in the client. Since client and server are on the same h

Re: [SQL] Correlating Asterisk CDRs

2011-12-07 Thread Raj Mathur (राज माथुर)
On Thursday 08 Dec 2011, Scott Marlowe wrote: > 2011/12/7 Raj Mathur (राज माथुर) : > > QUERY > > PLAN > > -- > > --

[SQL] Re: Re: [SQL] No response from the backend

2011-12-07 Thread feng.zhou
Thanks for your answer. The client and server run on the same machine(Windows7). They are connected by ODBC.The client accesses server by call ODBC API.Connection and query timeout don't be set in the client. 2011-12-08 feng.zhou 发件人: Craig Ringer 发送时间: 2011-12-07 21:03:46 收件人: feng

Re: [SQL] Correlating Asterisk CDRs

2011-12-07 Thread Scott Marlowe
2011/12/7 Raj Mathur (राज माथुर) : >                                                             QUERY PLAN > - >  Limit  (cost=46782.15..46782.40 rows=100 wid

Re: [SQL] Correlating Asterisk CDRs

2011-12-07 Thread Raj Mathur (राज माथुर)
On Wednesday 07 Dec 2011, Brent Dombrowski wrote: > On Dec 7, 2011, at 6:34 AM, Raj Mathur (राज माथुर) wrote: > > I'm trying to correlate Call Data Records (CDRs) from two Asterisk > > servers, one of which uses the other for telephony. The data is in > > the tables cdr and cdr2. With some indexe

Re: [SQL] Correlating Asterisk CDRs

2011-12-07 Thread Brent Dombrowski
On Dec 7, 2011, at 6:34 AM, Raj Mathur (राज माथुर) wrote: > Hi, > > I'm trying to correlate Call Data Records (CDRs) from two Asterisk > servers, one of which uses the other for telephony. The data is in > the tables cdr and cdr2. With some indexes, the query and explain > result are: > > expl

[SOLVED] Re: [SQL] Correlating Asterisk CDRs

2011-12-07 Thread Raj Mathur (राज माथुर)
On Wednesday 07 Dec 2011, Raj Mathur (राज माथुर) wrote: > On Wednesday 07 Dec 2011, Julien Cigar wrote: > > Try to raise work_mem > > Odd, I tried adding work_mem=50MB / 256MB / 1024MB into postgres.conf > and the times actually went up to over 12 seconds. Leaving it > commented results in the 4-

Re: [SQL] Correlating Asterisk CDRs

2011-12-07 Thread Julien Cigar
On 12/07/2011 16:14, Raj Mathur (राज माथुर) wrote: On Wednesday 07 Dec 2011, Julien Cigar wrote: Try to raise work_mem Odd, I tried adding work_mem=50MB / 256MB / 1024MB into postgres.conf and the times actually went up to over 12 seconds. Leaving it commented results in the 4-second time ori

Re: [SQL] Correlating Asterisk CDRs

2011-12-07 Thread Raj Mathur (राज माथुर)
On Wednesday 07 Dec 2011, Julien Cigar wrote: > Try to raise work_mem Odd, I tried adding work_mem=50MB / 256MB / 1024MB into postgres.conf and the times actually went up to over 12 seconds. Leaving it commented results in the 4-second time originally posted. Regards, -- Raj > On 12/07/2011

Re: [SQL] Correlating Asterisk CDRs

2011-12-07 Thread Julien Cigar
Try to raise work_mem On 12/07/2011 15:34, Raj Mathur (राज माथुर) wrote: Hi, I'm trying to correlate Call Data Records (CDRs) from two Asterisk servers, one of which uses the other for telephony. The data is in the tables cdr and cdr2. With some indexes, the query and explain result are: exp

[SQL] Correlating Asterisk CDRs

2011-12-07 Thread Raj Mathur (राज माथुर)
Hi, I'm trying to correlate Call Data Records (CDRs) from two Asterisk servers, one of which uses the other for telephony. The data is in the tables cdr and cdr2. With some indexes, the query and explain result are: explain analyse select cdr.calldate, cdr2.calldate, (cdr2.calldate-cdr.calldate

Re: [SQL] No response from the backend

2011-12-07 Thread Craig Ringer
On 12/07/2011 07:27 PM, feng.zhou wrote: Hi There are some questions when using progreSQL8.4.2. I don't sure this problem is bug.The detail is following: I make a client program that communicate with progreSQL by ODBC on Windows7. After running serveral months, this client program is hung at

[SQL] No response from the backend

2011-12-07 Thread feng.zhou
Hi There are some questions when using progreSQL8.4.2. I don't sure this problem is bug.The detail is following: I make a client program that communicate with progreSQL by ODBC on Windows7. After running serveral months, this client program is hung at 00:01 in 2011-11-26 , and become OK after 8