<?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>FSCK &#187; postgresql</title>
	<atom:link href="http://blog.fsck.hu/index.php/tag/postgresql/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.fsck.hu</link>
	<description>Everything Goes!</description>
	<lastBuildDate>Sun, 19 Jul 2009 17:49:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>FreeBSD + Postgresql</title>
		<link>http://blog.fsck.hu/index.php/2009/05/24/freebsd-postgresql/</link>
		<comments>http://blog.fsck.hu/index.php/2009/05/24/freebsd-postgresql/#comments</comments>
		<pubDate>Sun, 24 May 2009 11:32:00 +0000</pubDate>
		<dc:creator>Kerekes Attila</dc:creator>
				<category><![CDATA[BSD]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[postgresql]]></category>

		<guid isPermaLink="false">http://blog.fsck.hu/?p=5</guid>
		<description><![CDATA[Néha szükségünk lehet egy jó adatbázis szerverre az alkalmazásainkhoz. Hát itt egy rövid leírás, FreeBSDn hogyan tudjuk ezt összehozni. Mint ahogy azt a cím is mondja, postgresql-t fogunk használni:
[root@rogue ~]# cd /usr/ports/databases/postgresql84-server/
[root@rogue /usr/ports/databases/postgresql84-server]# make install clean
...
Ha végzett a folyamat, indítsuk el, és állítsuk be a szerverünket:
[root@rogue ~]# echo &#34;postgresql_enable=\&#34;YES\&#34;&#34; &#62;&#62; /etc/rc.conf
[root@rogue ~]# /usr/local/etc/rc.d/postgresql initdb
...
[root@rogue ~]# [...]]]></description>
			<content:encoded><![CDATA[<p>Néha szükségünk lehet egy jó adatbázis szerverre az alkalmazásainkhoz. Hát itt egy rövid leírás, FreeBSDn hogyan tudjuk ezt összehozni. Mint ahogy azt a cím is mondja, postgresql-t fogunk használni:</p>
<pre class="brush: plain;">[root@rogue ~]# cd /usr/ports/databases/postgresql84-server/
[root@rogue /usr/ports/databases/postgresql84-server]# make install clean
...</pre>
<p>Ha végzett a folyamat, indítsuk el, és állítsuk be a szerverünket:</p>
<pre class="brush: plain;">[root@rogue ~]# echo &quot;postgresql_enable=\&quot;YES\&quot;&quot; &gt;&gt; /etc/rc.conf
[root@rogue ~]# /usr/local/etc/rc.d/postgresql initdb
...
[root@rogue ~]# /usr/local/etc/rc.d/postgresql start</pre>
<p>Ezután mondjuk állítsunk be egy jelszót a pgsql usernek:</p>
<pre class="brush: plain;">[root@rogue ~]# su pgsql
[pgsql@rogue /root]$ psql templat1
...
template1=#ALTER ROLE pgsql PASSWORD 'jelszoide';
ALTER ROLE
template1=# \q

[pgsql@rogue /root]$</pre>
<p>Mostmár az azonosítást átállíthatjuk jelszavasra. A /usr/local/pgsql/data/pg_hba.conf-ot kell szerkesztenünk, hogy valami hasonló sorok legyenek a végén:</p>
<pre class="brush: plain;"># &quot;local&quot; is for Unix domain socket connections only
local   all         all                               md5
# IPv4 local connections:
host    all         all         127.0.0.1/32          md5
# IPv6 local connections:
host    all         all         ::1/128               md5
host    all         all         0.0.0.0/0             md5</pre>
<p>Majd indítsuk újra az adatbázis szervert:</p>
<pre class="brush: plain;">[root@rogue ~]# /usr/local/etc/rc.d/postgresql restart
...</pre>
<p>Mostmár létrehozhatunk magunknak egy adatbázist és hozzá egy felhasználót:</p>
<pre class="brush: plain;">[root@rogue ~]# su pgsql
[pgsql@rogue /root]$ createdb proba
Password:
[pgsql@rogue /root]$ createuser probauser -P
Enter password for new role:
Enter it again:
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) n
Shall the new role be allowed to create more new roles? (y/n) n
Password:
[pgsql@rogue /root]$ psql template1
Password:
Welcome to psql 8.3.7, the PostgreSQL interactive terminal.
...
template1=# GRANT ALL PRIVILEGES ON DATABASE proba to probauser;
GRANT
template1=# \q</pre>
<p>Próbáljuk is ki az új felhasználónkat az adatbázisunkon:</p>
<pre class="brush: plain;">[pgsql@rogue /root]$ psql -d proba -U probauser
Password for user probauser:
Welcome to psql 8.3.7, the PostgreSQL interactive terminal.
...
</pre>
<p>Remélem minden simán ment, és sikerült eljutni a végére :)<br />
Ajánlott irodalom:<br />
<a href="http://www.postgresql.org/docs/8.3/static/index.html" target="_blank">http://www.postgresql.org/docs/8.3/static/index.html</a></p>
<p>#eof</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fsck.hu/index.php/2009/05/24/freebsd-postgresql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
