Ich habe auf maxmind.com die Datei worldcitiespop.txt runtergeladen mit 3.173.959 Einträge. Hier die ersten Einträge:
Country,City,AccentCity,Region,Population,Latitude,Longitude
ad,aixas,Aix‡s,06,42.4833333,1.4666667
ad,aixirivali,Aixirivali,06,42.4666667,1.5
ad,aixirivall,Aixirivall,06,42.4666667,1.5
ad,aixirvall,Aixirvall,06,42.4666667,1.5
…
Nun möchte ich alle Einträge in meine PG-Datenbank speichern: Place (id: integer, country: string, city: string, accent_city: string, region: string, latitude: float, longitude: float, created_at: datetime, updated_at: datetime).
Ich kenne mich mit SQL nicht so gut aus, kann mir da jemand helfen? Danke.
Etwa so:
copy place (country, city, …) from ‘path/to/file’ csv delimiter ‘,’;
Beachte bitte die Hinweise hier: COPY - PostgreSQL wiki
Andreas