pgstac icon indicating copy to clipboard operation
pgstac copied to clipboard

Ingest data by multiple users

Open drnextgis opened this issue 2 years ago • 0 comments

Imagine that we have 2 users user1 and user2 which can ingest data into the database:

GRANT pgstac_ingest TO user1;
GRANT pgstac_ingest TO user2;

During the data ingestion process pgstac creates _items_N tables and makes the current user as an owner:

postgis=# \dt;
                        List of relations
 Schema |         Name         |       Type        |    Owner     
--------+----------------------+-------------------+--------------
 pgstac | _items_1             | table             | user1

Now if user2 try to ingest data belonging to the same collection it might end up calling ALTER TABLE from here which will fail with must be owner of table _items_1 error.

drnextgis avatar Jun 15 '22 22:06 drnextgis