resolve_geo_location(1) immutable lut function
This commit is contained in:
parent
2d802b67d5
commit
868dcb89f2
10
init.sql
10
init.sql
@ -23,6 +23,16 @@ create index if not exists idx_training_data_t on training_data(t);
|
||||
create index if not exists idx_training_data_training_id on training_data(training_id);
|
||||
create index if not exists idx_training_data_geog on training_data using GIST(geog);
|
||||
|
||||
create or replace function resolve_geo_location(geography) returns text as $$
|
||||
begin
|
||||
case when st_dwithin($1, st_point(45.516114, 9.216108), 500) then
|
||||
return 'Bicocca';
|
||||
else
|
||||
return 'unknown';
|
||||
end case;
|
||||
end
|
||||
$$ language plpgsql immutable;
|
||||
|
||||
create or replace view training_duration as
|
||||
(
|
||||
select
|
||||
|
Loading…
x
Reference in New Issue
Block a user