<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Planet PostgreSQL (short)</title><link>http://planet.postgresql.org</link><description>Planet PostgreSQL (short)</description><lastBuildDate>Sun, 12 Feb 2012 09:45:54 GMT</lastBuildDate><generator>Planet PostgreSQL</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Mark Wong: PDXPUG: February meeting</title><link>http://pdxpug.wordpress.com/2012/02/10/pdxpug-february-meeting/</link><description>&lt;p&gt;&lt;strong&gt;When:&lt;/strong&gt; 7-9pm Thu Feb 16, 2012&lt;br /&gt;
&lt;strong&gt;Where:&lt;/strong&gt; Iovation&lt;br /&gt;
&lt;strong&gt;Who:&lt;/strong&gt; John Melesky&lt;br /&gt;
&lt;strong&gt;What:&lt;/strong&gt; Locks… etc.&lt;/p&gt;
&lt;p&gt;High-traffic systems have to deal with locks. That’s just the
way it is. But that’s okay! Locks invisibly help manage
concurrency! Properly structured transactions will never run into
deadlocks with each other! Right?&lt;/p&gt;
&lt;p&gt;Well, sometimes locks are very visible, and sometimes you end up
with deadlocks that don’t make sense. I’m going to talk through a
couple of row-locking problems i’ve run into, and explain how and
why that should end up changing PostgreSQL’s SQL syntax.&lt;/p&gt;
&lt;p&gt;John’s been poking computers since he was old enough to type,
which was long enough ago that he debated whether to make a
“POKEing” joke. He’s a Software Engineer at Janrain, working with
the reporting and analytics infrastructure.&lt;/p&gt;
&lt;p&gt;Our meeting will be held at Iovation, on the 32nd floor of the
US Bancorp Tower at 111 SW 5th (5th &amp;amp; Oak). It’s right on the
Green &amp;amp; Yellow Max lines. Underground bike parking is available
in the parking garage; outdoors all around the block in the usual
spots. No bikes in the office, sorry!&lt;/p&gt;
&lt;p&gt;Building security will close access to the floor at 7:30.&lt;/p&gt;
&lt;p&gt;After-meeting beer location TBD. See you there!&lt;/p&gt;
&lt;br /&gt;
&lt;a rel="nofollow" href=
"http://feeds.wordpress.com/1.0/gocomments/pdxpug.wordpress.com/66/"&gt;
&lt;img alt="" border="0" src=
"http://feeds.wordpress.com/1.0/comments/pdxpug.wordpress.com/66/" /&gt;
&lt;/a&gt; &lt;a rel="nofollow" href=
"http://feeds.wordpress.com/1.0/godelicious/pdxpug.wordpress.com/66/"&gt;
&lt;img alt="" border="0" src=
"http://feeds.wordpress.com/1.0/delicious/pdxpug.wordpress.com/66/" /&gt;
&lt;/a&gt; &lt;a rel="nofollow" href=
"http://feeds.wordpress.com/1.0/gofacebook/pdxpug.wordpress.com/66/"&gt;
&lt;img alt="" border="0" src=
"http://feeds.wordpress.com/1.0/facebook/pdxpug.wordpress.com/66/" /&gt;
&lt;/a&gt; &lt;a rel="nofollow" href=
"http://feeds.wordpress.com/1.0/gotwitter/pdxpug.wordpress.com/66/"&gt;
&lt;img alt="" border="0" src=
"http://feeds.wordpress.com/1.0/twitter/pdxpug.wordpress.com/66/" /&gt;
&lt;/a&gt; &lt;a rel="nofollow" href=
"http://feeds.wordpress.com/1.0/gostumble/pdxpug.wordpress.com/66/"&gt;
&lt;img alt="" border="0" src=
"http://feeds.wordpress.com/1.0/stumble/pdxpug.wordpress.com/66/" /&gt;
&lt;/a&gt; &lt;a rel="nofollow" href=
"http://feeds.wordpress.com/1.0/godigg/pdxpug.wordpress.com/66/"&gt;&lt;img alt=""
border="0" src=
"http://feeds.wordpress.com/1.0/digg/pdxpug.wordpress.com/66/" /&gt;&lt;/a&gt;
&lt;a rel="nofollow" href=
"http://feeds.wordpress.com/1.0/goreddit/pdxpug.wordpress.com/66/"&gt;&lt;img alt=""
border="0" src=
"http://feeds.wordpress.com/1.0/reddit/pdxpug.wordpress.com/66/" /&gt;&lt;/a&gt;
&lt;img alt="" border="0" src=
"http://stats.wordpress.com/b.gif?host=pdxpug.wordpress.com&amp;amp;blog=30930172&amp;amp;post=66&amp;amp;subd=pdxpug&amp;amp;ref=&amp;amp;feed=1"
width="1" height="1" /&gt;
</description><guid isPermaLink="false">http://pdxpug.wordpress.com/?p=66</guid><pubDate>Fri, 10 Feb 2012 22:05:29 GMT</pubDate></item><item><title>Jim Smith: Announcing the Arizona Postgres Users Group</title><link>http://www.postgresmigrations.com/blog/post/3336006</link><description>As mentioned in an earlier post, we're announcing the start of a
PUG for Arizona.&amp;nbsp; The first meeting will be Thursday, March
29, from 5 to 7 at Bull's facility in Northwest Phoenix.&amp;nbsp;
Refreshments will be provided.&lt;br /&gt;
&lt;br /&gt;
You can join and get onto the mailing list and RSVP for the first
meeting at &lt;a href=
"https://www.bigtent.com/groups/azpug"&gt;https://www.bigtent.com/groups/azpug&lt;/a&gt;&lt;br /&gt;

&lt;br /&gt;
We look forward to meeting other PostgreSQL lovers and to help grow
the PostgreSQL community in our part of the world.&amp;nbsp; Please
feel free to pass the above link to anyone that's interested.
</description><guid isPermaLink="true">http://www.postgresmigrations.com/blog/post/3336006</guid><pubDate>Thu, 09 Feb 2012 23:10:30 GMT</pubDate></item><item><title>Bruce Momjian: Virtualizing Postgres</title><link>http://momjian.us/main/blogs/pgblog/2012.html#February_9_2012</link><description>&lt;p&gt;Postgres is an ideal database to run in a virtual environment or
public/private cloud — one reason is that Postgres relies heavily
on the operating system, rather than using features like raw
devices. Second, its license is obviously very flexible for virtual
deployments.&lt;/p&gt;
&lt;p&gt;I am often asked about running Postgres in virtual environments,
and I usually answer that it runs just fine --- and it does.
However, I am starting to realize that I am not answering the more
complex questions of which visualization technology to choose, and
what is the performance and reliability impact of
virtualization.&lt;/p&gt;
&lt;p&gt;&lt;a href=
"http://momjian.us/main/blogs/pgblog/2012.html#February_9_2012"&gt;Continue
Reading »&lt;/a&gt;&lt;/p&gt;

</description><guid isPermaLink="false">http://momjian.us/main/blogs/pgblog/2012.html#February_9_2012</guid><pubDate>Thu, 09 Feb 2012 18:00:01 GMT</pubDate></item><item><title>Chris Travers: Further Response to Robert Young</title><link>http://ledgersmbdev.blogspot.com/2012/02/further-response-to-robert-young.html</link><description>Robert Young has &lt;a href="http://drcoddwasright.blogspot.com/2012/02/camel-passes-through-eye-of-needle.html"&gt;
responded&lt;/a&gt; to my previous post and clarified his position.&amp;nbsp;
However, he is still incorrect in his assessment.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class="tr_bq"&gt;&amp;nbsp; The issue is lost cycles as one
moves down to a single thread. It's more about the number of
clients that can be supported "simultaneously". At one time I was
also enamoured of thread count to execute queries in parallel; not
so much now. For reporting generally, and BI/DW specifically, sure.
But for OLTP, where my interest lies, not so much. There, client
count is what matters. Clients run relatively discrete transactions
on few rows; parallelism isn't much help for that sort of client.
Yes, to some extent I've changed my mind.&lt;/blockquote&gt;
I think this makes the mistake of assuming that single threaded
multiple process models cannot utilize hyperthreading architectures
to increase computational efficiency.&lt;br /&gt;
&lt;br /&gt;
The first thing to note is that how a CPU cycles are utilized is
primarily the job of the scheduler which is a part of any
multitasking kernel, and different operating systems utilize very
different process and thread models.&amp;nbsp; These cannot be merely
reduced to their hardware equivalents.&amp;nbsp; If they were we would
see process vs thread performance to be largely equivalent in
Windows and Linux, but in fact while Windows is very
thread-friendly and process-unfriendly, though my understanding is
that applications on Windows running under SUA experience better
multiprocess performance than under the Win32 subsystem.&lt;br /&gt;
&lt;br /&gt;
On Linux and UNIX there is very little difference between a pthread
and a process except for memory isolation.&amp;nbsp; Individual
processes can be scheduled on logical cores supporting
hyperthreading, for example.&amp;nbsp; The overhead for supporting
multiple processes is low.&lt;br /&gt;
&lt;br /&gt;
On the other hand, on Windows, threads are cheap and processes are
expensive.&amp;nbsp; This is one reason why I typically recommend that
high-concurrency &lt;a href="http://www.postgresql.org/"&gt;PostgreSQL&lt;/a&gt; instances are not run
on Windows.&amp;nbsp; My understanding is that SUA addresses this issue
but I can't find solid comparisons at the moment and I don't know
of a PostgreSQL port to[...]</description><guid isPermaLink="false">tag:blogger.com,1999:blog-3346090548501966296.post-5388637259321123062</guid><pubDate>Thu, 09 Feb 2012 01:47:46 GMT</pubDate></item><item><title>Robert Haas: My Patches Are Breeding</title><link>http://rhaas.blogspot.com/2012/02/my-patches-are-breeding.html</link><description>One of the great things about being a long-term contributor to an
open source project like PostgreSQL is that you get to see other
people take the stuff you've done and use it as a stepping stone to
bigger and better things. One of my early PostgreSQL hacking
projects was &lt;a href=
"http://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=d4382c4ae7ea1e272f4fee388aac8ff99421471a"&gt;
a patch to extend the syntax of EXPLAIN&lt;/a&gt;. Prior to 9.0, the
grammar looked &lt;a href=
"http://www.postgresql.org/docs/8.4/static/sql-explain.html"&gt;like
this&lt;/a&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;
EXPLAIN [ ANALYZE ] [ VERBOSE ] statement
&lt;/pre&gt;
&lt;br /&gt;
Now, there's nothing particularly wrong with that grammar from a
usability perspective, but it turns out to be pretty terrible for
extensibility.&amp;nbsp; Let's suppose we want to add a new EXPLAIN
option that does something new and different - say, omit the
costing information from the output. Then we have to change the
grammar to something like this:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;
EXPLAIN [ ANALYZE ] [ VERBOSE ] [ NOCOSTS ] statement
&lt;/pre&gt;
&lt;br /&gt;
There are a couple of problems with this. One is that, as the
number of options increases, it gets hard to remember the order in
which they must be specified.&amp;nbsp; You might think that it would
be easy enough to recode the grammar to look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;
EXPLAIN [ ANALYZE | VERBOSE | NOCOSTS ]... statement
&lt;/pre&gt;
&lt;br /&gt;
...and it might be, but it's surprisingly easy, when using bison,
to create situations that bison finds ambiguous, even though a
human being might not. Another problem is that NOCOSTS has to
become what's called a keyword, which has a very small but nonzero
distributed cost across our entire grammar. Rightly or wrongly, a
number of patches that proposed to enhance EXPLAIN in various ways
got shot down because of these issues.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=
"http://rhaas.blogspot.com/2012/02/my-patches-are-breeding.html#more"&gt;
Read more »&lt;/a&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width="1" height="1" src=
"https://blogger.googleusercontent.com/tracker/20038672-6386329063044399715?l=rhaas.blogspot.com"
alt="" /&gt;&lt;/div&gt;

</description><guid isPermaLink="false">tag:blogger.com,1999:blog-20038672.post-6386329063044399715</guid><pubDate>Wed, 08 Feb 2012 19:28:42 GMT</pubDate></item><item><title>Selena Deckelmann: Catching up with pgsql-hackers: CRCs, checkpoint performance, SKIP LOCKED ROWS, dry-run pg_archivecleanup</title><link>http://www.chesnok.com/daily/2012/02/07/catching-up-with-pgsql-hackers-crcs-checkpoint-performance-skip-locked-rows-dry-run-pg_archivecleanup/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=catching-up-with-pgsql-hackers-crcs-checkpoint-performance-skip-locked-rows-dry-run-pg_archivecleanup</link><description>&lt;div id="tweetbutton3686" class="tw_button"&gt;&lt;a href=
"http://twitter.com/share?url=http%3A%2F%2Fwww.chesnok.com%2Fdaily%2F2012%2F02%2F07%2Fcatching-up-with-pgsql-hackers-crcs-checkpoint-performance-skip-locked-rows-dry-run-pg_archivecleanup%2F&amp;amp;text=Catching%20up%20with%20pgsql-hackers%3A%20CRCs%2C%20checkpoint%20performance%2C%20SKIP%20LOCKED%20ROWS%2C%20dry-run%20pg_archivecleanup&amp;amp;related=selenamarie:Catching%20up%20with%20pgsql-hackers&amp;amp;lang=en&amp;amp;count=horizontal&amp;amp;counturl=http%3A%2F%2Fwww.chesnok.com%2Fdaily%2F2012%2F02%2F07%2Fcatching-up-with-pgsql-hackers-crcs-checkpoint-performance-skip-locked-rows-dry-run-pg_archivecleanup%2F"
class="twitter-share-button"&gt;Tweet&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;I’ve been sick for a few days, so I settled in with a nice cup
of tea and started in on the tremendous backlog I’ve got on
pgsql-hackers. I put patch status at the end of each paragraph.&lt;/p&gt;
&lt;p&gt;The first thread I read was a patch for &lt;a href=
"http://archives.postgresql.org/message-id/CA+U5nMJzQyxcObkpNAf1SYTX-gO_Mom3O9JXHnGpxRo1kXJ7ww@mail.gmail.com"&gt;
implementing 16-bit CRCs for all buffer pages&lt;/a&gt;. This is the most
recent patch in a multi-year effort around CRCs. There are many
small and large problems with implementing this (performance, hint
bits and cramped page header space for starters). If you read the
whole thread, you’ll see some interesting compromises, and the role
that pg_upgrade now plays in the stewardship of page format
changes. Patch is still under review.&lt;/p&gt;
&lt;p&gt;That lead me over to performance &lt;a href=
"http://archives.postgresql.org/pgsql-hackers/2012-01/msg00943.php"&gt;
testing results&lt;/a&gt; from what was titled as a double-write buffer
patch from VMWare. The author of these patches doesn’t respond to
comments in-line like everyone else on -hackers does, so it makes
his responses pretty difficult to keep track of. Still WIP.&lt;/p&gt;
&lt;p&gt;And, related a &lt;a href=
"http://archives.postgresql.org/pgsql-hackers/2012-01/msg00883.php"&gt;
checkpoint performance tuning treatise from Greg Smith&lt;/a&gt;. This
started from a patch to add a parameter that allows adding pause
time before a checkpoint. He points out that to tune this usefully,
you need to know what the number of files a checkpoint typically
syncs. (and &lt;a href=
"http://archives.postgresql.org/message-id/4F13C38D.2080905@2ndQuadrant.com"&gt;
has a related patch that publishes this information&lt;/a&gt;). Patches
are still under review.&lt;/p&gt;
&lt;p&gt;There’s another discussion about &lt;a href=
"http://archives.postgresql.org/message-id/CADLWmXUUjmrPU-+9ss7BCATxM-hr6__9mB6Wv7ry3-r+KXGgBw@mail.gmail.com"&gt;
SKIP LOCKED ROWS and a patch&lt;/a&gt;, apparently a commercial database
feature. Early WIP.&lt;/p&gt;
&lt;p&gt;In usability land, there was &lt;a href=
"http://archives.postgresql.org/message-id/4EE4C393.4060302@2ndQuadrant.it"&gt;
an addition of a “dry-run” feature to pg_archivecleanup&lt;/a&gt;. This
one’s committed!&lt;/p&gt;
&lt;p&gt;This all makes me so excited for the 9.2 release this year.
Also, great to see a bunch of new folks submitting patches.&lt;/p&gt;

</description><guid isPermaLink="false">http://www.chesnok.com/daily/?p=3686</guid><pubDate>Tue, 07 Feb 2012 16:25:04 GMT</pubDate></item><item><title>Chris Travers: Robert Young is Wrong about Threads and PostgreSQL</title><link>http://ledgersmbdev.blogspot.com/2012/02/robert-young-is-wrong-about-threads-and.html</link><description>Robert Young has claimed, not&amp;nbsp;&lt;a href="http://drcoddwasright.blogspot.com/2012/01/dont-thread-on-me.html"&gt;once&lt;/a&gt;
but &lt;a href="http://drcoddwasright.blogspot.com/2012/02/damn-you-damocles.html"&gt;
twice&lt;/a&gt;, that a multi-threaded engine is necessary for database
performance to be good enough.&amp;nbsp; I am going to explain here why
he is wrong.&lt;br /&gt;
&lt;br /&gt;
Mr Young's argument more or less goes something like this:&amp;nbsp;
threads are more efficient, processor-power-wise to spin up than
processes, and therefore if you insist on a single-threaded
multi-process model, you can't have sufficient performance to make
your database system relevant.&lt;br /&gt;
&lt;br /&gt;
There are several important problems with this thinking.&amp;nbsp; The
first is that for it to be significant, the thread vs process
overhead, plus related IPC, etc. must be a significant portion of
actual CPU load.&amp;nbsp; If this is not the case, the difference
largely gets lost in the noise.&amp;nbsp; In my experience in looking
at databases, I have yet to identify one case where this is the
case.&amp;nbsp; Instead things like network connection/teardown,
command parsing, and, well, actual work dwarf process/thread
startup cycles by several orders of magnitude.&amp;nbsp; This means
that the actual startup processing overhead is likely insignificant
in the overall scheme of things,&lt;br /&gt;
&lt;br /&gt;
Of course actually starting up a process or thread is not all there
is to the picture.&amp;nbsp; There's communication between processes or
threads to take into account.&amp;nbsp; There is also the added
complexity of locking shared resources in a threaded vs process
model.&amp;nbsp; And there are of course the costs that come with a
lack of process isolation on the other side.&amp;nbsp; These all have
to be weighed against eachother, and it is not clear who the winner
is.&amp;nbsp; In fact even these costs will dwarf the startup costs by
a significant margin.&lt;br /&gt;
&lt;br /&gt;
Rather the reason why many RDBMS's have gone to a multi-threaded
model is that it is one way, perhaps even an elegant way, to
support intraquery parallelism.&amp;nbsp; In other words if you can
spin up a few more threads in your process, those threads can be
conducting scans on different partitions in different table spaces,
and thus overall increasing the resource utilization of a given
query.&amp;nbsp; This is an important [...]</description><guid isPermaLink="false">tag:blogger.com,1999:blog-3346090548501966296.post-8279578337979786657</guid><pubDate>Tue, 07 Feb 2012 05:54:18 GMT</pubDate></item><item><title>Steve Singer: 10 years of PostgreSQL replication</title><link>http://scanningpages.wordpress.com/2012/02/06/10-years-of-postgresql-replication/</link><description>&lt;p&gt;February 6′th 2012 marks the 10 year anniversary of the open
source &lt;a href="http://archives.postgresql.org/pgsql-patches/2002-02/msg00004.php"  target="_blank"&gt;release&lt;/a&gt; of the DBMirror replication system.
DBMirror was not the first PostgreSQL replication solution to be
released but it was the first one I was involved with.&lt;/p&gt;
&lt;p&gt;In the summer of 2001 I was working for &lt;a href="http://www.navtech.aero"  target="_blank"&gt;Navtech System
Support&lt;/a&gt;, an aviation software company. We were using PostgreSQL
6.x to store data for one of our applications. We needed to have an
up to date copy of the database available on servers at a remote
site. We also needed a standby database server in case our primary
server failed.&lt;br /&gt;
&lt;span id="more-477"&gt;&lt;/span&gt;&lt;br /&gt;
PostgreSQL didn’t have any built in replication but it did have
triggers. My colleagues at Navtech and myself figured that if we
wrote a trigger that captured a record of all changes made to a
database table we would then know what changes needed to be made on
a replica to keep it up to date with the master.&lt;/p&gt;
&lt;p&gt;I wrote the initial version of DBMirror over a few weeks during
the summer of 2001 targetting PostgreSQL 7.1. I no longer have a
copy of the original version but I think it only stored the primary
key of each row and referenced the original table while
replicating. In the September/October time-frame I spent a few more
weeks reworked DBMirror into the form we released it in. This
version stored the entire contents of a modified row. This is was
the first version that saw production use.&lt;/p&gt;
&lt;p&gt;In February of 2002 the management team at Navetch was kind
enough to allow us too open-source DBMirror. DBMirror was included
with the PostgreSQL source code as contrib/dbmirror where it
remained as a contrib module until 2007. No one tracks how many
users any particular PostgreSQL replication solution has (or had)
but based on mailing list traffic DBMirror was far more popular
than contrib/rserv, or any of the other options available until
Slony become more mature almost 4 years later.&lt;/p&gt;
&lt;p&gt;DBMirror was not particularly efficient, it stored each column
of a replicated table in its own row of the pendingData table, the
replication daemon was written in perl and the query to &lt;/p&gt;[...]</description><guid isPermaLink="false">http://scanningpages.wordpress.com/?p=477</guid><pubDate>Mon, 06 Feb 2012 12:26:18 GMT</pubDate></item><item><title>Joe Abbate: Automated Database Augmentation</title><link>http://pyrseas.wordpress.com/2012/02/05/automated-database-augmentation/</link><description>&lt;p&gt;Suppose you have a PostgreSQL database like the &lt;a href="http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/dbsamples/pagila/pagila-schema.sql%3Frev%3D1.8%26content-type%3Dtext/x-cvsweb-markup"&gt;
Pagila sample&lt;/a&gt; with 14 tables, each with a &lt;tt&gt;last_update&lt;/tt&gt;
timestamp column to record the date and time each row was modified,
and it is now a requirement to capture which user effected each
change. Or perhaps you have several tables without such audit trail
columns and need to add them quickly. Or maybe you have decided to
denormalize your design by adding a calculated column, e.g.,
extended price = unit price times quantity ordered, or a derived
column, e.g., carrying the customer name in the invoice table.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://classroom209.blogspot.com/2011/01/vocab-for-fire-stormf.html"&gt;
&lt;img class="alignright" title="Drudgery" src=
"http://4.bp.blogspot.com/_knNIUa4PX-s/TSSSaT20CJI/AAAAAAAABLc/gem_AOMgrz0/s1600/Drudgery.jpg"
alt="" width="288" height="230" /&gt;&lt;/a&gt;If you have some experience
as a DBA, the word “&lt;a href="http://en.wiktionary.org/wiki/drudgery"&gt;drudgery&lt;/a&gt;” may have
come to mind at the prospect of implementing the above features.
It’s possible that, after a while, you’ve developed an approach for
dealing with some of them but still wish there’d be &lt;em&gt;some
way&lt;/em&gt; to automate these thankless tasks.&lt;/p&gt;
&lt;p&gt;You may have looked at the Andromeda project’s “&lt;a href="http://www.andromeda-project.org/automations.html"&gt;automations&lt;/a&gt;”
which provide some of these capabilities. However, in order to take
advantage of the automations, you’ll first have to manually
describe your database in a YAML format (and you’ll have to install
Apache and PHP). Or you could have tried to use the follow-on
project, &lt;a href="http://code.google.com/p/triangulum-db/wiki/UsingTriangulum"&gt;Triangulum&lt;/a&gt;,
but essentially you’d still have to create a YAML schema (no need
for Apache, but you still need PHP).&lt;/p&gt;
&lt;p&gt;Some relief is forthcoming. As a result of discussions resulting
from my &lt;a title="Business Logic in the Database"  href="http://pyrseas.wordpress.com/2012/01/02/business-logic-in-the-database/"&gt;
Business Logic in the&amp;nbsp;Database&lt;/a&gt; post, I have been
collaborating with Roger Hunwicks on a potential solution to these
common DBA needs. The new Pyrseas tool is tentatively named
&lt;tt&gt;dbextend&lt;/tt&gt;&lt;sup&gt;1&lt;/sup&gt; and its initial documentation is
available in the &lt;a href="https://github.com/jmafc/Pyrseas/blob/extender/docs/dbextend.rst"&gt;Pyrseas
extender branch&lt;/a&gt;. This is how I envision &lt;tt&gt;dbextend&lt;/tt&gt; being
used.&lt;/p&gt;
&lt;p&gt;Consider the opening example. The DBA would create a simple YAML
file such as the (abbreviated) one below, listing the tables and
the needed features:&lt;/p&gt;
&lt;pre&gt;
schema public:
  table actor:
    audit_columns: default
  table category:
    audit_columns: default
...
  table store:
    audit_columns: default
&lt;/pre&gt;
&lt;p&gt;The DBA would then use this file, say &lt;tt&gt;audext.yaml&lt;/tt&gt;, as
input to dbexte&lt;/p&gt;[...]</description><guid isPermaLink="true">http://pyrseas.wordpress.com/?p=1476</guid><pubDate>Mon, 06 Feb 2012 03:38:49 GMT</pubDate></item><item><title>Andrew Dunstan: JSON for PG 9.2 ... and now for 9.1!</title><link>http://people.planetpostgresql.org/andrew/index.php?/archives/255-JSON-for-PG-9.2-...-and-now-for-9.1!.html</link><description>Robert Haas committed his bare bones JSON type five days ago, and
three days later I committed my array_to_json and row_to_json
constructors, so this is now definitely a go for 9.2. Kudos to
Robert for persisting with this - I had just about given up on us
getting it done for this release.&lt;br /&gt;
&lt;br /&gt;
As an added bonus for those of you who are a bit impatient to use
this stuff, I have back ported this to 9.1 as an extension. You can
get the code from my &lt;a href=
"https://bitbucket.org/adunstan/json_91"&gt;bitbucket repository&lt;/a&gt;,
and when I have polished it a bit more I will publish it on
&lt;a href="http://pgxn.org/"&gt;PGXN&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
PLEASE NOTE: this should work fine if you dump and restore the
database when moving to 9.2 - just suppress the extension creation.
But it won't work with binary upgrade.
</description><guid isPermaLink="false">http://people.planetpostgresql.org/andrew/index.php?/archives/255-guid.html</guid><pubDate>Sun, 05 Feb 2012 18:24:42 GMT</pubDate></item><item><title>Leo Hsu and Regina Obe: Back from DDOS Attack</title><link>http://www.postgresonline.com/journal/archives/242-Back-from-DDOS-Attack.html</link><description>&lt;p&gt;As many may have noticed, PostgresOnline.com has been down for
the past week or so and probably is still not reachable from many
parts of the world since our DNS server was also taken down as a
result of a Denial of Service (DDOS) attack instigated by an
Activision &lt;a href="http://www.callofduty.com/" target=
"_blank"&gt;Call of Duty Game exploit&lt;/a&gt; that turned thousands of
Call of Duty game servers into Zombies launching an attack on
us.&lt;/p&gt;
&lt;p&gt;We have a small confession to make. One of the businesses we
co-own is an e-Commerce site that sells condoms. You never know how
people will react when you say that in mixed company so we only
mention it in closer company. Some people are glad we are in a
business protecting against venereal diseases or unwanted
pregnancies and some feel strongly we are violating a mother nature
creed of conduct. WowCondoms was the site that was under attack on
a UDP port and we are not sure if it was a malicious intent or not
since the root instigator has not been found yet. The attack was
higher up from our servers so it knocked our ISP who in turn blamed
us for their outage. We never saw the traffic.&lt;/p&gt;
&lt;p&gt;The tragic thing is that it can happen to any site and does all
the time. It really hit home when it happened to us.&lt;/p&gt;
&lt;p&gt;Details of our fight are described here: &lt;a href=
"http://wowcondoms.com/Condom_Blog/83/Call_of_Duty_DDOS_Exploit"
target="_blank"&gt;WowCondoms plugs hole in Activision's Call of Duty
Game Servers&lt;/a&gt;&lt;/p&gt;

</description><guid isPermaLink="false">http://www.postgresonline.com/journal/archives/242-guid.html</guid><pubDate>Sun, 05 Feb 2012 15:43:02 GMT</pubDate></item><item><title>Chris Travers: LedgerSMB talk at FOSDEM</title><link>http://ledgersmbdev.blogspot.com/2012/02/ledgersmb-talk-at-fosdem.html</link><description>&lt;span&gt;Hi,&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;I just arrived at FOSDEM - Brussels. Due to last minute
arrangements, my talk about LedgerSMB isn't in the schedule. So,
here's the announcement:&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;There will be a LedgerSMB talk in the Perl devroom
(AW1.121)&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;between 12.25 and 12.45&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;The talk is on the fosdem site:&amp;nbsp;&lt;a href=
"http://fosdem.org/2012/schedule/event/ledgersmb_perl" target=
"_blank"&gt;http://fosdem.org/2012/schedule/event/ledgersmb_perl&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;With kind regards,&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;Erik.&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width="1" height="1" src=
"https://blogger.googleusercontent.com/tracker/3346090548501966296-2503007040587536117?l=ledgersmbdev.blogspot.com"
alt="" /&gt;&lt;/div&gt;

</description><guid isPermaLink="false">tag:blogger.com,1999:blog-3346090548501966296.post-2503007040587536117</guid><pubDate>Sun, 05 Feb 2012 10:54:01 GMT</pubDate></item><item><title>Hubert 'depesz' Lubaczewski: Waiting for 9.2 – pg_basebackup from slave</title><link>http://www.depesz.com/index.php/2012/02/03/waiting-for-9-2-pg_basebackup-from-slave/</link><description>On 25th of January, Simon Riggs committed patch: Allow
pg_basebackup FROM standby node WITH safety checking. Base backup
follows recommended PROCEDURE, plus goes TO great lengths TO ensure
that partial page writes are avoided. &amp;nbsp; Jun Ishizuka AND Fujii
Masao, WITH minor modifications In PostgreSQL 9.1 we got
pg_basebackup – it is a tool to [...]
</description><guid isPermaLink="false">http://www.depesz.com/?p=2399</guid><pubDate>Fri, 03 Feb 2012 14:08:48 GMT</pubDate></item><item><title>Jared Watkins: What I Do – Broadsoft CDR Files to Radius Accounting Records</title><link>http://jaredwatkins.com/wordpress/2012/02/what-i-do-broadsoft-cdr-files-to-radius-accounting-records/</link><description>&lt;div class="dd_post_share dd_post_share_right dd_buttons"&gt;
&lt;div class="dd_button_v dd-linkedin-ajax-load dd-linkedin-675"&gt;
&lt;/div&gt;
&lt;div class="dd_button_v"&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;As part of a larger project I needed to generate real time
radius records from the CDR accounting files of several cluster
pairs of Broadsoft application servers. So I wrote a perl script to
do just that. It maps the CDR fields to radius attribs and encodes
the accounting packet using the &lt;a href=
"http://search.cpan.org/~luismunoz/Net-Radius-2.103/Radius/Packet.pm"&gt;
Net::Radius::Packet&lt;/a&gt; CPAN module. &amp;nbsp;In my case I’m using the
&lt;a href="http://www.open.com.au/radiator/"&gt;Radiator radius
server&lt;/a&gt; &amp;nbsp;from &lt;a href="http://www.open.com.au/"&gt;OSC
Software&lt;/a&gt; on the other end with lots of custom ‘hook code’ to
clean up and store the call data coming off our network into a
&lt;a href="http://www.postgresql.org/"&gt;Postgresql&lt;/a&gt; database.
&amp;nbsp;This is my first time doing any development with radius.. but
I’ve been running this script on several servers for a few weeks
now and it appears to be quite stable.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Get it on the &lt;a href=
"http://jaredwatkins.com/wordpress/my-projects/file2radius/"&gt;Project
Page&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description><guid isPermaLink="false">http://jaredwatkins.com/wordpress/?p=675</guid><pubDate>Fri, 03 Feb 2012 03:40:17 GMT</pubDate></item><item><title>Bruce Momjian: Let's See work_mem</title><link>http://momjian.us/main/blogs/pgblog/2012.html#February_2_2012</link><description>&lt;p&gt;Having shown memory allocation (and deallocation) in my previous
&lt;a class="txt2html" href=
"http://momjian.us/main/blogs/pgblog/2012.html#February_1_2012"&gt;blog
post&lt;/a&gt;, I would like to show &lt;a class="txt2html" href=
"http://www.postgresql.org/docs/9.1/static/runtime-config-resource.html#RUNTIME-CONFIG-RESOURCE-MEMORY"&gt;
&lt;em&gt;work_mem&lt;/em&gt;&lt;/a&gt; in action.&lt;/p&gt;
&lt;p&gt;First, I ran the following database session using a &lt;a class=
"txt2html" href=
"http://momjian.us/main/blogs/pgblog/2012.html#January_20_2012"&gt;~6k
RPM drive&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;a href=
"http://momjian.us/main/blogs/pgblog/2012.html#February_2_2012"&gt;Continue
Reading »&lt;/a&gt;&lt;/p&gt;

</description><guid isPermaLink="false">http://momjian.us/main/blogs/pgblog/2012.html#February_2_2012</guid><pubDate>Thu, 02 Feb 2012 15:45:01 GMT</pubDate></item><item><title>Hubert 'depesz' Lubaczewski: Waiting for 9.2 – Trigger Depth</title><link>http://www.depesz.com/index.php/2012/02/01/waiting-for-9-2-trigger-depth/</link><description>On 25th of January, Alvaro Herrera committed patch: ADD
pg_trigger_depth() FUNCTION &amp;nbsp; This reports the depth level OF
triggers currently IN execution, OR zero IF NOT called FROM inside
a TRIGGER. &amp;nbsp; No catversion bump IN this patch, but you have TO
initdb IF you want access TO the NEW FUNCTION. &amp;nbsp; Author: Kevin
Grittner [...]
</description><guid isPermaLink="false">http://www.depesz.com/?p=2396</guid><pubDate>Wed, 01 Feb 2012 17:36:50 GMT</pubDate></item><item><title>Jim Smith: Why aren't more people/companies using PostgreSQL?</title><link>http://www.postgresmigrations.com/blog/post/3323648</link><description>&lt;p&gt;Why aren't more people/companies using PostgreSQL? Why aren't
they moving from proprietary databases to PostgreSQL?&amp;nbsp;&lt;br /&gt;
Possible answers: I haven't heard of PostgreSQL. I don't think
PostgreSQL will meet my needs. I don't know how to get away from my
database vendor.&lt;br /&gt;
I'd like to hear some of the reasons for not considering PostgreSQL
when creating or migrating a database.&lt;br /&gt;
&amp;nbsp;&lt;/p&gt;

</description><guid isPermaLink="true">http://www.postgresmigrations.com/blog/post/3323648</guid><pubDate>Wed, 01 Feb 2012 16:58:55 GMT</pubDate></item><item><title>Bruce Momjian: Postgres Memory Surprises</title><link>http://momjian.us/main/blogs/pgblog/2012.html#February_1_2012</link><description>&lt;p&gt;In my previous &lt;a class="txt2html" href=
"http://momjian.us/main/blogs/pgblog/2012.html#January_30_2012"&gt;blog
entry&lt;/a&gt;, I analyzed how various tools (&lt;em&gt;ps&lt;/em&gt; and
&lt;em&gt;smem&lt;/em&gt;) report memory usage. In summary:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;ps&lt;/em&gt; columns &lt;em&gt;TRS&lt;/em&gt;, &lt;em&gt;DRS&lt;/em&gt;, and
&lt;em&gt;VSZ&lt;/em&gt; report virtual address space allocated, not actual RAM
allocated.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;smem&lt;/em&gt;'s &lt;em&gt;USS&lt;/em&gt; reports a process's private
(unshared) memory allocated.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;smem&lt;/em&gt;'s &lt;em&gt;PSS&lt;/em&gt; is a sum of process's private
memory allocated and a proportional amount of shared memory (both
System V shared memory, like Postgres's shared_buffers, and shared
libraries).&lt;/li&gt;
&lt;li&gt;&lt;em&gt;RSS&lt;/em&gt; shows actual RAM allocated, private and
shared.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With these issues understood, let's look at a running Postgres
cluster:&lt;/p&gt;
&lt;p&gt;&lt;a href=
"http://momjian.us/main/blogs/pgblog/2012.html#February_1_2012"&gt;Continue
Reading »&lt;/a&gt;&lt;/p&gt;

</description><guid isPermaLink="false">http://momjian.us/main/blogs/pgblog/2012.html#February_1_2012</guid><pubDate>Wed, 01 Feb 2012 15:15:01 GMT</pubDate></item><item><title>Hubert 'depesz' Lubaczewski: Waiting for 9.2 – ALTER IF EXISTS</title><link>http://www.depesz.com/index.php/2012/02/01/waiting-for-9-2-alter-if-exists/</link><description>On 23th of January, Simon Riggs committed patch: ALTER
&amp;lt;thing&amp;gt; [IF EXISTS] ... allows silent DDL IF required, e.g.
ALTER FOREIGN TABLE IF EXISTS foo RENAME TO bar &amp;nbsp; Pavel
Stehule This adds important capability – change object of it
exists, and not raise exception if it doesn’t. Conditional DDL was
always big point on [...]
</description><guid isPermaLink="false">http://www.depesz.com/?p=2393</guid><pubDate>Wed, 01 Feb 2012 13:14:11 GMT</pubDate></item><item><title>Pavel Golub: Factorial using CTE in PostgreSQL</title><link>http://pgolub.wordpress.com/2012/02/01/factorial-using-cte-in-postgresql/</link><description>&lt;p&gt;Not so long ago &lt;a href=
"http://pgolub.wordpress.com/2010/06/20/fibonacci-rides-again/"&gt;I
used&lt;/a&gt; Common Table Expressions for &lt;a href=
"http://en.wikipedia.org/wiki/Fibonacci_number"&gt;Fibonacci
Numbers&lt;/a&gt; calculation.&lt;/p&gt;
&lt;p&gt;Today I had a conversation with one client about SQL in general
and about PosgreSQL dialect in particular. We talked about SQL’s
&lt;a href="http://en.wikipedia.org/wiki/Turing_completeness"&gt;Turing
completeness&lt;/a&gt; also. Well my opponent is sure that SQL (Postgres
dialect either) is not Turing Complete. But I know for sure that if
SQL supports CTE it is Turing Complete. Well, I’m sure about it
because some time ago at &lt;a href=
"http://www.oscon.com/oscon2009"&gt;Oscon 2009&lt;/a&gt; David Fetter said
so. And my confidence in this man is boundless. &lt;img src=
"http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif" alt=
":)" class="wp-smiley" /&gt;&lt;br /&gt;
&lt;img alt="" src=
"http://habrastorage.org/storage2/8e8/001/13c/8e800113cf3071f21c26c0de1aff577c.png"
title="Result set" class="alignright" width="106" height=
"287" /&gt;&lt;br /&gt;
Anyway, my client proposed to implement Factorial calculation on a
pure SQL. I choose Postgres dialect. He agreed.&lt;/p&gt;
&lt;p&gt;That was his first mistake! He didn’t know that Postgres has
built in &lt;a href=
"http://www.postgresql.org/docs/9.1/static/functions-math.html"&gt;“!”
and “!!” operators&lt;/a&gt; for this purpose. &lt;img src=
"http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif" alt=
":)" class="wp-smiley" /&gt;&lt;/p&gt;
&lt;p&gt;But to be more convincing, I have wrote this code:&lt;/p&gt;
&lt;table border="0" cellspacing="0" cellpadding="5"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;pre&gt;
WITH RECURSIVE fact(i, f) AS (
    VALUES (2, 1)
UNION ALL
    SELECT i + 1, i * f FROM fact
)
SELECT f FROM fact LIMIT 10;
&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;
Filed under: &lt;a href=
"http://pgolub.wordpress.com/category/postgresql/coding/"&gt;Coding&lt;/a&gt;,
&lt;a href=
"http://pgolub.wordpress.com/category/postgresql/"&gt;PostgreSQL&lt;/a&gt;
Tagged: &lt;a href="http://pgolub.wordpress.com/tag/cte/"&gt;CTE&lt;/a&gt;,
&lt;a href="http://pgolub.wordpress.com/tag/factorial/"&gt;factorial&lt;/a&gt;,
&lt;a href="http://pgolub.wordpress.com/tag/oscon/"&gt;oscon&lt;/a&gt;,
&lt;a href="http://pgolub.wordpress.com/tag/postgresql/"&gt;PostgreSQL&lt;/a&gt;,
&lt;a href="http://pgolub.wordpress.com/tag/sql/"&gt;SQL&lt;/a&gt;, &lt;a href=
"http://pgolub.wordpress.com/tag/trick/"&gt;trick&lt;/a&gt; &lt;a rel=
"nofollow" href=
"http://feeds.wordpress.com/1.0/gocomments/pgolub.wordpress.com/1730/"&gt;
&lt;img alt="" border="0" src=
"http://feeds.wordpress.com/1.0/comments/pgolub.wordpress.com/1730/" /&gt;
&lt;/a&gt; &lt;a rel="nofollow" href=
"http://feeds.wordpress.com/1.0/godelicious/pgolub.wordpress.com/1730/"&gt;
&lt;img alt="" border="0" src=
"http://feeds.wordpress.com/1.0/delicious/pgolub.wordpress.com/1730/" /&gt;
&lt;/a&gt; &lt;a rel="nofollow" href=
"http://feeds.wordpress.com/1.0/gofacebook/pgolub.wordpress.com/1730/"&gt;
&lt;img alt="" border="0" src=
"http://feeds.wordpress.com/1.0/facebook/pgolub.wordpress.com/1730/" /&gt;
&lt;/a&gt; &lt;a rel="nofollow" href=
"http://feeds.wordpress.com/1.0/gotwitter/pgolub.wordpress.com/1730/"&gt;
&lt;img alt="" border="0" src=
"http://feeds.wordpress.com/1.0/twitter/pgolub.wordpress.com/1730/" /&gt;
&lt;/a&gt; &lt;a rel="nofollow" href=
"http://feeds.wordpress.com/1.0/gostumble/pgolub.wordpress.com/1730/"&gt;
&lt;img alt="" border="0" src=
"http://feeds.wordpress.com/1.0/stumble/pgolub.wordpress.com/1730/" /&gt;
&lt;/a&gt; &lt;a rel="nofollow" href=
"http://feeds.wordpress.com/1.0/godigg/pgolub.wordpress.com/1730/"&gt;&lt;img alt=""
border="0" src=
"http://feeds.wordpress.com/1.0/digg/pgolub.wordpress.com/1730/" /&gt;&lt;/a&gt;
&lt;a rel="nofollow" href=
"http://feeds.wordpress.com/1.0/goreddit/pgolub.wordpress.com/1730/"&gt;
&lt;img alt="" border="0" src=
"http://feeds.wordpress.com/1.0/reddit/pgolub.wordpress.com/1730/" /&gt;
&lt;/a&gt; &lt;img alt="" border="0" src=
"http://stats.wordpress.com/b.gif?host=pgolub.wordpress.com&amp;amp;blog=5816673&amp;amp;post=1730&amp;amp;subd=pgolub&amp;amp;ref=&amp;amp;feed=1"
width="1" height="1" /&gt;
</description><guid isPermaLink="false">http://pgolub.wordpress.com/?p=1730</guid><pubDate>Wed, 01 Feb 2012 09:42:26 GMT</pubDate></item><item><title>Damien Clochard: Write a Foreign Data Wrapper in 15 minutes (Part 1/2)</title><link>http://blog.taadeem.net/index.php?post/2012/01/31/Write-a-Foreign-Data-Wrapper-in-15-minutes-Part-1/2</link><description>&lt;p&gt;Among the &lt;a href="http://wiki.postgresql.org/wiki/What%2527s_new_in_PostgreSQL_9.1"&gt;long
list of new features of PostgreSQL 9.1&lt;/a&gt; the new SQL/MED
implementation is probably of the most underrated. &lt;a href="http://en.wikipedia.org/wiki/SQL/MED"&gt;SQL/MED&lt;/a&gt; is an extension
of the SQL standard defines foreign data wrappers (FDW) that allow
you to reach data located outside of your database, with regular
SQL request (MED stands for Management of External Data). In a
nutshell, &lt;a href="http://rhaas.blogspot.com/2011/01/why-sqlmed-is-cool.html"&gt;SQL/MED
is cool&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;As far as i know, PostgreSQL and DB2 are the only major RDBMS
providing an implementation of this standard. The beauty with
PostgreSQL is that you can write your own data wrappers to connect
your database to any storage you want ; other RDBMS, NoSQL
storages, web services, whatever system that holds data and can
deliver it.&lt;/p&gt;
&lt;p&gt;Basically to &lt;a href="http://www.postgresql.org/docs/9.1/static/fdwhandler.html"&gt;Write a
Foreign Data Wrapper&lt;/a&gt; you need to code &lt;a href="http://www.postgresql.org/docs/9.1/static/fdw-callbacks.html"&gt;six
callback routines in C&lt;/a&gt; to explain how to plan and execute
queries toward your new source of data.&lt;/p&gt;
&lt;p&gt;PostgreSQL 9.1 has been released a few month ago, but there's
already a bunch of FDW available (even though most of them are
still beta). At the time, I'm writing this we already have &lt;a href="http://wiki.postgresql.org/wiki/Foreign_data_wrappers%2520more%2520than%252015%2520wrappers"  title="http://wiki.postgresql.org/wiki/Foreign_data_wrappers more than 15 wrappers"&gt;
http://wiki.postgresql.org/wiki/For...&lt;/a&gt;, so you can connect your
PostgreSQL server to ; &lt;a href="http://pgfoundry.org/projects/oracle-fdw/"&gt;Oracle&lt;/a&gt;, &lt;a href="http://github.com/dpage/mysql_fdw"&gt;MySQL&lt;/a&gt;, &lt;a href="http://multicorn.org/foreign-data-wrappers/%23sqlite-foreign-data-wrapper"&gt;
SQLlite&lt;/a&gt;, &lt;a href="https://github.com/ZhengYang/odbc_fdw"&gt;anything providing an ODBC
driver&lt;/a&gt;, &lt;a href="https://github.com/guedes/ldap_fdw"&gt;LDAP&lt;/a&gt;,
&lt;a href="https://github.com/ZhengYang/couchdb_fdw"&gt;couchdb&lt;/a&gt;,
&lt;a href="https://github.com/dpage/redis_fdw"&gt;redis&lt;/a&gt;, &lt;a href="https://github.com/umitanuki/s3_fdw"&gt;Amazon S3 storage&lt;/a&gt;,
&lt;a href="http://www.postgresql.org/docs/9.1/static/file-fdw.html"&gt;CSV
files&lt;/a&gt;, &lt;a href="https://github.com/umitanuki/twitter_fdw"&gt;Twitter&lt;/a&gt;, &lt;a href="https://github.com/Kozea/Multicorn/blob/master/python/multicorn/googlefdw.py"&gt;
Google Search&lt;/a&gt;, &lt;a href="https://github.com/cyga/www_fdw/"&gt;HTML
pages&lt;/a&gt;, &lt;a href="http://multicorn.org/foreign-data-wrappers/%23rss-foreign-data-wrapper"&gt;
RSS feeds&lt;/a&gt;, ....&lt;/p&gt;
&lt;p&gt;For an almost complete list, check out the PostgreSQL wiki ;
&lt;a href="http://wiki.postgresql.org/wiki/Foreign_data_wrappers"  title="http://wiki.postgresql.org/wiki/Foreign_data_wrappers"&gt;http://wiki.postgresql.org/wiki/For...&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And of course these wrappers are packaged as extension and most
of them are available on PGXN and quite easy to install : &lt;a href="http://pgxn.org/tag/fdw/"  title="http://pgxn.org/tag/fdw/"&gt;http://pgxn.org/tag/fdw/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;But there's more ! Among these FDW there's one called &lt;a href="http://multicorn.org/"&gt;Multicorn&lt;/a&gt;. This particular extension
that allow you to write FDW in Python. A wrapper over another
wrapper. Basically this means you don't have to know C to write
your own FDW and you can use high-level libraries from the Python
world.&lt;/p&gt;
&lt;p&gt;Ok let's take a simple example. I'd like to query data contained
in a web calendar like Google Calendar. Those data are available in
ical files, with a specific format called iCalendar. So want i need
to do is explain P&lt;/p&gt;[...]</description><guid isPermaLink="false">urn:md5:970ce34186e9712836787ee46c13c121</guid><pubDate>Tue, 31 Jan 2012 22:49:00 GMT</pubDate></item><item><title>Greg Smith: Using the PostgreSQL System Columns</title><link>http://blog.2ndquadrant.com/en/2012/01/using-the-postgresql-system-co.html</link><description>There are a few parts of the PostgreSQL internals that poke out
usefully if you look in the right place for them.&amp;nbsp; One useful
set to know about are the &lt;a href="http://www.postgresql.org/docs/current/static/ddl-system-columns.html"&gt;
System Columns&lt;/a&gt;, which you can explicitly request but don't see
by default.&amp;nbsp; For example:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;psql -x -c "SELECT oid,* FROM pg_class LIMIT
1"&lt;br /&gt;&lt;/blockquote&gt;
There is no column named oid in the pg_class table, but it's there
if you ask for it.&amp;nbsp; The oid used to be relied on more heavily
in PostgreSQL as a way to identify rows.&amp;nbsp; That's not true for
regular tables anymore, and you really don't want to start doing
that for your own tables.&amp;nbsp; OIDs are mainly useful now when
joining parts of the &lt;a href="http://www.postgresql.org/docs/current/static/catalogs.html"&gt;System
Catalog&lt;/a&gt; together.&amp;nbsp; A good example is the &lt;a href="http://wiki.postgresql.org/wiki/Disk_Usage"&gt;Disk Usage&lt;/a&gt;
query.&amp;nbsp; If you want to find the namespace a table is in, you
need to know you can ask for its OID.&amp;nbsp; It's possible to get
some of this data out of more portable views like
information_schema.tables.&amp;nbsp; But many of the useful things in
this area are PostgreSQL specific.&amp;nbsp; Sometimes I see people
starting with the information_schema views and joining against
other tables using its text name fields, such as the listed
table_name.&amp;nbsp; That approach has several edge cases that don't
work out correctly; not handling &lt;a href="http://www.postgresql.org/docs/current/static/storage-toast.html"&gt;TOAST&lt;/a&gt;
columns is a common example.&amp;nbsp; That makes them more prone to
breaking on you later, probably after your system has gone into
production, than an OID based join.&lt;br /&gt;
&lt;br /&gt;
There is also a tableoid system column.&amp;nbsp; As described in the
documentation, its main use case is identifying which partition a
row come from.&amp;nbsp; That's not a great thing to be driving
application logic from, but it can be useful for monitoring or
troubleshooting purposes.&amp;nbsp; For example, if you SELECT rows
from the parent table in a partitioning inheritance scheme, it's
normally expected that no rows will actually be stored there.&amp;nbsp;
Checking the tableoid is one way to confirm that.&amp;nbsp; You might
confirm that your INSERT/UPDATE trigger is moving rows to the right
place using tableoid as well.&amp;nbsp; It's possible to do that for
each individual partition section, but running a query against the[...]</description><guid isPermaLink="true">tag:blog.2ndquadrant.com,2012:/en//3.191</guid><pubDate>Tue, 31 Jan 2012 22:02:06 GMT</pubDate></item><item><title>Hubert 'depesz' Lubaczewski: Change in anonmymization of plans on explain.depesz.com</title><link>http://www.depesz.com/index.php/2012/01/31/change-in-anonmymization-of-plans-on-explain-depesz-com/</link><description>As you perhaps know, explain.depesz.com has anonymization feature.
Couple of days ago Filip contacted me and sent a patch that stopped
anonymization of typecasts. I thought about the patch, and what it
achieves, changed it’s internals, but kept the effect. And today,
it got released. Normal plan looks like this. But you might want to
[...]
</description><guid isPermaLink="false">http://www.depesz.com/?p=2382</guid><pubDate>Tue, 31 Jan 2012 12:10:56 GMT</pubDate></item><item><title>Greg Sabino Mullane: Protecting and auditing your secure PostgreSQL data</title><link>http://blog.endpoint.com/2012/01/protecting-auditing-postgresql-data.html</link><description>&lt;a href="http://4.bp.blogspot.com/-1R42QgfZvFs/TycvCoG8BtI/AAAAAAAAAPU/xJIL640LkBk/s1600/EIB.png"&gt;
&lt;img src=
"http://4.bp.blogspot.com/-1R42QgfZvFs/TycvCoG8BtI/AAAAAAAAAPU/xJIL640LkBk/s320/EIB.png"
border="0" alt="" id="BLOGGER_PHOTO_ID_5703579175260784338" name=
"BLOGGER_PHOTO_ID_5703579175260784338" /&gt;&lt;/a&gt;span{font-family:sans-serif;}span.p{color:red;}span.d{color:gray;}span.c{color:green;font-family:monospace;}span.o{font-family:monospace;color:#0022cc;}span.oo{font-family:monospace;font-weight:bolder;}
&lt;p&gt;PostgreSQL functions can be written in &lt;a href="http://www.postgresql.org/docs/9.1/static/xplang.html"&gt;many
languages&lt;/a&gt;. These languages fall into two categories, 'trusted'
and 'untrusted'. Trusted languages cannot do things "outside of the
database", such as writing to local files, opening sockets, sending
email, connecting to other systems, etc. Two such languages are
&lt;a href="http://www.postgresql.org/docs/9.1/static/plpgsql.html"&gt;PL/pgSQL&lt;/a&gt;
and and &lt;a href="http://www.postgresql.org/docs/9.1/static/plperl.html"&gt;PL/Perl&lt;/a&gt;.
For "untrusted" languages, such as PL/PerlU, all bets are off, and
they have no limitations placed on what they can do. Untrusted
languages can be very powerful, and sometimes dangerous.&lt;/p&gt;
&lt;p&gt;One of the reasons untrusted languages can be considered
dangerous is that they can cause side effects outside of the normal
transactional flow that cannot be rolled back. If your function
writes to local disk, and the transaction then rolls back, the
changes on disk are still there. Working around this is extremely
difficult, as there is no way to detect when a transaction has
rolled back at the level where you could, for example, undo your
local disk changes.&lt;/p&gt;
&lt;p&gt;However, there are times when this effect can be very useful.
For example, in a &lt;a href="http://postgresql.1045698.n5.nabble.com/Logging-access-to-data-in-database-table-td5430079.html"&gt;
recent thread&lt;/a&gt; on the PostgreSQL "general" mailing list (aka
pgsql-general), somebody asked for a way to audit SELECT queries
into a logging table that would survive someone doing a ROLLBACK.
In other words, if you had a function named weapon_details() and
wanted to have that function log all requests to it by inserting to
a table, a user could simply run the query, read the data, and then
rollback to thwart the auditing:&lt;/p&gt;
&lt;pre&gt;
&lt;span class="o"&gt;
BEGIN;

SELECT weapon_details('BFG 9000'); -- also inserts to an audit table

ROLLBACK;                          -- inserts to the audit table are now gone!
&lt;/span&gt;
&lt;/pre&gt;
&lt;p&gt;Certainly there are other ways to track who is using this query,
the most obvious being by enabling full Postgres logging (by
setting log_statement = 'all' in your postgresql.conf file.)
Howe&lt;/p&gt;[...]</description><guid isPermaLink="true">tag:blogger.com,1999:blog-7997313029981170997.post-7734681975994677033</guid><pubDate>Tue, 31 Jan 2012 03:55:59 GMT</pubDate></item><item><title>Bruce Momjian: Revisiting Memory Reporting</title><link>http://momjian.us/main/blogs/pgblog/2012.html#January_30_2012</link><description>&lt;p&gt;Memory is very important to databases — much more so than for
typical applications (&lt;a class="txt2html" href=
"http://momjian.us/main/presentations/overview.html#hw_selection"&gt;presentation&lt;/a&gt;).
Unfortunately, because memory allocation is so complex, it is often
hard to figure out how physical RAM is being used. There are
several reasons for the complexity:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Virtual Memory:&lt;/strong&gt; CPUs in virtual memory mode
don't access RAM directly, but rather through &lt;a class="txt2html"
href="http://en.wikipedia.org/wiki/Page_table"&gt;page
tables&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Segmentation:&lt;/strong&gt; Memory is allocated in specific
&lt;a class="txt2html" href=
"http://en.wikipedia.org/wiki/Segmentation_%28memory%29"&gt;segments&lt;/a&gt;:
&lt;a class="txt2html" href=
"http://en.wikipedia.org/wiki/Text_segment"&gt;text(code)&lt;/a&gt;,
&lt;a class="txt2html" href=
"http://en.wikipedia.org/wiki/Data_segment"&gt;data&lt;/a&gt;, and
stack.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Sharing:&lt;/strong&gt; physical RAM is often shared by
multiple processes, either in read-only mode (program
instructions), shared mode (read/write of share memory), or
&lt;a class="txt2html" href=
"http://en.wikipedia.org/wiki/Copy-on-write"&gt;copy-on-write&lt;/a&gt;
(create a new copy on write; used by &lt;a class="txt2html" href=
"http://en.wikipedia.org/wiki/Fork_%28operating_system%29"&gt;fork&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Robert Haas's excellent &lt;a class="txt2html" href=
"http://rhaas.blogspot.com/2012/01/linux-memory-reporting.html"&gt;blog
post&lt;/a&gt; highlighted much uncertainty about how to analyze memory
usage for specific processes, especially Postgres. I commented on
his blog, as did others, and now have a much clearer idea of how to
study memory usage. A &lt;a class="txt2html" href=
"http://utcc.utoronto.ca/~cks/space/blog/linux/LinuxMemoryStats"&gt;blog
post&lt;/a&gt; by Chris Siebenmann directly addresses some of my and
Robert's questions, and suggests &lt;a class="txt2html" href=
"http://www.selenic.com/smem/"&gt;smem&lt;/a&gt; as a way to analyze memory,
especially the sharing of memory. It was interesting to learn that
smem was designed specifically to address the problems Robert
outlined (&lt;a class="txt2html" href=
"http://lwn.net/Articles/230975/"&gt;2007&lt;/a&gt;, &lt;a class="txt2html"
href="http://lwn.net/Articles/329458/"&gt;2009&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;&lt;a href=
"http://momjian.us/main/blogs/pgblog/2012.html#January_30_2012"&gt;Continue
Reading »&lt;/a&gt;&lt;/p&gt;

</description><guid isPermaLink="false">http://momjian.us/main/blogs/pgblog/2012.html#January_30_2012</guid><pubDate>Mon, 30 Jan 2012 21:45:01 GMT</pubDate></item><item><title>David Wheeler: &lt;p&gt;SQL Change Management Sans Duplication</title><link>http://feedproxy.google.com/~r/justatheory/pgsum/~3/TloDXCSP52M/sql-change-management-sans-redundancy.html</link><description>&lt;p&gt;In the &lt;a href=
"http://justatheory.com/computers/databases/vcs-sql-change-management.html"&gt;
previous episode&lt;/a&gt; in this series, I had one issue with regard to
SQL change management that I wanted to resolve: duplication of code
between deploy and revert scripts sucks. Worse still is the
duplication of code to change just one line of a procedure. Here’s
how I propose to eliminate the dupes.&lt;/p&gt;
&lt;p&gt;&lt;a href=
"http://justatheory.com/computers/databases/sql-change-management-sans-redundancy.html"&gt;
Read More »&lt;/a&gt;&lt;/p&gt;
&lt;img src=
"http://feeds.feedburner.com/~r/justatheory/pgsum/~4/TloDXCSP52M"
height="1" width="1" alt="" /&gt;
</description><guid isPermaLink="true">tag:justatheory.com,2012:/computers/databases/sql-change-management-sans-redundancy</guid><pubDate>Mon, 30 Jan 2012 16:00:00 GMT</pubDate></item><item><title>Satoshi Nagayasu: PostgreSQL Conference 2012 on February 24 in Japan</title><link>http://pgsnaga.blogspot.com/2012/01/postgresql-conference-2012-on-february.html</link><description>Japan PostgreSQL Users Group will be having an annual 1day
technical conference, PostgreSQL Conference 2012, on February 24 in
Tokyo. There will be two keynote sessions and 13 sessions on
PostgreSQL. (The photo was taken by @koyhoge at PostgreSQL
Conference 2011) - PostgreSQL Conference 2012 - NPO法人
日本PostgreSQLユーザ http://www.postgresql.jp/events/pgcon2012/ (Google
translated) The opening
</description><guid isPermaLink="true">tag:blogger.com,1999:blog-12493181.post-7480472843747503062</guid><pubDate>Mon, 30 Jan 2012 00:54:14 GMT</pubDate></item><item><title>Josh Berkus: pgCon CfP and other events</title><link>http://it.toolbox.com/blogs/database-soup/pgcon-cfp-and-other-events-50214?rss=1</link><description>The dates for pgCon have been set and this year we have a bunch of
exciting new events to make pgCon even more worth attending. First,
though, I wanted to remind everyone that the Call for Presentations
ends Wednesday, so please make some talk submissions!
</description><guid isPermaLink="false">http://rss.ittoolbox.com/rss/50214@http://it.toolbox.com/blogs/database-soup</guid><pubDate>Sun, 29 Jan 2012 16:27:11 GMT</pubDate></item><item><title>Peter Geoghegan: Power consumption in Postgres 9.2</title><link>http://pgeoghegan.blogspot.com/2012/01/power-consumption-in-postgres-92.html</link><description>&lt;div&gt;&lt;b id="internal-source-marker_0.7957186095882207"&gt;&lt;span&gt;&lt;span&gt;One of the
issues of major concern to CPU vendors is optimising the power
consumption of their devices. In a world where increasingly,
computing resources are purchased in terms of fairly abstract units
of work, and where, when selecting the location of a major
data-centre, the local price of a kilowatt hour is likely to be
weighed just as heavily as the wholesale price of bandwidth, this
is quite understandable.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;Globally, data centres consumed between 1.1 and 1.5 percent
of electricity in 2010 (Source: &lt;a href="http://www.analyticspress.com/datacenters.html"&gt;Koomey&lt;/a&gt;). The
economic and ecological importance of minimizing that number is
fairly obvious.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;The broad trend towards increasing amounts of computing being
performed within large data centres, with consolidated
infrastructure, sold as a service rather than a product is
undeniable. Of course, the term “cloud computing” is often applied
to this phenomenon. That’s a term that I try to avoid, as it’s
fairly ambiguous.&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;br /&gt;
&lt;span&gt;There has been considerable effort to reduce wake-ups when
idle in software in general, including everything from web browsers
to word processors, which is related to the increasing importance
of mobile and embedded platforms. However, this effort is most
pronounced among developers of software that is expected to be
deployed in virtualised environment on many servers, as wake-ups
prevent CPUs from entering various idle states that allow them to
save electricity, and when these wakeups are multiplied by
thousands of VM instances, they add up very
quickly.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;As part of 4CaaSt, a research project funded by the European
Commission's Seventh Framework programme, that brings together
members of industry and academia with the collective goal of
producing an innovative&lt;/span&gt; &lt;span&gt;platform-as-as-service&lt;/span&gt;
&lt;span&gt;offering, I spent time reducing the idle wake-ups per second
in PostgreSQL. Postgres services firm 2ndQuadrant, where I work as
a database architect, has had the development of several PostgreSQL
features sponsored by 4CaaSt in furtherance of that goal, of which
this is only one.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;Historically, PostgreSQL has been weak in &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;[...]</description><guid isPermaLink="true">tag:blogger.com,1999:blog-7609611625311126307.post-1854108391899089194</guid><pubDate>Sun, 29 Jan 2012 00:10:15 GMT</pubDate></item><item><title>Andrew Dunstan: Microsoft C extension building</title><link>http://people.planetpostgresql.org/andrew/index.php?/archives/254-Microsoft-C-extension-building.html</link><description>Someone asked on IRC how to build an external module using
Microsoft C. I have done a lot of building core Postgres with
various versions of Microsoft C, and written or committed
substantial parts of the build system we use for it, but sadly I
don't know the answer, and couldn't find one anywhere in our docs
or on the wiki. Maybe there isn't a simple answer. If so, it's long
since time we should remedy that. Unix people tend to look down on
Windows, but in fact some of the largest deployments of Postgres
anywhere are on Windows. It should not be beyond our wits to
support this better.
</description><guid isPermaLink="false">http://people.planetpostgresql.org/andrew/index.php?/archives/254-guid.html</guid><pubDate>Sat, 28 Jan 2012 14:18:57 GMT</pubDate></item></channel></rss>
