<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
<channel>
	<title>Comments for SimonOnSoftware</title>
	
	<link>http://simononsoftware.com</link>
	<description>programming, databases and other IT something</description>
	<lastBuildDate>Mon, 16 Apr 2012 11:50:23 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/CommentsForSimonOnSoftware" /><feedburner:info uri="commentsforsimononsoftware" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:browserFriendly></feedburner:browserFriendly><item>
		<title>Comment on Random String in PostgreSQL by Szymon</title>
		<link>http://simononsoftware.com/random-string-in-postgresql/comment-page-1/#comment-11352</link>
		<dc:creator>Szymon</dc:creator>
		<pubDate>Mon, 16 Apr 2012 11:50:23 +0000</pubDate>
		<guid isPermaLink="false">http://simononsoftware.com/?p=1203#comment-11352</guid>
		<description>That's not surprising, as this function does nothing with strings, it just uses arrays of characters, it really doesn't matter what the characters are.</description>
		<content:encoded><![CDATA[<p>That&#8217;s not surprising, as this function does nothing with strings, it just uses arrays of characters, it really doesn&#8217;t matter what the characters are.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Random String in PostgreSQL by Roman</title>
		<link>http://simononsoftware.com/random-string-in-postgresql/comment-page-1/#comment-11351</link>
		<dc:creator>Roman</dc:creator>
		<pubDate>Mon, 16 Apr 2012 11:38:10 +0000</pubDate>
		<guid isPermaLink="false">http://simononsoftware.com/?p=1203#comment-11351</guid>
		<description>-- FOR NATIONAL WORDS SAMPLE:
CREATE OR REPLACE FUNCTION random_string_bis(length INT) RETURNS TEXT
LANGUAGE PLPGSQL
AS $$
DECLARE		aAl 	text[] := '{0,1,2,3,4,5,6,7,8,9,А,Б,В,Г,Д,Е,Ё,Ж,З,И,Й,К,Л,М,Н,О,П,Р,С,Т,В,У,Ф,Х,Ц,Ч,Ш,Щ,Ъ,Ы,Ь,Э,Ю,Я}'; 
		res	text;	
begin
res := (select string_agg(aAl[(random()*44)::int], '') FROM generate_series(1,length) t(a));
return res;
end
$$;
select random_string_bis(50);

DROP FUNCTION IF EXISTS random_string_stat (INT, INT);
CREATE OR REPLACE FUNCTION random_string_stat(iLength INT, iLoops int) RETURNS interval
LANGUAGE PLPGSQL
AS $$
DECLARE		sRes		text;
		tsStart		timestamp;
		tsFinish	timestamp;
begin
tsStart	:= clock_timestamp();
FOR i IN 1..iLoops LOOP
	sRes := random_string_bis(iLength);
	-- sRes := random_string_pavel(iLength);
	-- sRes := random_text_md5(iLength);
	-- sRes := random_text_md5_v2(iLength);
  END LOOP;
tsFinish := clock_timestamp();
RETURN (tsFinish - tsStart)/iLoops;
end
$$;</description>
		<content:encoded><![CDATA[<p>&#8211; FOR NATIONAL WORDS SAMPLE:<br />
CREATE OR REPLACE FUNCTION random_string_bis(length INT) RETURNS TEXT<br />
LANGUAGE PLPGSQL<br />
AS $$<br />
DECLARE		aAl 	text[] := &#8216;{0,1,2,3,4,5,6,7,8,9,А,Б,В,Г,Д,Е,Ё,Ж,З,И,Й,К,Л,М,Н,О,П,Р,С,Т,В,У,Ф,Х,Ц,Ч,Ш,Щ,Ъ,Ы,Ь,Э,Ю,Я}&#8217;;<br />
		res	text;<br />
begin<br />
res := (select string_agg(aAl[(random()*44)::int], &#8221;) FROM generate_series(1,length) t(a));<br />
return res;<br />
end<br />
$$;<br />
select random_string_bis(50);</p>
<p>DROP FUNCTION IF EXISTS random_string_stat (INT, INT);<br />
CREATE OR REPLACE FUNCTION random_string_stat(iLength INT, iLoops int) RETURNS interval<br />
LANGUAGE PLPGSQL<br />
AS $$<br />
DECLARE		sRes		text;<br />
		tsStart		timestamp;<br />
		tsFinish	timestamp;<br />
begin<br />
tsStart	:= clock_timestamp();<br />
FOR i IN 1..iLoops LOOP<br />
	sRes := random_string_bis(iLength);<br />
	&#8211; sRes := random_string_pavel(iLength);<br />
	&#8211; sRes := random_text_md5(iLength);<br />
	&#8211; sRes := random_text_md5_v2(iLength);<br />
  END LOOP;<br />
tsFinish := clock_timestamp();<br />
RETURN (tsFinish &#8211; tsStart)/iLoops;<br />
end<br />
$$;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Virtualenv Tutorial by telminov</title>
		<link>http://simononsoftware.com/virtualenv-tutorial/comment-page-1/#comment-11110</link>
		<dc:creator>telminov</dc:creator>
		<pubDate>Mon, 09 Apr 2012 10:34:00 +0000</pubDate>
		<guid isPermaLink="false">http://simononsoftware.com/?p=801#comment-11110</guid>
		<description>It's good quality tutorial. Thank you!</description>
		<content:encoded><![CDATA[<p>It&#8217;s good quality tutorial. Thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Why Ruby on Rails Migrations Don’t Work by Guest</title>
		<link>http://simononsoftware.com/why-ruby-on-rails-migrations-dont-work/comment-page-1/#comment-9440</link>
		<dc:creator>Guest</dc:creator>
		<pubDate>Fri, 17 Feb 2012 16:48:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.simononsoftware.com/?p=580#comment-9440</guid>
		<description>Just a warning to future readers. Contrary to the vibe I get from this article, You should ALWAYS use uniqueness constraints on the DB as well as in the model. 
This, "No unique indexes in databases because they are not needed," is not a true statement. The model will work most of the time but it WILL NOT check for concurrent writes.

That is (at the same time):
 user_a = User.new(name =&gt; "foobar")
 user_b = User.new(name =&gt; "foobar")
will validate because neither of these have been saved to the DB yet thus they are both past the model validation.

so, without a DB unique contraint:
 user_a.save
 user_b.save
will result in both of these in the DB even though they identical.

It WILL happen (although probably very rarely) if you don't have unique constraints on the DB as well as the model.</description>
		<content:encoded><![CDATA[<p>Just a warning to future readers. Contrary to the vibe I get from this article, You should ALWAYS use uniqueness constraints on the DB as well as in the model.<br />
This, &#8220;No unique indexes in databases because they are not needed,&#8221; is not a true statement. The model will work most of the time but it WILL NOT check for concurrent writes.</p>
<p>That is (at the same time):<br />
 user_a = User.new(name =&gt; &#8220;foobar&#8221;)<br />
 user_b = User.new(name =&gt; &#8220;foobar&#8221;)<br />
will validate because neither of these have been saved to the DB yet thus they are both past the model validation.</p>
<p>so, without a DB unique contraint:<br />
 user_a.save<br />
 user_b.save<br />
will result in both of these in the DB even though they identical.</p>
<p>It WILL happen (although probably very rarely) if you don&#8217;t have unique constraints on the DB as well as the model.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PostgreSQL Versioning Policy by Simon</title>
		<link>http://simononsoftware.com/postgresql-versioning-policy/comment-page-1/#comment-7244</link>
		<dc:creator>Simon</dc:creator>
		<pubDate>Mon, 21 Nov 2011 18:12:16 +0000</pubDate>
		<guid isPermaLink="false">http://simononsoftware.com/?p=1377#comment-7244</guid>
		<description>@Filip yes indeed :) thanks for the link</description>
		<content:encoded><![CDATA[<p>@Filip yes indeed <img src='http://simononsoftware.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  thanks for the link</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PostgreSQL Versioning Policy by Filip</title>
		<link>http://simononsoftware.com/postgresql-versioning-policy/comment-page-1/#comment-7243</link>
		<dc:creator>Filip</dc:creator>
		<pubDate>Mon, 21 Nov 2011 18:05:37 +0000</pubDate>
		<guid isPermaLink="false">http://simononsoftware.com/?p=1377#comment-7243</guid>
		<description>obligatory rading: http://semver.org/ :-)</description>
		<content:encoded><![CDATA[<p>obligatory rading: <a href="http://semver.org/" rel="nofollow">http://semver.org/</a> <img src='http://simononsoftware.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to Ensure There is One Row… part 2 by Simon</title>
		<link>http://simononsoftware.com/how-to-ensure-there-is-one-row-part-2/comment-page-1/#comment-7051</link>
		<dc:creator>Simon</dc:creator>
		<pubDate>Thu, 10 Nov 2011 21:27:46 +0000</pubDate>
		<guid isPermaLink="false">http://simononsoftware.com/?p=1346#comment-7051</guid>
		<description>Yep, indeed, much better solution ;)
Thanks</description>
		<content:encoded><![CDATA[<p>Yep, indeed, much better solution <img src='http://simononsoftware.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to Ensure There is One Row… part 2 by daniel</title>
		<link>http://simononsoftware.com/how-to-ensure-there-is-one-row-part-2/comment-page-1/#comment-7033</link>
		<dc:creator>daniel</dc:creator>
		<pubDate>Wed, 09 Nov 2011 23:25:37 +0000</pubDate>
		<guid isPermaLink="false">http://simononsoftware.com/?p=1346#comment-7033</guid>
		<description>Better (becouse smaller):
CREATE UNIQUE INDEX i_test ON test (name) WHERE value = 'a';</description>
		<content:encoded><![CDATA[<p>Better (becouse smaller):<br />
CREATE UNIQUE INDEX i_test ON test (name) WHERE value = &#8216;a&#8217;;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Random String in PostgreSQL by Svend Hansen</title>
		<link>http://simononsoftware.com/random-string-in-postgresql/comment-page-1/#comment-6753</link>
		<dc:creator>Svend Hansen</dc:creator>
		<pubDate>Thu, 20 Oct 2011 14:35:31 +0000</pubDate>
		<guid isPermaLink="false">http://simononsoftware.com/?p=1203#comment-6753</guid>
		<description>Hi,
I like the pure SQL version, but it seems that when you added the numbers to the seed String array ([0-9][A-Z]), you forgot to change the '26' to '36' when randomly indexing into it (to take advantage of the full string) :)
Cheers,
   Svend.</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I like the pure SQL version, but it seems that when you added the numbers to the seed String array ([0-9][A-Z]), you forgot to change the &#8217;26&#8242; to &#8217;36&#8242; when randomly indexing into it (to take advantage of the full string) <img src='http://simononsoftware.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Cheers,<br />
   Svend.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PostGIS and Small Number of Huge Geometries by Simon</title>
		<link>http://simononsoftware.com/postgis-and-small-number-of-huge-geometries/comment-page-1/#comment-6638</link>
		<dc:creator>Simon</dc:creator>
		<pubDate>Wed, 12 Oct 2011 16:03:20 +0000</pubDate>
		<guid isPermaLink="false">http://simononsoftware.com/?p=1278#comment-6638</guid>
		<description>I've already done that :)</description>
		<content:encoded><![CDATA[<p>I&#8217;ve already done that <img src='http://simononsoftware.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss><!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Object Caching 605/634 objects using disk: basic

Served from: simononsoftware.com @ 2012-04-16 14:51:23 -->

