Time series add time series document error with postgresql hts


#1

Opengamma version dev 1.2.x branch maven build 1.2.2

the code works fine with HSQLDB but not with postgresql.

code used

	ManageableHistoricalTimeSeriesInfo info = new ManageableHistoricalTimeSeriesInfo();
	info.setDataField(dataField);
	info.setDataProvider(dataProvider);
	info.setObservationTime(observationTime);
	info.setDataSource(dataSource);  		
	ManageableSecurity security = ConfigSource.getOGSecurityResource().getSecurity(idb);
	info.setExternalIdBundle(ExternalIdBundleWithDates.of(security.getExternalIdBundle()));
	info.setName(dataField + " " +idb.toString()));
		HistoricalTimeSeriesInfoDocument addedDoc = htsMaster.add(new HistoricalTimeSeriesInfoDocument(info));
		htsMaster.updateTimeSeriesDataPoints(addedDoc.getInfo().getTimeSeriesObjectId(), timeSeries);	

error:

com.opengamma.OpenGammaRuntimeException: Server threw exception: org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [CALL NEXT VALUE FOR hts_master_seq]; nested exception is org.postgresql.util.PSQLException: ERROR: syntax error at or near “CALL” Position: 1
at com.opengamma.util.rest.ExceptionThrowingClientFilter.handle(ExceptionThrowingClientFilter.java:75)
at com.sun.jersey.api.client.Client.handle(Client.java:648)
at com.sun.jersey.api.client.WebResource.handle(WebResource.java:680)
at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
at com.sun.jersey.api.client.WebResource$Builder.post(WebResource.java:568)
at com.opengamma.master.historicaltimeseries.impl.RemoteHistoricalTimeSeriesMaster.add(RemoteHistoricalTimeSeriesMaster.java:105)
at com.opengamma.master.historicaltimeseries.impl.RemoteHistoricalTimeSeriesMaster.add(RemoteHistoricalTimeSeriesMaster.java:35)
at com.algotree.ogloader.timeseries.TimeSeriesResource.addOrUpdate(TimeSeriesResource.java:281)
Caused by: com.sun.jersey.api.client.UniformInterfaceException: POST http://localhost:8080/jax/components/HistoricalTimeSeriesMaster/central/infos returned a response status of 500 Internal Server Error
at com.opengamma.util.rest.ExceptionThrowingClientFilter.handle(ExceptionThrowingClientFilter.java:64)
… 13 more


#2

Are you running an older version of Postgres? We test on v8.4 and v9.1.


#3

postgres=# select version();
version

PostgreSQL 9.1.9 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2, 64-bit
(1 row)


#4

I am getting this whenever I write hts info doc to db by hts master’s add method


#5

putting a frush src solved my issue event though, I didnt get what was the mistake I made, but it is working fine for me now…


#6

Ok, good. Haven’t seen this particular issue before so we weren’t sure what to suggest.