[GENERAL] Stored function debugging help

2011-11-28 Thread JavaNoobie
Hi All , Im new to writing stored functions in postgresql and in general . I'm trying to write onw with an input parameter and return a set of results stored in a temporary table. I do the following in my function . 1) Get a list of all the consumers and store their id's stored in a temp table. 2)

[GENERAL] psql query gets stuck indefinitely

2011-11-28 Thread tamanna madaan
Hi All I have postgres installed in cluster setup. My system has a script which executes the below query on remote system in cluster. psql -t -q -Uslon -h -d -c"select 1;" But somehow this query got stuck. It didnt return even after the remote system( on which this query was supposed to execute

Re: [GENERAL] Stored function debugging help

2011-11-28 Thread John R Pierce
On 11/28/11 1:30 AM, JavaNoobie wrote: 1) Get a list of all the consumers and store their id's stored in a temp table. 2) Iterate over a particular table and retrieve values corresponding to each value from the above list and store in a temp table. 3)Return the temp table. couldn't that all be

Re: [GENERAL] How to add conversion between LATIN1 and WIN1251 ?

2011-11-28 Thread Condor
On 26.11.2011 22:33, Adrian Klaver wrote: On Friday, November 25, 2011 11:28:06 pm Condor wrote: No, charset of databases is the same. I use the same ENV when I upgrade sql servers and recreate psql database directory. About client encoding, I never ever has before a configured postgresql

[GENERAL] tricking EXPLAIN?

2011-11-28 Thread Wim Bertels
Hallo, if u compare the 2 queries, then they should be equivalent: -- normal -- EXPLAIN ANALYZE SELECT amproc, amprocnum - average AS difference FROMpg_amproc, (SELECT avg(amprocnum) AS average FROMpg_amproc) AS tmp; -- trying to trick explain with a redundant join -- EX

Re: [GENERAL] tricking EXPLAIN?

2011-11-28 Thread Szymon Guz
On 28 November 2011 12:55, Wim Bertels wrote: > Hallo, > > if u compare the 2 queries, then they should be equivalent: > > -- normal > -- EXPLAIN ANALYZE > SELECT amproc, amprocnum - average AS difference > FROMpg_amproc, >(SELECT avg(amprocnum) AS average >FROMpg_amproc)

Re: [GENERAL] tricking EXPLAIN?

2011-11-28 Thread Wim Bertels
On ma, 2011-11-28 at 13:00 +0100, Szymon Guz wrote: > > > On 28 November 2011 12:55, Wim Bertels > wrote: > Hallo, > > if u compare the 2 queries, then they should be equivalent: > > -- normal > -- EXPLAIN ANALYZE > SELECT amproc, amproc

Re: [GENERAL] Stored function debugging help

2011-11-28 Thread JavaNoobie
Well I'm not fond of using a temporary table either. But how would I be able to iterate over a set of consumers while using a join ? From my (limited) , using only a join I would only be able to generate the data for a particular consumer , rather than all of them. -- View this message in context

Re: [GENERAL] Stored function debugging help

2011-11-28 Thread Alban Hertroys
On 28 November 2011 13:36, JavaNoobie wrote: > Well I'm not fond of using a temporary table either. But how would I be able > to iterate over a set of consumers while using a join ? From my (limited) , > using only a join I would only be able to generate the data for a particular > consumer , rath

[GENERAL] Any experiences with Foreign Data Wrappers (FDW) like mysql_fdw, odbc_fdw, www_fdw or odbc_fdw?

2011-11-28 Thread Stefan Keller
Hi, I'm interested in using Foreign Data Wrappers (FDW) in order to connect PG to CSV files, MongoDB, MS SQL Server and the Web. Was anyone able to compile and use FDWs [1], like mysql_fdw, odbc_fdw or www_fdw, in PG 9.1.1 (besides official file_fdw) under Ubuntu but also Windows? Does anyone have

[GENERAL] Extending the volume size of the data directory volume

2011-11-28 Thread panam
Hi, as I am importing gigabytes of data and the space on the volume where the data dictionary resides just became to small during that process, I resized it dynamically (it is a LVM volume) according to this procedure: http://www.techrepublic.com/blog/opensource/how-to-use-logical-volume-manager-

Re: [GENERAL] psql query gets stuck indefinitely

2011-11-28 Thread Craig Ringer
On 11/28/2011 05:30 PM, tamanna madaan wrote: Hi All I have postgres installed in cluster setup. My system has a script which executes the below query on remote system in cluster. psql -t -q -Uslon -h -d -c"select 1;" But somehow this query got stuck. It didnt return even after the remote sy

Re: [GENERAL] psql query gets stuck indefinitely

2011-11-28 Thread Craig Ringer
On 11/28/2011 05:30 PM, tamanna madaan wrote: Hi All I have postgres installed in cluster setup. My system has a script which executes the below query on remote system in cluster. psql -t -q -Uslon -h -d -c"select 1;" But somehow this query got stuck. It didnt return even after the remote system(

Re: [GENERAL] psql query gets stuck indefinitely

2011-11-28 Thread tamanna madaan
Hi Craig Thanks for your reply . But unfortunately I dont have that process running right now. I have already killed that process . But I have seen this problem sometimes on my setup. It generally happens when the remote system is going slow for some reason (CPU utilization high etc.) . But whate

Re: [GENERAL] Stored function debugging help

2011-11-28 Thread John R Pierce
On 11/28/11 4:36 AM, JavaNoobie wrote: Well I'm not fond of using a temporary table either. But how would I be able to iterate over a set of consumers while using a join ? From my (limited) , using only a join I would only be able to generate the data for a particular consumer , rather than all o

[GENERAL] odbc_fdw

2011-11-28 Thread fschwend
Hi there! I built the current PostgreSQL 9.1.1 sources under Ubuntu 11.04 (in a VMware under Win7). I followed the steps in this guide: www.thegeekstuff.com/2009/04/linux-postgresql-install-and-configure-from-source It seems to work (I can run the server and connect to it with PgAdmin). Now I'd

Re: [GENERAL] psql query gets stuck indefinitely

2011-11-28 Thread Craig Ringer
On 29/11/11 11:21, tamanna madaan wrote: > Hi Craig > > Thanks for your reply . But unfortunately I dont have that process > running right now. I have already killed that process . But I have > seen this problem sometimes on my setup. > It generally happens when the remote system is going slow for

[GENERAL] Lengthy deletion

2011-11-28 Thread Herouth Maoz
Hi. I was instructed to delete old records from one of the tables in our production system. The deletion took hours and I had to stop it in mid-operation and reschedule it as a night job. But then I had to do the same when I got up in the morning and it was still running. The odd thing about i

Re: [GENERAL] Lengthy deletion

2011-11-28 Thread Tom Lane
"Herouth Maoz" writes: > I was instructed to delete old records from one of the tables in our > production system. The deletion took hours and I had to stop it in > mid-operation and reschedule it as a night job. But then I had to do the same > when I got up in the morning and it was still runn