public-transport / gtfs-via-postgres

Process GTFS Static/Schedule by importing it into a PostgreSQL database.
https://github.com/derhuerst/gtfs-via-postgres#gtfs-via-postgres
Other
93 stars 18 forks source link

`valid_default_lang` error occurring for gtfs feeds. #32

Open rahulkgupta opened 1 year ago

rahulkgupta commented 1 year ago

ERROR: new row for relation "feed_info" violates check constraint "valid_default_lang"

Was fixed by changing feed_lang from en to en_US.utf8 but en seems to be used in the example amtrak GTFS and in BART.

derhuerst commented 1 year ago

AFAICT, en is a valid BCP 47 language tag, so it should not cause gtfs-via-postgres to fail.

This is the current implementation of the validation: https://github.com/public-transport/gtfs-via-postgres/blob/6a022f24dcb166fc9daee967739026c7d356e67d/lib/prerequisites.js#L5-L22

I'm not that familiar though, with the details of how PostgreSQL handles localisation, so I don't know how to implement this properly.

1Maxnet1 commented 1 year ago

FYI: I also got the same error. For me it was fixed with replacing "DE" by "de".