On 06/26/2017 11:21 AM, Alexander Farber wrote:
The error message returned by
the database is rather cryptic:

words=> select * from words_skip_game(1, 1);
ERROR:  query returned no rows
CONTEXT:  PL/pgSQL function words_skip_game(integer,integer) line 85 at
SQL statement

When I look at my source code
( https://gist.github.com/afarber/cac9a83b7a37307ace8d787be9b8ff4c ) at
the line 85, then I am not sure if the line number reported by the error
message is correct, because it points into middle of an UPDATE statement:

I agree the line numbers for error messages inside of plpgsql functions never seem to make sense, so I wouldn't get too hung up on line 85. Perhaps you should see what is line 85 when you do `\sf words_skip_game` (rather than line 85 in your own source code). But mostly I would try to find some other way of locating the cause of the error.

You can read about the "query returned no rows" message here:

https://www.postgresql.org/docs/9.5/static/plpgsql-statements.html

It seems to me you should only see it for `INTO STRICT`, not plain `INTO`. I see from your gist that your function *does* have some queries that are `INTO STRICT`, so I would focus on those.

That page also describes how to use `print_strict_params` to get a little more info about the details of the error.

I hope that helps!

Paul


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to