Skip to content

PostgreSQL NULL sorting behavior #6

@jacobdadams

Description

@jacobdadams

The problem

The Open SGID sorts NULL values in the opposite direction than the SGID and esri file geodatabases.

The reason

A PostgreSQL order by ascending query will order NULL values last, while the SGID (Microsoft SQL Server) and file geodatabases order them first.

The workaround

Invert the sort to have NULL values ordered they way you would like.

Examples

The PostgreSQL language supports the NULL value ordering in the ORDER BY clause. documentation

The following will crash ArcGIS Pro version < 2.5 if used as a query layer query.

SELECT * FROM municipal_boundaries ORDER BY minname NULLS FIRST;

Metadata

Metadata

Assignees

No one assigned

    Labels

    known-issueWe understand there is an issuewith-workaroundThis issue has a work around

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions