sgr icon indicating copy to clipboard operation
sgr copied to clipboard

Possible missing cache invalidation

Open harrybiddle opened this issue 2 years ago • 0 comments

I was getting the following result from SELECT * FROM "argentina/customs-declarations"."2013":

argentina/customs-declarations.2013: FAIL:
	Internal database error. Details: psycopg2.errors.NumericValueOutOfRange: value "5202990000" is out of range for type integer

	CONTEXT:  PL/pgSQL function schema_controller.fatal(text) line 3 at RAISE
	SQL statement "SELECT schema_controller.fatal(error_text)"
	PL/pgSQL function schema_controller.get_result_from_cache(anyelement,text,text,bigint) line 14 at PERFORM

The issue here is that the type should be character varying, not integer. I altered the schema and re-ran the query, but then got this:

argentina/customs-declarations.2013: FAIL:
	structure of query does not match function result type
	DETAIL:  Returned type character varying does not match expected type integer in column 9.
	CONTEXT:  PL/pgSQL function schema_controller.get_result_from_cache(anyelement,text,text,bigint) line 17 at RETURN QUERY

if I bust the cache with WHERE 82738 = 82738 then the query works fine.

I think the cache is at fault here: it should have either got with the program that the schema had changed, or it should have been invalidated somehow.

harrybiddle avatar Aug 29 '21 13:08 harrybiddle