<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1326349109905024924</id><updated>2011-07-28T20:57:09.572-07:00</updated><category term='Python'/><category term='Mac OS X'/><category term='Ubuntu'/><category term='PostgreSQL'/><category term='WinStrom'/><category term='Linux'/><category term='psycopg2'/><category term='accounting'/><title type='text'>Sharpe's PostgreSQL Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sharpe-s-postgres.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1326349109905024924/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://sharpe-s-postgres.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Sharpe</name><uri>http://www.blogger.com/profile/04473603436448581483</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_7QAGRtmbr1w/SqJU1OOSAtI/AAAAAAAAAEk/zY-we72siTw/s1600-R/mainsharpepic.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1326349109905024924.post-3407265574740582812</id><published>2009-12-20T17:19:00.000-08:00</published><updated>2009-12-20T17:52:24.095-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WinStrom'/><category scheme='http://www.blogger.com/atom/ns#' term='PostgreSQL'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Mac OS X'/><category scheme='http://www.blogger.com/atom/ns#' term='accounting'/><title type='text'>How to access WinStrom database directly</title><content type='html'>&lt;a href="http://www.winstrom.eu/"&gt;WinStrom&lt;/a&gt; is software for book-keeping, currently supporting Czech and partially Slovak accounting rules. It is working not only on Windows, but also on Linux and Mac OS X.&lt;br /&gt;&lt;br /&gt;It uses PostgreSQL for data storage. Sometimes you could need to access its database directly, not via WinStrom application. Here is how to accomplish this task when using WinStrom version 10.&lt;br /&gt;&lt;br /&gt;I found access credentials in these configuration files:&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;/etc/winstrom/winstrom-server.xml&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;~/.winstrom/settings.xml&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here are settings for pgAdmin III:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_7QAGRtmbr1w/Sy7QibJtbQI/AAAAAAAAAFg/IxFYElBtTbk/s1600-h/Obrazovka-Server+127.0.0.1.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 283px; height: 400px;" src="http://3.bp.blogspot.com/_7QAGRtmbr1w/Sy7QibJtbQI/AAAAAAAAAFg/IxFYElBtTbk/s400/Obrazovka-Server+127.0.0.1.png" alt="" id="BLOGGER_PHOTO_ID_5417496691595898114" border="0" /&gt;&lt;/a&gt;Your specific maintenance DB (database name, in my case &lt;span style="font-weight: bold;"&gt;system_business__s__r__o_&lt;/span&gt;) you can get from this part of &lt;span style="font-family:courier new;"&gt;settings.xml&lt;/span&gt;:&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;&lt;entry&gt;     &lt;string&gt;company-127.0.0.1:5434&lt;/string&gt;&lt;br /&gt;    &lt;string&gt;system_business__s__r__o_&lt;/string&gt;&lt;/entry&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Other values are from &lt;span style="font-family:courier new;"&gt;winstrom-server.xml&lt;/span&gt;:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;properties&gt;&lt;/properties&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    &lt;comment&gt;WinStrom server configuration&lt;/comment&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    &lt;entry key="host"&gt;localhost&lt;/entry&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    &lt;entry key="port"&gt;5435&lt;/entry&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    &lt;entry key="user"&gt;dba&lt;/entry&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    &lt;entry key="password"&gt;&lt;/entry&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);font-family:courier new;" &gt;Password&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Alternatively, you can connect using text-based console (&lt;span style="font-weight: bold;font-family:courier new;" &gt;psql&lt;/span&gt;):&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;ostry@elitebook:~$ &lt;span style="font-weight: bold;"&gt;psql -h 127.0.0.1 -p 5435 -U dba -W -d system_business__s__r__o_&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Password for user dba: &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;psql (8.4.1)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;SSL connection (cipher: DHE-RSA-AES256-SHA, bits: 256)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Type "help" for help.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;system_business__s__r__o_=#&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Success!&lt;br /&gt;&lt;br /&gt;Now you are able to edit also fields, which are not writeable by WinStrom application itself, e.g. "&lt;span style="font-weight: bold;"&gt;datvyst&lt;/span&gt;" field of "&lt;span style="font-weight: bold;"&gt;dpolobch&lt;/span&gt;" table (dates of ordered items).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1326349109905024924-3407265574740582812?l=sharpe-s-postgres.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sharpe-s-postgres.blogspot.com/feeds/3407265574740582812/comments/default' title='Zverejniť komentáre'/><link rel='replies' type='text/html' href='http://sharpe-s-postgres.blogspot.com/2009/12/how-to-access-winstrom-database.html#comment-form' title='0 komentárov'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1326349109905024924/posts/default/3407265574740582812'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1326349109905024924/posts/default/3407265574740582812'/><link rel='alternate' type='text/html' href='http://sharpe-s-postgres.blogspot.com/2009/12/how-to-access-winstrom-database.html' title='How to access WinStrom database directly'/><author><name>Sharpe</name><uri>http://www.blogger.com/profile/04473603436448581483</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_7QAGRtmbr1w/SqJU1OOSAtI/AAAAAAAAAEk/zY-we72siTw/s1600-R/mainsharpepic.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_7QAGRtmbr1w/Sy7QibJtbQI/AAAAAAAAAFg/IxFYElBtTbk/s72-c/Obrazovka-Server+127.0.0.1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1326349109905024924.post-5951092040138663520</id><published>2009-09-06T07:38:00.000-07:00</published><updated>2009-09-06T07:47:51.369-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PostgreSQL'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><category scheme='http://www.blogger.com/atom/ns#' term='Mac OS X'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><category scheme='http://www.blogger.com/atom/ns#' term='psycopg2'/><title type='text'>How to install PostgreSQL module for Python</title><content type='html'>How to install psycopg2?&lt;br /&gt;&lt;br /&gt;On &lt;a href="http://www.ubuntu.com/"&gt;Ubuntu&lt;/a&gt;&lt;a href="http://www.ubuntu.com/"&gt; Linux&lt;/a&gt; (9.04):&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;sudo apt-get install python-psycopg2&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;On &lt;a href="http://www.apple.com/macosx/"&gt;Mac OS X&lt;/a&gt; (Leopard) - valid for PostgreSQL 8.4:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;export PATH="/Library/PostgreSQL/&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;8.4/bin:$PATH" &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; sudo easy_install -U setuptools&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;sudo easy_install psycopg2&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In case of problems, install &lt;a href="http://www.postgresql.org/"&gt;PostgreSQL&lt;/a&gt; first. Don't know how? Don't worry, it is pretty straightforward. &lt;a href="http://sharpe-s-postgres.blogspot.com/2009/09/how-to-install-and-configure-postgresql.html"&gt;For example on Linux&lt;/a&gt;, but also on &lt;a href="http://www.apple.com/macosx/"&gt;Mac OS X&lt;/a&gt; or Windows.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1326349109905024924-5951092040138663520?l=sharpe-s-postgres.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sharpe-s-postgres.blogspot.com/feeds/5951092040138663520/comments/default' title='Zverejniť komentáre'/><link rel='replies' type='text/html' href='http://sharpe-s-postgres.blogspot.com/2009/09/how-to-install-postgresql-module-for.html#comment-form' title='0 komentárov'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1326349109905024924/posts/default/5951092040138663520'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1326349109905024924/posts/default/5951092040138663520'/><link rel='alternate' type='text/html' href='http://sharpe-s-postgres.blogspot.com/2009/09/how-to-install-postgresql-module-for.html' title='How to install PostgreSQL module for Python'/><author><name>Sharpe</name><uri>http://www.blogger.com/profile/04473603436448581483</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_7QAGRtmbr1w/SqJU1OOSAtI/AAAAAAAAAEk/zY-we72siTw/s1600-R/mainsharpepic.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1326349109905024924.post-8004404769952872309</id><published>2009-09-05T05:32:00.000-07:00</published><updated>2009-09-08T00:29:27.804-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PostgreSQL'/><title type='text'>How to install and configure PostgreSQL server on Ubuntu Linux 9.04</title><content type='html'>&lt;h1&gt;Installation&lt;/h1&gt;&lt;span style="font-family:courier new;"&gt;sudo apt-get install postgresql&lt;/span&gt;&lt;br /&gt;&lt;h1&gt;Create database&lt;/h1&gt;&lt;span style="font-family:courier new;"&gt;sudo su postgres&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;psql&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;postgres=# CREATE DATABASE dsbis_db WITH ENCODING 'utf-8';&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;where dsbis_db is database name.&lt;br /&gt;&lt;h1&gt;Create database user&lt;/h1&gt;&lt;span style="font-family:courier new;"&gt;postgres=# CREATE ROLE dsbis_db_user LOGIN PASSWORD 'ojweod30';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;postgres=# ALTER DATABASE dsbis_db OWNER TO dsbis_db_user;&lt;/span&gt;&lt;br /&gt;&lt;h1&gt;Configure host-based authorization&lt;/h1&gt;If you need e.g. allow remote access to this database, you need to edit this configuration file: &lt;span style="font-family:courier new;"&gt;/etc/postgresql/8.3/main/pg_hba.conf&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;To be able to connect locally with your newly added database user, add this line:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;local   all         all                              md5&lt;/span&gt;&lt;br /&gt;possibly as replacement of this line:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;local   all         all                              ident sameuser&lt;/span&gt;&lt;br /&gt;if you do not want to allow connecting to database to all local users of your &lt;a href="http://en.wikipedia.org/wiki/Linux"&gt;Linux&lt;/a&gt; system.&lt;br /&gt;&lt;h1&gt;Restart database server&lt;/h1&gt;&lt;span style="font-family:courier new;"&gt;sudo /etc/init.d/postgresql-8.3 restart&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;NOTE:&lt;/span&gt; Now, you can set your newly created database login/password in your application settings and it should work. But remember, that if you application resides on another host, probably you will need to allow connections from it in pg_hba.conf (see section above, about host baset authorization).&lt;br /&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1326349109905024924-8004404769952872309?l=sharpe-s-postgres.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sharpe-s-postgres.blogspot.com/feeds/8004404769952872309/comments/default' title='Zverejniť komentáre'/><link rel='replies' type='text/html' href='http://sharpe-s-postgres.blogspot.com/2009/09/how-to-install-and-configure-postgresql.html#comment-form' title='0 komentárov'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1326349109905024924/posts/default/8004404769952872309'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1326349109905024924/posts/default/8004404769952872309'/><link rel='alternate' type='text/html' href='http://sharpe-s-postgres.blogspot.com/2009/09/how-to-install-and-configure-postgresql.html' title='How to install and configure PostgreSQL server on Ubuntu Linux 9.04'/><author><name>Sharpe</name><uri>http://www.blogger.com/profile/04473603436448581483</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://3.bp.blogspot.com/_7QAGRtmbr1w/SqJU1OOSAtI/AAAAAAAAAEk/zY-we72siTw/s1600-R/mainsharpepic.jpg'/></author><thr:total>0</thr:total></entry></feed>
