2

When I get a sudden spike in web users, some statements start queueing indefinitely, even though i'm setting a timeout like:

SET STATEMENT_TIMEOUT TO 5000; SELECT get_user_properties(12345);

Do functions ignore statement_timeout if it is not set within the function body?

I'm using postgresql 9.2 and pg_bouncer with session pooling.

Nick
  • 555
  • 5
  • 22
  • Looks like setting it within the function doesn't work either. Is there a way to set statement_timeout per query? – Nick Oct 02 '13 at 18:25

1 Answers1

5

This works

BEGIN; SET SESSION STATEMENT_TIMEOUT TO 5000; COMMIT; SELECT get_user_properties(12345);
Nick
  • 555
  • 5
  • 22