Skip to content

Commit b6e9ec7

Browse files
committed
document public.gtfs_via_postgres_import_version() 📝
follow-up of ea6395c
1 parent c9dd880 commit b6e9ec7

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

cli.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ Options:
120120
Like --stats-by-route-date, this flag accepts
121121
none, view & materialized-view.
122122
--schema The schema to use for the database. Default: public
123+
Even when importing into a schema other than \`public\`,
124+
a function \`public.gtfs_via_postgres_import_version()\`
125+
gets created, to ensure that multiple imports into the
126+
same database are all made using the same version. See
127+
also multiple-datasets.md in the docs.
123128
--postgraphile Tweak generated SQL for PostGraphile usage.
124129
https://www.graphile.org/postgraphile/
125130
--postgraphile-password Password for the PostGraphile PostgreSQL user.

docs/multiple-datasets.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,5 @@ FROM
3131
ORDER BY paris.stop_loc <-> berlin.stop_loc DESC
3232
LIMIT 100
3333
```
34+
35+
*Note:* During an import, a function `public.gtfs_via_postgres_import_version()` gets created that returns `gtfs-via-postgres`'s version. If that function already exists (because it has been created by a previous import), its return value is compared to `gtfs-via-postgres`'s version, and if these two versions are not equal, the second import will fail. This ensures that multiple imports into the same database can only be made using the exact same `gtfs-via-postgres` version.

readme.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,11 @@ Options:
179179
Like --stats-by-route-date, this flag accepts
180180
none, view & materialized-view.
181181
--schema The schema to use for the database. Default: public
182+
Even when importing into a schema other than `public`,
183+
a function `public.gtfs_via_postgres_import_version()`
184+
gets created, to ensure that multiple imports into the
185+
same database are all made using the same version. See
186+
also multiple-datasets.md in the docs.
182187
--postgraphile Tweak generated SQL for PostGraphile usage.
183188
https://www.graphile.org/postgraphile/
184189
--postgraphile-password Password for the PostGraphile PostgreSQL user.

0 commit comments

Comments
 (0)