[GENERAL] enable_sort optimization problem

2005-05-25 Thread Dave E Martin
(8.0.1 on debian/linux 2.6.11 kernel) I have noticed that if I set enable_sort=false in the .conf file, my queries are running faster. I had a query which if I did a limit 20, ran in 6 milliseconds, but if I changed it to limit 21, it took around 19 seconds (or 19000 milliseconds). It also too

Re: [GENERAL] Modulus operator returns negative values / numeric division rounds up sometimes

2005-05-25 Thread Tom Lane
Paul Tillotson <[EMAIL PROTECTED]> writes: > I don't think anyone wants to defend the negative modulus as such, but to fix > it, we have to do one of these: > (1) Keep rounding division, but rewrite the numeric modulus operator to use a > form of division that always rounds towards zero. > or

[GENERAL] Modulus operator returns negative values / numeric division rounds up sometimes

2005-05-25 Thread Paul Tillotson
Alvaro Herrera (and others) have noticed that the numeric modulus operator sometimes gives negative results even when the dividend and divisor are positive: Oh, and while at it, it would be nice to solve the modulo bug that still lurks there: alvherre=# select 12345678901234567890 % 123; ?c

Re: [GENERAL] unsupported frontend protocol

2005-05-25 Thread Tom Lane
Bucks vs Bytes Inc <[EMAIL PROTECTED]> writes: > Is there any postmaster logging I can turn on that will detail what's > triggering the error? Well, you could change the error report in postmaster.c to show the specific protocol version code it's receiving (7.4 and up do this, but it hadn't occur

Re: [GENERAL] unsupported frontend protocol

2005-05-25 Thread Bucks vs Bytes Inc
Agreed that the symptom fits a client library mismatch, but the only thing I moved from the 7.4.3 system to the 7.3.4 system was a pg_dump'ed database. That can't carry anything that would affect the interaction between the existing PHP 4.2.2 and PostgreSQL 7.3.4 versions, can it? They worked w

Re: [GENERAL] PostgreSQL release schedule

2005-05-25 Thread Marc G. Fournier
On Wed, 25 May 2005, Robert Treat wrote: On Tuesday 24 May 2005 23:49, Tom Lane wrote: Bruno Wolff III <[EMAIL PROTECTED]> writes: "Marc G. Fournier" <[EMAIL PROTECTED]> wrote: Estimate right now for going beta on 8.1 is July 1st ... aiming for a Isn't that feature freeze? Typically there

Re: [GENERAL] plpython error since upgrading from 7.x to 8.x

2005-05-25 Thread CSN
Ah, you're right. The function appears to only cause an error on inserts and not updates. Thanks for pointing that out (I'm really green at Python). CSN --- Michael Fuhr <[EMAIL PROTECTED]> wrote: > On Wed, May 25, 2005 at 12:02:22PM -0700, CSN wrote: > > > > It happens when I try to insert ro

Re: [GENERAL] Compiling Postgresql 8.0.3 on Solaris 10

2005-05-25 Thread Tom Lane
Aly Dharshi <[EMAIL PROTECTED]> writes: > alias ls='colorls -al' > alias rm='rm -i' > I don't see any aliases that are going to break the compile process. I beg to differ --- I think the ones quoted above match your symptoms pretty well. So the question is: why are they getting used in a noninte

Re: [GENERAL] unsupported frontend protocol

2005-05-25 Thread Tom Lane
Bucks vs Bytes Inc <[EMAIL PROTECTED]> writes: > The database was created although there were a variety of errors which I > realized were due to 7.4.3 and 7.3.4 SQL incompatibilities. I had also > added a new entry to pg_hba.conf. After restarting the 7.3.4 postmaster > I started getting an endless

[GENERAL] unsupported frontend protocol

2005-05-25 Thread Bucks vs Bytes Inc
I've painted myself into a little corner here: I pg_dumped a 7.4.3 database, created a database of the same name on a 7.3.4 server, psql'd into the new database, and \i'd the dump file. The database was created although there were a variety of errors which I realized were due to 7.4.3 and 7.3.4

Re: [GENERAL] Compiling Postgresql 8.0.3 on Solaris 10

2005-05-25 Thread Aly Dharshi
Hello Tom, I hope that you are well. I tried to check my aliases in my current shell which is bash (/bin/bash): alias allproc='ps -ef | less' alias cls='clear' alias e='emacs -nw $1' alias e-mail='pine' alias ll='colorls -l' alias lo='exit' alias logout='exit' alias ls='colorls -al' alias mpr

Re: [GENERAL] Compiling Postgresql 8.0.3 on Solaris 10

2005-05-25 Thread Tom Lane
Aly Dharshi <[EMAIL PROTECTED]> writes: > I hope that you are well. I tried compiling Postgres 8.0.3 on Solaris > 10 and > encountered the following problem, has anybody else had problems. > [dharshi::02:03 PM::~/downloads/postgresql-8.0.3]$ ./configure > rm: remove conftest.sh (yes/no)? y

Re: [GENERAL] plpython error since upgrading from 7.x to 8.x

2005-05-25 Thread Michael Fuhr
On Wed, May 25, 2005 at 12:02:22PM -0700, CSN wrote: > > It happens when I try to insert rows: > > insert into table1 (col1, col2, col3) values (val1, > val2, val3); > > I have an insert/update trigger on that table, and the > plpythonu function just sends a notification email. > Here's the func

Re: [GENERAL] PostgreSQL release schedule

2005-05-25 Thread Robert Treat
On Tuesday 24 May 2005 23:49, Tom Lane wrote: > Bruno Wolff III <[EMAIL PROTECTED]> writes: > > "Marc G. Fournier" <[EMAIL PROTECTED]> wrote: > >> Estimate right now for going beta on 8.1 is July 1st ... aiming for a > > > > Isn't that feature freeze? Typically there has been a month between > >

Re: [GENERAL] Compiling Postgresql 8.0.3 on Solaris 10

2005-05-25 Thread Mohan, Ross
After 5 seconds of intense thought, I suggest that you check the privileges on your compiler stuff. Please keep posting and let us know how you fared. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Aly Dharshi Sent: Wednesday, May 25, 2005 4:12 PM To

[GENERAL] survey of the postgresql communiity

2005-05-25 Thread Si Chen
Hi everyone. My company (opensourcestrategies.com) is conducting a study of the PostgreSQL community to promote better understanding of open source software. We're trying to help people better understand: 1. the motivations behind contributing to open source software; and 2. dynamics betwee

[GENERAL] Compiling Postgresql 8.0.3 on Solaris 10

2005-05-25 Thread Aly Dharshi
Hello Folks, I hope that you are well. I tried compiling Postgres 8.0.3 on Solaris 10 and encountered the following problem, has anybody else had problems. I know that I have gcc3 installed and working, compiled apache with it as well as a small test program. This is a Sun Blade 150 with abou

Re: [GENERAL] plpython error since upgrading from 7.x to 8.x

2005-05-25 Thread CSN
It happens when I try to insert rows: insert into table1 (col1, col2, col3) values (val1, val2, val3); I have an insert/update trigger on that table, and the plpythonu function just sends a notification email. Here's the function: if TD["new"]["active"] != TD["old"]["active"]: import

Re: [GENERAL] triggers/functions across databases

2005-05-25 Thread Mike Nolan
> If you have databases that are dependent on each others data you should > probably move those databases into a new schema within one database... That's a non-trivial task, especially if some of the tables in the two databases have the same name. -- Mike Nolan ---(end o

Re: [GENERAL] triggers/functions across databases

2005-05-25 Thread Joshua D. Drake
Mike Nolan wrote: If you have databases that are dependent on each others data you should probably move those databases into a new schema within one database... That's a non-trivial task, especially if some of the tables in the two databases have the same name. Migrating from one database t

Re: [GENERAL] triggers/functions across databases

2005-05-25 Thread Joshua D. Drake
Eric Jones wrote: We are migrating from Informix to Postgres 7.4.7 and are having a difficult time finding if postgres can insert/update tables across different databases. Namely using functions/triggers when an update/insert is performed on a table it updates/inserts in a table on a different

Re: [GENERAL] Using PG 8.0 with OpenSSL

2005-05-25 Thread Joshua D. Drake
My PG running with OpenSSL and I have no problems connecting from my laptop (running the client) to my desktop (running the server) over ethernet. But I wish, that PG use certificated connections. I've create certificates for every user (all user are in pg_hba.conf with hostssl), but I didn'

[GENERAL] Advice

2005-05-25 Thread Manuel García
Hi, I am Manuel and I want to catch the full sentence executed on one table, at the moment I have one function in C, that function is  invoking by  trigger, but I need to catch the full sentence, by example insert into tempo values (1,2,’x’) or update tempo set a=2, b=’x’ where a=3 or delet

Re: [GENERAL] Update on tables when the row doesn't change

2005-05-25 Thread Martijn van Oosterhout
On Wed, May 25, 2005 at 08:41:23AM -0700, Tim Vadnais wrote: > Hi All, > > Can someone please address this aspect of Sebastian's email? I, too, am > interested in the response. > > >> Why does Postgres perform an update on the table even > >> if no data changes? > >> Can I circumvent this behav

Re: [GENERAL] Update on tables when the row doesn't change

2005-05-25 Thread Scott Marlowe
On Wed, 2005-05-25 at 10:41, Tim Vadnais wrote: > >> Why does Postgres perform an update on the table even > >> if no data changes? > >> Can I circumvent this behaviour of Postgres? > >> > Hi All, > > Can someone please address this aspect of Sebastian's email? I, too, am > interested in the re

Re: [GENERAL] triggers/functions across databases

2005-05-25 Thread Richard Huxton
Eric Jones wrote: We are migrating from Informix to Postgres 7.4.7 and are having a difficult time finding if postgres can insert/update tables across different databases. Namely using functions/triggers when an update/insert is performed on a table it updates/inserts in a table on a different

Re: [GENERAL] More detailed error logging?

2005-05-25 Thread Himanshu Baweja
check out http://www.postgresql.org/docs/8.0/static/runtime-config.html   there are a couple of logging parameters which can log almost everything u want :)   Regards Himanshu__Do You Yahoo!?Tired of spam? Yahoo! Mail has the best spam protection

Re: [GENERAL] triggers/functions across databases

2005-05-25 Thread Scott Marlowe
On Wed, 2005-05-25 at 07:08, Eric Jones wrote: > We are migrating from Informix to Postgres 7.4.7 and are having a > difficult time finding if postgres can insert/update tables across > different databases. Namely using functions/triggers when an > update/insert is performed on a table it update

Re: [GENERAL] Update on tables when the row doesn't change

2005-05-25 Thread Tim Vadnais
Hi All, Can someone please address this aspect of Sebastian's email? I, too, am interested in the response. >> Why does Postgres perform an update on the table even >> if no data changes? >> Can I circumvent this behaviour of Postgres? Tim -Original Message- From: [EMAIL PROTECTED] [m

Re: [GENERAL] Problem merging two rows into same primary key

2005-05-25 Thread Andrus
"Patrik Kudo" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi and thanks for your reply! > > Martijn van Oosterhout wrote: >>>Now to the problem. We want to merge rows with id = 2 and id = 4 into id >>>= 1 in the asdf table with the qwert table beeing updated to reflect the >>>ch

[GENERAL] triggers/functions across databases

2005-05-25 Thread Eric Jones
We are migrating from Informix to Postgres 7.4.7 and are having a difficult time finding if postgres can insert/update tables across different databases. Namely using functions/triggers when an update/insert is performed on a table it updates/inserts in a table on a different database. Informix

Re: [GENERAL] Update on tables when the row doesn't change

2005-05-25 Thread Sebastian Böck
Ragnar Hafstað wrote: On Wed, 2005-05-25 at 13:09 +0200, Sebastian Böck wrote: Dawid Kuroczko wrote: Be wary of the NULL values though. :) Either don't use them, add something like 'AND (text1 <> NEW.text1 OR text1 IS NULL OR NEW.text1 IS NULL)' or something more complicated. :) Thanks fo

Re: [GENERAL] postmaster fails to start

2005-05-25 Thread Tom Lane
"Dweck Nir" <[EMAIL PROTECTED]> writes: > LOG: database system was not properly shut down; automatic recovery in = > progress > LOG: redo starts at 1/A500075C > PANIC: btree_delete_page_redo: lost target page This seems closely related to the problem discussed in this recent thread: http://arch

Re: [GENERAL] Update on tables when the row doesn't change

2005-05-25 Thread Ragnar Hafstað
On Wed, 2005-05-25 at 13:09 +0200, Sebastian Böck wrote: > Dawid Kuroczko wrote: > > > > > Be wary of the NULL values though. :) Either don't use them, add > > something like 'AND (text1 <> NEW.text1 OR text1 IS NULL OR NEW.text1 > > IS NULL)' or something more complicated. :) > > Thanks for th

Re: [GENERAL] plpython error since upgrading from 7.x to 8.x

2005-05-25 Thread Michael Fuhr
On Wed, May 25, 2005 at 02:04:22AM -0700, CSN wrote: > > I had a plpythonu function that worked in 7.x but > since upgrading to 8.x it's giving this error: > > ERROR: plpython: function "notify" failed > DETAIL: exceptions.TypeError: unsubscriptable object Could you post a simple, self-containe

Re: [GENERAL] Update on tables when the row doesn't change

2005-05-25 Thread Sebastian Böck
Dawid Kuroczko wrote: Control question, I didn't check it, but would it be enough to change from: UPDATE join1 SET text1 = NEW.text1 WHERE id = OLD.id; to: UPDATE join1 SET text1 = NEW.text1 WHERE id = OLD.id AND text1 <> NEW.text1? ... I may be wrong. :) Yes, thats more elegant then my

Re: [GENERAL] Update on tables when the row doesn't change

2005-05-25 Thread Dawid Kuroczko
On 5/25/05, Sebastian Böck <[EMAIL PROTECTED]> wrote: > >>CREATE OR REPLACE FUNCTION upd (view_test) RETURNS VOID AS $$ > >>DECLARE > >>NEW ALIAS FOR $1; > >>BEGIN > >>RAISE NOTICE 'UPDATE'; > >>UPDATE test SET test = NEW.test WHERE id

Re: [GENERAL] Update on tables when the row doesn't change

2005-05-25 Thread Sebastian Böck
Martijn van Oosterhout wrote: Well, I havn't run the rule so I don't know exactly whether it is relevent, but simply put, RULEs are like *macro substitution*. In macros, if you specify an expression (like a view) as an argument, it is placed as a whole each place the argument is used. Yes I und

Re: [GENERAL] postmaster fails to start

2005-05-25 Thread Dweck Nir
hi, 1) when the postmaster was started the first time, it was just a matter of .pid file not being erased, since the machine was restarted. There was no other postmaster running. 2) all the WAL configurations are as default: #---

[GENERAL] plpython error since upgrading from 7.x to 8.x

2005-05-25 Thread CSN
I had a plpythonu function that worked in 7.x but since upgrading to 8.x it's giving this error: ERROR: plpython: function "notify" failed DETAIL: exceptions.TypeError: unsubscriptable object plpythonu IS installed in the database in which I'm trying to use the function. Any idea what the probl

Re: [GENERAL] postmaster fails to start

2005-05-25 Thread Richard Huxton
Dweck Nir wrote: Hi, I need urgent help. I am using PostgreSQL version 8.0.1. postmaster fails to start and the log file looks as follow: LOG: database system was shut down at 2005-05-24 15:50:46 MSD LOG: checkpoint record is at 1/8D117BE4 LOG: redo record is at 1/8D117BE4; undo record is at

Re: [GENERAL] More detailed error logging?

2005-05-25 Thread Richard Huxton
CSN wrote: Is it possible to have the database name, datetime, and maybe even the query itself show up in pgsql's error log? Plenty of options to log all sorts of info. See the manuals chapter "16.4.6. Error Reporting and Logging" for details. You can even increase detail settings in one par

Re: [GENERAL] Update on tables when the row doesn't change

2005-05-25 Thread Martijn van Oosterhout
Well, I havn't run the rule so I don't know exactly whether it is relevent, but simply put, RULEs are like *macro substitution*. In macros, if you specify an expression (like a view) as an argument, it is placed as a whole each place the argument is used. UPDATEs for different tables cannot be mer

[GENERAL] More detailed error logging?

2005-05-25 Thread CSN
Is it possible to have the database name, datetime, and maybe even the query itself show up in pgsql's error log? Thanks, CSN __ Do you Yahoo!? Yahoo! Small Business - Try our new Resources site http://smallbusiness.yahoo.com/resources/ ---

Re: [GENERAL] postmaster fails to start

2005-05-25 Thread Richard Huxton
I've taken the liberty of rearranging your email slightly. Dweck Nir wrote: The sequence of events was as follow: 1) computer was shut down without stopping postmaster. OK - not good. Some crucial questions: 1. Do you have fsync enabled or disabled in the postgresql.conf file? 2. Do you know w

Re: [GENERAL] Update on tables when the row doesn't change

2005-05-25 Thread Sebastian Böck
Dawid Kuroczko wrote: On 5/24/05, Sebastian Böck <[EMAIL PROTECTED]> wrote: /* 3rd way of separating updates con: unnecessary updates on tables pro: view gets evaluated only 1 time Not adressing the problem of unnecessary updates, but the view gets only evaluated one time. */ CREATE

[GENERAL] postmaster fails to start

2005-05-25 Thread Dweck Nir
Title: postmaster fails to start Hi, I need urgent help. I am using PostgreSQL version 8.0.1. postmaster fails to start and the log file looks as follow: LOG:  database system was shut down at 2005-05-24 15:50:46 MSD LOG:  checkpoint record is at 1/8D117BE4 LOG:  redo record is at 1/8D1

Re: [GENERAL] Update on tables when the row doesn't change

2005-05-25 Thread Dawid Kuroczko
On 5/24/05, Sebastian Böck <[EMAIL PROTECTED]> wrote: > /* 3rd way of separating updates >con: unnecessary updates on tables >pro: view gets evaluated only 1 time > >Not adressing the problem of unnecessary updates, but the view >gets only evaluated one time. > > */ > > CREATE OR

Re: [GENERAL] Update on tables when the row doesn't change

2005-05-25 Thread Richard Huxton
Tom Lane wrote: =?ISO-8859-1?Q?Sebastian_B=F6ck?= <[EMAIL PROTECTED]> writes: Why does Postgres perform updates to tables, even if the row doesn't change at all? Because testing for this would almost surely be a net loss for the vast majority of applications. Checking to see if the new row