Feature request #11614

Order PostGIS key selection column by order in table/view

Added by James Haggerty over 9 years ago. Updated over 6 years ago.

Pull Request or Patch supplied:No Resolution:
Easy fix?:No Copied to github as #:19868


I have a view which, depending on what the Postgres query analyser does, presents the key attributes in an annoying order (booleans first, if pg_attribute is the initial table). I would really like users of the database to have a sane key selected first, in this case the first column in the view. This could be very easily achieved by adding

ORDER BY attnum
to this query:

SELECT attname, CASE WHEN typname = ANY(ARRAY['geometry','geography','topogeometry']) THEN 1 ELSE null END AS isSpatial FROM pg_attribute JOIN pg_type ON atttypid=pg_type.oid WHERE attrelid=regclass('%1.%2')




#1 Updated by Giovanni Manghi almost 7 years ago

  • Easy fix? set to No

#2 Updated by Jürgen Fischer over 6 years ago

  • Category set to Unknown

Also available in: Atom PDF