[GENERAL] Unable to run this query

2010-07-05 Thread Srikanth Kata
I am not able to run this query in Postgres 8.4 and the OS is Linux Centos 5. I have dump of the DB, but in clients place this query is taking lots of time but no errors. Please suggest me what is the case to rectify this error. select s.*,a.actid,a.phone,d.domid,d.domname,d.domno,a.actno,a.act

Re: [GENERAL] Unable to run this query

2010-07-05 Thread Pavel Stehule
2010/7/5 Srikanth Kata : > > I am not able to run this query in Postgres 8.4 and the OS is Linux Centos 5. > > I have dump of the DB, but in clients place this query is taking lots of > time but no errors. > > Please suggest me what is the case to rectify this error. > > select > s.*,a.actid,a.phon

Re: [GENERAL] C-Functions using SPI - Missing Magic Block

2010-07-05 Thread Saitenheini
Hi people, after a two days break: I could compile the following code with Visual C++ Express 2010 under Windows Server 2003 R2: /* Use 32-bit timer (provided header file uses 64-bit timer, not * compatible with Windows postgreSQL versions */ #define _USE_32BIT_TIME_T #define BUILDING_DLL 1 #in

Re: [GENERAL] C-Functions using SPI - Missing Magic Block

2010-07-05 Thread Sam Mason
On Mon, Jul 05, 2010 at 10:20:30AM +0200, saitenhe...@web.de wrote: > Datum count_person(PG_FUNCTION_ARGS) { > SPI_connect(); > int ret = SPI_exec("SELECT count(*) FROM person", 0); > SPI_finish(); > PG_RETURN_INT32(ret); > } > > But I guess I still did something wrong, because no matter how many

[GENERAL] Out of memory on update of a single column table containg just one row.

2010-07-05 Thread Zeeshan.Ghalib
Hello Guys, We are trying to migrate from Oracle to Postgres. One of the major requirement of our database is the ability to generate XML feeds and some of our XML files are in the order of 500MB+. We are getting "Out of Memory" errors when doing an update on a table. Here is some detai

Re: [GENERAL] Out of memory on update of a single column table containg just one row.

2010-07-05 Thread Thom Brown
On 5 July 2010 11:47, wrote: > Hello Guys, > > > > We are trying to migrate from Oracle to Postgres.  One of the major > requirement of our database is the ability to generate XML feeds and some of > our XML files are in the order of 500MB+. > > > > We are getting "Out of Memory" errors when doin

Re: [GENERAL] Out of memory on update of a single column table containg just one row.

2010-07-05 Thread Zeeshan.Ghalib
> -Original Message- > From: Thom Brown [mailto:thombr...@gmail.com] > Sent: 05 July 2010 12:40 > To: Zeeshan Ghalib > Cc: pgsql-general@postgresql.org > Subject: Re: [GENERAL] Out of memory on update of a single column table > containg just one row. > Hi Zeeshan, > > Which version of Postg

Re: [GENERAL] Out of memory on update of a single column table containg just one row.

2010-07-05 Thread Thomas Markus
Hi, i tried a simple test: create temp table _t as select repeat('x',382637520) as test; update _t set test=test||test; pg 8.3 32bit fails with [Error Code: 0, SQL State: 53200] ERROR: out of memory Detail: Failed on request of size 765275088. pg 8.4.4 64bit works fine so upgrade to 64bit

[GENERAL] Windows Installation Problem

2010-07-05 Thread Len Morgan
I'm trying to install PostgreSQL 8.2 on a Windows 7 machine. I had started with 8.3 but installation stalled and after about 20 minutes I had to eventually kill it. When I try and run the 8.2 install, it just about gets ready and then tells me that another installation is running (this is aft

Re: [GENERAL] Out of memory on update of a single column table containg just one row.

2010-07-05 Thread Zeeshan.Ghalib
Hello Thom, Thanks for your quick response. So, is this there a restriction with 32-bit PostgreSQL, a bug or configuration issue? I will most definitely upgrade to 64-bit, because that's what we want anyway. However, I was curious what is the root cause of this problem? I am getting a bit wo

Re: [GENERAL] Out of memory on update of a single column table containg just one row.

2010-07-05 Thread Sam Mason
On Mon, Jul 05, 2010 at 01:52:20PM +, zeeshan.gha...@globaldatapoint.com wrote: > So, is this there a restriction with 32-bit PostgreSQL, a bug or > configuration issue? It's a restriction because of the 32bit address space. You've basically got between two and three GB of useful space left

Re: [GENERAL] Out of memory on update of a single column table containg just one row.

2010-07-05 Thread Zeeshan.Ghalib
Ok, that makes perfect sense. We will upgrade to 64-bit and continue our tests on the new build. By the way, is it safe to go ahead with Centos 5.5 or should we stick to the previous version 5.4? Thank you so much Sam and Thom for your speedy help :) Best regards, Zeeshan > -Origina

[GENERAL] how to remove a for-loop from programming language and put it into the query?

2010-07-05 Thread Pedro Zorzenon Neto
Hello! Can someone help me to develop a query? Things are more complex than this example, but with this simple example I can explain what I need and get an answer. Table: "diagnose_logs" Fields: - id serial - hardware_id integer - diag_value integer - ts timestamp So I collect many diag

Re: [GENERAL] how to remove a for-loop from programming language and put it into the query?

2010-07-05 Thread Thom Brown
On 5 July 2010 15:48, Pedro Zorzenon Neto wrote: > Hello! > > Can someone help me to develop a query? > > Things are more complex than this example, but with this simple example > I can explain what I need and get an answer. > > Table: "diagnose_logs" > Fields: >  - id serial >  - hardware_id inte

Re: [GENERAL] how to remove a for-loop from programming language and put it into the query?

2010-07-05 Thread Sam Mason
On Mon, Jul 05, 2010 at 11:48:37AM -0300, Pedro Zorzenon Neto wrote: > for ($i = 1; $i < 500; $i++) { > // return me the "most recent" diag_value from a hardware_id $i > // at the desired timestamp > runquery("select diag_value from diagnose_logs where ts <= '2009-12-25 > 23:59:59' and hardwa

Re: [GENERAL] how to remove a for-loop from programming language and put it into the query?

2010-07-05 Thread Pedro Zorzenon Neto
> I'm probably misunderstanding the problem, but can't you just do: > > SELECT > diag_value > FROM > diagnose_logs > WHERE > ts <= '2009-12-25 23:59:59' > AND > hardware_id BETWEEN 1 AND 500 > ORDER BY > ts DESC > LIMIT 1 Hi Thom, Yes, I think you misunderstood. An

Re: [GENERAL] how to remove a for-loop from programming language and put it into the query?

2010-07-05 Thread Tim Landscheidt
Pedro Zorzenon Neto wrote: > [...] > So, I need to get a report of all diagnostics of all hardware on > december 25th. > (external programming language) > for ($i = 1; $i < 500; $i++) { > // return me the "most recent" diag_value from a hardware_id $i > // at the desired timestamp > runque

Re: [GENERAL] how to remove a for-loop from programming language and put it into the query?

2010-07-05 Thread Thom Brown
On 5 July 2010 16:26, Pedro Zorzenon Neto wrote: >> I'm probably misunderstanding the problem, but can't you just do: >> >> SELECT >>       diag_value >> FROM >>       diagnose_logs >> WHERE >>       ts <= '2009-12-25 23:59:59' >> AND >>       hardware_id BETWEEN 1 AND 500 >> ORDER BY >>       ts

[GENERAL] Out of memory on update of a single column table containg just one row.

2010-07-05 Thread zeeshan.ghalib
Hello Guys, We are trying to migrate from Oracle to Postgres. One of the major requirement of our database is the ability to generate XML feeds and some of our XML files are in the order of 500MB+. We are getting "Out of Memory" errors when doing an update on a table. Here is some detai

Re: [GENERAL] how to remove a for-loop from programming language and put it into the query?

2010-07-05 Thread Pedro Zorzenon Neto
Em 05-07-2010 12:22, Sam Mason escreveu: > > You want to be using DISTINCT ON or some sort of WINDOW function. > DISTINCT ON works with older version of PG, but isn't as standards' > conforming. The following should do the trick with DISTINCT ON: > > SELECT DISTINCT ON (hardware_id) hardware_i

[GENERAL] Re: Out of memory on update of a single column table containg just one row.

2010-07-05 Thread Zeeshan.Ghalib
Please ignore this email. I sent this one earlier with the wrong email address and it was sent to moderator. From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Zeeshan Ghalib Sent: 05 July 2010 11:12 To: pgsql-general@postgresql.org Subject: [GEN

Re: [GENERAL] how to remove a for-loop from programming language and put it into the query?

2010-07-05 Thread Sam Mason
On Mon, Jul 05, 2010 at 12:44:55PM -0300, Pedro Zorzenon Neto wrote: > Em 05-07-2010 12:22, Sam Mason escreveu: > > SELECT DISTINCT ON (hardware_id) hardware_id, diag_value, ts > > FROM diagnose_logs > > WHERE ts <= '2009-12-25 23:59:59' > > ORDER BY hardware_id, ts DESC; > > It worked ok!

[GENERAL] OFFTOPIC -- pgpool list is down?????

2010-07-05 Thread Edmundo Robles L.
Do you know if the pgpool list is down???, i sent many emails to the pgpool list but since last week i can't receive any mail from pgpool list , i checktheir web site too, but the last message are of june. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To m

Re: [GENERAL] OFFTOPIC -- pgpool list is down?????

2010-07-05 Thread Devrim GÜNDÜZ
We are aware of this issue. Marc is looking at it. -- Devrim GÜNDÜZ PostgreSQL DBA @ Akinon/Markafoni, Red Hat Certified Engineer devrim~gunduz.org, devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr http://www.gunduz.org Twitter: http://twitter.com/devrimgunduz 05.Tem.2010 tarihinde 22:26 saati

[GENERAL] Manual for small project

2010-07-05 Thread pasman pasmański
Hello. I have to prepare manual to simple database in postgresql 8.4.4, Winxp+sp2. I want to store doc pages in comment field, format html. Is a better idea to store documentation ? thanks for answer -- pasman -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To

[GENERAL] moderninzing/upgrading mail list format

2010-07-05 Thread Dennis Gearon
I belong to MANY email listservers, probably like all of us. All of them, I am on digest. The CONTENT from all of you contributors is superior, more mature, and more directly helpful than all the other lists. I think it has something to do with the conservative, structured mind set of us Dbase

Re: [GENERAL] moderninzing/upgrading mail list format

2010-07-05 Thread Sam Mason
On Mon, Jul 05, 2010 at 02:43:58PM -0700, Dennis Gearon wrote: > I would like to open a conversation about either changing our email to > be more like google groups, or a move to google groups. You know you can read pg-general in google groups if you want: http://groups.google.com/group/pgsql.g

[GENERAL] cgi program doing multiple queries hangs in multiple places

2010-07-05 Thread Alan Corey
I'm having what I'd have consider a strange problem with PostgreSQL and libpq. The PostgreSQL version is now 8.4.2 running under OpenBSD 4.7 I had the same problem under OpenBSD 4.3 with whatever PostgreSQL version that had. (a couple years older) My program runs something around 20-40 differen

Re: [GENERAL] how to remove a for-loop from programming language and put it into the query?

2010-07-05 Thread Sim Zacks
> (external programming language) > for ($i = 1; $i < 500; $i++) { > // return me the "most recent" diag_value from a hardware_id $i > // at the desired timestamp > runquery("select diag_value from diagnose_logs where ts <= '2009-12-25 > 23:59:59' and hardware_id = $i order by ts desc limit

Re: [GENERAL] moderninzing/upgrading mail list format

2010-07-05 Thread Thomas Kellerer
Dennis Gearon, 05.07.2010 23:43: I belong to MANY email listservers, probably like all of us. All of them, I am on digest. The CONTENT from all of you contributors is superior, more mature, and more directly helpful than all the other lists. I think it has something to do with the conservative,