Blog This!   Lee Geistlinger's Web Log
Blog Home
Blog Archives
LittleGhost Home

E-mail: geistlinger AT gmail.com

Loading
Pic 'O the Day
Top 10 Lists
Everyone loves lists
Reviews
Books, Movies and so on
Blogroll
Feed Me!

XML Feed

Feeds I Read

My Online Aggregator

Theme
• Default
• Spring
• Summer
• Autumn
• Winter
• Black & White
• Gray & White
• MT-ish
• Classic
Listening To...
Evidence of Efforts

This page is powered by Blogger. Isn't yours?

Valid CSS!

[Valid RSS]

Recent Posts
 Thursday, April 10, 2003
Blogging Tools

Just for the hell of it, I''ve decided to build a blogging tool.

You know, a blogger or MovableType type tool.

Why? Because I can. And because I'll learn stuff doing it.

I'm building it on my Linux box in PHP against a Postgres database.

When I started this project, I sort of gave in and had it running against mySQL -- while I hate it, it is the dominant open-source database (for better or for worse...). MoveableType runs against this, and MT is used all over the Blogsphere, so whatever...

As I began coding and wanted to do stuff, however, I quickly ran out of obscenities to use for this sad excuse of a database.

I rebuilt tables in Postgres and I have not looked back. Everything I've wanted to do is easily handled in Postgres. Damn. Nice database.

One thing I don't particularily like - and maybe there's a way around it - is the string concatination operator -- it's "||" (without quotes, obviously)>

To me, that's an "or" operator -- I'm used to the ampersand (&) or a period (".") for string concatenation. I wouldn't mind the double pipes, except that it is so much like an OR operator. Seems weird.

Example, a value of "Mary" in the first_name column. To make it "Mary Ann" one would enter:

Update tableName set first_name = first_name || ' Ann' where [some restriction...name_id = 12 or whatever]

To me, this reads "Update first name to first name OR Ann where.....but that's just me, I guess.

On the other hand, Postgres is so Oracle-like that there might be another way to do this that is more traditional. Still, it's a little non-intuitive to me (I tried the ampersand and dot before hitting Google and finding a solution). Update: All my searching tells me that the double pipe -- || -- is the only string concatenation operator. Oh well. Can't say I'm thrilled with that, but what the hell...

Note: mySQL's way of doing this is to use the word fragment "concat" -- now that's WAY weird, to me...

- Posted by Lee at 1:32 PM Permalink #
^Top | Top Ten Home | Blog This! Home | Blog This! Archives