Thanks to alecm on freenode for the idea. Thanks also to Andres Freund for pointing out a hole in the first implementation.
Access control is an excellent reason for allowing writes to a VIEW but not to the underlying table. You would ideally like that VIEW to act exactly like a TABLE, but when you put an INSTEAD OF trigger in there, what's coming back isn't necessarily what you'd expect...
Continue reading "VIEW triggers RETURNING..." »
Thursday, February 3. 2011
Conferety-conf-conf-conf
I'm at the very exciting PostgreSQL Sessions in Paris, where I just talked about DBI-Link, and

where I'll talk about PL/Parrot to a frighteningly large room.
Continue reading "Conferety-conf-conf-conf" »
where I'll talk about PL/Parrot to a frighteningly large room.
Continue reading "Conferety-conf-conf-conf" »
Thursday, October 21. 2010
Kick 'em out, and keep 'em out!
It's sad, really. You're about to move a database to archival storage, possibly to /dev/null, but pesky users keep talking to it.
Continue reading "Kick 'em out, and keep 'em out!" »
Thursday, September 16. 2010
GRAPHical SQL (or how to make a forest)
Graphs? In Databases? Yes, you can!
Continue reading "GRAPHical SQL (or how to make a forest)" »
Saturday, July 24. 2010
MVC Backups
Since Josh Drake has failed to allow comments on his very excellent blog, especially this post,I have to respond below.
Continue reading "MVC Backups" »
Wednesday, June 9. 2010
Tablespaces in a (nut)shell
Sometimes, you run across traces of LarryDB. One typical one is a profusion of tablespaces.
Until you solve that problem, you'll need to deal with them. Let's take setting up a warm standby.
Continue reading "Tablespaces in a (nut)shell" »
Until you solve that problem, you'll need to deal with them. Let's take setting up a warm standby.
Continue reading "Tablespaces in a (nut)shell" »
Tuesday, May 4. 2010
Part(ition)ing Glances
In an earlier installment, we learned about how to partition a
referenced table, which was good as far as it went. A commenter very
astutely pointed out that this didn't work with RETURNING, so I set
to work fixing that problem.
Here's what I came up with.
Continue reading "Part(ition)ing Glances" »
referenced table, which was good as far as it went. A commenter very
astutely pointed out that this didn't work with RETURNING, so I set
to work fixing that problem.
Here's what I came up with.
Continue reading "Part(ition)ing Glances" »
Tuesday, April 27. 2010
psql, Paste, Perl: Pefficiency!
Enough alliteration already!
I was looking at Regina Obe's excellent piece on how to use psql to do an import on fixed-width data, and thought to myself, "self, how would you do this with fewer copies, just in case you happened across a few hundred gigs of data?"
Here's what I came up with:
Continue reading "psql, Paste, Perl: Pefficiency!" »
I was looking at Regina Obe's excellent piece on how to use psql to do an import on fixed-width data, and thought to myself, "self, how would you do this with fewer copies, just in case you happened across a few hundred gigs of data?"
Here's what I came up with:
Continue reading "psql, Paste, Perl: Pefficiency!" »
Thursday, April 22. 2010
File-driven Include and Exclude for pg_dump
So you're about to start replicating part of a database using Slony, and you'd rather not set up your replicas with all the extra cruft. You've made your list, but what to do with it?
Continue reading "File-driven Include and Exclude for pg_dump" »
Continue reading "File-driven Include and Exclude for pg_dump" »
Wednesday, April 14. 2010
The Cloud Under the Lamp Post
A drunk is under a lamp post. It's late at night, and he is crawling
around on his hands and knees, searching frantically all over the tiny
pool of brilliant light it casts. A passer-by asks him, "what are you
doing?" He answers, "I'm looking for my keys." Pointing out into the
darkness, he continues, "I dropped them over there, but the light's
much better over here."
The joke is an old one, and illustrates an interesting truth about
human psychology.
What does this have to do with The Cloud, you ask?
Read on.
Continue reading "The Cloud Under the Lamp Post" »
around on his hands and knees, searching frantically all over the tiny
pool of brilliant light it casts. A passer-by asks him, "what are you
doing?" He answers, "I'm looking for my keys." Pointing out into the
darkness, he continues, "I dropped them over there, but the light's
much better over here."
The joke is an old one, and illustrates an interesting truth about
human psychology.
What does this have to do with The Cloud, you ask?
Read on.
Continue reading "The Cloud Under the Lamp Post" »
Tuesday, April 6. 2010
Partly Cloudy, with a Very High Chance of FAIL
Everywhere you turn, it's "cloud" this, "cloud" that, "cloud" the other.
Public clouds, private clouds, hybrid
clouds, fluffy clouds...but somewhere in all that billowing haze,
there's an actual use case.
The people who designed cloud computing made certain explicit
trade-offs, some of which have been lost in all the hype. Given those
explicit trade-offs, your application is a candidate for "the cloud" in
general only if it has all of the following characteristics:
- Embarrassingly parallelizable
- Does not have bounded latency requirements
- Needs CPU much more than I/O
- Tolerant to partial data loss
Continue reading "Partly Cloudy, with a Very High Chance of FAIL" »
Public clouds, private clouds, hybrid
clouds, fluffy clouds...but somewhere in all that billowing haze,
there's an actual use case.
The people who designed cloud computing made certain explicit
trade-offs, some of which have been lost in all the hype. Given those
explicit trade-offs, your application is a candidate for "the cloud" in
general only if it has all of the following characteristics:
- Embarrassingly parallelizable
- Does not have bounded latency requirements
- Needs CPU much more than I/O
- Tolerant to partial data loss
Continue reading "Partly Cloudy, with a Very High Chance of FAIL" »
Wednesday, March 10. 2010
Free Your DBI-Link, and the Rest Will Follow
DBI-Link is now on Github!
Here's how I did it: Continue reading "Free Your DBI-Link, and the Rest Will Follow" »
Here's how I did it: Continue reading "Free Your DBI-Link, and the Rest Will Follow" »
Wednesday, March 3. 2010
Git + bash = win
Modern git comes with a great way to improve your life: git-completion.bash. To use it, just add the following to your .bashrc:
Once you've done this, any time you're in a git subdirectory, the branch name will appear in your PS1.
Any time you're not, it won't.
Simple!
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
export PS1='\h:\u:\w $(__git_ps1 "(%s) ")'
fi
Once you've done this, any time you're in a git subdirectory, the branch name will appear in your PS1.
Any time you're not, it won't.
Simple!
Friday, February 19. 2010
Part(ition)ing Is Such Sweet Sorrow
There are excellent references on partitioning tables that depend on one table, but what happens when you need to partition the referenced table?
Let's find out! Continue reading "Part(ition)ing Is Such Sweet Sorrow" »
Let's find out! Continue reading "Part(ition)ing Is Such Sweet Sorrow" »
« previous page
(Page 2 of 6, totaling 80 entries)
next page »