Re: [GENERAL] optimal hardware for postgres?

2005-04-26 Thread Alex Turner
The first thing you need to do is assess where your bottleneck is going to be. Is it RAM? or CPU or IO? If your system is IO bound, you are better off spending your $s on a good IO controller and lots of drives that racking up the $$s with Expensive Opteron 275s or 250s, when a 242 would do the

Re: [GENERAL] Migrating MySQL app to postgres?

2005-04-26 Thread Alex Turner
Be warned that if you use python, expect it to be slow. Many basic associative array operations are more than 10x slower than C++'s comparative operations leading to long page execution time if you are dealing with alot of data. I have written a simple web framework in Python and XML, and it's a

Re: [GENERAL] optimal hardware for postgres?

2005-04-26 Thread William Yu
Linux 2.6 does have NUMA support. But whether it's actually a for Postgres is debatable due to the architecture. First let's take a look at how NUMA makes this run faster in a 2x Opteron system. The idea is that the processes running on CPU0 can access memory attached to that CPU a lot faster

Re: [GENERAL] Immutable attributes?

2005-04-26 Thread Stephane Bortzmeyer
On Sun, Apr 24, 2005 at 10:05:53PM -0600, Michael Fuhr [EMAIL PROTECTED] wrote a message of 85 lines which said: This wouldn't solve all your problems, but you could write a generic trigger function in a language like PL/Tcl or PL/Python (or PL/Perl in 8.0 and later) and pass the column

[GENERAL] savepoints

2005-04-26 Thread Thaler Robert
do savepoints automatically be released on commit by postgres? thanks robert

[GENERAL] jdbc3 and ResultSet.getFetchSize()

2005-04-26 Thread Michal Hlavac
helo, I have this code: ResultSet rs = stmt.executeQuery(SELECT attr FROM table WHERE id=1); System.out.println(rs.getFetchSize()); rs.getFetchSize() everytime returns 0... why??? thanx, miso ---(end of broadcast)--- TIP 9: the planner will

[GENERAL] oid wraparound

2005-04-26 Thread =?ISO-8859-15?Q?Hubert_Fr=F6hlich?=
Hi list, some time ago, there was a discussion about oid wraparound. See http://archives.postgresql.org/pgsql-general/2002-10/msg00561.php . Those days, we had PostgreSQL 7.1 and 7.2, and we had to be careful oids approaching 2^32 (2.14 billion) Now, we have 8.0. What does the situation look

[GENERAL] Intervals

2005-04-26 Thread Jake Stride
Is there a way to convert in interval into hours? I have a table that records the amount of time worked by a person and want to sum up all the hours, however with the column being an interval once you reach more than 24 hours it turns that into a day. This is not what I want so instead of

Re: [GENERAL] Intervals

2005-04-26 Thread Michael Glaesemann
On Apr 26, 2005, at 18:47, Jake Stride wrote: Is there a way to convert in interval into hours? I have a table that records the amount of time worked by a person and want to sum up all the hours, however with the column being an interval once you reach more than 24 hours it turns that into a day.

Re: [GENERAL] Intervals

2005-04-26 Thread Dawid Kuroczko
On 4/26/05, Jake Stride [EMAIL PROTECTED] wrote: Is there a way to convert in interval into hours? I have a table that records the amount of time worked by a person and want to sum up all the hours, however with the column being an interval once you reach more than 24 hours it turns that into

Re: [GENERAL] Intervals

2005-04-26 Thread Andrei Gaspar
I had the same problem and wrote a small function create function hours(timestamp without time zone, timestamp without time zone) RETURNS integer as $$select cast( (cast($2 as date) - cast($1 as date)) * 24 + extract(hour from cast($2 as time) - cast($1 as time)) as integer)$$ language SQL

Re: [GENERAL] oid wraparound

2005-04-26 Thread Russell Smith
On Tue, 26 Apr 2005 07:24 pm, Hubert Fröhlich wrote: Hi list, some time ago, there was a discussion about oid wraparound. See http://archives.postgresql.org/pgsql-general/2002-10/msg00561.php . Those days, we had PostgreSQL 7.1 and 7.2, and we had to be careful oids approaching 2^32

Re: [GENERAL] oid wraparound

2005-04-26 Thread Neil Conway
Hubert Fröhlich wrote: Those days, we had PostgreSQL 7.1 and 7.2, and we had to be careful oids approaching 2^32 (2.14 billion) Now, we have 8.0. What does the situation look like? With the default settings, there is exactly the same risk of OID wraparound as in earlier releases. However, you

Re: [GENERAL] optimal hardware for postgres?

2005-04-26 Thread Marco Colombo
On Tue, 2005-04-26 at 01:32 -0700, William Yu wrote: Linux 2.6 does have NUMA support. But whether it's actually a for Postgres is debatable due to the architecture. First let's take a look at how NUMA makes this run faster in a 2x Opteron system. The idea is that the processes running on

Re: [GENERAL] pgadminIII - creating servers

2005-04-26 Thread Sean Davis
On Apr 25, 2005, at 10:54 PM, [EMAIL PROTECTED] wrote: I just now tried creating a second server with pgadminIII.    I am confused as to why one would have more than one server.  There does not seem to be any way to switch from one server to another, or to log into one particular server (and

Re: [GENERAL] savepoints

2005-04-26 Thread Alvaro Herrera
On Tue, Apr 26, 2005 at 10:52:34AM +0200, Thaler Robert wrote: do savepoints automatically be released on commit by postgres? Yes. Savepoints do not cross transaction boundaries. -- Alvaro Herrera ([EMAIL PROTECTED]) Some men are heterosexual, and some are bisexual, and some men don't think

Re: [GENERAL] Migrating MySQL app to postgres?

2005-04-26 Thread Rich Shepard
On Tue, 26 Apr 2005, Joe Healy wrote: I have found using python with reportlab (http://www.reportlab.org/rl_toolkit.html) very easy to create pdf reports based on queries. Joe, Thank you very much. I'll look at it. Yesterday I discovered another report writer (uses python) called papryrus that

Re: [GENERAL] rollback vs. commit for closing read-only transaction

2005-04-26 Thread Richard_D_Levine
For portability's sake commit successful transactions and rollback those that fail. Rick [EMAIL PROTECTED] wrote on 04/25/2005 05:53:11 PM: Dann Corbit [EMAIL PROTECTED] writes: Probably, turning fsync off would be helpful, since you know it is read-only. Wouldn't make any difference: a

Re: [GENERAL] Immutable attributes?

2005-04-26 Thread Mario Soto Cordones
Hi for all , plese a question ,this function can be write in pl/pgsql ??? thank for all 2005/4/24, Stephane Bortzmeyer [EMAIL PROTECTED]: To protect the database from programming errors (there is a team working on the project and some beginners may produce bugs), I would like to flag

Re: [GENERAL] Immutable attributes?

2005-04-26 Thread Stephane Bortzmeyer
On Tue, Apr 26, 2005 at 09:49:05AM -0400, Mario Soto Cordones [EMAIL PROTECTED] wrote a message of 45 lines which said: Hi for all , plese a question ,this function can be write in pl/pgsql ??? I do not understand, it IS pl/pgsql. CREATE OR REPLACE FUNCTION check_immutable()

Re: [GENERAL] UltraSPARC versus AMD

2005-04-26 Thread Richard_D_Levine
Mike Mascari mascarm@mascari.com wrote on 04/25/2005 09:21:02 PM: [EMAIL PROTECTED] wrote: In my *utter* lack of enthusiasm over this option, I was gathering ammunition for better hardware. I went to spec.org for speed comparisons, and sun.com for price comparisons. Sun's *entry* level

Re: [GENERAL] Immutable attributes?

2005-04-26 Thread Pavel Stehule
On Tue, 26 Apr 2005, Mario Soto Cordones wrote: Hi for all , plese a question ,this function can be write in pl/pgsql ??? No, there is no possibility write it in pl/pgsql. Pavel Stehule ---(end of broadcast)--- TIP 9: the planner

Re: [GENERAL] Immutable attributes? Correction

2005-04-26 Thread Pavel Stehule
On Tue, 26 Apr 2005, Mario Soto Cordones wrote: Hi for all , plese a question ,this function can be write in pl/pgsql ??? I am sorry. Universal handler for immutable attributes is not possible in plpgsql. Only if you know names of immutable columns, than you can use plpgsql. You

Re: [GENERAL] Calculated bigserial column in a view

2005-04-26 Thread Jeff Eckermann
Bruno Wolff III [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Please keep replies copied to the list so that other people can learn from and comment on the discussion unless to have a good reason to make the thread private. On Mon, Apr 25, 2005 at 21:46:20 +0200, Zlatko Matic

Re: [GENERAL] Postgres source (tar file) for Fedora Core OS?

2005-04-26 Thread John DeSoi
On Apr 26, 2005, at 12:13 AM, Dinesh Pandey wrote: From where can I download latest Postgres source (tar file) for Fedora Core OS? http://www.postgresql.org/ftp/v8.0.2/ John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of

[GENERAL] Change Windows path to Unix path...

2005-04-26 Thread Patrick . FICHE
Hi, I'm trying to execute COPY command from some pgsql function. The filename is given as an argument of the function. But I get the filename like 'F:\tmp\file.txt' and I need to change this to 'F:/tmp/file.txt' before applying the COPY command. I dind't succeed to replace '\' by '/' in

Re: [GENERAL] Change Windows path to Unix path...

2005-04-26 Thread Shelby Cain
--- [EMAIL PROTECTED] wrote: Hi, I'm trying to execute COPY command from some pgsql function. The filename is given as an argument of the function. But I get the filename like 'F:\tmp\file.txt' and I need to change this to 'F:/tmp/file.txt' before applying the COPY command. I

[GENERAL] out of memory

2005-04-26 Thread Hugues-Vincent Grislin
Hello, I have a problem when i try to execute my request : ERROR: out of memory DETAIL: Failed on request of size 336. (I had execute the " VACCUM" before) It's a SELECT which contains several jointures (simple ones, 1-1). With 5 jointures there is no problem but with 6, i have this

Re: [GENERAL] UltraSPARC versus AMD

2005-04-26 Thread Brent Wood
On Sat, 23 Apr 2005, Uwe C. Schroeder wrote: Well, you overlook one thing there. SUN has always has a really good I/O performance - something far from negligible for a database application. A lot of the PC systems lack that kind of I/O thruput. Just compare a simple P4 with ATAPI drives to

Re: [GENERAL] Postgres source (tar file) for Fedora Core OS?

2005-04-26 Thread Marco Colombo
On Tue, 2005-04-26 at 09:43 +0530, Dinesh Pandey wrote: From where can I download latest Postgres source (tar file) for Fedora Core OS? Regards Dinesh Pandey This is a question for Fedora mailing-lists. Anyway, FC distributes sources in RPM format. Assuming you're referring to the latest

[GENERAL] About index - a query or data manipulation command can use at most one index per table

2005-04-26 Thread Ying Lu
Hello List, A question about index. It mentioned in postgresql 8.0 doc a query or data manipulation command can use *at most one index* *per table*. An example query is: select * from A left join B using (id) where A.type='apple' and A.isExport=true; id is the primary key for both table A B.

Re: [GENERAL] Intervals

2005-04-26 Thread Jake Stride
That is helpful, I have created a slightly different function that returns an interval in the format HH:MM not sure if it will help anyone or anyone has any suggestions to improve it: create function hours(interval) returns varchar as 'SELECT floor(extract(epoch from $1)/3600) || \':\' ||

Re: [GENERAL] About index - a query or data manipulation command

2005-04-26 Thread Ragnar =?ISO-8859-1?Q?Hafsta=F0?=
On Tue, 2005-04-26 at 13:58 -0400, Ying Lu wrote: select * from A left join B using (id) where A.type='apple' and A.isExport=true; id is the primary key for both table A B. If index (type, isExport) has been created for table A. In the above query, will this index works? simplest is

Re: [GENERAL] About index - a query or data manipulation command can use at most one index per table

2005-04-26 Thread Michael Fuhr
On Tue, Apr 26, 2005 at 01:58:09PM -0400, Ying Lu wrote: A question about index. It mentioned in postgresql 8.0 doc a query or data manipulation command can use *at most one index* *per table*. An example query is: select * from A left join B using (id) where A.type='apple' and

Re: [GENERAL] UltraSPARC versus AMD

2005-04-26 Thread Richard_D_Levine
[EMAIL PROTECTED] wrote on 04/25/2005 09:19:57 PM: On Sat, 23 Apr 2005, Uwe C. Schroeder wrote: Well, you overlook one thing there. SUN has always has a really good I/O performance - something far from negligible for a database application. A lot of the PC systems lack that kind of

Re: [GENERAL] UltraSPARC versus AMD

2005-04-26 Thread Richard_D_Levine
Sun's stock was at $65.00 in late 2000 and has rocketed to $3.50. I think somebody else besides us noticed too. [EMAIL PROTECTED] wrote on 04/26/2005 01:12:49 PM: -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Brent Wood Sent: Monday, April 25,

Re: [GENERAL] Calculated bigserial column in a view

2005-04-26 Thread SCassidy
If you want a unique key across several tables, can you not do something like: CREATE SEQUENCE detail_seq INCREMENT BY 1; CREATE TABLE table1 ( table1_id INTEGER PRIMARY KEY DEFAULT nextval('detail_seq'), item1_name VARCHAR(100) NOT NULL ); CREATE TABLE table2 (

[GENERAL] Query Designer

2005-04-26 Thread Carlos Gustavo Fischer
Hello, people. I´m looking for a FREE tool where you can VISUALLY link tables and mark fields and the tool generates the query automatically. I´ve tried PGExplorer. It´s nice, but it doens´t create JOINS, just a lot of WHERE... =...AND...=...AND... Do you people have any tips ?? Thanks in

[GENERAL] plruby on Windows

2005-04-26 Thread Steve - DND
Does anyone know if it's possible to build plruby for the native version of PostgreSQL 8? If so, can you please let me know where you obtained the sourcecode, and build instructions, if any? Thanks, Steve ---(end of broadcast)--- TIP 2: you can

[GENERAL] PRIMARY KEY on a *group* of columns imply that each column is NOT NULL?

2005-04-26 Thread Stephane Bortzmeyer
If I define a primary key: name TEXT NOT NULL, address INET, PRIMARY KEY(name, address) the definition (seen by \d) becomes: name | text| not null address | inet| not null address is now not null, which I do

Re: [GENERAL] PRIMARY KEY on a *group* of columns imply that each column is NOT NULL?

2005-04-26 Thread Guy Rouillier
Stephane Bortzmeyer wrote: If I define a primary key: name TEXT NOT NULL, address INET, PRIMARY KEY(name, address) the definition (seen by \d) becomes: name | text| not null address | inet| not null

Re: [GENERAL] UltraSPARC versus AMD - Slowaris

2005-04-26 Thread Mohan, Ross
Richly deserved IMNSHO. my current employer was bilked for many many months for a piece of crap E10K that barely outperforms a couple of AMD chips. But at many, many times the price. We finally upgraded/migrated to AIX/g5 chips and run what was run on 20 cpus on 2. If Sun pulls out of its slow

[GENERAL] blob storage

2005-04-26 Thread Travis Harris
I would like to use P* to store files. These files will probably range from 500K to 2 MB in size and there will be thousands upon thousands of them. I was wondering how P* stores blobs, if it is all in one file, or if each blob is sored in it's own file. The reason being, I know that windows

Re: [GENERAL] PRIMARY KEY on a *group* of columns imply that each column is NOT

2005-04-26 Thread Stephane Bortzmeyer
On Tue, Apr 26, 2005 at 03:22:40PM -0500, Guy Rouillier [EMAIL PROTECTED] wrote a message of 37 lines which said: The primary key constraint specifies that a column or columns of a table may contain only unique (non-duplicate), nonnull values. Technically, PRIMARY KEY is merely a

Re: [GENERAL] blob storage

2005-04-26 Thread Scott Marlowe
On Tue, 2005-04-26 at 15:30, Travis Harris wrote: I would like to use P* to store files. These files will probably range from 500K to 2 MB in size and there will be thousands upon thousands of them. I was wondering how P* stores blobs, if it is all in one file, or if each blob is sored in

Re: [GENERAL] blob storage

2005-04-26 Thread Joshua D. Drake
Travis Harris wrote: I would like to use P* to store files. These files will probably range from 500K to 2 MB in size and there will be thousands upon thousands of them. I was wondering how P* stores blobs, Either as bytea or a large object. if it is all in one file, or if each blob is sored in

Re: [GENERAL] UltraSPARC versus AMD - Slowaris

2005-04-26 Thread Scott Marlowe
Maybe that's why used Sun E10ks with 12 CPUs and 12 gig of ram are going for $5995 AND still not selling on ebay... On Tue, 2005-04-26 at 15:27, Mohan, Ross wrote: Richly deserved IMNSHO. my current employer was bilked for many many months for a piece of crap E10K that barely outperforms a

Re: [GENERAL] blob storage

2005-04-26 Thread Rich Shepard
On Tue, 26 Apr 2005, Travis Harris wrote: I would like to use P* to store files. These files will probably range from 500K to 2 MB in size and there will be thousands upon thousands of them. I was wondering how P* stores blobs, if it is all in one file, or if each blob is sored in it's own file.

Re: [GENERAL] UltraSPARC versus AMD - Slowaris

2005-04-26 Thread Ben
bilked is my new favorite word. On Tue, 26 Apr 2005, Mohan, Ross wrote: Richly deserved IMNSHO. my current employer was bilked for many many months for a piece of crap E10K that barely outperforms a couple of AMD chips. But at many, many times the price. We finally upgraded/migrated to AIX/g5

Re: [GENERAL] PRIMARY KEY on a *group* of columns imply that each

2005-04-26 Thread Scott Marlowe
On Tue, 2005-04-26 at 15:39, Stephane Bortzmeyer wrote: On Tue, Apr 26, 2005 at 03:22:40PM -0500, Guy Rouillier [EMAIL PROTECTED] wrote a message of 37 lines which said: The primary key constraint specifies that a column or columns of a table may contain only unique (non-duplicate),

[GENERAL] How to reduce disk usage and found where disk usage is used? + reindex force doesn`t seem to work

2005-04-26 Thread David Gagnon
Hi all, I'll really appreciate any help to reduce the disk usage of postgresql. I have a web site witch is data are refreshed each night. Right now the disk usage is about 400 Megs but since I reload data all nights it getting huge. I do vacuum each time I am finished loading data. I look

Re: [GENERAL] plruby on Windows

2005-04-26 Thread Werner Bohl
On Tue, 2005-04-26 at 13:05 -0700, Steve - DND wrote: Does anyone know if it's possible to build plruby for the native version of PostgreSQL 8? If so, can you please let me know where you obtained the sourcecode, and build instructions, if any? Tried also to build it, but no luck. You may use

[GENERAL] subqueries and qualification of table names

2005-04-26 Thread Kevin Murphy
I have a query which didn't work properly until I fully qualified columns used in a a subquery with the appropriate table names. The reason is that both tables have a column named 'chromosome' used in the subquery. In the following query, PG treats the phrase and chromosome = chromosome as

Re: [GENERAL] blob storage

2005-04-26 Thread Alvaro Herrera
On Tue, Apr 26, 2005 at 03:41:28PM -0500, Scott Marlowe wrote: On Tue, 2005-04-26 at 15:30, Travis Harris wrote: I would like to use P* to store files. These files will probably range from 500K to 2 MB in size and there will be thousands upon thousands of them. I was wondering how P*

Re: [GENERAL] blob storage

2005-04-26 Thread Scott Marlowe
On Tue, 2005-04-26 at 16:42, Alvaro Herrera wrote: On Tue, Apr 26, 2005 at 03:41:28PM -0500, Scott Marlowe wrote: On Tue, 2005-04-26 at 15:30, Travis Harris wrote: I would like to use P* to store files. These files will probably range from 500K to 2 MB in size and there will be thousands

[GENERAL] Performance difference between ANY and IN, also array syntax

2005-04-26 Thread Bart Grantham
Hello, all. I work for a Manhattan ISP and have developed an internal systems management/housekeeping app on php/postgres 7.4. I am trying to speed up some bits with stored procedures and have had great success, except I've now run into a bit of trouble. It comes down to this: # SELECT *

Re: [GENERAL] blob storage

2005-04-26 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: On Tue, Apr 26, 2005 at 03:41:28PM -0500, Scott Marlowe wrote: If you store them as large objects, they will each get their own file. Huh, no, they won't. They will be stored in the pg_largeobject table. It's been quite a while since they are not

[GENERAL] www.thekompany.com rekall

2005-04-26 Thread Typing80wpm
I just downloaded the windows demo for Rekall, which is an MSAccess like product (loosely speaking) with native drivers for postgresql and some other engines (plus odbc for yet others). I was a bit confused on certain things so I emailed my questions, and the president of the company

Re: [GENERAL] Performance difference between ANY and IN, also array syntax

2005-04-26 Thread James Robinson
Without anything truly fancy, you could write a proc which dynamically builds a query string using the IN form out of a array parameter: You get to do a bunch of string contatenation and you don't get the luxury of pre-planning, but this technique might work for you. If your arrays aren't too

Re: [GENERAL] Pgpool questions

2005-04-26 Thread Tatsuo Ishii
Ok, I have added per query basis weight control to my TODO list. -- Tatsuo Ishii Thanks. Is it on your todo list to something like this...? It is the opposite of /* NO LOAD BALANCE */. Make a /* SLAVE */ type comment to force it to a slave? It would be helpful in forcing a

Re: [GENERAL] subqueries and qualification of table names

2005-04-26 Thread Tom Lane
Kevin Murphy [EMAIL PROTECTED] writes: ... In the following query, PG treats the phrase and chromosome = chromosome as and genetic.chromosome = genetic.chromosome. And that surprises you why? regards, tom lane ---(end of

Re: [GENERAL] Performance difference between ANY and IN, also array syntax

2005-04-26 Thread Tom Lane
Bart Grantham [EMAIL PROTECTED] writes: It comes down to this: # SELECT * FROM connections WHERE connectee_node_id = ANY ( ARRAY[28543,28542] ); [ performance sucks ] Yeah :-(. The = ANY (array) notation is new in the last release or so, and is completely without optimization of any kind.