CREATE OR REPLACE VIEW public.search_pop_places AS SELECT pop_places.name AS searchstring, (pop_places.type::text || ' '::text) || pop_places.name::text AS displaytext, '01_pop_places'::text AS search_category, pop_places.geom AS the_geom, 'pop_places'::text AS showlayer FROM pop_places; CREATE OR REPLACE VIEW public.search_airports AS SELECT (airports.name || ' ' || airports.iata) AS searchstring, (airports.name || ' (' || airports.iata ||')') AS displaytext, '02_airports'::text AS search_category, airports.geom AS the_geom, 'airports'::text AS showlayer FROM airports; CREATE OR REPLACE VIEW public.search_admin AS SELECT admin.name AS searchstring, (admin.admintype::text || ' '::text) || admin.name::text AS displaytext, '03_municipality'::text AS search_category, admin.geom AS the_geom, 'municipality'::text AS showlayer FROM admin;