Leave a Comment

Mar 20, 2019 | GIS

So I’ve been neck deep in Postgresql/Postgis which has been a bit fun but a bit maddening.

One problems I ran into was “What is this column?”. Generally if a client hands me the database I start working with it and do a few things but I don’t worry about their columns in the database. People keep weird things for no reason and I’ve learned to stop asking so many questions on why.

In this case the client had a PDF describing the standard they were working toward. They also had some extra fields they needed for other applications. So I found myself constantly cracking open the PDF or emailing them going “Why is this and what is this?”. If only there was some metadata….

…….but they have this in a PDF and it is good:

So the comment command to the rescue. I’m going to attach the definition to the field: comment on column oirid is ‘leave your comment here’;

Command line magic

Yeah I know that was a lot to add for a comment and I did it all from the magic of the psql command. If I take a look at the table from QGIS using DB Manager now:

View Comments in QGIS.

At this point I know what the column is even if this is a bit overkill. The question is now “Can I get this easy enough to get the client to document their database on the columns I don’t know?”

Actually that’s easy with DBmanager. I can go in and edit an existing table:

Edit your columns in DB Manager

From here I can edit a column and make comments. If I write up some directions the client can jump in and start documenting the more scattered things they have the in database. They can even leave a comment on the table to describe why you have the table.

Comment your columns

I’m constantly overlooking DBManager and the things you can do with it. In this case you can edit an existing table and add comments to help with documenting your database/project. You can import data into PostGIS. You can toss SQL against the database.

You may also like

QGIS2Web and the Hunt for Bike Lanes

QGIS2Web and the Hunt for Bike Lanes

I was teaching a QGIS class a while back and at one point the discussion drifted into "So this OpenStreetMap thing" and I discussed how I enjoy making edits. Eventually it turned to "I'm trying to get Chattanooga's Bike Lanes into it in my spare time". One thing led...

Training Classes for January 2024

Training Classes for January 2024

So I have 3 classes coming up in Mid January that I should have been talking about sooner but....December was a bit hectic. Exploring QGIS, Model Designer, and Tips and Tricks are happening. Jump over to the Support page and you'll see the info with links. I'm pretty...

2023 – The Year End Review

2023 – The Year End Review

So if you're keeping up in 2020 I was ready to end the business thanks to Covid. 2022 was probably my best year in business in a very long time. This year was slower than anticipated BUT that's why you save money, advertise, and spend wisely. It also had it's exciting...