stac-utils / pgstac

Schema, functions and a python library for storing and accessing STAC collections and items in PostgreSQL
MIT License
153 stars 39 forks source link

Don't allow Collections without ids to be written #224

Closed lossyrob closed 1 year ago

lossyrob commented 1 year ago

Writing an empty Collection is allowed, and will cause a Collection with a NULL id:

postgis=# select pgstac.create_collection('{}');
postgis=# select count(*) from collections where id is null;
count
-------
     1

This caused a confusing issue during development due to an accidentally written Collection into a local dev PgSTAC.

It would be useful for PgSTAC to reject the null ID Collections to error loudly about this case.