<?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>AprilChild &#187; PostgreSQL</title>
	<atom:link href="http://www.april-child.com/blog/category/postgresql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.april-child.com/blog</link>
	<description>Insignificant Tagline</description>
	<lastBuildDate>Tue, 13 Apr 2010 18:42:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Online collaboration back on&#8230; Work on a document with your colleague</title>
		<link>http://www.april-child.com/blog/2010/04/13/online-collaboration-back-on-work-on-a-document-with-your-colleague/</link>
		<comments>http://www.april-child.com/blog/2010/04/13/online-collaboration-back-on-work-on-a-document-with-your-colleague/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 18:42:42 +0000</pubDate>
		<dc:creator>p</dc:creator>
				<category><![CDATA[Amy]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PostgreSQL]]></category>

		<guid isPermaLink="false">http://www.april-child.com/blog/?p=69</guid>
		<description><![CDATA[Amy Editor is having all the nice collaboration features back on!]]></description>
			<content:encoded><![CDATA[<p>
I managed to get some time dedicated to finish the procedure of web hosting switch, enabled plpgsql in a PostgreSQL database (still love ya, despite all that NoSQL wave) and here we go: Amy Editor is having all the nice collaboration features back on! You may even decide to create an accout (or use one from FB) and keep track of your often misused colleagues helping you with programming or any other writing stuff :). All available from the editor&#8217;s menu.
</p>
<p>
Please keep in mind, I&#8217;m not developing the editor for almost 3 years, I&#8217;m not here for technical support, the sources are at GitHub (<a href="http://github.com/aprilchild">github.com/aprilchild</a>) and even though there&#8217;s no license specified in the code, it&#8217;s sort of like MIT. In other words &#8211; you&#8217;re hereby free to do whatever you&#8217;d like with it. Including commercial use. I don&#8217;t mind, have fun:).
</p>
<p>P.S. &#8211; something&#8217;s cooking, something far better than this old Amy Editor. In the same field, but &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.april-child.com/blog/2010/04/13/online-collaboration-back-on-work-on-a-document-with-your-colleague/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>tsearch2-utf8-czech &#8211; Czech UTF-8 support for Tsearch2 PostgreSQL 8.2+</title>
		<link>http://www.april-child.com/blog/2007/06/25/tsearch2-utf8-czech-czech-utf-8-support-for-tsearch2-postgresql-82/</link>
		<comments>http://www.april-child.com/blog/2007/06/25/tsearch2-utf8-czech-czech-utf-8-support-for-tsearch2-postgresql-82/#comments</comments>
		<pubDate>Mon, 25 Jun 2007 11:26:22 +0000</pubDate>
		<dc:creator>p</dc:creator>
				<category><![CDATA[Garuda]]></category>
		<category><![CDATA[PostgreSQL]]></category>

		<guid isPermaLink="false">http://www.april-child.com/blog/2007/06/25/tsearch2-utf8-czech-czech-utf-8-support-for-tsearch2-postgresql-82/</guid>
		<description><![CDATA[
Here goes quick and dirty manual for Czech UTF-8 fulltext support in PostgreSQL (8.2+). It&#8217;s quite possible, it will work with other languages as well. The important thing here is the UTF-8 support, apart from typical Latin2 (ISO-8859-2) settings which I was never fond of.


First you should set your server machine environment, that is set [...]]]></description>
			<content:encoded><![CDATA[<p>
Here goes quick and dirty manual for Czech UTF-8 fulltext support in PostgreSQL (8.2+). It&#8217;s quite possible, it will work with other languages as well. The important thing here is the <strong>UTF-8 support</strong>, apart from typical Latin2 (ISO-8859-2) settings which I was never fond of.
</p>
<p>
First you should set your server machine environment, that is set its locale. Launch the command <strong>locale -a</strong> to get a list of all supported locales. Here&#8217;s what my Mac box says:</p>
<p><code><br />
iMac:/usr/local/pgsql/bin postgres$ locale -a<br />
..<br />
..<br />
cs_CZ<br />
cs_CZ.ISO8859-2<br />
cs_CZ.UTF-8<br />
..<br />
..</p>
<p>sk_SK.UTF-8<br />
sl_SI<br />
sl_SI.ISO8859-2<br />
sl_SI.UTF-8<br />
sr_YU<br />
sr_YU.ISO8859-2<br />
sr_YU.ISO8859-5<br />
sr_YU.UTF-8<br />
sv_SE<br />
sv_SE.ISO8859-1<br />
sv_SE.ISO8859-15<br />
sv_SE.UTF-8<br />
tr_TR<br />
tr_TR.ISO8859-9<br />
tr_TR.UTF-8<br />
uk_UA<br />
uk_UA.ISO8859-5<br />
uk_UA.KOI8-U<br />
uk_UA.UTF-8<br />
..<br />
..<br />
C<br />
POSIX<br />
</code></p>
<p>
You should find your UTF-8 language there. I was looking for cs_CZ.UTF-8. Once found and confirmed, you should set it up to be your primary locale. Run <strong>locale</strong> and see what is your actual setting.
</p>
<p><code><br />
iMac:/usr/local/pgsql/bin postgres$ locale<br />
LANG="cs_CZ.UTF-8"<br />
LC_COLLATE="cs_CZ.UTF-8"<br />
LC_CTYPE="cs_CZ.UTF-8"<br />
LC_MESSAGES="cs_CZ.UTF-8"<br />
LC_MONETARY="cs_CZ.UTF-8"<br />
LC_NUMERIC="cs_CZ.UTF-8"<br />
LC_TIME="cs_CZ.UTF-8"<br />
LC_ALL="cs_CZ.UTF-8"<br />
</code></p>
<p>In order to change it (if it&#8217;s different than required), I&#8217;ve added the following to the ~/.bash_login file (this may vary on your system, consult Google for how to setup default locale on you machine).
</p>
<p><code><br />
iMac:/usr/local/pgsql/bin postgres$ vim ~/.bash_login </p>
<p>export LC_CTYPE=cs_CZ.UTF-8<br />
export LANG=cs_CZ.UTF-8<br />
export LANGUAGE=cs_CZ.UTF-8<br />
</code></p>
<p>Now you need to initialize postgres datadir with appropriate locale. In my case:
</p>
<p><code><br />
-- initialize<br />
/usr/local/pgsql/bin/initdb --locale=cs_CZ.UTF-8 /usr/local/pgsql/data<br />
-- and to create a database use:<br />
createdb -E UTF8 test<br />
</code></p>
<p>You are almost done, now install tsearch2 support to you database by running the <strong>tsearch2.sql</strong> script.
</p>
<p>Final step is to download my tsearch2-utf8-czech package and follow the instructions (you basically edit and launch the install.sql script on your database and test.sql to test tsearch2 support).
</p>
<p>
	Download the <a href="/blog-data/tsearch2-utf8-czech.tgz">tsearch2-utf8-czech</a> package (includes tsearch2.sql script and ispell dictionaries). <em>All examples of use and configuration are included in the packages</em>.
</p>
<p>
Links: <a href="http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/">Tsearch2 page</a>, <a href="http://www.pgsql.cz/index.php/TSearch2">Tsearch2 information in Czech</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.april-child.com/blog/2007/06/25/tsearch2-utf8-czech-czech-utf-8-support-for-tsearch2-postgresql-82/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running Ruby in PostgreSQL on Mac OS X</title>
		<link>http://www.april-child.com/blog/2007/05/10/running-ruby-in-postgresql-on-mac-os-x/</link>
		<comments>http://www.april-child.com/blog/2007/05/10/running-ruby-in-postgresql-on-mac-os-x/#comments</comments>
		<pubDate>Thu, 10 May 2007 08:05:22 +0000</pubDate>
		<dc:creator>p</dc:creator>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.april-child.com/blog/2007/05/10/running-ruby-in-postgresql-on-mac-os-x/</guid>
		<description><![CDATA[No doubt, PostgreSQL is the best open-source database system. You may argue about that, but there&#8217;s nothing else for you to do than accept it :-). Ruby, on the other hand, is love at the first sight language, so it&#8217;s seems natural to combine those two and become comfortable happy, uhmm ;-). I&#8217;ll show you [...]]]></description>
			<content:encoded><![CDATA[<p>No doubt, PostgreSQL is the best open-source database system. You may argue about that, but there&#8217;s nothing else for you to do than accept it :-). Ruby, on the other hand, is love at the first sight language, so it&#8217;s seems natural to combine those two and become comfortable happy, uhmm ;-). I&#8217;ll show you how to make this combination happen on OS X, compilation on other platforms is described somewhere else.</p>
<p><em>Compiled on: iMac 2.16 GHz, Intel Core 2 Duo, Mac OS X 10.4.9, Ruby 1.8.5 (2006-12-25 patchlevel 12) [i686-darwin8.8.1], PostgreSQL 8.1.8</em></p>
<p>Prerequisities: PostgreSQL installed from source (compiled &#8211; not difficult, and compiles smoothly), Ruby installed</p>
<ul>
<li>1. get the <a href="http://raa.ruby-lang.org/list.rhtml?name=pl-ruby">PL/Ruby package</a> by Guy Decoux. </li>
<li>2. ungzip the archive (double click will do, command-line fans &#8211; do whatever you like:-)</li>
<li>3. in Terminal enter the plruby-0.5.0 directory</li>
<li>4. type <tt>ruby extconf.rb --with-safe-level=0</tt></li>
<li>5. type <tt>make</tt></li>
<li>6. type <tt>sudo make install</tt></li>
<li>7. now PL/Ruby is installed, we need to create some PostgreSQL hook before starting to write our stored procedures/functions in Ruby.</li>
<li>8. enter the template1 database, which is used as template for newly created databases. type <tt>psql template1</tt></li>
<li>9. type <tt>create function plruby_call_handler() returns language_handler as '/usr/local/lib/ruby/site_ruby/1.8/i686-darwin8.8.1/plruby.bundle' language 'C';</tt></li>
<li>10. create language inside the database <tt>create language 'plruby' handler plruby_call_handler lancompiler 'PL/Ruby';  </tt></li>
<li>11. quit the console <tt>\q</tt>, you are set.
</ul>
<p>Now you might want to create new database that will include PL/Ruby language. If you want to add Ruby support to existing database, simply repeat steps 9 to 11 for your database.</p>
<p>Let&#8217;s see some action, we will write one simple stupid function used as multiplier, written in Ruby. *<strong>Sorry folks, I don&#8217;t know how to disable typographic apostrophes in Wordpres, you have to replace ` to &#8216; in the commands.</strong>*</p>
<p><code class="code"><br />
<strong>psql template1</strong><br />
Welcome to psql 8.1.8, the PostgreSQL interactive terminal.</p>
<p>Type:  \copyright for distribution terms<br />
       \h for help with SQL commands<br />
       \? for help with psql commands<br />
       \g or terminate with semicolon to execute query<br />
       \q to quit</p>
<p>template1=# <strong>create database rubytest;</strong><br />
CREATE DATABASE<br />
template1=# <strong>\c rubytest</strong><br />
You are now connected to database "rubytest".<br />
rubytest=# <strong>create or replace function ruby_multiply(integer) returns integer as 'return 2*args[0].to_i' language 'plruby';</strong><br />
CREATE FUNCTION<br />
rubytest=# <strong>select ruby_multiply(2);</strong><br />
 ruby_multiply<br />
----------<br />
      4<br />
(1 row)<br />
</code></p>
<p>More to be found at: <a href="http://www.robbyonrails.com/articles/2005/08/22/installing-untrusted-pl-ruby-for-postgresql">Installing untrusted PL/Ruby for PostgreSQL</a> and  <a href="http://www.robbyonrails.com/articles/2005/08/22/pl-ruby-loves-rubygems-and-drb">PL/Ruby loves RubyGems and DRb</a> by Robby Russel, and official <a href="http://moulon.inra.fr/ruby/plruby.html">PL/Ruby</a> project homepage.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.april-child.com/blog/2007/05/10/running-ruby-in-postgresql-on-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
