[GENERAL] Query to find sum of grouped counts from 2 tables

2011-01-07 Thread Satish Burnwal (sburnwal)
I have 2 tables containing the data for same items: STORE1 - Id typeitems - 1 FOOD10 2 FOOD15 3 SOAP20 STORE2 - Id typeitems

Re: [GENERAL] Need Help in query

2010-12-23 Thread Satish Burnwal (sburnwal)
Thanks! I did not know such a function exists. From: Nicklas Avén [mailto:nicklas.a...@jordogskog.no] Sent: Thursday, December 23, 2010 3:31 PM To: Satish Burnwal (sburnwal) Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Need Help in query Hallo This I think should work. To get

[GENERAL] Need Help in query

2010-12-23 Thread Satish Burnwal (sburnwal)
I need a help in writing a query. I have data as follows: mydb=# select * from usrlog ; logid | userid | loginhr | logouthr ---+--+-+-- 0 | sburnwal | 0 |1 1 | rickyrs | 1 |5 2 | satishbn | 1 |6 3 | tao

[GENERAL] Complete row is fetched ?

2010-04-15 Thread Satish Burnwal (sburnwal)
I have a ques - say I have a table that has 10 columns. But in a simple select query from that table, I use just 3 columns. I want to know whether even for fetching 3 columns, read happens for all the 10 columns and out of that the required 3 columns are returned ? ie Does the complete row with all

Re: [GENERAL] Query is stuck

2010-04-15 Thread Satish Burnwal (sburnwal)
Great!! Your help is very valuable!! -Original Message- From: Justin Graf [mailto:jus...@magwerks.com] Sent: Wednesday, April 14, 2010 7:35 PM To: Bill Moran Cc: Satish Burnwal (sburnwal); pgsql-general@postgresql.org Subject: Re: [GENERAL] Query is stuck I suggest writting something

Re: [GENERAL] Query is stuck

2010-04-14 Thread Satish Burnwal (sburnwal)
0..3526.30 rows=2000 width=8) (never executed) Index Cond: ((($0)::text = (dm_user)::text) AND (($1)::text = (dm_ip)::text)) Filter: ((ss_key)::text <> ''::text) Total runtime: 8.670 ms (9 rows) -Original Message- From: Bill Moran [mailto:wm

Re: [GENERAL] Query is stuck

2010-04-14 Thread Satish Burnwal (sburnwal)
cords is increasing the query time by more than 1000 times. Also, can you tell me whether in this case, I shall create index jointly on (dm_ip, dm_user) or separately on them ? Thanks -Satish -Original Message- From: t...@fuzzy.cz [mailto:t...@fuzzy.cz] Sent: Tuesday, April 13, 2010 7:

Re: [GENERAL] [ADMIN] Query is stuck

2010-04-13 Thread Satish Burnwal (sburnwal)
I am using 8.1, so waiting coln is not there in pg_stat_activity. I frequently see these in the server logs: LOG: autovacuum: processing database "controlsmartdb" Though I can give you the result of vacuum run (but it is not helping): controlsmartdb=# vacuum full verbose analyze repcopy; INFO:

Re: [GENERAL] Query is stuck

2010-04-13 Thread Satish Burnwal (sburnwal)
I am on postgres 8.1. bash-3.2$ postgres --version postgres (PostgreSQL) 8.1.11 From: Plugge, Joe R. [mailto:jrplu...@west.com] Sent: Tuesday, April 13, 2010 6:37 PM To: Satish Burnwal (sburnwal); pgsql-general@postgresql.org Cc: pgsql-ad...@postgresql.org Subject: RE: Query is stuck

Re: [GENERAL] Query is stuck

2010-04-13 Thread Satish Burnwal (sburnwal)
controlsmartdb=# select * from pg_stat_activity where waiting='t'; ERROR: column "waiting" does not exist From: Plugge, Joe R. [mailto:jrplu...@west.com] Sent: Tuesday, April 13, 2010 6:32 PM To: Satish Burnwal (sburnwal); pgsql-general@postgresql.org Cc: pgsql-ad...@po

[GENERAL] Query is stuck

2010-04-13 Thread Satish Burnwal (sburnwal)
I have a query which is not giving me the result even after 30 minutes. I want to know how to detect what is going and what's wrong ? EXPLAIN query - gives me the following: controlsmartdb=# explain select report_id, dm_ip, dm_mac, dm_user, dm_os, report_time, sys_name, sys_user, sys_user_do

[GENERAL] Converting bytea to LargeObject

2010-02-17 Thread Satish Burnwal (sburnwal)
I am also having the problem as mentioned in http://archives.postgresql.org/pgsql-general/2009-01/msg00771.php. However, the sql statement: UPDATE tbl SET newoid = ( SELECT oid FROM ( SELECT oid, lowrite(lo_open(oid, 131072), byteafield) FROM lo_create(0) o(oid)) x); Thi