Re: [SQL] Insane behaviour in 8.3.3

2012-06-15 Thread Raj Mathur (राज माथुर)
On Friday 15 Jun 2012, Samuel Gendler wrote: > On Fri, Jun 15, 2012 at 1:24 AM, Achilleas Mantzios < > > [email protected]> wrote: > > And i forgot to mention, minicom term emulation quality sucks, even > > giving simple > > shell commands is a PITA, upgrading the whole fleet would mean

Re: [SQL] Flatten table using timestamp and source

2012-05-25 Thread Raj Mathur (राज माथुर)
On Saturday 26 May 2012, Raj Mathur (राज माथुर) wrote: > On Friday 25 May 2012, Raj Mathur (राज माथुर) wrote: > > On Thursday 24 May 2012, Elrich Marx wrote: > > > If source changes, in this case from 1 to 2, then etime would be > > > the last value of stime for so

Re: [SQL] Flatten table using timestamp and source

2012-05-25 Thread Raj Mathur (राज माथुर)
On Friday 25 May 2012, Raj Mathur (राज माथुर) wrote: > On Thursday 24 May 2012, Elrich Marx wrote: > > If source changes, in this case from 1 to 2, then etime would be > > the last value of stime for source =1; So for source 1 it starts > > at stime 13:00 and contin

Re: [SQL] Flatten table using timestamp and source

2012-05-24 Thread Raj Mathur (राज माथुर)
On Thursday 24 May 2012, Elrich Marx wrote: > If source changes, in this case from 1 to 2, then etime would be the > last value of stime for source =1; So for source 1 it starts at > stime 13:00 and continues till 13:02 (etime). > > This should result in 3 records, because source is 1, then 2, the

Re: [SQL] Flatten table using timestamp and source

2012-05-24 Thread Raj Mathur (राज माथुर)
On Thursday 24 May 2012, Elrich Marx wrote: > I am quite new to Postgres, so please bear with me. > > I have a table with data in the following format: > > Table name : Time_Source_Table > > Source , Stime > 1, "2012-05-24 13:00:00" > 1, "2012-05-24 13:01:00" > 1, "2012-05-24 13:02:00" > 2, "20

Re: [SQL] master/detail

2012-05-20 Thread Raj Mathur (राज माथुर)
On Monday 21 May 2012, Jan Bakuwel wrote: > Hi, > > I'm trying to get my head around the following question. As an > example take a table with products: > > productid (pk) > name > > and productprice > > productpriceid (pk) > productid (fk) > pricedate > price > > There are multiple records in

Re: [SQL] Simple way to get missing number

2012-04-24 Thread Raj Mathur (राज माथुर)
On Tuesday 24 Apr 2012, Andreas Kretschmer wrote: > Emi Lu wrote: > > Good morning, > > > > May I know is there a simple sql command which could return missing > > numbers please? > > > > For example, > > > > t1(id integer) > > > > values= 1, 2, 3 500 > > > > select miss_num(id) > >

Re: [SQL] need help with import

2012-02-15 Thread Raj Mathur (राज माथुर)
On Thursday 16 Feb 2012, Andreas wrote: > Hi > I get CSV files to import. > Th structure is like this. > main part, sub part > Could be like this > > A, a1 > A, a2 > A, a3 > B, b1 > B, b2 > > The database has a table for main_part and one for sub_part. > The relation needs to be n:m so there is a

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

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 table

[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 > comme

Re: [SQL] Correlating Asterisk CDRs

2011-12-07 Thread Raj Mathur (राज माथुर)
7/2011 15:34, 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 indexes, the query and explain > > result a

[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] Generic design: char vs varchar primary keys

2011-08-03 Thread Raj Mathur (राज माथुर)
On Thursday 04 Aug 2011, Josh Kupershmidt wrote: > 2011/8/3 Raj Mathur (राज माथुर) : > > Can you point me to any pages that explain the difference between > > using, say CHAR(8) vs VARCHAR(8) as the primary key for a table? > > Is there any impact on the database in terms of

[SQL] Generic design: char vs varchar primary keys

2011-08-03 Thread Raj Mathur (राज माथुर)
Hi, Can you point me to any pages that explain the difference between using, say CHAR(8) vs VARCHAR(8) as the primary key for a table? Is there any impact on the database in terms of: - Speed of indexed retrieval - Speed of join from a referencing table - Storage (I presume VARHAR(8) would hav