gtfs-lib
gtfs-lib copied to clipboard
Editor: Extra fields added to tables during export
Observed behavior
A GTFS feed that is loaded and snapshotted for the RDBMS-backed editor will contain additional fields not attached to the originally imported tables. E.g., the editor-specific route_branding_url field will be added to the routes table on export.
Expected behavior
Ideally a GTFS feed making a round trip would contain no additional fields/modifications. There is a related issue #283 that modifies stop_sequence values.
Steps to reproduce the problem
- Import any GTFS feed
- Load into editor
- Snapshot and publish feed.
- Download GTFS and observe addition of routes#route_branding_url field.
Notes on configuration and files required to reproduce the issue
n/a
As discussed outside of GH, there may be a potential fix here with pg_stats to determine which columns have all null values and skip those on the export of the table from the GTFS Editor: https://dba.stackexchange.com/a/2932/206444.
E.g.:
vacuum analyze; -- if needed
select schemaname, tablename, attname
from pg_stats
where most_common_vals is null
and most_common_freqs is null
and histogram_bounds is null
and correlation is null
and null_frac = 1;