Skip to content

Instantly share code, notes, and snippets.

@jaylevitt
Created October 5, 2011 12:42
Show Gist options
  • Save jaylevitt/1264334 to your computer and use it in GitHub Desktop.
Save jaylevitt/1264334 to your computer and use it in GitHub Desktop.
ERROR: structure of query does not match function result type
create or replace function similarity(my_user_id int)
returns table(user_id int, similarity float) as $$
begin
return query select similarity(my_user_id, 'default=>1'::hstore);
end;
$$ language plpgsql stable strict;
create or replace function similarity(my_user_id int, weightings hstore)
returns table(user_id int, similarity float) as $$
begin
-- stuff that works
end
$$ language plpgsql stable strict;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment