I DIDN'T TEST THIS JERS BUT IT SHOULD WORK

!hoggy has a bug where it just uses the maximum int of the current table. However, you can delete quotes from the table so this sometimes returns a null entry. 

Consider:

id | Data 
202| ....
203| ....
205| ....
206| ....

The current code will do rand(0,206) and sometimes get 204 which was a quote that was deleted. It will return a null row and throw an exception.

Also I totally didn't test this but looking at the sqlalchemy api this looks like how it could be done