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
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 REPLACE
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
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
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
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 = OLD.id;
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
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 the notice, but
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 for
:[EMAIL PROTECTED] On Behalf Of Sebastian Böck
Sent: Tuesday, May 24, 2005 8:06 AM
To: pgsql-general@postgresql.org
Subject: [GENERAL] Update on tables when the row doesn't change
Hi all,
Maybe it's a very silly question, but why does Postgres perform an update on
the table even if no data changes
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 response.
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 behaviour of
Hi all,
maybe it's a very silly question, but why does Postgres perform an
update on the table even if no data changes?
I recognized this recently doing a rewrite of my rules because they
took to long. I had many conditional rules I collapsed to one
unconditional rule, so that the views get
I'm sure I'm not the only one, but, what are you talking about? RULEs
are not really obvious so it would help if you could post an example of
what you mean...
Have a nice day,
On Tue, May 24, 2005 at 05:05:34PM +0200, Sebastian Böck wrote:
Hi all,
maybe it's a very silly question, but why
Martijn van Oosterhout wrote:
I'm sure I'm not the only one, but, what are you talking about? RULEs
are not really obvious so it would help if you could post an example of
what you mean...
Have a nice day,
Hi, I'm not really talking about rules.
I'm talking about updates on *real* tables,
On 5/24/05, Sebastian Böck [EMAIL PROTECTED] wrote:
Martijn van Oosterhout wrote:
I'm sure I'm not the only one, but, what are you talking about? RULEs
are not really obvious so it would help if you could post an example of
what you mean...
Have a nice day,
Hi, I'm not really talking
Jaime Casanova wrote:
On 5/24/05, Sebastian Böck [EMAIL PROTECTED] wrote:
Martijn van Oosterhout wrote:
I'm sure I'm not the only one, but, what are you talking about? RULEs
are not really obvious so it would help if you could post an example of
what you mean...
I attach some sample SQL
Sorry, missed the SQL to test.
Sebastian
/* tables */
CREATE TABLE test (
id INTEGER PRIMARY KEY,
test TEXT NOT NULL
);
CREATE TABLE join1 (
id INTEGER PRIMARY KEY,
text1 TEXT NOT NULL
);
CREATE TABLE join2 (
id INTEGER PRIMARY KEY,
text2 TEXT
=?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 value exactly
equals
19 matches
Mail list logo