Hey Ya'll,
I'm a little puzzled by the speed of the stored procedures I am writing.
Here is the query alone in pgAdmin
select distinct featuretype from gnis_placenames where state='CT'
TIME: 312+16ms
Here is a stored procedure
create or replace function getfeaturetypes(text) r
How do I get this to work?
create or replace function getquadalphabet(text) returns setof varchar
as $$
declare r varchar;
begin
for r in SELECT distinct(substring(drgtitle, 1, 1)) as text from
stockdrgmeta where state ilike '%' || $1 || '%'
LOOP
return next r;
END LOOP;
end;
$$ la