[GENERAL] Performance of a view

2005-11-14 Thread John McCawley
Hello all, I have a fairly complex query whose performance problem I have isolated to a fairly small subset. The pertinent parts of the table structure are as follows: //- tbl_claim claim_id integer SERIAL PRIMARY KEY; claimnum varchar(32); //---

Re: [GENERAL] Question about 8.1 release news

2005-11-14 Thread Bruce Momjian
Marko Kreen wrote: > On Sun, Nov 06, 2005 at 04:35:24PM -0400, Marc G. Fournier wrote: > > Once released, the more visibility, the better :) Release is schedualed > > right now for Tuesday morning ... > > Just a nitpick - should the version be 8.1.0 or 8.1? > 'configure.in' says ATM '8.1.0' but

Re: [GENERAL] 3 x PostgreSQL in cluster/redunant

2005-11-14 Thread Jim C. Nasby
On Tue, Nov 15, 2005 at 12:09:40AM +0100, Johnny Ljunggren wrote: > Jim C. Nasby wrote: > >On Mon, Nov 14, 2005 at 07:36:44PM +0100, Michelle Konzack wrote: > >>I have three Sun Server where I have reserved on each Server a Raid-5 > > >Keep in mind that databases and RAID5 generally don't mix very

Re: [GENERAL] Choosing PostgreSQL as the database for our next project

2005-11-14 Thread William Yu
Johnny Ljunggren wrote: Hmm, okay. We're now looking at another, simpler, way to do it. The same setup but the clients on Center 1/2 will connect directly to the Main center (2Mb leased line). The databases on Center 1/2 will then just be a replica of the Main databases. The biggest issue thou

Re: [GENERAL] 3 x PostgreSQL in cluster/redunant

2005-11-14 Thread Johnny Ljunggren
Jim C. Nasby wrote: On Mon, Nov 14, 2005 at 07:36:44PM +0100, Michelle Konzack wrote: I have three Sun Server where I have reserved on each Server a Raid-5 Keep in mind that databases and RAID5 generally don't mix very well. oh, how come? What is the ideal setup of a database server when it

Re: [GENERAL] Updated: partitioning functions

2005-11-14 Thread Mikael Carneholm
>This looks like a good set of examples of how to set up custom partition >management. >Not sure whether a generic approach is that useful though, but maybe it >could be a tech docs paper? I was mainly into creating a single function that could set up insert/update rules/functions for a parent

Re: [GENERAL] Queries causing highest I/O load since pg_stat_reset?

2005-11-14 Thread Jim C. Nasby
I don't think there's any way to do this currently. Maybe if you wrote an external program that polled pg_stat_activity and then correlated procpid to the output of top, etc. On Mon, Nov 14, 2005 at 08:59:19PM +0100, Mikael Carneholm wrote: > Hi, > > is it possible to retrieve a list of queries t

Re: [GENERAL] 3 x PostgreSQL in cluster/redunant

2005-11-14 Thread Jim C. Nasby
On Mon, Nov 14, 2005 at 07:36:44PM +0100, Michelle Konzack wrote: > Hello *, > > I have three Sun Server where I have reserved on each Server a Raid-5 > of 1 TByte for my PostgreSQL. The first PostgreSQL is up and running > with a database of 150 GByte. Keep in mind that databases and RAID5 gen

Re: [GENERAL] Duplicate rows

2005-11-14 Thread Samer Abukhait
so what's the problem exactly?? what's holding you from adding the primary key over fluid_id ?? in the trigger, you could use an if exists to check if the row is there before and i guess there is no need for a loop? you can do the same per row. On 11/12/05, Bob Pawley <[EMAIL PROTECTED]> wrote:

Re: [GENERAL] Queries causing highest I/O load since pg_stat_reset?

2005-11-14 Thread Mikael Carneholm
> select * from pg_stat_activity; Nope, doesn't cut it. First, it only gives you the current_query (and current_query is just that - the current query for *active* connections, not historical sessions). Second, it doesn't provide any info on blocks read/written. And pg_stat_foo_tables gives you

Re: [GENERAL] IF EXISTS

2005-11-14 Thread Samer Abukhait
How about if exists (select .. from ..) On 11/14/05, Jaime Casanova <[EMAIL PROTECTED]> wrote: > On 11/14/05, P.M <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I would like to know if "IF EXISTS" exists under > > postgresql ? > > because i did not find it. > > > > before to create users or database,

Re: [GENERAL] Choosing PostgreSQL as the database for our next project

2005-11-14 Thread Jim C. Nasby
On Mon, Nov 14, 2005 at 06:02:03PM +0100, Johnny Ljunggren wrote: > Scott Ribe wrote: > >>From what I understand this will be possible but I may need to roll my > >>own replication code to handle data conflict issues? Especially since > >>center 1/2 may be down at the same time and then might chang

Re: [GENERAL] 3 x PostgreSQL in cluster/redunant

2005-11-14 Thread Scott Marlowe
On Mon, 2005-11-14 at 12:36, Michelle Konzack wrote: > Hello *, > > I have three Sun Server where I have reserved on each Server a Raid-5 > of 1 TByte for my PostgreSQL. The first PostgreSQL is up and running > with a database of 150 GByte. > > Now I like to make the three Sun Servers redunant

Re: [GENERAL] IF EXISTS

2005-11-14 Thread Jaime Casanova
On 11/14/05, P.M <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to know if "IF EXISTS" exists under > postgresql ? > because i did not find it. > > before to create users or database, i would like to be > sure that they do not exist already. > > so how can i test it and do something like : > > I

[GENERAL] 3 x PostgreSQL in cluster/redunant

2005-11-14 Thread Michelle Konzack
Hello *, I have three Sun Server where I have reserved on each Server a Raid-5 of 1 TByte for my PostgreSQL. The first PostgreSQL is up and running with a database of 150 GByte. Now I like to make the three Sun Servers redunant but I do not find any usefull HOWTO's or manuals how to setup Postg

Re: [GENERAL] IF EXISTS

2005-11-14 Thread Bruno Wolff III
On Mon, Nov 14, 2005 at 13:20:59 -0800, "P.M" <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to know if "IF EXISTS" exists under > postgresql ? > because i did not find it. > > before to create users or database, i would like to be > sure that they do not exist already. > > so how can i tes

[GENERAL] IF EXISTS

2005-11-14 Thread P.M
Hi, I would like to know if "IF EXISTS" exists under postgresql ? because i did not find it. before to create users or database, i would like to be sure that they do not exist already. so how can i test it and do something like : IF EXISTS database "test" DROP database "test"; thanks a lot, Ma

Re: [GENERAL] [8.1] "drop table" in plpgsql function

2005-11-14 Thread John DeSoi
Sergey, On Nov 14, 2005, at 2:03 AM, Sergey Karin wrote: I have found a strange error. Perhaps your f_is_table_exist function is not working correctly. Using variables for table references is not supported in plpgsql (any version). You must use execute. Here is my test on 8.0.4: create t

[GENERAL] 8.1 beta3 initdb required?

2005-11-14 Thread Tony Caduto
Hi, Is a initdb required to go from 8.1beta 3 to 8.1.0? Thanks, Tony ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] Updated: partitioning functions

2005-11-14 Thread Simon Riggs
On Sat, 2005-11-12 at 18:37 +0100, Mikael Carneholm wrote: > don't know if someone noticed my previous post, but here's now an updated > version of the script (see attachment) > > Comments welcome. > This looks like a good set of examples of how to set up custom partition management. Not sur

Re: [GENERAL] Queries causing highest I/O load since pg_stat_reset?

2005-11-14 Thread Jaime Casanova
On 11/14/05, Mikael Carneholm <[EMAIL PROTECTED]> wrote: > Hi, > > is it possible to retrieve a list of queries that has caused the highest i/o > load? Something like > > (1) select pg_stat_reset(); > (2) run some queries for a while > (3) list the queries that caused the highest i/o since step (1

[GENERAL] Queries causing highest I/O load since pg_stat_reset?

2005-11-14 Thread Mikael Carneholm
Hi, is it possible to retrieve a list of queries that has caused the highest i/o load? Something like (1) select pg_stat_reset(); (2) run some queries for a while (3) list the queries that caused the highest i/o since step (1) ? /Mikael ---(end of broadcast)---

Re: [GENERAL] Bug with index-usage?

2005-11-14 Thread Tom Lane
=?ISO-8859-1?Q?Sebastian_B=F6ck?= <[EMAIL PROTECTED]> writes: > I get unpredictibale results selecting from a view depending on > index-usage. It's not actually *using* the indexes, although presence of the indexes does seem to be needed to trigger the bug: regression=# explain SELECT * from tes

Re: [GENERAL] Bug with index-usage?

2005-11-14 Thread Sebastian Böck
Jaime Casanova wrote: On 11/14/05, Sebastian Böck <[EMAIL PROTECTED]> wrote: Hello, I get unpredictibale results selecting from a view depending on index-usage. Please see the attached script for details. Is it a bug or some "weird feature"? Any help appreciated to get predictibale results

Re: [GENERAL] Bug with index-usage?

2005-11-14 Thread Scott Marlowe
On Mon, 2005-11-14 at 11:30, Csaba Nagy wrote: > The OP was complaining about the results of the above script, which I > could readily reproduce on a 8.1.0 installation on debian (see below). > The same select which returned 3 rows will return nothing after creating > the partial indexes, which loo

Re: [GENERAL] Bug with index-usage?

2005-11-14 Thread Jaime Casanova
On 11/14/05, Sebastian Böck <[EMAIL PROTECTED]> wrote: > Hello, > > I get unpredictibale results selecting from a view depending on > index-usage. > > Please see the attached script for details. > > Is it a bug or some "weird feature"? > > Any help appreciated to get predictibale results > > Sebast

Re: [GENERAL] Bug with index-usage?

2005-11-14 Thread Andreas Kretschmer
Sebastian Böck <[EMAIL PROTECTED]> schrieb: > Hello, > > I get unpredictibale results selecting from a view depending on > index-usage. > [ snipp ] > > SELECT * from test WHERE type = 'a'; unfortunately, no result. What Du you expect? Andreas -- Really, I'm not out to destroy Microsoft. Tha

Re: [GENERAL] Bug with index-usage?

2005-11-14 Thread Csaba Nagy
The OP was complaining about the results of the above script, which I could readily reproduce on a 8.1.0 installation on debian (see below). The same select which returned 3 rows will return nothing after creating the partial indexes, which looks as a bug to me... I can't tell anything about why it

Re: [GENERAL] Bug with index-usage?

2005-11-14 Thread Scott Marlowe
On Mon, 2005-11-14 at 11:25, Sebastian Böck wrote: > Scott Marlowe wrote: > > On Mon, 2005-11-14 at 11:07, Sebastian Böck wrote: > > > >>Hello, > >> > >>I get unpredictibale results selecting from a view depending on > >>index-usage. > > > > > > PostgreSQL uses a cost based planner. So, it ten

Re: [GENERAL] Bug with index-usage?

2005-11-14 Thread Scott Marlowe
On Mon, 2005-11-14 at 11:07, Sebastian Böck wrote: > Hello, > > I get unpredictibale results selecting from a view depending on > index-usage. Also read up on vacuum, analyze, and explain analyze. ---(end of broadcast)--- TIP 3: Have you checked o

Re: [GENERAL] Bug with index-usage?

2005-11-14 Thread Sebastian Böck
Scott Marlowe wrote: On Mon, 2005-11-14 at 11:07, Sebastian Böck wrote: Hello, I get unpredictibale results selecting from a view depending on index-usage. PostgreSQL uses a cost based planner. So, it tends to not use the plan you might expect, especially in "toy" test cases with small da

Re: [GENERAL] Bug with index-usage?

2005-11-14 Thread Scott Marlowe
On Mon, 2005-11-14 at 11:07, Sebastian Böck wrote: > Hello, > > I get unpredictibale results selecting from a view depending on > index-usage. PostgreSQL uses a cost based planner. So, it tends to not use the plan you might expect, especially in "toy" test cases with small data sets. I.e. why

[GENERAL] Bug with index-usage?

2005-11-14 Thread Sebastian Böck
Hello, I get unpredictibale results selecting from a view depending on index-usage. Please see the attached script for details. Is it a bug or some "weird feature"? Any help appreciated to get predictibale results Sebastian CREATE TABLE test1 ( id SERIAL PRIMARY KEY, name TEXT NOT NULL

Re: [GENERAL] Choosing PostgreSQL as the database for our next project

2005-11-14 Thread Johnny Ljunggren
Scott Ribe wrote: From what I understand this will be possible but I may need to roll my own replication code to handle data conflict issues? Especially since center 1/2 may be down at the same time and then might change the same data. How do the tools for this compare against the ones from Oracl

Re: [GENERAL] Outer join with where conditions

2005-11-14 Thread Michał Otroszczenko
> Conditions in WHERE are conditions logically applied after the join, so > the second query is join rows of booking_load with rows of > dict_load_type_tsl that have the same dict_load_type_id and if no such > rows in dict_load_type_tsl are found extend with NULLs then throw out any > rows for whic

Re: [GENERAL] Outer join with where conditions

2005-11-14 Thread Bruno Wolff III
On Mon, Nov 14, 2005 at 14:45:22 +0100, Michał Otroszczenko <[EMAIL PROTECTED]> wrote: > Hello, > > I wonder If I could move additional join condition from ON part of > query to where part. Yes, but the semantics are different for outer joins. > > For example instead of: > > SELECT * FROM >

Re: [GENERAL] Fuzzy text search

2005-11-14 Thread Hannes Dorbath
On 14.11.2005 16:46, jennyw wrote: We've heard that PostgreSQL can do fuzzy search, but haven't had much luck. I'm brand new to PostgreSQL, so this might be completely obvious for an experienced user. Are there any how-tos on fuzzy text searching? Someone said to try using tsearch2, but it seem

Re: [GENERAL] Fuzzy text search

2005-11-14 Thread Teodor Sigaev
jennyw wrote: We've heard that PostgreSQL can do fuzzy search, but haven't had much luck. I'm brand new to PostgreSQL, so this might be completely obvious for an experienced user. Are there any how-tos on fuzzy text searching? Someone said to try using tsearch2, but it seems that it does full

Re: [GENERAL] Fuzzy text search

2005-11-14 Thread Martijn van Oosterhout
On Mon, Nov 14, 2005 at 07:46:51AM -0800, jennyw wrote: > We've heard that PostgreSQL can do fuzzy search, but haven't had much > luck. I'm brand new to PostgreSQL, so this might be completely obvious > for an experienced user. > > Are there any how-tos on fuzzy text searching? Someone said to

[GENERAL] Fuzzy text search

2005-11-14 Thread jennyw
We've heard that PostgreSQL can do fuzzy search, but haven't had much luck. I'm brand new to PostgreSQL, so this might be completely obvious for an experienced user. Are there any how-tos on fuzzy text searching? Someone said to try using tsearch2, but it seems that it does full-text searching

Re: [GENERAL] Outer join with where conditions

2005-11-14 Thread Stephan Szabo
On Mon, 14 Nov 2005, [ISO-8859-2] Micha? Otroszczenko wrote: > I wonder If I could move additional join condition from ON part of > query to where part. > > For example instead of: > > SELECT * FROM > booking_load AS bload > LEFT OUTER JOIN dict_load_type_tsl AS load_tsl ON ( >

[GENERAL] Outer join with where conditions

2005-11-14 Thread Michał Otroszczenko
Hello, I wonder If I could move additional join condition from ON part of query to where part. For example instead of: SELECT * FROM booking_load AS bload LEFT OUTER JOIN dict_load_type_tsl AS load_tsl ON ( load_tsl.dict_load_type_id = bload.dict_load_type_id

[GENERAL] odbc and psql 8.1.0

2005-11-14 Thread Hugo
Hi , has anybody experienced any problem with the odbc driver that comes with postgres 8.1.0 , I was testing my application against the beta 4 and everything was working OK, now I installed the 8.1.0 plus the odbc driver , and now my application is returning wrong results , the application is the s

[GENERAL] Connection Oracle database from Postgres function

2005-11-14 Thread Dinesh Pandey
I want to access Oracle database from Postgres. One way to use DBI-LINK and use “plperl” function in Postgres to make connection with Oracle. Using that I am getting the following error.   Environment   Solaris 9 SPARC PostgreSQL 8.0 DBI-LINK Perl-5.8.5 -

Re: [GENERAL] Choosing PostgreSQL as the database for our next project

2005-11-14 Thread Johnny Ljunggren
William Yu wrote: Johnny Ljunggren wrote: 1. Replication - multimaster I'll try to explain the setup to the best of my ability: Three centers: Main center - database with a backup database Center 1 - database with a backup database Center 2 - database with a backup database (same as center 1)