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?

  • 2
    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, 2013 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? Sep 5, 2013 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... Sep 6, 2013 at 19:06

1 Answer 1


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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