Commits

Lars Kanis committed 69ac504

Adjust PGError test to also match PostgreSQL 8.3

  • Participants
  • Parent commits 451ee7c

Comments (0)

Files changed (1)

File spec/pg/result_spec.rb

 			should == 'relation "nonexistant_table" does not exist'
 		result.error_field( PG::PG_DIAG_MESSAGE_DETAIL ).should be_nil()
 		result.error_field( PG::PG_DIAG_MESSAGE_HINT ).should be_nil()
-		result.error_field( PG::PG_DIAG_STATEMENT_POSITION ).should == '15'
+		statement_pos = RSpec.configuration.exclusion_filter[:postgresql_90] ? nil : '15'
+		result.error_field( PG::PG_DIAG_STATEMENT_POSITION ).should == statement_pos
 		result.error_field( PG::PG_DIAG_INTERNAL_POSITION ).should be_nil()
 		result.error_field( PG::PG_DIAG_INTERNAL_QUERY ).should be_nil()
 		result.error_field( PG::PG_DIAG_CONTEXT ).should be_nil()
-		result.error_field( PG::PG_DIAG_SOURCE_FILE ).should =~ /parse_relation\.c$/
+		result.error_field( PG::PG_DIAG_SOURCE_FILE ).should =~ /parse_relation\.c$|namespace\.c$/
 		result.error_field( PG::PG_DIAG_SOURCE_LINE ).should =~ /^\d+$/
-		result.error_field( PG::PG_DIAG_SOURCE_FUNCTION ).should == 'parserOpenTable'
+		result.error_field( PG::PG_DIAG_SOURCE_FUNCTION ).should =~ /^parserOpenTable$|^RangeVarGetRelid$/
 
 	end