[SQL] Performance issue

2005-08-30 Thread Ricky Sutanto
I use Apache Web Server and PostgreSQL 7.3 to collect data everyday. Now it has been 5 month since I install that server. I wonder why now my web very slow to retrieve and display data? When I check the memory, I found that postgreSQL client seem not release after allocate. I try to find bug

[SQL] Time differences between rows, not columns?

2005-08-30 Thread Amit_Wadhwa
Using postgresSQL 8.0 for windows, running on windows 2003 server 16gb RAM, 3Ghz dual p4. Language: Java - JDBC postgres driver: postgresql-8.0-310.jdbc3.jar I have an application with 3 tables (in this context that is) Table bills bill_id NOT NULL serial ... And other columns Table

Re: [SQL] Time differences between rows, not columns?

2005-08-30 Thread Anthony Molinaro
Amit, You say I want to know how much time it took for a bill to be accepted after it was submitted So, do you want between 10 and 40, not 10 and 20? I assume you meant 10 and 40. Ok, there's a few approaches to your questions, first To get how much time it took for a bill to be accepted after

Re: [SQL] REINDEX DATABASE

2005-08-30 Thread Achilleus Mantzios
O Achilleus Mantzios έγραψε στις Jul 28, 2005 : O Chris Browne έγραψε στις Jul 27, 2005 : I'll try to postpone the next reindexdb at the end of august, and get some numbers then. However the big difference in performance as i told was near the 2GB threshold, and at *that* point (and

Re: [SQL] Time differences between rows, not columns?

2005-08-30 Thread Amit_Wadhwa
Thanks! snipAmit,You say I want to know how much time it took for a bill to be accepted after it was submitted So, do you want between 10 and 40, not 10 and 20? I assume you meant 10 and 40... /snip ...Could be any status to any status, I wanted to generalize the concept for future usage. I

Re: [SQL] Performance issue

2005-08-30 Thread Michael Fuhr
On Tue, Aug 30, 2005 at 03:42:06PM +0700, Ricky Sutanto wrote: I use Apache Web Server and PostgreSQL 7.3 to collect data everyday. Now it has been 5 month since I install that server. Which release of PostgreSQL 7.3? What operating system and version? I wonder why now my web very slow to

Re: [SQL] Time differences between rows, not columns?

2005-08-30 Thread Anthony Molinaro
Amit, Glad it worked out :) As for the performance, lemme say that while I'm a huge fan Of postgres, my experience in regards to optimization in a production Environment is limited to Oracle and DB2. In oracle for example, if you have an index on a numeric field and perform min/max on it,

Re: [SQL] Performance issue

2005-08-30 Thread Bruno Wolff III
On Tue, Aug 30, 2005 at 15:42:06 +0700, Ricky Sutanto [EMAIL PROTECTED] wrote: I use Apache Web Server and PostgreSQL 7.3 to collect data everyday. Now it has been 5 month since I install that server. I wonder why now my web very slow to retrieve and display data? When I check the

Re: [SQL] question

2005-08-30 Thread Halley Pacheco de Oliveira
In PHP I use this code with a prepared statement to insert null in the field justif_emenda when the value in the form is an empty string or a string with only spaces. I hope this will help you. $sql = INSERT INTO tbl_emenda ( . id_emenda, subtipo_emenda, tipo_emenda, . nome_autor,

Re: [SQL] question

2005-08-30 Thread Vivek Khera
On Aug 24, 2005, at 1:05 AM, Matt A. wrote: We used nullif('$value','') on inserts in mssql. We moved to postgres and love it but the nullif() doesn't match empty strings to each other to return null other than a text type, causing an error. This is a major part of our application. I

Re: [SQL] Numerical variables in pqsql statements

2005-08-30 Thread Thomas F. O'Connell
Well, browse through this list: http://www.postgresql.org/docs/books/ I can't make any recommendations, as I am fairly familiar with the online documentation, which, when supported by the community, seems to be pretty good. -- Thomas F. O'Connell Co-Founder, Information Architect

[SQL] plpgsql question

2005-08-30 Thread Postgres Admin
Can I do something like this: CREATE TABLE sample (id SERIAL, node INTEGER, parent INTEGER); INSERT INTO sample(node,parent) VALUES(1,0); INSERT INTO sample(node,parent) VALUES(2,0); INSERT INTO sample(node,parent) VALUES(3,1); INSERT INTO sample(node,parent) VALUES(4,3) CREATE OR REPLACE

Re: [SQL] [ADMIN] plpgsql question

2005-08-30 Thread Michael Fuhr
On Tue, Aug 30, 2005 at 12:15:54PM -0400, Postgres Admin wrote: Can I do something like this: It's good that you gave an example, but it would also be good to give a summary of what you're trying to do and what trouble you're having so people don't have to guess. CREATE TABLE sample (id

Re: [SQL] [ADMIN] plpgsql question

2005-08-30 Thread Postgres Admin
I have data in one table called articles and I would like to make a function in which takes certain data from it and display the results. Example: CREATE TABLE articles ( article_id serial, title varchar(200), posted timestamp, article_subject varchar(200), article_body text, allow_comments

Re: [SQL] booleans and nulls

2005-08-30 Thread Scott Marlowe
On Sat, 2005-08-20 at 21:25, Matt L. wrote: Out of curiousity, 1. Does a boolean column occupy 1byte of disk whether or not the value is null or not? No. Nulls are stored, one bit per, to a byte at a time. I.e. if you have 8 null fields, they are stored in the same byte. 2. Is matching

Re: [SQL] sqlstate 02000 while declaring cursor/freeing prepared

2005-08-30 Thread andy rost
Just so that we can snip this thread, we've confirmed that free cursor and free statement do not affect sqlca structure elements sqlcode and sqlstate. Michael Fuhr wrote: On Mon, Aug 29, 2005 at 04:39:36PM -0500, andy rost wrote: I worked on my problem a little further and have a little more

Re: [SQL] [ADMIN] plpgsql question

2005-08-30 Thread Michael Fuhr
On Tue, Aug 30, 2005 at 01:59:04PM -0400, Postgres Admin wrote: ERROR: set-valued function called in context that cannot accept a set CONTEXT: PL/pgSQL function article_sample line 10 at return next You don't show what you did to get this error, but I'd guess you called the function like