<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>select * from depesz; &#187; tnt</title>
	<atom:link href="http://www.depesz.com/tag/tnt/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.depesz.com</link>
	<description></description>
	<lastBuildDate>Mon, 07 May 2012 20:34:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Tips N&#8217; Tricks &#8211; getting sizes of relations without locks</title>
		<link>http://www.depesz.com/2011/12/20/tips-n-tricks-getting-sizes-of-relations-without-locks/</link>
		<comments>http://www.depesz.com/2011/12/20/tips-n-tricks-getting-sizes-of-relations-without-locks/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 16:23:02 +0000</pubDate>
		<dc:creator>depesz</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[locks]]></category>
		<category><![CDATA[pg_relation_size]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[size]]></category>
		<category><![CDATA[tnt]]></category>

		<guid isPermaLink="false">http://www.depesz.com/?p=2353</guid>
		<description><![CDATA[If you have production DB servers, chances are you&#8217;re running variant of these queries: SELECT SUM&#40;pg_relation_size&#40;oid&#41;&#41; FROM pg_class WHERE relkind = 'i' SELECT SUM&#40;pg_relation_size&#40;oid&#41;&#41; FROM pg_class WHERE relkind = 'r' To get summarized size of tables and/or indexes in your database (for example for graphing purposes). This (getting pg_relation_size for rows in pg_class) has one [...]]]></description>
		<wfw:commentRss>http://www.depesz.com/2011/12/20/tips-n-tricks-getting-sizes-of-relations-without-locks/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Tips n&#8217; Tricks &#8211; return nothing from PL/PgSQL function</title>
		<link>http://www.depesz.com/2011/05/03/tips-n-tricks-return-nothing-from-plpgsql-function/</link>
		<comments>http://www.depesz.com/2011/05/03/tips-n-tricks-return-nothing-from-plpgsql-function/#comments</comments>
		<pubDate>Tue, 03 May 2011 12:10:58 +0000</pubDate>
		<dc:creator>depesz</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[empty]]></category>
		<category><![CDATA[nothing]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[stackoverflow]]></category>
		<category><![CDATA[tnt]]></category>
		<category><![CDATA[void]]></category>

		<guid isPermaLink="false">http://www.depesz.com/?p=2156</guid>
		<description><![CDATA[Every now and then I need a function that returns nothing. As you perhaps know, even defining function as &#8220;RETURNS VOID&#8221; doesn&#8217;t fully solve the problem: $ BEGIN; CREATE FUNCTION testit&#40;&#41; RETURNS void AS $$ BEGIN RETURN; END; $$ LANGUAGE plpgsql; CREATE FUNCTION &#160; $ SELECT testit&#40;&#41;; testit -------- &#160; &#40;1 ROW&#41; 1 row?! Clearly [...]]]></description>
		<wfw:commentRss>http://www.depesz.com/2011/05/03/tips-n-tricks-return-nothing-from-plpgsql-function/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Tips N&#8217; Tricks &#8211; using GNU Screen as shell</title>
		<link>http://www.depesz.com/2010/08/30/tips-n-tricks-using-gnu-screen-as-shell/</link>
		<comments>http://www.depesz.com/2010/08/30/tips-n-tricks-using-gnu-screen-as-shell/#comments</comments>
		<pubDate>Mon, 30 Aug 2010 12:04:37 +0000</pubDate>
		<dc:creator>depesz</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[screen]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[tnt]]></category>

		<guid isPermaLink="false">http://www.depesz.com/?p=1824</guid>
		<description><![CDATA[I&#8217;m quite often doing stuff on remote machines, and quite frequently I start some long-running job, when I remember that I didn&#8217;t ran it via screen &#8211; so it will break, if my network connection will die. Is there any sane way to start screen automatically? YES. In manual to screen, you can find that [...]]]></description>
		<wfw:commentRss>http://www.depesz.com/2010/08/30/tips-n-tricks-using-gnu-screen-as-shell/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Tips N&#8217; Tricks &#8211; looking for value in all columns of a table</title>
		<link>http://www.depesz.com/2010/06/24/tips-n-tricks-looking-for-value-in-all-columns-of-a-table/</link>
		<comments>http://www.depesz.com/2010/06/24/tips-n-tricks-looking-for-value-in-all-columns-of-a-table/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 12:11:22 +0000</pubDate>
		<dc:creator>depesz</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[record]]></category>
		<category><![CDATA[row]]></category>
		<category><![CDATA[tnt]]></category>

		<guid isPermaLink="false">http://www.depesz.com/?p=1741</guid>
		<description><![CDATA[Every so often you might need to find a value regardless of which column it&#8217;s in. Of course not in application code, as this would be very slow. But you might be in situation where you just don&#8217;t know where did application get some value from, and you want to find it in table. Table [...]]]></description>
		<wfw:commentRss>http://www.depesz.com/2010/06/24/tips-n-tricks-looking-for-value-in-all-columns-of-a-table/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Tips n&#8217; tricks &#8211; rank on changes</title>
		<link>http://www.depesz.com/2010/05/13/tips-n-tricks-rank-on-changes/</link>
		<comments>http://www.depesz.com/2010/05/13/tips-n-tricks-rank-on-changes/#comments</comments>
		<pubDate>Thu, 13 May 2010 14:19:32 +0000</pubDate>
		<dc:creator>depesz</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[changes]]></category>
		<category><![CDATA[count]]></category>
		<category><![CDATA[lag]]></category>
		<category><![CDATA[nullif]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[rank]]></category>
		<category><![CDATA[tnt]]></category>
		<category><![CDATA[window functions]]></category>

		<guid isPermaLink="false">http://www.depesz.com/?p=1696</guid>
		<description><![CDATA[I got asked this: having this table: # select * from a order by d; t &#124; d ---+---- O &#124; 1 O &#124; 2 O &#124; 3 M &#124; 4 M &#124; 5 M &#124; 6 M &#124; 7 O &#124; 8 O &#124; 9 O &#124; 10 I &#124; 11 I &#124; 12 [...]]]></description>
		<wfw:commentRss>http://www.depesz.com/2010/05/13/tips-n-tricks-rank-on-changes/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Tips n&#8217; Tricks &#8211; using &#8220;wrong&#8221; index</title>
		<link>http://www.depesz.com/2010/04/15/tips-n-tricks-using-wrong-index/</link>
		<comments>http://www.depesz.com/2010/04/15/tips-n-tricks-using-wrong-index/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 09:37:03 +0000</pubDate>
		<dc:creator>depesz</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[index]]></category>
		<category><![CDATA[monotonic]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[tnt]]></category>

		<guid isPermaLink="false">http://www.depesz.com/?p=1662</guid>
		<description><![CDATA[More than once I&#8217;ve seen situation when there is a table, with serial primary key, and rows contain also some kind of creation timestamp, which is usually monotonic, or close to monotonic. Example of such case are for example comments or posts in forums &#8211; each get it&#8217;s ID, but they also have creation timestamp. [...]]]></description>
		<wfw:commentRss>http://www.depesz.com/2010/04/15/tips-n-tricks-using-wrong-index/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tips N’ Tricks &#8211; Generating readable reports with plain SQL</title>
		<link>http://www.depesz.com/2009/06/23/tips-n%e2%80%99-tricks-generating-readable-reports-with-plain-sql/</link>
		<comments>http://www.depesz.com/2009/06/23/tips-n%e2%80%99-tricks-generating-readable-reports-with-plain-sql/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 11:51:43 +0000</pubDate>
		<dc:creator>depesz</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[psql]]></category>
		<category><![CDATA[report]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[tnt]]></category>

		<guid isPermaLink="false">http://www.depesz.com/?p=1434</guid>
		<description><![CDATA[Let&#8217;s say you imported some data, but it contains duplicates. You will have to handle them in some way, but to make sensible choice on how to handle it, you need more information. So, let&#8217;s start. We have table: # \d users Table "public.users" Column &#124; Type &#124; Modifiers ------------+--------------------------+---------------------------------------------------- id &#124; integer &#124; not [...]]]></description>
		<wfw:commentRss>http://www.depesz.com/2009/06/23/tips-n%e2%80%99-tricks-generating-readable-reports-with-plain-sql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tips N’ Tricks &#8211; setting field based on order</title>
		<link>http://www.depesz.com/2008/10/30/tips-n%e2%80%99-tricks-setting-field-based-on-order/</link>
		<comments>http://www.depesz.com/2008/10/30/tips-n%e2%80%99-tricks-setting-field-based-on-order/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 15:50:25 +0000</pubDate>
		<dc:creator>depesz</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[sequence]]></category>
		<category><![CDATA[tnt]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://www.depesz.com/?p=1303</guid>
		<description><![CDATA[Let&#8217;s imagine following situation: create table test (id int4 primary key, priority int4); insert into test (id) select distinct (random() * 100000000)::int4 from generate_series(1,1000); Table test will now contain some (up to 1000) records, with random ids. Now, we want to update first 3 records (ordered by id) to have following values in priority: 10000 [...]]]></description>
		<wfw:commentRss>http://www.depesz.com/2008/10/30/tips-n%e2%80%99-tricks-setting-field-based-on-order/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tips N&#8217; Tricks &#8211; count of all and just some</title>
		<link>http://www.depesz.com/2008/10/08/tips-n-tricks-count-of-all-and-just-some/</link>
		<comments>http://www.depesz.com/2008/10/08/tips-n-tricks-count-of-all-and-just-some/#comments</comments>
		<pubDate>Wed, 08 Oct 2008 18:10:17 +0000</pubDate>
		<dc:creator>depesz</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[count]]></category>
		<category><![CDATA[group by]]></category>
		<category><![CDATA[nullif]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[tnt]]></category>

		<guid isPermaLink="false">http://www.depesz.com/?p=1293</guid>
		<description><![CDATA[Let&#8217;s assume you have very simple table with users: # \d users Table "public.users" Column &#124; Type &#124; Modifiers -----------+---------+---------------------------------------------------- id &#124; integer &#124; not null default nextval('users_id_seq'::regclass) username &#124; text &#124; not null is_active &#124; boolean &#124; not null default true Indexes: "users_pkey" PRIMARY KEY, btree (id) "users_username_key" UNIQUE, btree (username) And you&#8217;d like [...]]]></description>
		<wfw:commentRss>http://www.depesz.com/2008/10/08/tips-n-tricks-count-of-all-and-just-some/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>postgresql tips &amp; tricks</title>
		<link>http://www.depesz.com/2007/09/19/postgresql-tips-tricks-4/</link>
		<comments>http://www.depesz.com/2007/09/19/postgresql-tips-tricks-4/#comments</comments>
		<pubDate>Wed, 19 Sep 2007 14:30:31 +0000</pubDate>
		<dc:creator>depesz</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[tnt]]></category>

		<guid isPermaLink="false">http://www.depesz.com/index.php/2007/09/19/postgresql-tips-tricks-4/</guid>
		<description><![CDATA[cortilap @ freenode&#8217;s #postgresql asked about how to create a check() that will allow only one of the columns to be not null. it doesn&#8217;t sound cool, let&#8217;s see: with 2 columns (a,b) you make a check: check ( (a is not null and b is null) or (a is null and b is not [...]]]></description>
		<wfw:commentRss>http://www.depesz.com/2007/09/19/postgresql-tips-tricks-4/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>postgresql tips &amp; tricks</title>
		<link>http://www.depesz.com/2007/08/31/postgresql-tips-tricks-3/</link>
		<comments>http://www.depesz.com/2007/08/31/postgresql-tips-tricks-3/#comments</comments>
		<pubDate>Fri, 31 Aug 2007 09:19:18 +0000</pubDate>
		<dc:creator>depesz</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[order by]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[sort]]></category>
		<category><![CDATA[tnt]]></category>

		<guid isPermaLink="false">http://www.depesz.com/index.php/2007/08/31/postgresql-tips-tricks-3/</guid>
		<description><![CDATA[faber4 on irc asked about how to get ascii-based sorting, while his postgresql was initdb&#8217;ed with utf-8 based locale (en_US.UTF-8 to be exact). what can we do about it? first, let&#8217;s check if my environment is ok: # show lc_collate; lc_collate ------------- pl_PL.UTF-8 (1 row) looks file. pl_PL is not en_US, but it&#8217;s utf, so [...]]]></description>
		<wfw:commentRss>http://www.depesz.com/2007/08/31/postgresql-tips-tricks-3/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>postgresql tips &amp; tricks</title>
		<link>http://www.depesz.com/2007/08/29/postgresql-tips-tricks-2/</link>
		<comments>http://www.depesz.com/2007/08/29/postgresql-tips-tricks-2/#comments</comments>
		<pubDate>Wed, 29 Aug 2007 11:29:08 +0000</pubDate>
		<dc:creator>depesz</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[tnt]]></category>

		<guid isPermaLink="false">http://www.depesz.com/index.php/2007/08/29/postgresql-tips-tricks-2/</guid>
		<description><![CDATA[luckymurali_81 on freenodes #postgresql had a problem. his query returns data in wrong order. what can we do about it? his query: select yday.region,yday.yday,mtd.mtd,target.target from (SELECT dr.region,sum(f.collection) as yday FROM fact_collection f,dim_time dt,dim_region dr WHERE dt.bus_date=current_date-45 AND dt.time_id=f.time_id AND f.region_id=dr.region_id GROUP BY dr.region) as yday, (SELECT dr.region,sum(f.collection) as mtd FROM fact_collection f,dim_time dt, dim_region dr [...]]]></description>
		<wfw:commentRss>http://www.depesz.com/2007/08/29/postgresql-tips-tricks-2/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>postgresql tips &amp; tricks</title>
		<link>http://www.depesz.com/2007/07/10/postgresql-tips-tricks/</link>
		<comments>http://www.depesz.com/2007/07/10/postgresql-tips-tricks/#comments</comments>
		<pubDate>Tue, 10 Jul 2007 13:38:45 +0000</pubDate>
		<dc:creator>depesz</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[tnt]]></category>

		<guid isPermaLink="false">http://www.depesz.com/index.php/2007/07/10/postgresql-tips-tricks/</guid>
		<description><![CDATA[mage_ from #postgresql had interesting problem today. he has a table with 2 date fields, and he wants to have list of all years from both fields. together. as one list. his approach: select date_part('year', date1) from test union select date_part('year', date2) from test; is hardly satisfactory &#8211; it takes too long. any way to [...]]]></description>
		<wfw:commentRss>http://www.depesz.com/2007/07/10/postgresql-tips-tricks/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

