PgSqlBrowser
Tue Jun 26 12:45:05 PM PDT 2001 <pevans@users.sf.net>
A python-wxwindows GUI to browse postgres databases. Uses the psycopg db adapter. Shows table attribs, row-count and allows per column sorting of the current fetch. Has an editable query widget.
Version 0.092 includes a connection dialog, and saves queries on a per table basis. Also, a slider to position the database cursor, a 'Jump' button, an edit button and post editing case correction for sql keywords. PgSqlB now 'remembers' the last connection and includes a small sql cheat-sheet.
Installing is just placing the 'sqlbrowser.py' file somewhere in your path - assuming you have all the prerequisites that is... Not for the faint of heart if you're not really into this stuff and just want a quick download as a diversion ;-)
If the 'Postgres' database didn't come with your distro you can find it here: http://www.postgresql.org/
The 'psycopg' database adapter is no fun to compile and binaries are only for debian so far. I'm including a copy to save you the time, but you should really grab your own from: http://initd.org/Software/psycopg PgSqlBrowser needs 0.093 or greater now, because of changes in the way cursors are handled. Initial connect overhead is the same, but browsing large tables is much faster using the native postgres cursors. If you use the included version, just copy it into your python site-packages dir, chown it to root:root and chmod it so that it's executable. After experimenting with several adapters, this one's the most consistent and complete I think. It's multi-threaded (not in this script though) and simple to use.
'psycopg' in turn requires the 'mxDateTime' module: http://www.lemburg.com/files/python/mxDateTime.html
SqlBrowser is written in 'wxpython', so you'll need that: http://wxpython.org. Which in turn needs the 'wxGTK' libs, but these are available from the same site.
Naturally, you'll need the 'python' language itself: http://python.org
Whew! Hopefully you'll have most of the above already installed.
This script loads all available databases into its file menu on startup. If you have permissions it will list the tables of your selection in one pane and the attributes in the other. The second tab lets you do sql queries (default: SELECT * FROM tablename) and fetch as many or few records as you like. It connects using your login name.
You can always add an 'ORDER BY' to your query, but all the columns will sort if you click on the column label. A feature I find very handy.
The next thing to be added is a dialog for host, port, user and passwd. Then it will be worth saving prefs and, at the same time, the query widget will change to a combo with a saved history of queries on a given database.
Then editing of the database and table data. It's not ever likely to be a forms editor, but I'm working on making the on-the-fly forms on the third tab customizable to some extent. (the 'forms' tab is not in 0.08)
Basically, I needed to get my feet wet with Postgres, so I wrote this.
The only fully functional general tool I know is 'PgAccess' from http://flex.ro/pgaccess/ It's written in tcl/tk and has a form designer too. NB, you'll need to know tcl/tk to use the forms designer.
Mon Jun 11 10:54:38 PM PDT 2001
I have to switch to updating my payroll module or I'd
implement most of whats missing now. (The Feds just can't
leave those formulas alone for long..)
