Nov 29, 2008

PostgreSQL \edit and Syntax Highlighting

If you've ever used \edit with PostgreSQL you've probably noticed that it's not using syntax highlighting that your favorite editor most likely supports. I've wondered why this is for a while, Postgres uses vim on my system which supports robust highlighting among other things.

I had a few things suggested to me, such as setting putting settings in my .vimrc, most of which would have forced filetype=sql on files that weren't sql, and would have been active outside of psql.

When you have a question what's the first thing you should do? RTFM. The answer was in the man page all along.

Tip: psql searches the environment variables PSQL_EDITOR,
EDITOR, and VISUAL (in that order) for an editor to use.
If all of them are unset, vi is used on Unix systems,
notepad.exe on Windows systems.

so how does this solve the problem? well the only program that uses PSQL_EDITOR is Postgres, and most editors allow you to specify options at startup. In the case of vim, if you want to have use filetype=sql for the default filetype for \edit all you have to do is

export PSQL_EDITOR='vim -c "set ft=sql"'

of course if you don't use vim or you want to set some different options you'll have to read the documentation for your editor, or operating system.

Nov 17, 2008

Finally Linux gets something first

... and it's something we didn't build. We get lots of things first but we usually build them. We never get proprietary software first. At best we get proprietary software the same day. Generally we get it months later. However, today linux takes another giant step towards being the dominant next OS, we are the first to receive 64-bit flash from adobe. Windows isn't getting it, Mac OS X isn't getting it, we are.

Nov 8, 2008

The Motherboard I want doesn't exist

My Desktop is dieing and needs to be replaced. So I'm working on researching the parts I'd need to replace it. As any good IT person knows, the motherboard is the most important decision to make when building a computer. Theirs a good chance that someone reading this will cry out I'm wrong.

The reason the Motherboard is the most important decision is it dictates the potential of the whole computer. For example the motherboard on my existing system has an AGP video card slot, I can't buy one of the latest and greatest video cards because it doesn't support it. Motheboard dictates everything from the power supply you buy to video card, ram and processor, and more.

So why is it I can't find a motherboard that I want? well... I have pretty complex requirements.

First, it has to work on Linux. That actually isn't that difficult but it does require a little research making sure all components are supported under Linux, and they have to be supported well, I don't want half-assed support that's going to take me a week to get working. I also have several seemingly incompatible hardware requirements.

I want a dual socket motherboard that supports recent quad core processors, ideally processors that have on chip virtualization features.

My next requirement is that I wanted an onboard graphics chipset that is supported by linux with open source drivers. The best choice for this is the intel line of chipsets. The latest being the Intel GMA 4500 HD. Now I have a problem, I can't find a SINGLE board that is Dual Socket and has onboard intel video (actually I think I did find one but the processor support was capped at like p4 or something). So why is it I can't get a system like this? Intel makes all these parts and yet they don't have an offering.

The last thing I want is onboard raid 0/1/10 that will work with my linux system without too much finagling. Advice has been given to me that I should ignore that and just use linux's raid (or buy a true hw raid card).

I also have some requirements for pci* slots but they are less strict, 1+ 16x pcie (for a future video card), 1+ 4x pcie or 1+ pci-x (for hw raid card in the future), 1+ pci (depends on onboard sound... I have a good audigy card that will work for me if the onboard isn't better than it).

So it seems I'll have to sacrifice some requirements. Chances are I'll do some heavy video card research so I can dump the intel video requirement.