John DeSoi's blog

PHP support

A preview of coming attractions in pgEdit 1.1: PHP support. PHP can be used in two different ways. First, it can be used to write plPHP stored procedures. In this case pgEdit looks for a $php$ dollar quote or the LANGUAGE parameter with 'plPHP' at the start of the function definition. If this is found, PHP syntax coloring is used for the body of the function.

PHP can also be used as a preprocessor to parameterize and dynamically generate SQL. pgEdit recognizes opening and closing PHP tags and automatically switches syntax coloring between PHP and SQL. The PHP output from the mixed syntax file is then passed to psql for processing.

OS X PostgreSQL Installer

The PostgreSQL Tools for Mac OS X project has been started on SourceForge. The goal of the project is to bring better PostgreSQL installation and management tools to OS X.

X-Windows hell

I've spent the last few days learning more about X-Windows in the ongoing saga to bring pgEdit to Linux. As I mentioned in a previous blog entry, right now Motif is my only option. So I have been spending what seems like endless hours fiddling with X-Windows resources in an effort to make pgEdit look presentable.

I can't get over how much effort it takes to make something look good. With the Macintosh and Windows versions, the default fonts and styles for things generally worked fine with some minor tweaking. But take a look at this screenshot which shows were I'm starting from in Motif when I don't make any resource customizations.

psql error processing

It is a happy day when you start working on a new feature and it turns out much better than your original vision. In executing SQL with pgEdit (using psql) I wanted to move the cursor to the first line where an error was found. I got this working but found it unsatisfying because the default in psql is to not stop processing when an error is encountered (you need to \set ON_ERROR_STOP 1 to get this behavior). So to fix the second or third error you would have to jump to the right line reported by psql which might change if you added or removed lines in fixing the first error.

Using editor points provided a nifty way to solve this. A point is something like a location in the editor buffer, but it can be made to "float" as text is added and removed around it rather than representing some absolute offset from the start of the buffer. So pgEdit creates points for each error line and keeps the associated error message along with it. The new Next Error and Previous Error commands allow you to jump to each error location in the buffer and display the associated error message at the bottom of the window. When jumping to the next error, the correct line is located even if fixing previous errors added or removed lines from the file.

pgEdit for Linux?

I've had several requests for a Linux version of pgEdit along with some very intriguing feature suggestions. The biggest obstacle is getting a user interface on par with the Macintosh and Windows versions. At the moment my development tools only support the Motif window manager on Linux (Lesstif or OpenMotif). The first time I compiled pgEdit on Linux I was pretty disappointed with the interface. "Motif is just so... 80's" is one assessment I recently received on the subject.

Based on suggestions from the LispWorks mailing list, I spent some time tweaking colors and fonts.

Blog On!

pgEdit 1.0 is out the door and I'm finally getting around to this. I'll be up front and say I much prefer programming over writing, but I'm hoping my time spent here will help me create better products. I think this can happen by sharing what I'm working on, how it is being implemented, and listening to your feedback and comments. Even if you don't want to login, feel free to send feedback anytime to the email address on the support page.

But this blog won't be all work and no play. In addition to PostgreSQL and product development topics, expect to see entries about Lisp, user interface design, education, and anything else that might be interesting at the moment.

Pages

Subscribe to RSS - John DeSoi's blog