<?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>Moki Systems Blog &#187; PostgreSQL</title>
	<atom:link href="http://www.mokisystems.com/blog/category/postgresql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mokisystems.com/blog</link>
	<description>Addressing such topics as: web programming, design, ruby on rails, cake php, postgresql, linux, seo</description>
	<lastBuildDate>Thu, 19 Aug 2010 00:18:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Postgresql Encoding &#8211; UTF8</title>
		<link>http://www.mokisystems.com/blog/postgresql-encoding-utf8/</link>
		<comments>http://www.mokisystems.com/blog/postgresql-encoding-utf8/#comments</comments>
		<pubDate>Mon, 09 Jun 2008 20:10:20 +0000</pubDate>
		<dc:creator>james</dc:creator>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[changing encoding]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[pg_dump]]></category>
		<category><![CDATA[postgres]]></category>
		<category><![CDATA[SQL_ASCII]]></category>
		<category><![CDATA[UTF-8]]></category>
		<category><![CDATA[UTF8]]></category>

		<guid isPermaLink="false">http://www.mokisystems.com/blog/postgresql-encoding-utf8/</guid>
		<description><![CDATA[Over the past many years I have been involved in projects requiring localization into many different languages.  One issue with this is how data is stored in the database.  
As we support and help various customers with Postgresql related database issues, we still find users who are encoding their databases in SQL_ASCII.  [...]]]></description>
			<content:encoded><![CDATA[<p>Over the past many years I have been involved in projects requiring localization into many different languages.  One issue with this is how data is stored in the database.  </p>
<p>As we support and help various customers with Postgresql related database issues, we still find users who are encoding their databases in SQL_ASCII.   Perhaps there is a reason for this, if there is I haven&#8217;t figured it out yet.  </p>
<p>In many cases, this eventually causes them problems and they end up having to switch from SQL_ASCII or some other encoding over to UTF8.  </p>
<p>There may be more, but I know of two different ways of converting the encoding of the database to UTF8.</p>
<p>One way is</p>

<div class="wp_syntax"><div class="code"><pre class="bash">iconv -f iso<span style="color: #000000;">-8859</span><span style="color: #000000;">-1</span> -t utf<span style="color: #000000;">-8</span> dump_file dump_file_recoded</pre></div></div>

<p>The preferred way however is to use the -E option of the pg_dump command like this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash">pg_dump -U postgres -W -E UTF8 -d pg_bench <span style="color: #000000; font-weight: bold;">&gt;</span>pgbench.backup.</pre></div></div>

<p>the -W command forces you to put in a password.</p>
<p>For more details on how to use the pg_dump command, here are the docs:</p>
<p><a href="http://www.postgresql.org/docs/8.3/interactive/app-pg_dump.html">http://www.postgresql.org/docs/8.3/interactive/app-pg_dump.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mokisystems.com/blog/postgresql-encoding-utf8/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Setting up Slony on Windows</title>
		<link>http://www.mokisystems.com/blog/setting-up-slony-on-windows/</link>
		<comments>http://www.mokisystems.com/blog/setting-up-slony-on-windows/#comments</comments>
		<pubDate>Tue, 13 May 2008 17:54:05 +0000</pubDate>
		<dc:creator>james</dc:creator>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Slony]]></category>
		<category><![CDATA[pgadmin]]></category>
		<category><![CDATA[pgadminIII]]></category>
		<category><![CDATA[postgresql replication]]></category>
		<category><![CDATA[postgresql windows]]></category>
		<category><![CDATA[Slony replication]]></category>
		<category><![CDATA[slony windows.]]></category>
		<category><![CDATA[slony1]]></category>
		<category><![CDATA[slonyI]]></category>

		<guid isPermaLink="false">http://www.mokisystems.com/blog/setting-up-slony-on-windows/</guid>
		<description><![CDATA[This isn&#8217;t intended to be a complete tutorial, but for those of us who have previously only run Slony on Linux, this might be a helpful post.

Install Slony
Configure pgAdmin file/options and set the slony path
G:\Program Files (x86)\PostgreSQL\8.2\share
Create the master db
create the slave db
Initialize the master database.  From the command line
pgbench.exe -U postgres -i pb
copy [...]]]></description>
			<content:encoded><![CDATA[<p>This isn&#8217;t intended to be a complete tutorial, but for those of us who have previously only run Slony on Linux, this might be a helpful post.<br />
<span id="more-12"></span></p>
<p>Install Slony</p>
<p>Configure pgAdmin file/options and set the slony path</p>
<p><code>G:\Program Files (x86)\PostgreSQL\8.2\share</code></p>
<p>Create the master db</p>
<p>create the slave db</p>
<p>Initialize the master database.  From the command line<br />
<code>pgbench.exe -U postgres -i pb</code></p>
<p>copy the master to the slave: from command line</p>
<p><code>pg_dump.exe  -U postgres -h localhost pb |psql =U postgres -h localhost pbslave</code></p>
<p>Add a new cluster on the master<img src="file:///C:/DOCUME%7E1/james/LOCALS%7E1/Temp/moz-screenshot-10.jpg" /></p>
<p><a href="http://www.mokisystems.com/blog/wp-content/uploads/2008/05/add_node_on_slave.bmp" title="add_cluster_on_master"><img src="http://www.mokisystems.com/blog/wp-content/uploads/2008/05/add_node_on_slave.bmp" alt="add_cluster_on_master" /></a></p>
<p>Add a node on the slave db</p>
<p><a href="http://www.mokisystems.com/blog/wp-content/uploads/2008/05/add_node_on_slave1.bmp" title="Add_node_on_slave"><img src="http://www.mokisystems.com/blog/wp-content/uploads/2008/05/add_node_on_slave1.bmp" alt="Add_node_on_slave" /></a></p>
<p style="margin-bottom: 0in">Add a path on both the master to the slave</p>
<p style="margin-bottom: 0in">host=localhost port=5432 dbname=pbslave user=postgres password=a</p>
<p style="margin-bottom: 0in">  <a href="http://www.mokisystems.com/blog/wp-content/uploads/2008/05/add_path_on_master.bmp" title="Add_path_on_master"><img src="http://www.mokisystems.com/blog/wp-content/uploads/2008/05/add_path_on_master.bmp" alt="Add_path_on_master" /></a></p>
<p style="margin-bottom: 0in">Add a path on the slave to the master</p>
<p style="margin-bottom: 0in">host=localhost port=5432 dbname=pb user=postgres password=a</p>
<p style="margin-bottom: 0in"><a href="http://www.mokisystems.com/blog/wp-content/uploads/2008/05/add_path_to_master.bmp" title="add_path_on_slave"><img src="http://www.mokisystems.com/blog/wp-content/uploads/2008/05/add_path_to_master.bmp" alt="add_path_on_slave" /></a></p>
<p style="margin-bottom: 0in">Add a replication set on the master</p>
<p style="margin-bottom: 0in"><a href="http://www.mokisystems.com/blog/wp-content/uploads/2008/05/add_replication_set.bmp" title="add_replication_set"><img src="http://www.mokisystems.com/blog/wp-content/uploads/2008/05/add_replication_set.bmp" alt="add_replication_set" /></a></p>
<p style="margin-bottom: 0in">&nbsp;</p>
<p style="margin-bottom: 0in">Add accounts, branches, tellers</p>
<p style="margin-bottom: 0in"><a href="http://www.mokisystems.com/blog/wp-content/uploads/2008/05/add_accounts.bmp" title="add_accounts"><img src="http://www.mokisystems.com/blog/wp-content/uploads/2008/05/add_accounts.bmp" alt="add_accounts" /></a></p>
<p style="margin-bottom: 0in">From the master Subscribe the slave</p>
<p style="margin-bottom: 0in">from the all tables set, right click subscribe set</p>
<p style="margin-bottom: 0in">&nbsp;</p>
<p style="margin-bottom: 0in">&nbsp;</p>
<p style="margin-bottom: 0in">Slony is configured, now we have to make windows start the engines correctly.</p>
<p style="margin-bottom: 0in">&nbsp;</p>
<p style="margin-bottom: 0in">Create two text files in <a href="file:///C:/slony">c:\slony</a></p>
<p style="margin-bottom: 0in">master.conf and slave.conf which look like this:</p>
<p><code>cluster_name='pgbench'<br />
conn_info='dbname=pgbench user=postgres password=a'<br />
</code></p>
<p style="margin-bottom: 0in">From the command line register the engines</p>
<p><code>slon -addengine slony g:\slony\slave.conf<br />
lon -addengine slony g:\slony\master.conf</code></p>
<p style="margin-bottom: 0in">if this hasn&#8217;t been done register slony as a service</p>
<p><code>slon -regservice slony</code></p>
<p>go to services and start slony</p>
<p>check event log for errors</p>
<p>if there are none then run a test from the master:</p>
<p><code>insert into accounts values (100001, 1, 0, 'test');</code></p>
<p style="margin-bottom: 0in">from the slave</p>
<p><code>select count(*) from accounts;</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mokisystems.com/blog/setting-up-slony-on-windows/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
