Search Postgresql Archives

Re: feature request for Postgresql Rule system.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2006-12-18 at 15:06 -0800, Richard Broersma Jr wrote:
> > None of A, C, I, or D say that you need to report a truthful update 
> > count.
> > 
> > The fact that the update count is wrong with updatable views is a known 
> > deficiency.
> 
> I see.  However, my my case I would like all of the sql statments in the rule to succeed and if
> they don't I would want none of them to succeed so that at least my data isn't partially changed. 
> Is there anyway to catch this?
> 

What I was trying to explain is that all of your statements *are*
succeeding. A WHERE clause in an UPDATE may match zero or more rows. The
second UPDATE in your rule matches zero rows.

For instance, you can do an UPDATE like:

UPDATE foo SET i = 1 WHERE ( 11 = 12 );

And that statement will succeed, but nothing in foo will change, because
eleven is never equal to twelve.

Similarly, your second UPDATE is succeeding but not changing anything,
thus PQcmdTuples() returns 0, and you see an "UPDATE 0".

You need to examine that UPDATE, because it's not doing what you expect.
Perhaps you have several int fields in each table, and you're comparing
against the wrong one in the WHERE clause? We need to see your table
definitions and perhaps some sample content to help you further.

Regards,
	Jeff Davis



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux