You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-4Lines changed: 16 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,13 +25,25 @@ PGStac requires **Postgresql>=12** and **PostGIS>=3**. Best performance will be
25
25
### PGStac Settings
26
26
PGStac installs everything into the pgstac schema in the database. You will need to make sure that this schema is set up in the search_path for the database.
27
27
28
-
There are additional variables that control the settings used for calculating and displaying context (total row count) for a search.
28
+
There are additional variables that control the settings used for calculating and displaying context (total row count) for a search, as well as a variable to set the filter language (cql-json or cql-json2).
29
+
The context is "off" by default, and the default filter language is set to "cql2-json".
29
30
30
-
Variables can be set either by passing them in via the connection options using your connection library or by setting them on the Role that is used to log in to the database.
31
+
Variables can be set either by passing them in via the connection options using your connection library, setting them in the pgstac_settings table or by setting them on the Role that is used to log in to the database.
31
32
33
+
Example for updating the pgstac_settings table with a new value:
34
+
```sql
35
+
INSERT INTO pgstac_settings (name, value)
36
+
VALUES
37
+
('default-filter-lang', 'cql-json'),
38
+
('context', 'on')
39
+
40
+
ON CONFLICT ONCONSTRAINT pgstac_settings_pkey DO UPDATESET value =excluded.value;
41
+
```
42
+
43
+
Alternatively, update the role:
32
44
```
33
45
ALTER ROLE <username> SET SEARCH_PATH to pgstac, public;
34
-
ALTER ROLE <username> SET pgstac.collection TO <'on','off','auto'>;
46
+
ALTER ROLE <username> SET pgstac.context TO <'on','off','auto'>;
35
47
ALTER ROLE <username> SET pgstac.context_estimated_count TO '<number of estimated rows when in auto mode that when an estimated count is less than will trigger a full count>';
36
48
ALTER ROLE <username> SET pgstac.context_estimated_cost TO '<estimated query cost from explain when in auto mode that when an estimated cost is less than will trigger a full count>';
37
49
ALTER ROLE <username> SET pgstac.context_stats_ttl TO '<an interval string ie "1 day" after which pgstac search will force recalculation of it's estimates>>';
@@ -93,7 +105,7 @@ Migrations are stored in ```pypgstac/pypgstac/migration`s``` and are distributed
93
105
### Running Migrations
94
106
PyPGStac has a utility for checking the version of an existing PGStac database and applying the appropriate migrations in the correct order. It can also be used to setup a database from scratch.
95
107
96
-
To create an initial PGStac database or bring an existing one up to date:
108
+
To create an initial PGStac database or bring an existing one up to date, check you have the pypgstac version installed you want to migrate to and run:
0 commit comments