create or replace function zipsrc3(text) returns setof text as $$ select address from zipcode where (num1, num2) = (substring($1 for 3)::integer, substring($1 from 5 for 4)::integer) $$ language sql;