Posts

Showing posts from 2010

count_if (expression)

Someone just posted a problem on a PostgreSQL mailing list. They had several boolean columns, but they wanted to get how many values were true for each column, but in 1 query. There are several ways to do this, but none of which are particularly elegant. Say we have the following table definition: CREATE TABLE subscribers ( subscriber text PRIMARY KEY, news boolean DEFAULT false, sport boolean DEFAULT false, promotions boolean DEFAULT false, horrible_spam boolean DEFAULT false ); INSERT INTO subscribers (subscriber, news, sport, promotions, horrible_spam) VALUES ('person_a', true, false, false, false), ('person_b', true, true, true, false), ('person_c', true, false, true, true), ('person_d', false, false, false, false), ('person_e', true, true, false, false), ('person_f', true, false, true, true), ('person_g', true, false, false, false); Now we want to get a count of how many of each subscription category has...

PGDay.EU 2010 Call for Papers ending soon!

Dave Page posted this on the European PostgreSQL mailing list, but thought I'd also put this out there... This year's European PostgreSQL Conference is due to be held on the 6 - 8th December 2010 in Stuttgart Germany ( http://2010.pgday.eu/ ). Following on from last years extremely successful event in Paris, we hope to make the show bigger and better than before, with: * A 4 star hotel venue (with spa facilities in the complex) * A special guest keynote speaker (to be announced Real Soon Now :-) ) * Multiple talk tracks in English and German * Talks for PostgreSQL hackers and users, as well as decision makers * A day of training sessions Of course, to make that happen we need talk proposals from our community members and users. We're looking for presentations aimed at developers, users and decision makers on topics such as: - Developing applications for PostgreSQL - Administering large scale PostgreSQL installations - Case studies of PostgreSQL deployments - PostgreSQL tool...

PostgreSQL docs reloaded

If you regularly reference the online PostgreSQL docs, you may have noticed that they have just had a face-lift in time for the big 9.0 release. If not, take a look . This went through quite a few revisions with input from many folk in the Postgres community. As with all things, you won't please everyone, and this is no less true in the case of this redesign. But look at this as a pilot change, where we've come up with a first version with possible "bug-fixes" to follow. I've also provided similar changes for the French version , although there's only been feedback from one person for that. Regardless, they appear to have gone with it anyway. I'm no designer, and neither are the majority of the people who contributed their recommendations, but the original cause of me wanting to make some changes is so that the examples which appear throughout the docs would be distinct from the main body text. Previously they appeared to all merge into one which ma...

Why I refuse to use transporter technology

As you are aware , transporter technology has allowed us to deliver objects across great distances almost instantaneously . Not only does this mean we don't have to wait for items we've ordered to take a long journey across land and sea , but we also saves us a huge amount of money in postage costs . However , while people have started to use this to travel across the globe, I can't bring myself to do it . The reason is simple. I will be killed off forever . Here's my rationale ... When the Transmat sequence begins , it starts by converting your matter to energy and during this process , every molecule and electro-chemical reaction in your body is recorded with the exact position, electrical charge, temperature ... everything copied down into the network's distributed memory . This data is then sent to the rematerialisation hub nearest to your destination. The hub ...

GMail + Lab Features = perfect PostgreSQL Mailing list manager

Image
I've been following many PostgreSQL mailing lists for some time now, and because so many emails arrive in my inbox every hour, they need organising. Until recently I've used a filter on my email to label everything to and from *@postgresql.org with the label "PostgreSQL", to mark it as read and to archive it (i.e. skip the inbox). That way I could just click on the PostgreSQL label and view all the emails. But I do subscribe to a LOT of the groups, and they're all bundled into the same label. So comes Gmail Lab features to the rescue, namely " Nested Labels " and " Hide Labels from Subjects ". This does require a fair amount of initial setup, but only needs to be done once. Basically Nested Labels allows for a tree-like structure of labels defined by /parent/child/grandchild/ etc. For example, I've set up a new filter for all emails to pgsql-general to be labelled PostgreSQL/General which puts it in the General label beneath the Postg...