<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to TIPS</title><link>https://sourceforge.net/p/postgres-xc/xc-wiki/TIPS/</link><description>Recent changes to TIPS</description><atom:link href="https://sourceforge.net/p/postgres-xc/xc-wiki/TIPS/feed" rel="self"/><language>en</language><lastBuildDate>Fri, 27 Jun 2014 02:32:31 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/postgres-xc/xc-wiki/TIPS/feed" rel="self" type="application/rss+xml"/><item><title>TIPS modified by Koichi Suzuki</title><link>https://sourceforge.net/p/postgres-xc/xc-wiki/TIPS/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -1,4 +1,4 @@
-## = Show Table Distribution and Replication
+### Show Table Distribution and Replication

 The following statement shows each table's distribution/replication status. 

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Koichi Suzuki</dc:creator><pubDate>Fri, 27 Jun 2014 02:32:31 -0000</pubDate><guid>https://sourceforge.nete740d5308090119224edae02ca16af313791b88c</guid></item><item><title>TIPS modified by Koichi Suzuki</title><link>https://sourceforge.net/p/postgres-xc/xc-wiki/TIPS/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -5,3 +5,37 @@
      SELECT pg_class.relname, pgxc_class.pclocatortype,pgxc_class.pcattnum FROM
             pg_class, pgxc_class WHERE pg_class.oid = pgxc_class.pcrelid;

+
+The following is better: 
+    
+     SELECT pg_class.relname relation,
+            pgxc_class.pclocatortype distribution,
+            pg_attribute.attname attribute
+        FROM pg_class, pgxc_class, pg_attribute
+        WHERE pg_class.oid = pgxc_class.pcrelid
+              and pg_class.oid = pg_attribute.attrelid
+              and pgxc_class.pcattnum = pg_attribute.attnum
+     UNION
+     SELECT pg_class.relname relation,
+            pgxc_class.pclocatortype distribution,
+            'none' attribute
+        FROM pg_class, pgxc_class, pg_attribute
+        WHERE pg_class.oid = pgxc_class.pcrelid
+              and pg_class.oid = pg_attribute.attrelid
+              and pgxc_class.pcattnum = 0
+        ;
+    
+
+The result is like: 
+    
+      relation   | distribution | attribute 
+    -------------+--------------+-----------
+     table_five  | M            | a
+     table_four  | H            | a
+     table_one   | H            | a
+     table_seven | R            | none
+     table_six   | N            | none
+     table_three | H            | a
+     table_two   | H            | a
+    (7 rows)
+    
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Koichi Suzuki</dc:creator><pubDate>Fri, 27 Jun 2014 02:32:31 -0000</pubDate><guid>https://sourceforge.net2645a6e4b70775223a81647670712557977d428d</guid></item><item><title>TIPS modified by Koichi Suzuki</title><link>https://sourceforge.net/p/postgres-xc/xc-wiki/TIPS/</link><description>&lt;div class="markdown_content"&gt;&lt;h2 id="show-table-distribution-and-replication"&gt;= Show Table Distribution and Replication&lt;/h2&gt;
&lt;p&gt;The following statement shows each table's distribution/replication status. &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt; &lt;span class="n"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;pg_class&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;relname&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pgxc_class&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pclocatortype&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;pgxc_class&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pcattnum&lt;/span&gt; &lt;span class="n"&gt;FROM&lt;/span&gt;
        &lt;span class="n"&gt;pg_class&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pgxc_class&lt;/span&gt; &lt;span class="n"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;pg_class&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;oid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pgxc_class&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pcrelid&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Koichi Suzuki</dc:creator><pubDate>Fri, 27 Jun 2014 02:32:31 -0000</pubDate><guid>https://sourceforge.net62271e76b21e0c14299fd435108d0307b3151c74</guid></item></channel></rss>