[GENERAL] Pgpool-II and Slony-I : query lag, sequences and stored procedures need help

2008-09-17 Thread Andrea Moretto
Hello there! I am currently evaluating the best solution for a high-availability, load balanced cluster. Currently I am testing this environment : postgres 8.3.1, pgpool-II 2.1, Slony-I 1.2.14. I've setup a master server to replicate all tables with Slony-I to a slave, and a frontend with

Re: [GENERAL] Converting string to IN query

2008-09-17 Thread Harald Fuchs
In article [EMAIL PROTECTED], Andrus [EMAIL PROTECTED] writes: I found that following query works: create temp table test ( test int ) on commit drop; insert into test values(1); select * from test where test = ANY ( '{1,2}' ); Is this best solution ? Will it work without causing stack

[GENERAL] FAQ: how to read EXPLAYN ANALYZE and act upon

2008-09-17 Thread Ivan Sergio Borgonovo
The subjects says it all. I'm looking for a tutorial that will teach me how to read explain analyze and maybe point me to some solutions (rewriting the query, adding some indexes, tune postgres.conf...). I notice I HUGE difference reordering join. Are there guidelines to reorder joint too?

Re: [GENERAL] FAQ: how to read EXPLAYN ANALYZE and act upon

2008-09-17 Thread Rodrigo E. De León Plicet
On Wed, Sep 17, 2008 at 9:43 AM, Ivan Sergio Borgonovo [EMAIL PROTECTED] wrote: The subjects says it all. A couple of links that may be of use: http://pooteeweet.org/files/phpworks06/explaining_explain.pdf http://redivi.com/~bob/oscon2005_pgsql_pdf/OSCON_Explaining_Explain_Public.pdf Good

Re: [GENERAL] FAQ: how to read EXPLAYN ANALYZE and act upon

2008-09-17 Thread Greg Smith
On Wed, 17 Sep 2008, Ivan Sergio Borgonovo wrote: I'm looking for a tutorial that will teach me how to read explain analyze and maybe point me to some solutions (rewriting the query, adding some indexes, tune postgres.conf...). All of the EXPLAIN tutorials and tools I'm aware of are listed at

[GENERAL] Design question

2008-09-17 Thread Mike Diehl
Hi all, I've got a design question that I need to ask before I go too far down what might be the wrong road. I've got a customer, who has multiple customers, who need to be able to upload an excel spreadsheet into Postgres. Then they want to be able to slice and dice that data. The problem

Re: [GENERAL] Index order

2008-09-17 Thread Korry Douglas
Hmm, I understand what you're saying, but how ion earth do I create a function that reorders the result based on all the different characters ^ . * etc that could cause this? Write a function that strips out the characters you want to ignore (returning the rest of the given string) and

Re: [GENERAL] Design question

2008-09-17 Thread James Strater
Have you considered one large table with all of the columns from the various spreadsheets, then a separate view for each customer? - Original Message From: Mike Diehl [EMAIL PROTECTED] To: pgsql-general@postgresql.org Sent: Wednesday, September 17, 2008 12:29:15 PM Subject: [GENERAL]

Re: [GENERAL] Design question

2008-09-17 Thread Scott Marlowe
On Wed, Sep 17, 2008 at 11:29 AM, Mike Diehl [EMAIL PROTECTED] wrote: Hi all, I've got a design question that I need to ask before I go too far down what might be the wrong road. I've got a customer, who has multiple customers, who need to be able to upload an excel spreadsheet into

[GENERAL] 8.3.3 stability ?

2008-09-17 Thread Gauthier, Dave
Time for an upgrade. How stable is 8.3.3 ? In a nutshell, what does it buy me over 8.2?

Re: [GENERAL] Design question

2008-09-17 Thread Richard Huxton
Mike Diehl wrote: 1. Create a table for each spreadsheet, using column headings as field names. Every field would be a char/varchar. We might have a table to track which client owns which table. This could amount to 10's of tables being added to the db. Give each client their own

Re: [GENERAL] 8.3.3 stability ?

2008-09-17 Thread Scott Marlowe
On Wed, Sep 17, 2008 at 11:31 AM, Gauthier, Dave [EMAIL PROTECTED] wrote: Time for an upgrade. How stable is 8.3.3 ? In a nutshell, what does it buy me over 8.2? 8.3.3 is as stable as 8.2 in my opinion (been running it in production for a couple months now and there has been no issues with

Re: [GENERAL] 8.3.3 stability ?

2008-09-17 Thread Raymond O'Donnell
On 17/09/2008 18:31, Gauthier, Dave wrote: Time for an upgrade. How stable is 8.3.3 ? It wouldn't have been released if it wasn't stable... :-) In a nutshell, what does it buy me over 8.2? Have a look at the release notes, but from memory it gets you a good deal more features and speed.

[GENERAL] Textmatchning

2008-09-17 Thread A B
Hi. I would like to compare two columns a and b and find all cases where a is a part of b, like this select * from mytable where a ilike b; but that will not give me a row in the case when a = 'foo' and b='FOOTBALL' and I want that to be a match. So how do I rewrite my expression? I can't find

Re: [GENERAL] 8.3.3 stability ?

2008-09-17 Thread Tom Lane
Scott Marlowe [EMAIL PROTECTED] writes: On Wed, Sep 17, 2008 at 11:31 AM, Gauthier, Dave [EMAIL PROTECTED] wrote: Time for an upgrade. How stable is 8.3.3 ? If I was deploying to production today, I'd use 8.3.3 no questions. FWIW, 8.3.4, which is due out Monday, squashes about half a dozen

Re: [GENERAL] Textmatchning

2008-09-17 Thread Scott Marlowe
On Wed, Sep 17, 2008 at 12:36 PM, A B [EMAIL PROTECTED] wrote: Hi. I would like to compare two columns a and b and find all cases where a is a part of b, like this select * from mytable where a ilike b; but that will not give me a row in the case when a = 'foo' and b='FOOTBALL' and I want

Re: [GENERAL] Textmatchning

2008-09-17 Thread Edoardo Panfili
A B ha scritto: Hi. I would like to compare two columns a and b and find all cases where a is a part of b, like this select * from mytable where a ilike b; but that will not give me a row in the case when a = 'foo' and b='FOOTBALL' and I want that to be a match. So how do I rewrite my

Re: [GENERAL] Backend timeout

2008-09-17 Thread Erik Jones
On Sep 16, 2008, at 6:21 AM, Dragan Ciric wrote: Hi! We need some help. Sometimes we have broken connections with backend ( postgresql server ). When this occurs, we have idle in transaction indication on server side. Can you answer us, how long will server stay in this state and what

Re: [GENERAL] 8.3.3 stability ?

2008-09-17 Thread Ben
On Wed, 17 Sep 2008, Scott Marlowe wrote: 8.3 has much better performance for certain types of workloads, especially with HOT updates, and the more efficient bg writer and vacuuming seems many times faster than it was before. If I was deploying to production today, I'd use 8.3.3 no questions.

Re: [GENERAL] Backend timeout

2008-09-17 Thread Scott Marlowe
On Tue, Sep 16, 2008 at 7:21 AM, Dragan Ciric [EMAIL PROTECTED] wrote: Hi! We need some help. Sometimes we have broken connections with backend ( postgresql server ). When this occurs, we have idle in transaction indication on server side. Can you answer us, how long will server stay in

Re: [GENERAL] 8.3.3 stability ?

2008-09-17 Thread Scott Marlowe
On Wed, Sep 17, 2008 at 2:38 PM, Ben [EMAIL PROTECTED] wrote: On Wed, 17 Sep 2008, Scott Marlowe wrote: 8.3 has much better performance for certain types of workloads, especially with HOT updates, and the more efficient bg writer and vacuuming seems many times faster than it was before. If

[GENERAL] updating to 8.3.x

2008-09-17 Thread Scott Marlowe
In another thread, Ben mentioned the issues he's running into with upgrading to 8.3 and lack of some of the old implicit (but wrong) type conversion. Remember 8.3 also gives you the opportunity to fix all the sloppy code in your application that depends upon implicit casting. If that's as

Re: [GENERAL] Textmatchning

2008-09-17 Thread Daniel Verite
A B wrote: I would like to compare two columns a and b and find all cases where a is a part of b, like this select * from mytable where a ilike b; a is a part of b can simply be expressed as: position(a in b)0 and if you need case insensitivity: position(upper(a) in upper(b))0 Best

Re: [GENERAL] updating to 8.3.x

2008-09-17 Thread Ben
On Wed, 17 Sep 2008, Scott Marlowe wrote: In another thread, Ben mentioned the issues he's running into with upgrading to 8.3 and lack of some of the old implicit (but wrong) type conversion. Remember 8.3 also gives you the opportunity to fix all the sloppy code in your application that

[GENERAL] Bad Timestamp Format at 23 in ...

2008-09-17 Thread Warren Bell
I have Postgresql 8.3 (PostgresPlus) running on an Apple with Tomcat 6. I am using the postgresql-8.3-603.jdbc3.jar driver. My app runs fine when on the apple, but when I move it over to a Windows machine running Tomcat 6 that accesses the same exact database on the Apple I get a Bad Timestamp

Re: [GENERAL] Bad Timestamp Format at 23 in ...

2008-09-17 Thread Martin Gainty
please display the SQL or Java Statement which constructs the incorrect date thanks, Martin __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a

Re: [GENERAL] Index order

2008-09-17 Thread Glyn Astill
Write a function that strips out the characters you want to ignore (returning the rest of the given string) and then create an index on that function. Hmm, thanks for the suggesgion. Although the problem seems to have been that the locale I was using was ignoring those characters when

Re: [GENERAL] 8.3.3 stability ?

2008-09-17 Thread Naz
Gauthier, Dave wrote: Time for an upgrade. How stable is 8.3.3 ? In a nutshell, what does it buy me over 8.2? IMHO the biggest new feature other than the usual performance enhancements is full text search integrated into the core. 8.3.3 been in use here in production since it was

Re: [GENERAL] Bad Timestamp Format at 23 in ...

2008-09-17 Thread Warren Bell
When I insert a record from the Apple app the java date inserted looks like 2008-09-17 19:52:41.584 and ends up in he db the same way. When I insert a record from the Windows app the java date inserted looks like this 2008-09-17 19:55:44.774 and ends up in the db like this 2008-09-17

Re: [GENERAL] pg_dumpall problem when roles have default schemas

2008-09-17 Thread Bruce Momjian
[EMAIL PROTECTED] wrote: I've run into a problem while migrating an existing 8.2.7 data base to a new server running 8.3.3 (although I think the version numbers may not matter -- I think I've seen this problem in the past and just lived with it since so much of Postgresql is so great!). The

[GENERAL] Synchronize two similar tables: recursive triggers

2008-09-17 Thread Michael Toews
Hi all, I need to have two tables that are mostly synchronized in my database, such that an edit to a row in one is made to the other, and vice versa. Normally, this is done using views with rules, however my situation does not allow editable views (http://trac.osgeo.org/fdo/ticket/346). So, I

Re: [GENERAL] Trigger does not behave as expected

2008-09-17 Thread Craig Ringer
Goboxe wrote: Hi, I have a trigger as below. I am wondering why when I tried to insert to master table with date= 20080908, the trigger does not insert to z_agg_tmcarr_pfx_gtwy_cc_w_20080908. First, check using \d tablename to make sure that the trigger is actually defined on the table.

Re: [GENERAL] Statement level trigger clarification

2008-09-17 Thread Craig Ringer
Peter Eisentraut wrote: Chris Velevitch wrote: I have a function that sets new.last_modified := current_timestamp; Remember that current_timestamp is stable across the lifetime of a transaction; it'll return the same value each time it is called. Given that, you can just use it in a

Re: [GENERAL] Synchronize two similar tables: recursive triggers

2008-09-17 Thread Pavel Stehule
Hello ad colum that will contains info about source of value like create table a(a integer, from_trigger bool); create table b(a integer, from_trigger bool); create or replace function synchronize_handler_a() returns trigger as $$ begin if not new.from_trigger then new.from trigger :=

Re: [GENERAL] 8.3.3 stability ?

2008-09-17 Thread Simon Riggs
On Wed, 2008-09-17 at 16:07 -0400, Tom Lane wrote: Scott Marlowe [EMAIL PROTECTED] writes: On Wed, Sep 17, 2008 at 11:31 AM, Gauthier, Dave [EMAIL PROTECTED] wrote: Time for an upgrade. How stable is 8.3.3 ? If I was deploying to production today, I'd use 8.3.3 no questions. FWIW,