<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: update account set password = &#8216;new_password&#8217;; oops?!</title>
	<atom:link href="http://www.depesz.com/index.php/2007/07/27/update-account-set-password-new_password-oops/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.depesz.com/index.php/2007/07/27/update-account-set-password-new_password-oops/</link>
	<description></description>
	<lastBuildDate>Thu, 29 Jul 2010 21:40:44 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: &#60;/depesz&#62; &#187; Blog Archive &#187; rownum anyone? cumulative sum in one query?</title>
		<link>http://www.depesz.com/index.php/2007/07/27/update-account-set-password-new_password-oops/comment-page-1/#comment-19482</link>
		<dc:creator>&#60;/depesz&#62; &#187; Blog Archive &#187; rownum anyone? cumulative sum in one query?</dc:creator>
		<pubDate>Fri, 17 Aug 2007 08:40:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.depesz.com/index.php/2007/07/27/update-account-set-password-new_password-oops/#comment-19482</guid>
		<description>[...] as you can see it&#8217;s pretty simple. one important thing is that i use custom variable class - you have to define it in your postgresql.conf. as for how - check my previous posting. [...]</description>
		<content:encoded><![CDATA[<p>[...] as you can see it&#8217;s pretty simple. one important thing is that i use custom variable class &#8211; you have to define it in your postgresql.conf. as for how &#8211; check my previous posting. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: depesz</title>
		<link>http://www.depesz.com/index.php/2007/07/27/update-account-set-password-new_password-oops/comment-page-1/#comment-18839</link>
		<dc:creator>depesz</dc:creator>
		<pubDate>Wed, 01 Aug 2007 04:55:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.depesz.com/index.php/2007/07/27/update-account-set-password-new_password-oops/#comment-18839</guid>
		<description>@Xavier:
that&#039;s why there is before statement trigger.

i really think it would be good if you just tried the code. the problem you&#039;re describing doesn&#039;t exist.</description>
		<content:encoded><![CDATA[<p>@Xavier:<br />
that&#8217;s why there is before statement trigger.</p>
<p>i really think it would be good if you just tried the code. the problem you&#8217;re describing doesn&#8217;t exist.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xavier</title>
		<link>http://www.depesz.com/index.php/2007/07/27/update-account-set-password-new_password-oops/comment-page-1/#comment-18784</link>
		<dc:creator>Xavier</dc:creator>
		<pubDate>Tue, 31 Jul 2007 18:36:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.depesz.com/index.php/2007/07/27/update-account-set-password-new_password-oops/#comment-18784</guid>
		<description>No, I don&#039;t _want_ to do that, I&#039;m just saying that $_SHARED{&#039;count&#039;} will reference to the same variable across all three tables&#039; UPDATE statements, and so it could be a problem.</description>
		<content:encoded><![CDATA[<p>No, I don&#8217;t _want_ to do that, I&#8217;m just saying that $_SHARED{&#8216;count&#8217;} will reference to the same variable across all three tables&#8217; UPDATE statements, and so it could be a problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: depesz</title>
		<link>http://www.depesz.com/index.php/2007/07/27/update-account-set-password-new_password-oops/comment-page-1/#comment-18782</link>
		<dc:creator>depesz</dc:creator>
		<pubDate>Tue, 31 Jul 2007 18:00:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.depesz.com/index.php/2007/07/27/update-account-set-password-new_password-oops/#comment-18782</guid>
		<description>@Xavier:
no, it doesn&#039;t block the transaction. nor it was ever supposed to do so.
it is to block multi-row-updates. not multi-row-updateing-transactions.

if you want to block something like this, it&#039;s doable - let me know, i&#039;ll write it. on the other hand - i don&#039;t really see the point of blocking such transactions.</description>
		<content:encoded><![CDATA[<p>@Xavier:<br />
no, it doesn&#8217;t block the transaction. nor it was ever supposed to do so.<br />
it is to block multi-row-updates. not multi-row-updateing-transactions.</p>
<p>if you want to block something like this, it&#8217;s doable &#8211; let me know, i&#8217;ll write it. on the other hand &#8211; i don&#8217;t really see the point of blocking such transactions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xavier</title>
		<link>http://www.depesz.com/index.php/2007/07/27/update-account-set-password-new_password-oops/comment-page-1/#comment-18778</link>
		<dc:creator>Xavier</dc:creator>
		<pubDate>Tue, 31 Jul 2007 16:43:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.depesz.com/index.php/2007/07/27/update-account-set-password-new_password-oops/#comment-18778</guid>
		<description>I haven&#039;t tested that technique yet, but it looks as if it would block transactions trying  to update just one row in multiple tables to which the triggers are bound.

For example, if you bind these triggers to 3 tables (in order to protect them from mass-updates), and initiate a transaction, calling:
BEGIN;
UPDATE table1 SET field1 = val1 WHERE id = 1;
UPDATE table2 SET field2 = val2 WHERE id = 2;
UPDATE table3 SET field3 = val3 WHERE id = 3;
COMMIT;

I would expect it to die since it uses a shared counter for the trigger function. It would probably be better to create a hash-table to store one counter per table, and use the table-name as a hash key so you are preventing this.</description>
		<content:encoded><![CDATA[<p>I haven&#8217;t tested that technique yet, but it looks as if it would block transactions trying  to update just one row in multiple tables to which the triggers are bound.</p>
<p>For example, if you bind these triggers to 3 tables (in order to protect them from mass-updates), and initiate a transaction, calling:<br />
BEGIN;<br />
UPDATE table1 SET field1 = val1 WHERE id = 1;<br />
UPDATE table2 SET field2 = val2 WHERE id = 2;<br />
UPDATE table3 SET field3 = val3 WHERE id = 3;<br />
COMMIT;</p>
<p>I would expect it to die since it uses a shared counter for the trigger function. It would probably be better to create a hash-table to store one counter per table, and use the table-name as a hash key so you are preventing this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: depesz</title>
		<link>http://www.depesz.com/index.php/2007/07/27/update-account-set-password-new_password-oops/comment-page-1/#comment-18754</link>
		<dc:creator>depesz</dc:creator>
		<pubDate>Tue, 31 Jul 2007 05:35:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.depesz.com/index.php/2007/07/27/update-account-set-password-new_password-oops/#comment-18754</guid>
		<description>@krolik:
not really. if it&#039;s a tribute, then it&#039;s rather tribute to some anonymous (for me) soul from &quot;tbg&quot; which was setting &quot;vacation&quot; lately.</description>
		<content:encoded><![CDATA[<p>@krolik:<br />
not really. if it&#8217;s a tribute, then it&#8217;s rather tribute to some anonymous (for me) soul from &#8220;tbg&#8221; which was setting &#8220;vacation&#8221; lately.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: krolik</title>
		<link>http://www.depesz.com/index.php/2007/07/27/update-account-set-password-new_password-oops/comment-page-1/#comment-18723</link>
		<dc:creator>krolik</dc:creator>
		<pubDate>Mon, 30 Jul 2007 20:50:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.depesz.com/index.php/2007/07/27/update-account-set-password-new_password-oops/#comment-18723</guid>
		<description>Depesz: tribute to morr&#039;s mailsystem disaster ? ;-)</description>
		<content:encoded><![CDATA[<p>Depesz: tribute to morr&#8217;s mailsystem disaster ? <img src='http://www.depesz.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jakob</title>
		<link>http://www.depesz.com/index.php/2007/07/27/update-account-set-password-new_password-oops/comment-page-1/#comment-18698</link>
		<dc:creator>Jakob</dc:creator>
		<pubDate>Mon, 30 Jul 2007 14:57:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.depesz.com/index.php/2007/07/27/update-account-set-password-new_password-oops/#comment-18698</guid>
		<description>This is exactly what I expected to find out after reading the title o.us poetry. Thanks for informative article</description>
		<content:encoded><![CDATA[<p>This is exactly what I expected to find out after reading the title o.us poetry. Thanks for informative article</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: depesz</title>
		<link>http://www.depesz.com/index.php/2007/07/27/update-account-set-password-new_password-oops/comment-page-1/#comment-18530</link>
		<dc:creator>depesz</dc:creator>
		<pubDate>Fri, 27 Jul 2007 14:14:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.depesz.com/index.php/2007/07/27/update-account-set-password-new_password-oops/#comment-18530</guid>
		<description>thanks - i think i fixed then/than issue.</description>
		<content:encoded><![CDATA[<p>thanks &#8211; i think i fixed then/than issue.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Krzysztof Wilczynski</title>
		<link>http://www.depesz.com/index.php/2007/07/27/update-account-set-password-new_password-oops/comment-page-1/#comment-18521</link>
		<dc:creator>Krzysztof Wilczynski</dc:creator>
		<pubDate>Fri, 27 Jul 2007 11:58:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.depesz.com/index.php/2007/07/27/update-account-set-password-new_password-oops/#comment-18521</guid>
		<description>Excellent piece of code... thanks. By the way: sed &#039;s/then/than/&#039;; :-)</description>
		<content:encoded><![CDATA[<p>Excellent piece of code&#8230; thanks. By the way: sed &#8216;s/then/than/&#8217;; <img src='http://www.depesz.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>
