fix psql import

create or replace function cast_to_city_place(text) returns city_place as $$
begin
    return cast($1 as city_place);
exception
    when invalid_text_representation then
        return 'town';
end;
$$ language plpgsql immutable;

ALTER TABLE osm_city_point
    ALTER COLUMN place TYPE city_place USING cast_to_city_place(place);


Révision #1
Créé 26 septembre 2023 21:53:48 par tjiho
Mis à jour 26 septembre 2023 22:36:24 par tjiho