Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


We're loading City and County data into our database, but looking to remove several fields we don't use.

Those fields we do use I'd like our users to simply highlight on a printout I give them based on a schema report from the .SHP we're getting the data from.

Is there a way to get a list of the fields in a SHP or PostGIS layer in a format such as a spreadsheet I can print off and give to users?



share|improve this question
You want to do this from QGIS? Here's how you could get the schema information on a Shapefile from the command line: ogrinfo my_shapefile.shp -al -fid 1 where 1 or some valid fid is given (so that only one feature is described). – Arthur Sep 4 '13 at 18:50
Any particular GIS software you want to, or won't use? How about programming languages? Or are you looking for a generic option? – RyanDalton Sep 5 '13 at 16:46
Generic option short of taking a screen capture...or even short of PGModeler or ArcGIS diagrammer I suppose...nothing custom unless there's no other way...just wondering what's out there... – DPSSpatial Sep 6 '13 at 19:06
up vote 1 down vote accepted

You can query your database's information schema using pgAdmin to get a list of columns in a particular table, then copy-paste the results into a spreadsheet to distribute. Here's an example of one kind of report you can get:

SELECT column_name, data_type, character_maximum_length
  FROM information_schema.columns 
  WHERE table_schema = 'mySchema'
  AND table_name = 'myTable'
  ORDER BY ordinal_position
share|improve this answer
Thank you @dbaston, that did the trick best I've seen so far!!! – DPSSpatial Sep 12 '13 at 19:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.