<?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-2431503496741952451</id><updated>2012-04-29T05:45:29.280-07:00</updated><category term='PostgreSQL'/><title type='text'>Jaime Casanova's Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://jaime2ndquadrant.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2431503496741952451/posts/default'/><link rel='alternate' type='text/html' href='http://jaime2ndquadrant.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Jaime Casanova</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2431503496741952451.post-4185267685340846549</id><published>2011-09-15T22:39:00.000-07:00</published><updated>2011-09-15T22:39:22.115-07:00</updated><title type='text'>PGDay Ecuador 2011</title><content type='html'>&lt;span style="font-family: sans-serif; font-size: x-small;"&gt;&lt;span style="line-height: 19px;"&gt;How can we measure the use of PostgreSQL in some country or region? it seems that the level of support for an event is a good way!&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: sans-serif; font-size: x-small;"&gt;&lt;span style="line-height: 19px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: sans-serif; font-size: x-small;"&gt;&lt;span style="line-height: 19px;"&gt;In June 2008 i suggested the idea of making a PGDay here with little or no response. I have suggested the same idea all years since then with similar response, but this year i had a very good response... we got a University to lend us their instalations and 10 talks without considering my own. We organize it in just a few month with little resources and just local people. It looks like a good start.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: sans-serif; font-size: x-small;"&gt;&lt;span style="line-height: 19px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: sans-serif; font-size: x-small;"&gt;&lt;span style="line-height: 19px;"&gt;I'm planning to talk about the community work, how people can help and how much people trust in PostgreSQL. Some other people will talk about 9.1's features, plpython, cluster and replication tools and other things; so we are going from one people wanting to talk to several people covering a few areas...&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: sans-serif; font-size: x-small;"&gt;&lt;span style="line-height: 19px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: sans-serif; font-size: x-small;"&gt;&lt;span style="line-height: 19px;"&gt;yeah! we are growing! i hope next year we can invite people from outside, i didn't do that this time because of lack of money and time (but if someone can afford the expenses and can move thing in his agenda, i can schedule it ;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: sans-serif; font-size: x-small;"&gt;&lt;span style="line-height: 19px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: sans-serif; font-size: x-small;"&gt;&lt;span style="line-height: 19px;"&gt;For now, i'm happy to anounce that PGDay Ecuador will be held at October the 8th, 2011&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: sans-serif; font-size: x-small;"&gt;&lt;span style="line-height: 19px;"&gt;For information see:&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;a href="http://wiki.postgresql.org/wiki/PGDay_Ecuador_2011"&gt;http://wiki.postgresql.org/wiki/PGDay_Ecuador_2011&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2431503496741952451-4185267685340846549?l=jaime2ndquadrant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaime2ndquadrant.blogspot.com/feeds/4185267685340846549/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://jaime2ndquadrant.blogspot.com/2011/09/pgday-ecuador-2011.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2431503496741952451/posts/default/4185267685340846549'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2431503496741952451/posts/default/4185267685340846549'/><link rel='alternate' type='text/html' href='http://jaime2ndquadrant.blogspot.com/2011/09/pgday-ecuador-2011.html' title='PGDay Ecuador 2011'/><author><name>Jaime Casanova</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2431503496741952451.post-8668817813040728921</id><published>2011-07-25T23:28:00.000-07:00</published><updated>2011-07-26T02:10:17.301-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PostgreSQL'/><title type='text'>Auditing table changes</title><content type='html'>How often are you asked for logging changes in tables? AFAIR, every&amp;nbsp;single customer i have had asked me for that...&amp;nbsp;Until now, i have using table_log&amp;nbsp;(http://pgfoundry.org/projects/tablelog) for that but this is less than&lt;br /&gt;ideal for several reasons.&lt;br /&gt;&lt;br /&gt;what table_log does is to create a new table for every table we track&amp;nbsp;with the same columns as the original table has plus some added columns&amp;nbsp;at the end of the table, this has a few problems:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;if we add new columns to the original table we need to contort things&amp;nbsp;to add the same columns in the correct place in the log table if we&amp;nbsp;don't want to lose history.&lt;/li&gt;&lt;li&gt;if you drop a column, you should do the same on the log table or you&amp;nbsp;couldn't be able to insert new records. in this case the solution is to&amp;nbsp;lose some history&lt;/li&gt;&lt;li&gt;this inserts 1 record per INSERT, 1 record per DELETE and 2&amp;nbsp;records per UPDATE (the old and new versions of the record are stored);&amp;nbsp;so in heavily updated tables size can be double of the real one&lt;/li&gt;&lt;li&gt;no support for logging truncate actions&lt;/li&gt;&lt;li&gt;there is no simple way to determine which is the old and new versions&amp;nbsp;of a single tuple, you need to match new versions with old versions&amp;nbsp;using time of change, user and mode (UPDATE)&lt;/li&gt;&lt;li&gt;there is missing information, at least ip of the client&lt;/li&gt;&lt;/ol&gt;for these reasons, i have made a little trigger to make this a little&amp;nbsp;better (&lt;a href="https://github.com/jcasanov/pg_audit"&gt;https://github.com/jcasanov/pg_audit&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;what i have done here is:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;use hstore, and ensure only log the values that have changed.&amp;nbsp;because of that, if columns are added or&amp;nbsp;removed we don't need to do&amp;nbsp;anything to the logger table.&lt;/li&gt;&lt;li&gt;it inserts only 1 record per action so use less space than table_log&lt;/li&gt;&lt;li&gt;it logs TRUNCATE actions (it needs an additional trigger for that,&amp;nbsp;though)&lt;/li&gt;&lt;li&gt;old and new values are on the same record so is really obvious what&amp;nbsp;have changed in the tuple&lt;/li&gt;&lt;li&gt;i have added two fields that there aren't in table_log current_user&amp;nbsp;and client_addr (i'm not sure how useful&amp;nbsp;current_user is but surely&amp;nbsp;the ip can be useful)&lt;/li&gt;&lt;li&gt;i have used only one table for all tables tracked, that way if we&amp;nbsp;want to have separate tables for some we&amp;nbsp;can partition by relid&lt;/li&gt;&lt;/ul&gt;i have written this in plpgsql but can think on move it to c if it seems&amp;nbsp;useful&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2431503496741952451-8668817813040728921?l=jaime2ndquadrant.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaime2ndquadrant.blogspot.com/feeds/8668817813040728921/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://jaime2ndquadrant.blogspot.com/2011/07/how-often-are-you-asked-for-logging.html#comment-form' title='5 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2431503496741952451/posts/default/8668817813040728921'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2431503496741952451/posts/default/8668817813040728921'/><link rel='alternate' type='text/html' href='http://jaime2ndquadrant.blogspot.com/2011/07/how-often-are-you-asked-for-logging.html' title='Auditing table changes'/><author><name>Jaime Casanova</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry></feed>
