How I Learned to Stop Worrying and Love the Triggers

Some people are afraid of triggers. Reasons for this are not really understandable for me, but I guess it stems from the fact that these are usually application developers, and not database admins. Or they encountered some kind of problem with triggers, and now they tend to think that triggers are inherently evil. But they … Continue reading “How I Learned to Stop Worrying and Love the Triggers”

Waiting for 9.1 – Add UNIQUE/PRIMARY KEY with index

On 25th of January, Tom Lane committed patch: Implement ALTER TABLE ADD UNIQUE/PRIMARY KEY USING INDEX.   This feature allows a unique or pkey constraint to be created using an already-existing unique index. While the constraint isn’t very functionally different from the bare index, it’s nice to be able to do that for documentation purposes. … Continue reading “Waiting for 9.1 – Add UNIQUE/PRIMARY KEY with index”

Understanding postgresql.conf : checkpoint_completion_target

Starting new blog series – explanation of various configuration parameters. I will of course follow no schedule or order – if I’d had to – it would be my job, and in this way – it’s fun. First configuration parameter to write about is checkpoint_completion_target.

speeding up like ‘%xxx%’

as most of you know postgresql can easily speedup searches using: field like ‘something%’ and (less easily): field like ‘%something’ but how about: field like ‘%something%’ general idea is to use some kind of full text search/indexing – tsearch, lucene, sphinx, you name it. but sometimes you can’t install fts/fti, or it doesn’t really solve … Continue reading “speeding up like ‘%xxx%’”